ar71xx: ack completed tx descriptors only after the full frame has been completed
Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 42457
This commit is contained in:
parent
2dabf3a775
commit
1961f8cdb7
1 changed files with 16 additions and 10 deletions
|
@ -901,11 +901,12 @@ static int ag71xx_tx_packets(struct ag71xx *ag)
|
||||||
struct ag71xx_platform_data *pdata = ag71xx_get_pdata(ag);
|
struct ag71xx_platform_data *pdata = ag71xx_get_pdata(ag);
|
||||||
int sent = 0;
|
int sent = 0;
|
||||||
int bytes_compl = 0;
|
int bytes_compl = 0;
|
||||||
|
int n = 0;
|
||||||
|
|
||||||
DBG("%s: processing TX ring\n", ag->dev->name);
|
DBG("%s: processing TX ring\n", ag->dev->name);
|
||||||
|
|
||||||
while (ring->dirty != ring->curr) {
|
while (ring->dirty + n != ring->curr) {
|
||||||
unsigned int i = ring->dirty % ring->size;
|
unsigned int i = (ring->dirty + n) % ring->size;
|
||||||
struct ag71xx_desc *desc = ring->buf[i].desc;
|
struct ag71xx_desc *desc = ring->buf[i].desc;
|
||||||
struct sk_buff *skb = ring->buf[i].skb;
|
struct sk_buff *skb = ring->buf[i].skb;
|
||||||
|
|
||||||
|
@ -916,17 +917,22 @@ static int ag71xx_tx_packets(struct ag71xx *ag)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
ag71xx_wr(ag, AG71XX_REG_TX_STATUS, TX_STATUS_PS);
|
n++;
|
||||||
|
if (!skb)
|
||||||
|
continue;
|
||||||
|
|
||||||
if (skb) {
|
dev_kfree_skb_any(skb);
|
||||||
dev_kfree_skb_any(skb);
|
ring->buf[i].skb = NULL;
|
||||||
ring->buf[i].skb = NULL;
|
|
||||||
|
|
||||||
bytes_compl += ring->buf[i].len;
|
bytes_compl += ring->buf[i].len;
|
||||||
sent++;
|
|
||||||
|
sent++;
|
||||||
|
ring->dirty += n;
|
||||||
|
|
||||||
|
while (n > 0) {
|
||||||
|
ag71xx_wr(ag, AG71XX_REG_TX_STATUS, TX_STATUS_PS);
|
||||||
|
n--;
|
||||||
}
|
}
|
||||||
|
|
||||||
ring->dirty++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DBG("%s: %d packets sent out\n", ag->dev->name, sent);
|
DBG("%s: %d packets sent out\n", ag->dev->name, sent);
|
||||||
|
|
Loading…
Reference in a new issue