diff options
author | hauke <hauke@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2013-09-18 15:19:25 +0000 |
---|---|---|
committer | hauke <hauke@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2013-09-18 15:19:25 +0000 |
commit | 473ef714032fac45193f3866488fb70ab0fa8e7d (patch) | |
tree | a83533d208a3ac6ef1d94ae7adce5b532e21c3eb /target/linux/brcm47xx/patches-3.10/740-bgmac-add-support-for-Byte-Queue-Limits.patch | |
parent | d0fa5bac88f6707b0159daad0e5fddf84a77025e (diff) |
brcm47xx: bgmac: b44: add support for Byte Queue Limits
This adds support for Byte Queue Limits in bgmac and b44, now it is
possible to use more advanced network queue control algorithms.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@38038 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/brcm47xx/patches-3.10/740-bgmac-add-support-for-Byte-Queue-Limits.patch')
-rw-r--r-- | target/linux/brcm47xx/patches-3.10/740-bgmac-add-support-for-Byte-Queue-Limits.patch | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/target/linux/brcm47xx/patches-3.10/740-bgmac-add-support-for-Byte-Queue-Limits.patch b/target/linux/brcm47xx/patches-3.10/740-bgmac-add-support-for-Byte-Queue-Limits.patch new file mode 100644 index 0000000000..68d1bc9f6b --- /dev/null +++ b/target/linux/brcm47xx/patches-3.10/740-bgmac-add-support-for-Byte-Queue-Limits.patch @@ -0,0 +1,50 @@ +From: Hauke Mehrtens <hauke@hauke-m.de> +bgmac: add support for Byte Queue Limits + +--- a/drivers/net/ethernet/broadcom/bgmac.c ++++ b/drivers/net/ethernet/broadcom/bgmac.c +@@ -178,6 +178,7 @@ static void bgmac_dma_tx_free(struct bgm + 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 +196,9 @@ static void bgmac_dma_tx_free(struct bgm + 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 +212,8 @@ static void bgmac_dma_tx_free(struct bgm + 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); + } +@@ -987,6 +993,8 @@ static void bgmac_chip_reset(struct bgma + bgmac_set(bgmac, BGMAC_PHY_CNTL, BGMAC_PC_MTE); + bgmac_miiconfig(bgmac); + bgmac_phy_init(bgmac); ++ ++ netdev_reset_queue(bgmac->net_dev); + + bgmac->int_status = 0; + } +@@ -1198,6 +1206,8 @@ static netdev_tx_t bgmac_start_xmit(stru + struct bgmac *bgmac = netdev_priv(net_dev); + struct bgmac_dma_ring *ring; + ++ netdev_sent_queue(net_dev, skb->len); ++ + /* No QOS support yet */ + ring = &bgmac->tx_ring[0]; + return bgmac_dma_tx_add(bgmac, ring, skb); |