]> git.baikalelectronics.ru Git - kernel.git/commit
net: bcmgenet: update ring producer index and buffer count in xmit
authorFlorian Fainelli <f.fainelli@gmail.com>
Fri, 13 Mar 2015 19:11:06 +0000 (12:11 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 13 Mar 2015 19:52:31 +0000 (15:52 -0400)
commit6e3dd529c8255e309b4fd122f50e0815dbe2f0a4
tree07347e19a36c09ce7b95a45984388b75dd4a27c7
parente2f550f61449eadb9343dac550767d875f69074b
net: bcmgenet: update ring producer index and buffer count in xmit

There is no need to have both bcmgenet_xmit_single() and
bcmgenet_xmit_frag() perform a free_bds decrement and a prod_index
increment by one. In case one of these functions fails to map a SKB or
fragment for transmit, we will return and exit bcmgenet_xmit() with an
error.

We can therefore safely use our local copy of nr_frags to know by how
much we should decrement the number of free buffers available, and by
how much the producer count must be incremented and do this in the tail
of bcmgenet_xmit().

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Petri Gynther <pgynther@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/genet/bcmgenet.c