summaryrefslogtreecommitdiffstats
path: root/src/vnet/ethernet/ethernet.h
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2018-11-14 16:55:53 +0100
committerFlorin Coras <florin.coras@gmail.com>2018-11-20 22:05:06 +0000
commit650223c0ae8fe781aea5f26c92a6cf9bc2ca59e5 (patch)
tree1a4d5b85ed7adeab9e5f34410362a6323d096a65 /src/vnet/ethernet/ethernet.h
parent7e0b17df0990ebca9cbae71b31cae7fd2c439acf (diff)
ethernet-input optimizations
Change-Id: I4ec7750ef58363bd8966a16a2baeec6db18b7e9e Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vnet/ethernet/ethernet.h')
-rw-r--r--src/vnet/ethernet/ethernet.h15
1 files changed, 15 insertions, 0 deletions
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 <vnet/pg/pg.h>
#include <vnet/feature/feature.h>
+/* 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)