Skip to content

Commit

Permalink
net: macb: move checksum clearing outside of spinlock
Browse files Browse the repository at this point in the history
Move checksum clearing outside of spinlock. The SKB is protected by
networking lock (HARD_TX_LOCK()).

Signed-off-by: Claudiu Beznea <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
claudiubeznea authored and davem330 committed Aug 7, 2018
1 parent d1c3895 commit 33729f2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drivers/net/ethernet/cadence/macb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1662,6 +1662,11 @@ static netdev_tx_t macb_start_xmit(struct sk_buff *skb, struct net_device *dev)
bool is_lso, is_udp = 0;
netdev_tx_t ret = NETDEV_TX_OK;

if (macb_clear_csum(skb)) {
dev_kfree_skb_any(skb);
return ret;
}

is_lso = (skb_shinfo(skb)->gso_size != 0);

if (is_lso) {
Expand Down Expand Up @@ -1717,11 +1722,6 @@ static netdev_tx_t macb_start_xmit(struct sk_buff *skb, struct net_device *dev)
return NETDEV_TX_BUSY;
}

if (macb_clear_csum(skb)) {
dev_kfree_skb_any(skb);
goto unlock;
}

/* Map socket buffer for DMA transfer */
if (!macb_tx_map(bp, queue, skb, hdrlen)) {
dev_kfree_skb_any(skb);
Expand Down

0 comments on commit 33729f2

Please sign in to comment.