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 | |
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')
4 files changed, 106 insertions, 10 deletions
diff --git a/target/linux/brcm47xx/patches-3.10/730-b44-add-support-for-Byte-Queue-Limits.patch b/target/linux/brcm47xx/patches-3.10/730-b44-add-support-for-Byte-Queue-Limits.patch new file mode 100644 index 0000000000..5da6abe202 --- /dev/null +++ b/target/linux/brcm47xx/patches-3.10/730-b44-add-support-for-Byte-Queue-Limits.patch @@ -0,0 +1,46 @@ +From: Hauke Mehrtens <hauke@hauke-m.de> +b44: add support for Byte Queue Limits + +--- a/drivers/net/ethernet/broadcom/b44.c ++++ b/drivers/net/ethernet/broadcom/b44.c +@@ -622,6 +622,7 @@ static void b44_timer(unsigned long __op + static void b44_tx(struct b44 *bp) + { + u32 cur, cons; ++ unsigned bytes_compl = 0, pkts_compl = 0; + + cur = br32(bp, B44_DMATX_STAT) & DMATX_STAT_CDMASK; + cur /= sizeof(struct dma_desc); +@@ -638,9 +639,14 @@ static void b44_tx(struct b44 *bp) + skb->len, + DMA_TO_DEVICE); + rp->skb = NULL; ++ ++ bytes_compl += skb->len; ++ pkts_compl++; ++ + dev_kfree_skb_irq(skb); + } + ++ netdev_completed_queue(bp->dev, pkts_compl, bytes_compl); + bp->tx_cons = cons; + if (netif_queue_stopped(bp->dev) && + TX_BUFFS_AVAIL(bp) > B44_TX_WAKEUP_THRESH) +@@ -1044,6 +1050,8 @@ static netdev_tx_t b44_start_xmit(struct + if (bp->flags & B44_FLAG_REORDER_BUG) + br32(bp, B44_DMATX_PTR); + ++ netdev_sent_queue(dev, skb->len); ++ + if (TX_BUFFS_AVAIL(bp) < 1) + netif_stop_queue(dev); + +@@ -1442,6 +1450,8 @@ static void b44_init_hw(struct b44 *bp, + + val = br32(bp, B44_ENET_CTRL); + bw32(bp, B44_ENET_CTRL, (val | ENET_CTRL_ENABLE)); ++ ++ netdev_reset_queue(bp->dev); + } + + static int b44_open(struct net_device *dev) 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); diff --git a/target/linux/brcm47xx/patches-3.10/770-bgmac-phylib.patch b/target/linux/brcm47xx/patches-3.10/770-bgmac-phylib.patch index 33308319db..4a42aeba77 100644 --- a/target/linux/brcm47xx/patches-3.10/770-bgmac-phylib.patch +++ b/target/linux/brcm47xx/patches-3.10/770-bgmac-phylib.patch @@ -10,7 +10,7 @@ They can be found on BCM47xx SoCs and provide gigabit ethernet. --- a/drivers/net/ethernet/broadcom/bgmac.c +++ b/drivers/net/ethernet/broadcom/bgmac.c -@@ -1219,27 +1219,14 @@ static int bgmac_set_mac_address(struct +@@ -1229,27 +1229,14 @@ static int bgmac_set_mac_address(struct static int bgmac_ioctl(struct net_device *net_dev, struct ifreq *ifr, int cmd) { struct bgmac *bgmac = netdev_priv(net_dev); @@ -45,7 +45,7 @@ } static const struct net_device_ops bgmac_netdev_ops = { -@@ -1261,61 +1248,18 @@ static int bgmac_get_settings(struct net +@@ -1271,61 +1258,18 @@ static int bgmac_get_settings(struct net { struct bgmac *bgmac = netdev_priv(net_dev); @@ -111,7 +111,7 @@ static void bgmac_get_drvinfo(struct net_device *net_dev, struct ethtool_drvinfo *info) -@@ -1326,6 +1270,7 @@ static void bgmac_get_drvinfo(struct net +@@ -1336,6 +1280,7 @@ static void bgmac_get_drvinfo(struct net static const struct ethtool_ops bgmac_ethtool_ops = { .get_settings = bgmac_get_settings, @@ -119,7 +119,7 @@ .get_drvinfo = bgmac_get_drvinfo, }; -@@ -1344,10 +1289,42 @@ static int bgmac_mii_write(struct mii_bu +@@ -1354,10 +1299,42 @@ static int bgmac_mii_write(struct mii_bu return bgmac_phy_write(bus->priv, mii_id, regnum, value); } @@ -162,7 +162,7 @@ mii_bus = mdiobus_alloc(); if (!mii_bus) -@@ -1378,7 +1355,29 @@ static int bgmac_mii_register(struct bgm +@@ -1388,7 +1365,29 @@ static int bgmac_mii_register(struct bgm bgmac->mii_bus = mii_bus; diff --git a/target/linux/brcm47xx/patches-3.10/780-b44-phylib.patch b/target/linux/brcm47xx/patches-3.10/780-b44-phylib.patch index 72b374ce55..244978b3f2 100644 --- a/target/linux/brcm47xx/patches-3.10/780-b44-phylib.patch +++ b/target/linux/brcm47xx/patches-3.10/780-b44-phylib.patch @@ -47,7 +47,7 @@ } static int b44_phy_reset(struct b44 *bp) -@@ -1821,102 +1824,24 @@ static int b44_get_settings(struct net_d +@@ -1831,102 +1834,24 @@ static int b44_get_settings(struct net_d { struct b44 *bp = netdev_priv(dev); @@ -155,7 +155,7 @@ } static void b44_get_ringparam(struct net_device *dev, -@@ -2092,20 +2017,81 @@ static const struct ethtool_ops b44_etht +@@ -2102,20 +2027,81 @@ static const struct ethtool_ops b44_etht static int b44_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) { @@ -239,7 +239,7 @@ static int b44_get_invariants(struct b44 *bp) { struct ssb_device *sdev = bp->sdev; -@@ -2225,12 +2211,38 @@ static int b44_init_one(struct ssb_devic +@@ -2235,12 +2221,38 @@ static int b44_init_one(struct ssb_devic goto err_out_powerdown; } @@ -284,7 +284,7 @@ /* By default, advertise all speed/duplex settings. */ bp->flags |= (B44_FLAG_ADV_10HALF | B44_FLAG_ADV_10FULL | -@@ -2262,6 +2274,16 @@ static int b44_init_one(struct ssb_devic +@@ -2272,6 +2284,16 @@ static int b44_init_one(struct ssb_devic return 0; @@ -301,7 +301,7 @@ err_out_powerdown: ssb_bus_may_powerdown(sdev->bus); -@@ -2275,8 +2297,12 @@ out: +@@ -2285,8 +2307,12 @@ out: static void b44_remove_one(struct ssb_device *sdev) { struct net_device *dev = ssb_get_drvdata(sdev); |