Skip to content

Commit acac054

Browse files
jlemonPaolo Abeni
authored andcommitted
net: bcmgenet: hide status block before TX timestamping
The hardware checksum offloading requires use of a transmit status block inserted before the outgoing frame data, this was updated in '9a9ba2a4aaaa ("net: bcmgenet: always enable status blocks")' However, skb_tx_timestamp() assumes that it is passed a raw frame and PTP parsing chokes on this status block. Fix this by calling __skb_pull(), which hides the TSB before calling skb_tx_timestamp(), so an outgoing PTP packet is parsed correctly. As the data in the skb has already been set up for DMA, and the dma_unmap_* calls use a separately stored address, there is no no effective change in the data transmission. Signed-off-by: Jonathan Lemon <[email protected]> Acked-by: Florian Fainelli <[email protected]> Link: https://lore.kernel.org/r/[email protected] Fixes: d03825f ("net: bcmgenet: add skb_tx_timestamp call") Signed-off-by: Paolo Abeni <[email protected]>
1 parent b561275 commit acac054

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/net/ethernet/broadcom/genet/bcmgenet.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2035,6 +2035,11 @@ static struct sk_buff *bcmgenet_add_tsb(struct net_device *dev,
20352035
return skb;
20362036
}
20372037

2038+
static void bcmgenet_hide_tsb(struct sk_buff *skb)
2039+
{
2040+
__skb_pull(skb, sizeof(struct status_64));
2041+
}
2042+
20382043
static netdev_tx_t bcmgenet_xmit(struct sk_buff *skb, struct net_device *dev)
20392044
{
20402045
struct bcmgenet_priv *priv = netdev_priv(dev);
@@ -2141,6 +2146,8 @@ static netdev_tx_t bcmgenet_xmit(struct sk_buff *skb, struct net_device *dev)
21412146
}
21422147

21432148
GENET_CB(skb)->last_cb = tx_cb_ptr;
2149+
2150+
bcmgenet_hide_tsb(skb);
21442151
skb_tx_timestamp(skb);
21452152

21462153
/* Decrement total BD count and advance our write pointer */

0 commit comments

Comments
 (0)