aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/devices/af_packet/af_packet.h
diff options
context:
space:
mode:
authorMohsin Kazmi <sykazmi@cisco.com>2022-03-18 16:58:31 +0000
committerDamjan Marion <dmarion@me.com>2022-03-23 18:47:15 +0000
commit219cbcb29fdcd9d76d7fe00c5a5e074f8e149083 (patch)
tree8d7addee9bb3e23dff3c3998cd2b06c1a6274f21 /src/vnet/devices/af_packet/af_packet.h
parent8d7cdc808fdb810a843b48bfcca358cf083c04e8 (diff)
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 <sykazmi@cisco.com>
Diffstat (limited to 'src/vnet/devices/af_packet/af_packet.h')
-rw-r--r--src/vnet/devices/af_packet/af_packet.h17
1 files changed, 12 insertions, 5 deletions
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 <linux/if_packet.h>
+
#include <vppinfra/lock.h>
#include <vlib/log.h>
+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;