Skip to contentSkip to conversation

net: wangxun: don't advertise IFF_SUPP_NOFCS

PATCH Applied Rongguang Wei 3 participants 3 messages Jun 17 – Jun 19

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: wangxun: don't advertise IFF_SUPP_NOFCS

From: Rongguang Wei <[email protected]>

Like commit a24162f18825("i40e: don't advertise IFF_SUPP_NOFCS"), ngbe and txgbe also advertises IFF_SUPP_NOFCS and allowing users to use the SO_NOFCS socket option. But the driver does not check skb->no_fcs, so this option is silently ignored.

With this change, send() fails with -EPROTONOSUPPORT when AF_PACKET socket is set SO_NOFCS option.

---
 drivers/net/ethernet/wangxun/ngbe/ngbe_main.c   | 1 -
 drivers/net/ethernet/wangxun/txgbe/txgbe_main.c | 1 -
 2 files changed, 2 deletions(-)
drivers/net/ethernet/wangxun/ngbe/ngbe_main.c +0 -1
index d8e3827a8b1f..1e4ebac8e495 100644
@@ -713,7 +713,6 @@ static int ngbe_probe(struct pci_dev *pdev,
 	netdev->features |= NETIF_F_GRO;
 
 	netdev->priv_flags |= IFF_UNICAST_FLT;
-	netdev->priv_flags |= IFF_SUPP_NOFCS;
 	netdev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
 
 	netdev->min_mtu = ETH_MIN_MTU;
drivers/net/ethernet/wangxun/txgbe/txgbe_main.c +0 -1
index 8b7c3753bb6a..db9262b00a66 100644
@@ -801,7 +801,6 @@ static int txgbe_probe(struct pci_dev *pdev,
 	netdev->features |= NETIF_F_RX_UDP_TUNNEL_PORT;
 
 	netdev->priv_flags |= IFF_UNICAST_FLT;
-	netdev->priv_flags |= IFF_SUPP_NOFCS;
 	netdev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
 
 	netdev->min_mtu = ETH_MIN_MTU;
Signature · 1 line
2.25.1
#1 lore raw
Quoted 6 lines

2026年6月17日 17:28,Rongguang Wei <[email protected]> 写道:

From: Rongguang Wei <[email protected]>

Quoted 7 lines

Like commit a24162f18825("i40e: don't advertise IFF_SUPP_NOFCS"), ngbe and txgbe also advertises IFF_SUPP_NOFCS and allowing users to use the SO_NOFCS socket option. But the driver does not check skb->no_fcs, so this option is silently ignored.

With this change, send() fails with -EPROTONOSUPPORT when AF_PACKET socket is set SO_NOFCS option.

In fact, the hardware supports this function, but it seems that no one is using it at present. To ensure that the interface does not report any errors, it can be removed.

Quoted 36 lines

---
drivers/net/ethernet/wangxun/ngbe/ngbe_main.c | 1 -
drivers/net/ethernet/wangxun/txgbe/txgbe_main.c | 1 -

2 files changed, 2 deletions(-)
drivers/net/ethernet/wangxun/ngbe/ngbe_main.c +0 -1
index d8e3827a8b1f..1e4ebac8e495 100644
@@ -713,7 +713,6 @@ static int ngbe_probe(struct pci_dev *pdev,
 netdev->features |= NETIF_F_GRO;
 
 netdev->priv_flags |= IFF_UNICAST_FLT;
- netdev->priv_flags |= IFF_SUPP_NOFCS;
 netdev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
 
 netdev->min_mtu = ETH_MIN_MTU;
drivers/net/ethernet/wangxun/txgbe/txgbe_main.c +0 -1
index 8b7c3753bb6a..db9262b00a66 100644
@@ -801,7 +801,6 @@ static int txgbe_probe(struct pci_dev *pdev,
 netdev->features |= NETIF_F_RX_UDP_TUNNEL_PORT;
 
 netdev->priv_flags |= IFF_UNICAST_FLT;
- netdev->priv_flags |= IFF_SUPP_NOFCS;
 netdev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
 
 netdev->min_mtu = ETH_MIN_MTU;
Signature · 1 line
2.25.1
#2 lore raw
In reply to Rongguang Wei
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Wed, 17 Jun 2026 17:28:54 +0800 you wrote:

From: Rongguang Wei <[email protected]>

Like commit a24162f18825("i40e: don't advertise IFF_SUPP_NOFCS"), ngbe and txgbe also advertises IFF_SUPP_NOFCS and allowing users to use the SO_NOFCS socket option. But the driver does not check skb->no_fcs, so this option is silently ignored.

[...]

Here is the summary with links:
- [net-next,v1] net: wangxun: don't advertise IFF_SUPP_NOFCS

    https://git.kernel.org/netdev/net/c/0ec4b7859870

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html