lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230330070305.18808-1-boon.khai.ng@intel.com>
Date:   Thu, 30 Mar 2023 15:03:05 +0800
From:   Boon Khai Ng <boon.khai.ng@...el.com>
To:     "David S . Miller" <davem@...emloft.net>
Cc:     linux-kernel@...r.kernel.org,
        Mun Yew Tham <mun.yew.tham@...el.com>,
        Tien Sung Ang <tien.sung.ang@...el.com>,
        Boon Khai Ng <boon.khai.ng@...el.com>
Subject: [PATCH v1 2/8] drivers: net: stmmac_main: fix vlan toggle option.

This patch is to fix toggling rx vlan offload from the ethool.

Signed-off-by: Boon Khai Ng <boon.khai.ng@...el.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 8ee595d46481..664c32d61622 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -4565,10 +4565,8 @@ static void stmmac_rx_vlan(struct net_device *dev, struct sk_buff *skb)
 	veth = (struct vlan_ethhdr *)skb->data;
 	vlan_proto = veth->h_vlan_proto;
 
-	if ((vlan_proto == htons(ETH_P_8021Q) &&
-	     dev->features & NETIF_F_HW_VLAN_CTAG_RX) ||
-	    (vlan_proto == htons(ETH_P_8021AD) &&
-	     dev->features & NETIF_F_HW_VLAN_STAG_RX)) {
+	if (vlan_proto == htons(ETH_P_8021Q) ||
+	    vlan_proto == htons(ETH_P_8021AD)) {
 		/* pop the vlan tag */
 		vlanid = ntohs(veth->h_vlan_TCI);
 		memmove(skb->data + VLAN_HLEN, veth, ETH_ALEN * 2);
@@ -5685,6 +5683,8 @@ static int stmmac_set_features(struct net_device *netdev,
 
 	if (changed & NETIF_F_HW_VLAN_CTAG_RX)
 		stmmac_set_hw_vlan_mode(priv, priv->ioaddr, features);
+		priv->plat->use_hw_vlan = features & NETIF_F_HW_VLAN_CTAG_RX;
+	}
 
 	return 0;
 }
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ