summaryrefslogtreecommitdiffstats
path: root/src/vnet/devices/af_packet/af_packet.h
diff options
context:
space:
mode:
authorMohsin Kazmi <sykazmi@cisco.com>2022-09-08 17:21:20 +0000
committerMohsin Kazmi <sykazmi@cisco.com>2022-10-21 16:32:56 +0000
commit8b90d89b05322ceaaf57e0eda403c4f92546f7b3 (patch)
tree7ee0ecc2128f41e3e2219489dff890430a36c385 /src/vnet/devices/af_packet/af_packet.h
parent65bff88c3671ec6ee561e70f17c60ea9784a39dd (diff)
devices: add support for af-packet v2
Type: feature Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: I2ccaf1d512dcb72e414be8c69cbb538ebbe0e933
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, 14 insertions, 3 deletions
diff --git a/src/vnet/devices/af_packet/af_packet.h b/src/vnet/devices/af_packet/af_packet.h
index 940acbb1372..7aa5e6d5b9a 100644
--- a/src/vnet/devices/af_packet/af_packet.h
+++ b/src/vnet/devices/af_packet/af_packet.h
@@ -23,9 +23,17 @@
#include <vlib/log.h>
typedef struct tpacket_block_desc block_desc_t;
+typedef struct tpacket_req tpacket_req_t;
typedef struct tpacket_req3 tpacket_req3_t;
+typedef struct tpacket2_hdr tpacket2_hdr_t;
typedef struct tpacket3_hdr tpacket3_hdr_t;
+typedef union _tpacket_req_u
+{
+ tpacket_req_t req;
+ tpacket_req3_t req3;
+} tpacket_req_u_t;
+
typedef enum
{
AF_PACKET_IF_MODE_ETHERNET = 1,
@@ -37,6 +45,7 @@ typedef enum
AF_PACKET_IF_FLAGS_QDISC_BYPASS = 1,
AF_PACKET_IF_FLAGS_CKSUM_GSO = 2,
AF_PACKET_IF_FLAGS_FANOUT = 4,
+ AF_PACKET_IF_FLAGS_VERSION_2 = 8,
} af_packet_if_flags_t;
typedef struct
@@ -58,8 +67,8 @@ typedef struct
int fd;
union
{
- tpacket_req3_t *rx_req;
- tpacket_req3_t *tx_req;
+ tpacket_req_u_t *rx_req;
+ tpacket_req_u_t *tx_req;
};
union
@@ -71,6 +80,7 @@ typedef struct
union
{
u32 next_rx_block;
+ u32 next_rx_frame;
u32 next_tx_frame;
};
@@ -95,7 +105,7 @@ typedef struct
af_packet_if_mode_t mode;
u8 is_admin_up;
u8 is_cksum_gso_enabled;
-
+ u8 version;
af_packet_queue_t *rx_queues;
af_packet_queue_t *tx_queues;
@@ -139,6 +149,7 @@ typedef struct
u32 tx_frames_per_block;
u8 num_rxqs;
u8 num_txqs;
+ u8 is_v2;
af_packet_if_mode_t mode;
af_packet_if_flags_t flags;