From 4a302ee7c75f3d4fd1a73a9d1f6c34b3bde8d620 Mon Sep 17 00:00:00 2001 From: John Lo Date: Tue, 12 May 2020 22:34:39 -0400 Subject: ethernet: fix DMAC check and skip unnecessary ones (VPP-1868) Fix and optimize DMAC check in ethernet-input node to utilize NIC or driver which support L3 DMAC-filtering mode so that DMAC check can be bypassed safely for interfaces/sub-interfaces in L3 mode. Checking of interface in L3-DMAC-filtering state to avoid DMAC check require the following: a) Fix interface driver init sequence for devices which supports L3 DMAC-filtering to indicate its capability and initialize interface to L3 DMAC-filtering state. b) Fix ethernet_set_flags() function and its associated callback flags_change() functions registered by various drivers in interface infra to provide proper L3 DMAC filtering status. Maintain interface/sub-interface L3 config count so DMAC checks can be bypassed if L3 forwarding is not setup on any main/sub-interfaces. Type: fix Ticket: VPP-1868 Signed-off-by: John Lo Change-Id: I204d90459c13e9e486cfcba4e64e3d479bc9f2ae --- src/vnet/interface.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/vnet/interface.h') diff --git a/src/vnet/interface.h b/src/vnet/interface.h index ee64a81d250..5f4fd065756 100644 --- a/src/vnet/interface.h +++ b/src/vnet/interface.h @@ -503,6 +503,9 @@ typedef enum vnet_hw_interface_flags_t_ /* non-broadcast multiple access */ VNET_HW_INTERFACE_FLAG_NBMA = (1 << 19), + + /* hw/driver can switch between l2-promisc and l3-dmac-filter modes */ + VNET_HW_INTERFACE_FLAG_SUPPORTS_MAC_FILTER = (1 << 20), } vnet_hw_interface_flags_t; #define VNET_HW_INTERFACE_FLAG_DUPLEX_SHIFT 1 @@ -570,8 +573,9 @@ typedef struct vnet_hw_interface_t /* Hash table mapping sub interface id to sw_if_index. */ uword *sub_interface_sw_if_index_by_id; - /* Count of number of L2 subinterfaces */ + /* Count of number of L2 and L3 subinterfaces */ u32 l2_if_count; + u32 l3_if_count; /* Bonded interface info - 0 - not a bonded interface nor a slave -- cgit 1.2.3-korg