16 #define DPDK_NB_RX_DESC_DEFAULT 512 17 #define DPDK_NB_TX_DESC_DEFAULT 512 18 #define DPDK_NB_RX_DESC_VIRTIO 256 19 #define DPDK_NB_TX_DESC_VIRTIO 256 20 #define DPDK_NB_RX_DESC_10GE 2048 21 #define DPDK_NB_TX_DESC_10GE 2048 22 #define DPDK_NB_RX_DESC_40GE (4096-128) 23 #define DPDK_NB_TX_DESC_40GE 2048 24 #define DPDK_NB_RX_DESC_ENIC (4096+1024) 27 #define foreach_eal_double_hyphen_predicate_arg \ 35 #define foreach_eal_single_hyphen_mandatory_arg \ 39 #define foreach_eal_single_hyphen_arg \ 41 _(mem-alloc-request, m) \ 45 #define foreach_eal_double_hyphen_arg \ 65 n_this_chunk = rte_eth_rx_burst (xd->
device_index, queue_id,
67 n_buffers += n_this_chunk;
68 n_left -= n_this_chunk;
71 if (n_this_chunk < 32)
79 unsigned socket_id = rte_socket_id();
82 #if RTE_VERSION >= RTE_VERSION_NUM(2, 2, 0, 0) 83 offset = queue_id * VIRTIO_QNUM;
85 struct vhost_virtqueue *vq =
95 n_buffers = rte_vhost_dequeue_burst(&xd->
vu_vhost_dev, offset + VIRTIO_TXQ,
96 bm->pktmbuf_pools[socket_id],
100 struct rte_mbuf **pkts = xd->
rx_vectors[queue_id];
101 for (i = 0; i < n_buffers; i++) {
102 struct rte_mbuf *buff = pkts[
i];
103 bytes += rte_pktmbuf_data_len(buff);
121 vring->
bytes += bytes;
129 #ifdef RTE_LIBRTE_KNI 133 rte_kni_handle_request(xd->
kni);
159 _vec_len(xd->
xstats) = len;
172 u64 rxerrors, last_rxerrors;
197 xd->
stats.rx_nombuf -
211 #if RTE_VERSION >= RTE_VERSION_NUM(2, 2, 0, 0) 212 rxerrors = xd->
stats.ierrors;
215 rxerrors = xd->
stats.ibadcrc
227 rxerrors - last_rxerrors);
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
sll srl srl sll sra u16x4 i
struct rte_eth_stats last_stats
void dpdk_vhost_user_send_interrupt(vlib_main_t *vm, dpdk_device_t *xd, int idx)
vnet_interface_main_t interface_main
u32 vhost_coalesce_frames
struct virtio_net vu_vhost_dev
vlib_buffer_main_t * buffer_main
always_inline vlib_main_t * vlib_get_main(void)
struct rte_eth_stats stats
vnet_main_t * vnet_get_main(void)
u8 dpdk_vhost_user_want_interrupt(dpdk_device_t *xd, int idx)
dpdk_vu_vring vrings[VHOST_MAX_QUEUE_PAIRS *2]
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
static void dpdk_get_xstats(dpdk_device_t *xd)
struct rte_eth_xstats * last_cleared_xstats
f64 time_last_stats_update
always_inline void vlib_increment_simple_counter(vlib_simple_counter_main_t *cm, u32 cpu_index, u32 index, u32 increment)
uword os_get_cpu_number(void)
vlib_simple_counter_main_t * sw_if_counters
static void dpdk_update_counters(dpdk_device_t *xd, f64 now)
struct rte_mbuf *** rx_vectors
#define clib_memcpy(a, b, c)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
dpdk_device_type_t dev_type
static u32 dpdk_rx_burst(dpdk_main_t *dm, dpdk_device_t *xd, u16 queue_id)
struct rte_eth_xstats * xstats
always_inline f64 vlib_time_now(vlib_main_t *vm)