Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: airoha: Fix TSO support for header cloned skbs

For GSO packets, skb_cow_head() will reallocate the skb for TSO header
cloned skbs in airoha_dev_xmit(). For this reason, sinfo pointer can be
no more valid. Fix the issue relying on skb_shinfo() macro directly in
airoha_dev_xmit().

The problem exists since
commit 23020f049327 ("net: airoha: Introduce ethernet support for EN7581 SoC")
but it is not a user visible, since we can't currently enable TSO
for DSA user ports since we are missing to initialize net_device
vlan_features field.

Reviewed-by: Mateusz Polchlopek <mateusz.polchlopek@intel.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://patch.msgid.link/20250213-airoha-en7581-flowtable-offload-v4-1-b69ca16d74db@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Lorenzo Bianconi and committed by
Jakub Kicinski
c6287e1a 4671bb1a

+5 -5
+5 -5
drivers/net/ethernet/mediatek/airoha_eth.c
··· 2556 2556 static netdev_tx_t airoha_dev_xmit(struct sk_buff *skb, 2557 2557 struct net_device *dev) 2558 2558 { 2559 - struct skb_shared_info *sinfo = skb_shinfo(skb); 2560 2559 struct airoha_gdm_port *port = netdev_priv(dev); 2560 + u32 nr_frags = 1 + skb_shinfo(skb)->nr_frags; 2561 2561 u32 msg0, msg1, len = skb_headlen(skb); 2562 2562 struct airoha_qdma *qdma = port->qdma; 2563 - u32 nr_frags = 1 + sinfo->nr_frags; 2564 2563 struct netdev_queue *txq; 2565 2564 struct airoha_queue *q; 2566 2565 void *data = skb->data; ··· 2582 2583 if (skb_cow_head(skb, 0)) 2583 2584 goto error; 2584 2585 2585 - if (sinfo->gso_type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6)) { 2586 - __be16 csum = cpu_to_be16(sinfo->gso_size); 2586 + if (skb_shinfo(skb)->gso_type & (SKB_GSO_TCPV4 | 2587 + SKB_GSO_TCPV6)) { 2588 + __be16 csum = cpu_to_be16(skb_shinfo(skb)->gso_size); 2587 2589 2588 2590 tcp_hdr(skb)->check = (__force __sum16)csum; 2589 2591 msg0 |= FIELD_PREP(QDMA_ETH_TXMSG_TSO_MASK, 1); ··· 2613 2613 for (i = 0; i < nr_frags; i++) { 2614 2614 struct airoha_qdma_desc *desc = &q->desc[index]; 2615 2615 struct airoha_queue_entry *e = &q->entry[index]; 2616 - skb_frag_t *frag = &sinfo->frags[i]; 2616 + skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; 2617 2617 dma_addr_t addr; 2618 2618 u32 val; 2619 2619