]> git.baikalelectronics.ru Git - kernel.git/commit
net: systemport: rewrite bcm_sysport_rx_refill
authorFlorian Fainelli <f.fainelli@gmail.com>
Thu, 28 May 2015 22:24:43 +0000 (15:24 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sun, 31 May 2015 06:51:17 +0000 (23:51 -0700)
commit2c61e8fece579d233701a363962771c4321d0a13
treeb868339e4d147662449e6451d2ad9a85b2dd13b7
parentdd763cbf8d5dfc8fe1583b5d395ae68496cf2b25
net: systemport: rewrite bcm_sysport_rx_refill

Currently, bcm_sysport_desc_rx() calls bcm_sysport_rx_refill() at the end of Rx
packet processing loop, after the current Rx packet has already been passed to
napi_gro_receive(). However, bcm_sysport_rx_refill() might fail to allocate a new
Rx skb, thus leaving a hole on the Rx queue where no valid Rx buffer exists.

To eliminate this situation:

1. Rewrite bcm_sysport_rx_refill() to retain the current Rx skb on the
Rx queue if a new replacement Rx skb can't be allocated and DMA-mapped.
In this case, the data on the current Rx skb is effectively dropped.

2. Modify bcm_sysport_desc_rx() to call bcm_sysport_rx_refill() at the
top of Rx packet processing loop, so that the new replacement Rx skb is
already in place before the current Rx skb is processed.

This is loosely inspired from 58761d9034bc ("net: bcmgenet: rewrite
bcmgenet_rx_refill()")

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bcmsysport.c