summaryrefslogtreecommitdiffstats
path: root/src/vnet/devices/af_packet
diff options
context:
space:
mode:
authorJohn Lo <loj@cisco.com>2020-05-12 22:34:39 -0400
committerDamjan Marion <dmarion@me.com>2020-05-27 17:27:27 +0000
commit4a302ee7c75f3d4fd1a73a9d1f6c34b3bde8d620 (patch)
tree46afc10a5fb0edc511b18ab8cac176458a9e59c0 /src/vnet/devices/af_packet
parent94f3295d3807ccadbadbc863640af4fc4c224d7f (diff)
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 <loj@cisco.com> Change-Id: I204d90459c13e9e486cfcba4e64e3d479bc9f2ae
Diffstat (limited to 'src/vnet/devices/af_packet')
-rw-r--r--src/vnet/devices/af_packet/af_packet.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vnet/devices/af_packet/af_packet.c b/src/vnet/devices/af_packet/af_packet.c
index 22ddf4ecd11..455e76b4280 100644
--- a/src/vnet/devices/af_packet/af_packet.c
+++ b/src/vnet/devices/af_packet/af_packet.c
@@ -67,7 +67,7 @@ af_packet_eth_flag_change (vnet_main_t * vnm, vnet_hw_interface_t * hi,
af_packet_if_t *apif =
pool_elt_at_index (apm->interfaces, hi->dev_instance);
- if (ETHERNET_INTERFACE_FLAG_MTU == (flags & ETHERNET_INTERFACE_FLAG_MTU))
+ if (flags == ETHERNET_INTERFACE_FLAG_MTU)
{
s = format (0, "/sys/class/net/%s/mtu%c", apif->host_if_name, 0);