From 650223c0ae8fe781aea5f26c92a6cf9bc2ca59e5 Mon Sep 17 00:00:00 2001 From: Damjan Marion Date: Wed, 14 Nov 2018 16:55:53 +0100 Subject: ethernet-input optimizations Change-Id: I4ec7750ef58363bd8966a16a2baeec6db18b7e9e Signed-off-by: Damjan Marion --- src/vnet/ethernet/ethernet.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/vnet/ethernet/ethernet.h') diff --git a/src/vnet/ethernet/ethernet.h b/src/vnet/ethernet/ethernet.h index ece7aa58217..7435599c347 100644 --- a/src/vnet/ethernet/ethernet.h +++ b/src/vnet/ethernet/ethernet.h @@ -45,6 +45,20 @@ #include #include +/* ethernet-input frame flags and scalar data */ + +/* all packets in frame share same sw_if_index */ +#define ETH_INPUT_FRAME_F_SINGLE_SW_IF_IDX (1 << 0) + +/* all ip4 packets in frame have correct ip4 checksum */ +#define ETH_INPUT_FRAME_F_IP4_CKSUM_OK (1 << 1) + +typedef struct +{ + u32 sw_if_index; + u32 hw_if_index; +} ethernet_input_frame_t; + always_inline u64 ethernet_mac_address_u64 (const u8 * a) { @@ -154,6 +168,7 @@ typedef u32 (ethernet_flag_change_function_t) /* Ethernet interface instance. */ typedef struct ethernet_interface { + u32 flags; /* Accept all packets (promiscuous mode). */ #define ETHERNET_INTERFACE_FLAG_ACCEPT_ALL (1 << 0) -- cgit 1.2.3-korg