aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/devices/dpdk
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2017-02-28 21:55:28 +0100
committerNeale Ranns <nranns@cisco.com>2017-03-01 11:11:37 +0000
commitb3bb10101ceffec1df0624c785acbd40858870ec (patch)
tree9f4a8bc34be67373a372f800cd6eab86e85d556a /src/vnet/devices/dpdk
parentf7c379403a98cf060d28bac24916c51067c4ec90 (diff)
devices: vnet_get_aggregate_rx_packets should not be dpdk specific
Change-Id: I1152db4b7d1602653d7d8b2c6cb28cf5c526c4ca Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vnet/devices/dpdk')
-rw-r--r--src/vnet/devices/dpdk/dpdk.h34
-rwxr-xr-xsrc/vnet/devices/dpdk/init.c8
-rw-r--r--src/vnet/devices/dpdk/node.c3
3 files changed, 1 insertions, 44 deletions
diff --git a/src/vnet/devices/dpdk/dpdk.h b/src/vnet/devices/dpdk/dpdk.h
index 79c694f7cbc..bf9f2768e08 100644
--- a/src/vnet/devices/dpdk/dpdk.h
+++ b/src/vnet/devices/dpdk/dpdk.h
@@ -225,22 +225,6 @@ typedef struct
typedef struct
{
- CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
-
- /* total input packet counter */
- u64 aggregate_rx_packets;
-} dpdk_worker_t;
-
-typedef struct
-{
- CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
-
- /* total input packet counter */
- u64 aggregate_rx_packets;
-} dpdk_hqos_thread_t;
-
-typedef struct
-{
u32 device;
u16 queue_id;
} dpdk_device_and_queue_t;
@@ -360,12 +344,6 @@ typedef struct
/* vlib buffer free list, must be same size as an rte_mbuf */
u32 vlib_buffer_free_list_index;
- /* dpdk worker "threads" */
- dpdk_worker_t *workers;
-
- /* dpdk HQoS "threads" */
- dpdk_hqos_thread_t *hqos_threads;
-
/* Ethernet input node index */
u32 ethernet_input_node_index;
@@ -475,18 +453,6 @@ void dpdk_update_link_state (dpdk_device_t * xd, f64 now);
void dpdk_device_lock_init (dpdk_device_t * xd);
void dpdk_device_lock_free (dpdk_device_t * xd);
-static inline u64
-vnet_get_aggregate_rx_packets (void)
-{
- dpdk_main_t *dm = &dpdk_main;
- u64 sum = 0;
- dpdk_worker_t *dw;
-
- vec_foreach (dw, dm->workers) sum += dw->aggregate_rx_packets;
-
- return sum;
-}
-
void dpdk_rx_trace (dpdk_main_t * dm,
vlib_node_runtime_t * node,
dpdk_device_t * xd,
diff --git a/src/vnet/devices/dpdk/init.c b/src/vnet/devices/dpdk/init.c
index f4700133d21..29423e152c4 100755
--- a/src/vnet/devices/dpdk/init.c
+++ b/src/vnet/devices/dpdk/init.c
@@ -277,9 +277,6 @@ dpdk_lib_init (dpdk_main_t * dm)
vec_validate_aligned (dm->devices_by_cpu, tm->n_vlib_mains - 1,
CLIB_CACHE_LINE_BYTES);
- vec_validate_aligned (dm->workers, tm->n_vlib_mains - 1,
- CLIB_CACHE_LINE_BYTES);
-
dm->hqos_cpu_first_index = 0;
dm->hqos_cpu_count = 0;
@@ -296,9 +293,6 @@ dpdk_lib_init (dpdk_main_t * dm)
vec_validate_aligned (dm->devices_by_hqos_cpu, tm->n_vlib_mains - 1,
CLIB_CACHE_LINE_BYTES);
- vec_validate_aligned (dm->hqos_threads, tm->n_vlib_mains - 1,
- CLIB_CACHE_LINE_BYTES);
-
nports = rte_eth_dev_count ();
if (nports < 1)
{
@@ -1756,8 +1750,6 @@ dpdk_init (vlib_main_t * vm)
STATIC_ASSERT (offsetof (dpdk_device_t, cacheline1) ==
CLIB_CACHE_LINE_BYTES,
"Data in cache line 0 is bigger than cache line size");
- STATIC_ASSERT (offsetof (dpdk_worker_t, cacheline0) == 0,
- "Cache line marker must be 1st element in dpdk_worker_t");
STATIC_ASSERT (offsetof (frame_queue_trace_t, cacheline0) == 0,
"Cache line marker must be 1st element in frame_queue_trace_t");
diff --git a/src/vnet/devices/dpdk/node.c b/src/vnet/devices/dpdk/node.c
index bde9dfae76d..0d64ae089e7 100644
--- a/src/vnet/devices/dpdk/node.c
+++ b/src/vnet/devices/dpdk/node.c
@@ -556,8 +556,7 @@ dpdk_device_input (dpdk_main_t * dm, dpdk_device_t * xd,
+ VNET_INTERFACE_COUNTER_RX,
cpu_index, xd->vlib_sw_if_index, mb_index, n_rx_bytes);
- dpdk_worker_t *dw = vec_elt_at_index (dm->workers, cpu_index);
- dw->aggregate_rx_packets += mb_index;
+ vnet_device_increment_rx_packets (cpu_index, mb_index);
return mb_index;
}