From 219cbcb29fdcd9d76d7fe00c5a5e074f8e149083 Mon Sep 17 00:00:00 2001 From: Mohsin Kazmi Date: Fri, 18 Mar 2022 16:58:31 +0000 Subject: devices: af-packet v3 support Type: feature CPU usage ~20% less than v2. Performance improvement 20% more than v2. High vector rate. Change-Id: I24bc594200f42664b59d07b44d44578e61068bbc Signed-off-by: Mohsin Kazmi --- src/vnet/devices/af_packet/af_packet.h | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'src/vnet/devices/af_packet/af_packet.h') diff --git a/src/vnet/devices/af_packet/af_packet.h b/src/vnet/devices/af_packet/af_packet.h index d7d16b91c8c..ed3f10bb092 100644 --- a/src/vnet/devices/af_packet/af_packet.h +++ b/src/vnet/devices/af_packet/af_packet.h @@ -17,9 +17,15 @@ *------------------------------------------------------------------ */ +#include + #include #include +typedef struct tpacket_block_desc block_desc_t; +typedef struct tpacket_req3 tpacket_req3_t; +typedef struct tpacket3_hdr tpacket3_hdr_t; + typedef enum { AF_PACKET_IF_MODE_ETHERNET = 1, @@ -39,15 +45,16 @@ typedef struct u8 *host_if_name; int host_if_index; int fd; - struct tpacket_req *rx_req; - struct tpacket_req *tx_req; - u8 *rx_ring; - u8 *tx_ring; + tpacket_req3_t *rx_req; + tpacket_req3_t *tx_req; + u8 **rx_ring; + u8 **tx_ring; + u32 hdrlen; u32 hw_if_index; u32 sw_if_index; u32 clib_file_index; - u32 next_rx_frame; + u32 next_rx_block; u32 next_tx_frame; u32 per_interface_next_index; -- cgit 1.2.3-korg