Message ID | 52959214.7000501@huawei.com |
---|---|
State | Accepted, archived |
Delegated to: | David Miller |
Headers | show |
From: Yang Yingliang <yangyingliang@huawei.com> Date: Wed, 27 Nov 2013 14:32:52 +0800 > From: Yang Yingliang <yangyingliang@huawei.com> > > Using iperf to send packets(GSO mode is on), a bug is triggered: ... > When a skb has frags, bytes_compl plus skb->len nr_frags times in cp_tx(). > It's not the correct value(actually, it should plus skb->len once) and it > will trigger the BUG_ON(bytes_compl > num_queued - dql->num_completed). > So only increase bytes_compl when finish sending all frags. pkts_compl also > has a wrong value, fix it too. > > It's introduced by commit 871f0d4c("8139cp: enable bql"). > > Suggested-by: Eric Dumazet <edumazet@google.com> > Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Applied and queued up for -stable, thanks. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/net/ethernet/realtek/8139cp.c b/drivers/net/ethernet/realtek/8139cp.c index f2a2128..737c1a8 100644 --- a/drivers/net/ethernet/realtek/8139cp.c +++ b/drivers/net/ethernet/realtek/8139cp.c @@ -678,9 +678,6 @@ static void cp_tx (struct cp_private *cp) le32_to_cpu(txd->opts1) & 0xffff, PCI_DMA_TODEVICE); - bytes_compl += skb->len; - pkts_compl++; - if (status & LastFrag) { if (status & (TxError | TxFIFOUnder)) { netif_dbg(cp, tx_err, cp->dev, @@ -702,6 +699,8 @@ static void cp_tx (struct cp_private *cp) netif_dbg(cp, tx_done, cp->dev, "tx done, slot %d\n", tx_tail); } + bytes_compl += skb->len; + pkts_compl++; dev_kfree_skb_irq(skb); }