* [PATCH v3] bgmac: add support for Byte Queue Limits
@ 2013-09-29 11:54 Hauke Mehrtens
2013-09-30 4:34 ` Eric Dumazet
0 siblings, 1 reply; 3+ messages in thread
From: Hauke Mehrtens @ 2013-09-29 11:54 UTC (permalink / raw)
To: davem; +Cc: zajec5, eric.dumazet, netdev, Hauke Mehrtens
This makes it possible to use some more advanced queuing
techniques with this driver.
When multi queue support will be added some changes to Byte Queue
handling is needed.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
v3: now netdev_sent_queue() is called after the descriptor is written
to the memory, but before the hardware is told that there is a new
descriptor, the package can not be dropped by the driver any more and
netdev_completed_queue() have not been called for this skb, because the
driver haven't told the hardware about this package yet.
drivers/net/ethernet/broadcom/bgmac.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/net/ethernet/broadcom/bgmac.c b/drivers/net/ethernet/broadcom/bgmac.c
index 249468f..7eca5a1 100644
--- a/drivers/net/ethernet/broadcom/bgmac.c
+++ b/drivers/net/ethernet/broadcom/bgmac.c
@@ -149,6 +149,8 @@ static netdev_tx_t bgmac_dma_tx_add(struct bgmac *bgmac,
dma_desc->ctl0 = cpu_to_le32(ctl0);
dma_desc->ctl1 = cpu_to_le32(ctl1);
+ netdev_sent_queue(net_dev, skb->len);
+
wmb();
/* Increase ring->end to point empty slot. We tell hardware the first
@@ -178,6 +180,7 @@ static void bgmac_dma_tx_free(struct bgmac *bgmac, struct bgmac_dma_ring *ring)
struct device *dma_dev = bgmac->core->dma_dev;
int empty_slot;
bool freed = false;
+ unsigned bytes_compl = 0, pkts_compl = 0;
/* The last slot that hardware didn't consume yet */
empty_slot = bgmac_read(bgmac, ring->mmio_base + BGMAC_DMA_TX_STATUS);
@@ -195,6 +198,9 @@ static void bgmac_dma_tx_free(struct bgmac *bgmac, struct bgmac_dma_ring *ring)
slot->skb->len, DMA_TO_DEVICE);
slot->dma_addr = 0;
+ bytes_compl += slot->skb->len;
+ pkts_compl++;
+
/* Free memory! :) */
dev_kfree_skb(slot->skb);
slot->skb = NULL;
@@ -208,6 +214,8 @@ static void bgmac_dma_tx_free(struct bgmac *bgmac, struct bgmac_dma_ring *ring)
freed = true;
}
+ netdev_completed_queue(bgmac->net_dev, pkts_compl, bytes_compl);
+
if (freed && netif_queue_stopped(bgmac->net_dev))
netif_wake_queue(bgmac->net_dev);
}
@@ -988,6 +996,8 @@ static void bgmac_chip_reset(struct bgmac *bgmac)
bgmac_miiconfig(bgmac);
bgmac_phy_init(bgmac);
+ netdev_reset_queue(bgmac->net_dev);
+
bgmac->int_status = 0;
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v3] bgmac: add support for Byte Queue Limits
2013-09-29 11:54 [PATCH v3] bgmac: add support for Byte Queue Limits Hauke Mehrtens
@ 2013-09-30 4:34 ` Eric Dumazet
2013-10-01 5:11 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Eric Dumazet @ 2013-09-30 4:34 UTC (permalink / raw)
To: Hauke Mehrtens; +Cc: davem, zajec5, netdev
On Sun, 2013-09-29 at 13:54 +0200, Hauke Mehrtens wrote:
> This makes it possible to use some more advanced queuing
> techniques with this driver.
>
> When multi queue support will be added some changes to Byte Queue
> handling is needed.
>
> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
> ---
Reviewed-by: Eric Dumazet <edumazet@google.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v3] bgmac: add support for Byte Queue Limits
2013-09-30 4:34 ` Eric Dumazet
@ 2013-10-01 5:11 ` David Miller
0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2013-10-01 5:11 UTC (permalink / raw)
To: eric.dumazet; +Cc: hauke, zajec5, netdev
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sun, 29 Sep 2013 21:34:44 -0700
> On Sun, 2013-09-29 at 13:54 +0200, Hauke Mehrtens wrote:
>> This makes it possible to use some more advanced queuing
>> techniques with this driver.
>>
>> When multi queue support will be added some changes to Byte Queue
>> handling is needed.
>>
>> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
>> ---
>
> Reviewed-by: Eric Dumazet <edumazet@google.com>
Applied.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-10-01 5:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-29 11:54 [PATCH v3] bgmac: add support for Byte Queue Limits Hauke Mehrtens
2013-09-30 4:34 ` Eric Dumazet
2013-10-01 5:11 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).