Skip to contentSkip to conversation

net: bgmac: stop advertising TX checksum offload

PATCH Applied Rosen Penev 5 participants 6 messages Nov 2 – Nov 10

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

PATCH 1/1 net: bgmac: stop advertising TX checksum offload

The driver advertises NETIF_F_IP_CSUM and NETIF_F_IPV6_CSUM, but bgmac_dma_tx_add() calls skb_checksum_help() on every CHECKSUM_PARTIAL skb, so the checksum is always computed in software anyway. The return value is ignored too, so if skb_checksum_help() fails the frame is sent with a bad checksum.

Remove the feature flags and the fallback. The stack then computes the checksum before handing the skb to the driver.

Tested on an ASUS RT-N16.

---
 drivers/net/ethernet/broadcom/bgmac.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/net/ethernet/broadcom/bgmac.c +1 -4
index 2dff43f540d3..822903a3ac6e 100644
@@ -145,9 +145,6 @@ static netdev_tx_t bgmac_dma_tx_add(struct bgmac *bgmac,
 		goto err_drop;
 	}
 
-	if (skb->ip_summed == CHECKSUM_PARTIAL)
-		skb_checksum_help(skb);
-
 	nr_frags = skb_shinfo(skb)->nr_frags;
 
 	/* ring->end - ring->start will return the number of valid slots,
@@ -1574,7 +1571,7 @@ int bgmac_enet_probe(struct bgmac *bgmac)
 		goto err_dma_free;
 	}
 
-	net_dev->features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
+	net_dev->features = NETIF_F_SG;
 	net_dev->hw_features = net_dev->features;
 	net_dev->vlan_features = net_dev->features;
 
Signature · 1 line
2.56.0
#1 lore raw

…

Quoted 2 lines

Remove the feature flags and the fallback. The stack then computes the checksum before handing the skb to the driver.

…

How can a “stack” compute anything?

Regards,
Markus

reviewer
#2 lore raw
Quoted 6 lines · Markus Elfring

…

Quoted 2 lines

Remove the feature flags and the fallback. The stack then computes the checksum before handing the skb to the driver.

…

How can a “stack” compute anything?

Perhaps your assumption is that stack refers to stack memory. But my assumption is that stack refers to the software stack, or slightly more specifically, core parts of the Linux implementation of networking.

reviewer Reviewed-by on v1 1/1
#3 lore raw
In reply to Rosen Penev
Quoted 6 lines · Rosen Penev

The driver advertises NETIF_F_IP_CSUM and NETIF_F_IPV6_CSUM, but bgmac_dma_tx_add() calls skb_checksum_help() on every CHECKSUM_PARTIAL skb, so the checksum is always computed in software anyway. The return value is ignored too, so if skb_checksum_help() fails the frame is sent with a bad checksum.

Quoted 6 lines

Remove the feature flags and the fallback. The stack then computes the checksum before handing the skb to the driver.

Tested on an ASUS RT-N16.

Reviewed-by on v1 1/1
#4 lore raw
In reply to Rosen Penev
Quoted 6 lines · Rosen Penev

The driver advertises NETIF_F_IP_CSUM and NETIF_F_IPV6_CSUM, but bgmac_dma_tx_add() calls skb_checksum_help() on every CHECKSUM_PARTIAL skb, so the checksum is always computed in software anyway. The return value is ignored too, so if skb_checksum_help() fails the frame is sent with a bad checksum.

Quoted 6 lines

Remove the feature flags and the fallback. The stack then computes the checksum before handing the skb to the driver.

Tested on an ASUS RT-N16.

There is no transmit checksum offload through the DMA descriptors, it can only be done through FA/FA+ which is not supported yet (working on that).

Signature · 1 line
Florian
#5 lore raw
In reply to Rosen Penev
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

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

Quoted 10 lines · On Mon, 2 Nov 2026 13:58:06 -0800 you wrote:

The driver advertises NETIF_F_IP_CSUM and NETIF_F_IPV6_CSUM, but bgmac_dma_tx_add() calls skb_checksum_help() on every CHECKSUM_PARTIAL skb, so the checksum is always computed in software anyway. The return value is ignored too, so if skb_checksum_help() fails the frame is sent with a bad checksum.

Remove the feature flags and the fallback. The stack then computes the checksum before handing the skb to the driver.

[...]

Here is the summary with links:
- [net-next] net: bgmac: stop advertising TX checksum offload

    https://git.kernel.org/netdev/net-next/c/e65a0ec96f9d

You are awesome, thank you!

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