misc: deprecate dpdk hqos
Not in functional state for a long time ... Type: refactor Change-Id: I2cc1525a6d49518cbc94faf6afbf0d2d0d515f56 Signed-off-by: Damjan Marion <damarion@cisco.com>
This commit is contained in:
Damjan Marion
committed by
Damjan Marion
parent
7db6ab03db
commit
548d70de68
1726
extras/deprecated/dpdk-hqos/dpdk-hqos.diff
Normal file
1726
extras/deprecated/dpdk-hqos/dpdk-hqos.diff
Normal file
File diff suppressed because it is too large
Load Diff
@ -118,8 +118,6 @@ add_vpp_plugin(dpdk
|
||||
buffer.c
|
||||
main.c
|
||||
thread.c
|
||||
# api/dpdk_api.c
|
||||
# api/dpdk_test.c
|
||||
device/cli.c
|
||||
device/common.c
|
||||
device/device.c
|
||||
@ -127,7 +125,6 @@ add_vpp_plugin(dpdk
|
||||
device/format.c
|
||||
device/init.c
|
||||
device/node.c
|
||||
# hqos/hqos.c
|
||||
ipsec/cli.c
|
||||
ipsec/crypto_node.c
|
||||
ipsec/esp_decrypt.c
|
||||
@ -142,12 +139,6 @@ add_vpp_plugin(dpdk
|
||||
ipsec/esp_decrypt.c
|
||||
ipsec/esp_encrypt.c
|
||||
|
||||
# API_FILES
|
||||
# api/dpdk.api
|
||||
|
||||
# API_TEST_SOURCES
|
||||
# api/dpdk_test.c
|
||||
|
||||
INSTALL_HEADERS
|
||||
device/dpdk.h
|
||||
ipsec/ipsec.h
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -180,21 +180,6 @@ static_always_inline
|
||||
queue_id = (queue_id + 1) % xd->tx_q_used;
|
||||
}
|
||||
|
||||
#if 0
|
||||
if (PREDICT_FALSE (xd->flags & DPDK_DEVICE_FLAG_HQOS)) /* HQoS ON */
|
||||
{
|
||||
/* no wrap, transmit in one burst */
|
||||
dpdk_device_hqos_per_worker_thread_t *hqos =
|
||||
&xd->hqos_wt[vm->thread_index];
|
||||
|
||||
ASSERT (hqos->swq != NULL);
|
||||
|
||||
dpdk_hqos_metadata_set (hqos, mb, n_left);
|
||||
n_sent = rte_ring_sp_enqueue_burst (hqos->swq, (void **) mb,
|
||||
n_left, 0);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if (PREDICT_TRUE (xd->flags & DPDK_DEVICE_FLAG_PMD))
|
||||
{
|
||||
/* no wrap, transmit in one burst */
|
||||
|
@ -119,40 +119,6 @@ typedef enum
|
||||
|
||||
typedef uint16_t dpdk_portid_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
/* Required for vec_validate_aligned */
|
||||
CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
|
||||
|
||||
struct rte_ring *swq;
|
||||
|
||||
u64 hqos_field0_slabmask;
|
||||
u32 hqos_field0_slabpos;
|
||||
u32 hqos_field0_slabshr;
|
||||
u64 hqos_field1_slabmask;
|
||||
u32 hqos_field1_slabpos;
|
||||
u32 hqos_field1_slabshr;
|
||||
u64 hqos_field2_slabmask;
|
||||
u32 hqos_field2_slabpos;
|
||||
u32 hqos_field2_slabshr;
|
||||
u32 hqos_tc_table[64];
|
||||
} dpdk_device_hqos_per_worker_thread_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
/* Required for vec_validate_aligned */
|
||||
CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
|
||||
struct rte_ring **swq;
|
||||
struct rte_mbuf **pkts_enq;
|
||||
struct rte_mbuf **pkts_deq;
|
||||
struct rte_sched_port *hqos;
|
||||
u32 hqos_burst_enq;
|
||||
u32 hqos_burst_deq;
|
||||
u32 pkts_enq_len;
|
||||
u32 swq_pos;
|
||||
u32 flush_count;
|
||||
} dpdk_device_hqos_per_hqos_thread_t;
|
||||
|
||||
#define foreach_dpdk_device_flags \
|
||||
_( 0, ADMIN_UP, "admin-up") \
|
||||
_( 1, PROMISC, "promisc") \
|
||||
@ -160,7 +126,6 @@ typedef struct
|
||||
_( 3, PMD_INIT_FAIL, "pmd-init-fail") \
|
||||
_( 4, MAYBE_MULTISEG, "maybe-multiseg") \
|
||||
_( 5, HAVE_SUBIF, "subif") \
|
||||
_( 6, HQOS, "hqos") \
|
||||
_( 9, TX_OFFLOAD, "tx-offload") \
|
||||
_(10, INTEL_PHDR_CKSUM, "intel-phdr-cksum") \
|
||||
_(11, RX_FLOW_OFFLOAD, "rx-flow-offload") \
|
||||
@ -235,10 +200,6 @@ typedef struct
|
||||
u32 parked_loop_count;
|
||||
struct rte_flow_error last_flow_error;
|
||||
|
||||
/* HQoS related */
|
||||
dpdk_device_hqos_per_worker_thread_t *hqos_wt;
|
||||
dpdk_device_hqos_per_hqos_thread_t *hqos_ht;
|
||||
|
||||
/* af_packet instance number */
|
||||
u16 af_packet_instance_num;
|
||||
|
||||
@ -278,39 +239,6 @@ typedef struct
|
||||
#define HQOS_FLUSH_COUNT_THRESHOLD 100000
|
||||
#endif
|
||||
|
||||
typedef struct dpdk_device_config_hqos_t
|
||||
{
|
||||
u32 hqos_thread;
|
||||
u32 hqos_thread_valid;
|
||||
|
||||
u32 swq_size;
|
||||
u32 burst_enq;
|
||||
u32 burst_deq;
|
||||
|
||||
u32 pktfield0_slabpos;
|
||||
u32 pktfield1_slabpos;
|
||||
u32 pktfield2_slabpos;
|
||||
u64 pktfield0_slabmask;
|
||||
u64 pktfield1_slabmask;
|
||||
u64 pktfield2_slabmask;
|
||||
u32 tc_table[64];
|
||||
|
||||
struct rte_sched_port_params port;
|
||||
struct rte_sched_subport_params *subport;
|
||||
struct rte_sched_pipe_params *pipe;
|
||||
uint32_t *pipe_map;
|
||||
} dpdk_device_config_hqos_t;
|
||||
|
||||
int dpdk_hqos_validate_mask (u64 mask, u32 n);
|
||||
void dpdk_device_config_hqos_pipe_profile_default (dpdk_device_config_hqos_t *
|
||||
hqos, u32 pipe_profile_id);
|
||||
#if 0
|
||||
void dpdk_device_config_hqos_default (dpdk_device_config_hqos_t * hqos);
|
||||
#endif
|
||||
clib_error_t *dpdk_port_setup_hqos (dpdk_device_t * xd,
|
||||
dpdk_device_config_hqos_t * hqos);
|
||||
void dpdk_hqos_metadata_set (dpdk_device_hqos_per_worker_thread_t * hqos,
|
||||
struct rte_mbuf **pkts, u32 n_pkts);
|
||||
|
||||
#define foreach_dpdk_device_config_item \
|
||||
_ (num_rx_queues) \
|
||||
@ -333,8 +261,6 @@ typedef struct
|
||||
foreach_dpdk_device_config_item
|
||||
#undef _
|
||||
clib_bitmap_t * workers;
|
||||
u32 hqos_enabled;
|
||||
dpdk_device_config_hqos_t hqos;
|
||||
u8 tso;
|
||||
u8 *devargs;
|
||||
|
||||
@ -397,7 +323,6 @@ typedef struct
|
||||
|
||||
/* Devices */
|
||||
dpdk_device_t *devices;
|
||||
dpdk_device_and_queue_t **devices_by_hqos_cpu;
|
||||
dpdk_per_thread_data_t *per_thread_data;
|
||||
|
||||
/* buffer flags template, configurable to enable/disable tcp / udp cksum */
|
||||
@ -409,10 +334,6 @@ typedef struct
|
||||
*/
|
||||
u8 admin_up_down_in_progress;
|
||||
|
||||
/* which cpus are running I/O TX */
|
||||
int hqos_cpu_first_index;
|
||||
int hqos_cpu_count;
|
||||
|
||||
/* control interval of dpdk link state and stat polling */
|
||||
f64 link_state_poll_interval;
|
||||
f64 stat_poll_interval;
|
||||
@ -502,8 +423,6 @@ format_function_t format_dpdk_tx_offload_caps;
|
||||
vnet_flow_dev_ops_function_t dpdk_flow_ops_fn;
|
||||
|
||||
clib_error_t *unformat_rss_fn (unformat_input_t * input, uword * rss_fn);
|
||||
clib_error_t *unformat_hqos (unformat_input_t * input,
|
||||
dpdk_device_config_hqos_t * hqos);
|
||||
|
||||
struct rte_pci_device *dpdk_get_pci_device (const struct rte_eth_dev_info
|
||||
*info);
|
||||
|
@ -913,25 +913,6 @@ unformat_rss_fn (unformat_input_t * input, uword * rss_fn)
|
||||
return 0;
|
||||
}
|
||||
|
||||
clib_error_t *
|
||||
unformat_hqos (unformat_input_t * input, dpdk_device_config_hqos_t * hqos)
|
||||
{
|
||||
clib_error_t *error = 0;
|
||||
|
||||
while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
|
||||
{
|
||||
if (unformat (input, "hqos-thread %u", &hqos->hqos_thread))
|
||||
hqos->hqos_thread_valid = 1;
|
||||
else
|
||||
{
|
||||
error = clib_error_return (0, "unknown input `%U'",
|
||||
format_unformat_error, input);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
/*
|
||||
* fd.io coding-style-patch-verification: ON
|
||||
|
@ -214,29 +214,9 @@ dpdk_lib_init (dpdk_main_t * dm)
|
||||
dpdk_device_t *xd;
|
||||
vlib_pci_addr_t last_pci_addr;
|
||||
u32 last_pci_addr_port = 0;
|
||||
vlib_thread_registration_t *tr_hqos;
|
||||
uword *p_hqos;
|
||||
|
||||
u32 next_hqos_cpu = 0;
|
||||
u8 af_packet_instance_num = 0;
|
||||
last_pci_addr.as_u32 = ~0;
|
||||
|
||||
dm->hqos_cpu_first_index = 0;
|
||||
dm->hqos_cpu_count = 0;
|
||||
|
||||
/* find out which cpus will be used for I/O TX */
|
||||
p_hqos = hash_get_mem (tm->thread_registrations_by_name, "hqos-threads");
|
||||
tr_hqos = p_hqos ? (vlib_thread_registration_t *) p_hqos[0] : 0;
|
||||
|
||||
if (tr_hqos && tr_hqos->count > 0)
|
||||
{
|
||||
dm->hqos_cpu_first_index = tr_hqos->first_index;
|
||||
dm->hqos_cpu_count = tr_hqos->count;
|
||||
}
|
||||
|
||||
vec_validate_aligned (dm->devices_by_hqos_cpu, tm->n_vlib_mains - 1,
|
||||
CLIB_CACHE_LINE_BYTES);
|
||||
|
||||
nports = rte_eth_dev_count_avail ();
|
||||
|
||||
if (nports < 1)
|
||||
@ -596,38 +576,6 @@ dpdk_lib_init (dpdk_main_t * dm)
|
||||
/* assign interface to input thread */
|
||||
int q;
|
||||
|
||||
if (devconf->hqos_enabled)
|
||||
{
|
||||
xd->flags |= DPDK_DEVICE_FLAG_HQOS;
|
||||
|
||||
int cpu;
|
||||
if (devconf->hqos.hqos_thread_valid)
|
||||
{
|
||||
if (devconf->hqos.hqos_thread >= dm->hqos_cpu_count)
|
||||
return clib_error_return (0, "invalid HQoS thread index");
|
||||
|
||||
cpu = dm->hqos_cpu_first_index + devconf->hqos.hqos_thread;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (dm->hqos_cpu_count == 0)
|
||||
return clib_error_return (0, "no HQoS threads available");
|
||||
|
||||
cpu = dm->hqos_cpu_first_index + next_hqos_cpu;
|
||||
|
||||
next_hqos_cpu++;
|
||||
if (next_hqos_cpu == dm->hqos_cpu_count)
|
||||
next_hqos_cpu = 0;
|
||||
|
||||
devconf->hqos.hqos_thread_valid = 1;
|
||||
devconf->hqos.hqos_thread = cpu;
|
||||
}
|
||||
|
||||
dpdk_device_and_queue_t *dq;
|
||||
vec_add2 (dm->devices_by_hqos_cpu[cpu], dq, 1);
|
||||
dq->device = xd->device_index;
|
||||
dq->queue_id = 0;
|
||||
}
|
||||
|
||||
error = ethernet_register_interface
|
||||
(dm->vnet_main, dpdk_device_class.index, xd->device_index,
|
||||
@ -770,14 +718,6 @@ dpdk_lib_init (dpdk_main_t * dm)
|
||||
format_dpdk_device_name, i,
|
||||
format_dpdk_device_errors, xd);
|
||||
|
||||
if (devconf->hqos_enabled)
|
||||
{
|
||||
clib_error_t *rv;
|
||||
rv = dpdk_port_setup_hqos (xd, &devconf->hqos);
|
||||
if (rv)
|
||||
return rv;
|
||||
}
|
||||
|
||||
/*
|
||||
* A note on Cisco VIC (PMD_ENIC) and VLAN:
|
||||
*
|
||||
@ -1060,11 +1000,7 @@ dpdk_device_config (dpdk_config_main_t * conf, vlib_pci_addr_t pci_addr,
|
||||
}
|
||||
|
||||
devconf->pci_addr.as_u32 = pci_addr.as_u32;
|
||||
devconf->hqos_enabled = 0;
|
||||
devconf->tso = DPDK_DEVICE_TSO_DEFAULT;
|
||||
#if 0
|
||||
dpdk_device_config_hqos_default (&devconf->hqos);
|
||||
#endif
|
||||
|
||||
if (!input)
|
||||
return 0;
|
||||
@ -1097,19 +1033,6 @@ dpdk_device_config (dpdk_config_main_t * conf, vlib_pci_addr_t pci_addr,
|
||||
devconf->vlan_strip_offload = DPDK_DEVICE_VLAN_STRIP_OFF;
|
||||
else if (unformat (input, "vlan-strip-offload on"))
|
||||
devconf->vlan_strip_offload = DPDK_DEVICE_VLAN_STRIP_ON;
|
||||
else
|
||||
if (unformat
|
||||
(input, "hqos %U", unformat_vlib_cli_sub_input, &sub_input))
|
||||
{
|
||||
devconf->hqos_enabled = 1;
|
||||
error = unformat_hqos (&sub_input, &devconf->hqos);
|
||||
if (error)
|
||||
break;
|
||||
}
|
||||
else if (unformat (input, "hqos"))
|
||||
{
|
||||
devconf->hqos_enabled = 1;
|
||||
}
|
||||
else if (unformat (input, "tso on"))
|
||||
{
|
||||
devconf->tso = DPDK_DEVICE_TSO_ON;
|
||||
|
Reference in New Issue
Block a user