From e8d516daf3b1fe30cdbe994a02f6f57338a0527d Mon Sep 17 00:00:00 2001 From: Mohan Thadikamalla Date: Mon, 28 Aug 2023 14:30:42 +0530 Subject: [PATCH] nvethernet: Disable VLAN VID tag filters Issue: The L2 Orin bridge use case is encountered an issue on AV+L NDAS builds for VLAN ping from HOST1 to HOST2 over L2 Orin bridge. As HOST1/HOST2 VLAN packets are dropped by EQOS/MGBE MAC due to VLAN VID feature enable. Fix: To support the L2 Orin bridge VLAN HOST1 to HOST2 data usecase, disable the VLAN VID filters in the nvethernet driver. Bug 4230250 Change-Id: I02514fcc15b7764fe93118a9f90c16716368c73c Signed-off-by: Mohan Thadikamalla (cherry picked from commit 86cb37f933846a012ba6d8cdac275a2edda0aa42) Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3003075 Reviewed-by: Bhadram Varka Reviewed-by: Srinivas Ramachandran GVS: Gerrit_Virtual_Submit --- .../net/ethernet/nvidia/nvethernet/ether_linux.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/nvidia/nvethernet/ether_linux.c b/drivers/net/ethernet/nvidia/nvethernet/ether_linux.c index a81bddb1..23006a1f 100644 --- a/drivers/net/ethernet/nvidia/nvethernet/ether_linux.c +++ b/drivers/net/ethernet/nvidia/nvethernet/ether_linux.c @@ -2696,7 +2696,9 @@ static int ether_open(struct net_device *dev) #ifndef OSI_STRIPPED_LIB /* As all registers reset as part of ether_close(), reset private * structure variable as well */ +#ifdef ETHER_VLAN_VID_SUPPORT pdata->vlan_hash_filtering = OSI_PERFECT_FILTER_MODE; +#endif /* ETHER_VLAN_VID_SUPPORT */ pdata->l2_filtering_mode = OSI_PERFECT_FILTER_MODE; #endif /* !OSI_STRIPPED_LIB */ @@ -4123,7 +4125,7 @@ static int ether_set_features(struct net_device *ndev, netdev_features_t feat) return ret; } -#ifndef OSI_STRIPPED_LIB +#ifdef ETHER_VLAN_VID_SUPPORT /** * @brief Adds VLAN ID. This function is invoked by upper * layer when a new VLAN id is registered. This function updates the HW @@ -4211,7 +4213,7 @@ static int ether_vlan_rx_kill_vid(struct net_device *ndev, __be16 vlan_proto, return ret; } -#endif /* !OSI_STRIPPED_LIB */ +#endif /* ETHER_VLAN_VID_SUPPORT */ /** * @brief ether_setup_tc - TC HW offload support @@ -4266,10 +4268,10 @@ static const struct net_device_ops ether_netdev_ops = { .ndo_select_queue = ether_select_queue, .ndo_set_features = ether_set_features, .ndo_set_rx_mode = ether_set_rx_mode, -#ifndef OSI_STRIPPED_LIB +#ifdef ETHER_VLAN_VID_SUPPORT .ndo_vlan_rx_add_vid = ether_vlan_rx_add_vid, .ndo_vlan_rx_kill_vid = ether_vlan_rx_kill_vid, -#endif /* !OSI_STRIPPED_LIB */ +#endif /* ETHER_VLAN_VID_SUPPORT */ .ndo_setup_tc = ether_setup_tc, }; @@ -6363,10 +6365,10 @@ static void ether_set_ndev_features(struct net_device *ndev, features |= NETIF_F_HW_VLAN_CTAG_TX; } -#ifndef OSI_STRIPPED_LIB +#ifdef ETHER_VLAN_VID_SUPPORT /* Rx VLAN tag stripping/filtering enabled by default */ features |= NETIF_F_HW_VLAN_CTAG_FILTER; -#endif /* !OSI_STRIPPED_LIB */ +#endif /* ETHER_VLAN_VID_SUPPORT */ /* Receive Hashing offload */ if (pdata->hw_feat.rss_en) {