mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Boon Khai Ng <boon.khai.ng@intel.com>
To: "David S . Miller" <davem@davemloft.net>
Cc: linux-kernel@vger.kernel.org,
	Mun Yew Tham <mun.yew.tham@intel.com>,
	Tien Sung Ang <tien.sung.ang@intel.com>,
	Boon Khai Ng <boon.khai.ng@intel.com>
Subject: [PATCH v1 2/8] drivers: net: stmmac_main: fix vlan toggle option.
Date: Thu, 30 Mar 2023 15:03:05 +0800	[thread overview]
Message-ID: <20230330070305.18808-1-boon.khai.ng@intel.com> (raw)

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

Signed-off-by: Boon Khai Ng <boon.khai.ng@intel.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


             reply	other threads:[~2023-03-30  7:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-30  7:03 Boon Khai Ng [this message]
2023-03-30 10:02 ` kernel test robot
2023-03-30 11:24 ` kernel test robot
2023-03-30 17:24 ` Please ignore this review, send out by accident Boon Khai Ng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230330070305.18808-1-boon.khai.ng@intel.com \
    --to=boon.khai.ng@intel.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mun.yew.tham@intel.com \
    --cc=tien.sung.ang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®