]> git.baikalelectronics.ru Git - kernel.git/commit
net: bcmgenet: fix TX reclaim accounting for fragments
authorFlorian Fainelli <f.fainelli@gmail.com>
Mon, 22 Sep 2014 18:54:42 +0000 (11:54 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 22 Sep 2014 22:38:40 +0000 (18:38 -0400)
commit321ed423068c1171e4c15d52c16788b7a4dc354e
tree450e9ba46516bb9f215e210502785f0c6c3bf5bd
parent1e79ec2e931a09ebe3c1f45ce100f74e09ffe174
net: bcmgenet: fix TX reclaim accounting for fragments

The GENET driver supports SKB fragments, and succeeds in transmitting
them properly, but when reclaiming these transmitted fragments, we will
only update the count of free buffer descriptors by 1, even for SKBs
with fragments. This leads to the networking stack thinking it has more
room than the hardware has when pushing new SKBs, and backing off
consequently because we return NETDEV_TX_BUSY.

Fix this by accounting for the SKB nr_frags plus one (itself) and update
ring->free_bds accordingly with that value for each iteration loop in
__bcmgenet_tx_reclaim().

Fixes: 390dff99da87 ("net: bcmgenet: add main driver file")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/genet/bcmgenet.c