Skip to content

Commit

Permalink
r8169: don't increment tx_dropped in case of NETDEV_TX_BUSY
Browse files Browse the repository at this point in the history
The skb isn't consumed in case of NETDEV_TX_BUSY, therefore don't
increment the tx_dropped counter.

Fixes: 188f4af ("r8169: use NETDEV_TX_{BUSY/OK}")
Cc: [email protected]
Suggested-by: Jakub Kicinski <[email protected]>
Signed-off-by: Heiner Kallweit <[email protected]>
Reviewed-by: Wojciech Drewek <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
hkallweit authored and kuba-moo committed Aug 1, 2024
1 parent 601df20 commit d516b18
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions drivers/net/ethernet/realtek/r8169_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4349,7 +4349,8 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
if (unlikely(!rtl_tx_slots_avail(tp))) {
if (net_ratelimit())
netdev_err(dev, "BUG! Tx Ring full when queue awake!\n");
goto err_stop_0;
netif_stop_queue(dev);
return NETDEV_TX_BUSY;
}

opts[1] = rtl8169_tx_vlan_tag(skb);
Expand Down Expand Up @@ -4405,11 +4406,6 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
dev_kfree_skb_any(skb);
dev->stats.tx_dropped++;
return NETDEV_TX_OK;

err_stop_0:
netif_stop_queue(dev);
dev->stats.tx_dropped++;
return NETDEV_TX_BUSY;
}

static unsigned int rtl_last_frag_len(struct sk_buff *skb)
Expand Down

0 comments on commit d516b18

Please sign in to comment.