aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/patches-3.18/077-04-bgmac-simplify-tx-ring-index-handling.patch
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2015-04-14 12:17:20 +0000
committerFelix Fietkau <nbd@openwrt.org>2015-04-14 12:17:20 +0000
commit054044ff91891723025a6b35bd583c98e141ea3d (patch)
treea3f4744223e4a3ac72ac691f8690cf0cc57cf1c7 /target/linux/generic/patches-3.18/077-04-bgmac-simplify-tx-ring-index-handling.patch
parent023d3337d828ba911cc8713839e18afd6b7da244 (diff)
downloadupstream-054044ff91891723025a6b35bd583c98e141ea3d.tar.gz
upstream-054044ff91891723025a6b35bd583c98e141ea3d.tar.bz2
upstream-054044ff91891723025a6b35bd583c98e141ea3d.zip
kernel: update bgmac patches to the latest version submitted
Signed-off-by: Felix Fietkau <nbd@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@45431 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/generic/patches-3.18/077-04-bgmac-simplify-tx-ring-index-handling.patch')
-rw-r--r--target/linux/generic/patches-3.18/077-04-bgmac-simplify-tx-ring-index-handling.patch16
1 files changed, 9 insertions, 7 deletions
diff --git a/target/linux/generic/patches-3.18/077-04-bgmac-simplify-tx-ring-index-handling.patch b/target/linux/generic/patches-3.18/077-04-bgmac-simplify-tx-ring-index-handling.patch
index cf62a50a2f..241a3083a9 100644
--- a/target/linux/generic/patches-3.18/077-04-bgmac-simplify-tx-ring-index-handling.patch
+++ b/target/linux/generic/patches-3.18/077-04-bgmac-simplify-tx-ring-index-handling.patch
@@ -25,22 +25,24 @@ Signed-off-by: Felix Fietkau <nbd@openwrt.org>
int i;
if (skb->len > BGMAC_DESC_CTL1_LEN) {
-@@ -158,13 +157,7 @@ static netdev_tx_t bgmac_dma_tx_add(stru
- skb_checksum_help(skb);
+@@ -159,12 +158,10 @@ static netdev_tx_t bgmac_dma_tx_add(stru
nr_frags = skb_shinfo(skb)->nr_frags;
--
+
- if (ring->start <= ring->end)
- free_slots = ring->start - ring->end + BGMAC_TX_RING_SLOTS;
- else
- free_slots = ring->start - ring->end;
-
- if (free_slots <= nr_frags + 1) {
++ /* ring->end - ring->start will return the number of valid slots,
++ * even when ring->end overflows
++ */
+ if (ring->end - ring->start + nr_frags + 1 >= BGMAC_TX_RING_SLOTS) {
bgmac_err(bgmac, "TX ring is full, queue should be stopped!\n");
netif_stop_queue(net_dev);
return NETDEV_TX_BUSY;
-@@ -200,7 +193,7 @@ static netdev_tx_t bgmac_dma_tx_add(stru
+@@ -200,7 +197,7 @@ static netdev_tx_t bgmac_dma_tx_add(stru
}
slot->skb = skb;
@@ -49,7 +51,7 @@ Signed-off-by: Felix Fietkau <nbd@openwrt.org>
netdev_sent_queue(net_dev, skb->len);
wmb();
-@@ -208,13 +201,12 @@ static netdev_tx_t bgmac_dma_tx_add(stru
+@@ -208,13 +205,12 @@ static netdev_tx_t bgmac_dma_tx_add(stru
/* Increase ring->end to point empty slot. We tell hardware the first
* slot it should *not* read.
*/
@@ -66,7 +68,7 @@ Signed-off-by: Felix Fietkau <nbd@openwrt.org>
netif_stop_queue(net_dev);
return NETDEV_TX_OK;
-@@ -256,17 +248,17 @@ static void bgmac_dma_tx_free(struct bgm
+@@ -256,17 +252,17 @@ static void bgmac_dma_tx_free(struct bgm
empty_slot &= BGMAC_DMA_TX_STATDPTR;
empty_slot /= sizeof(struct bgmac_dma_desc);
@@ -93,7 +95,7 @@ Signed-off-by: Felix Fietkau <nbd@openwrt.org>
if (ctl1 & BGMAC_DESC_CTL0_SOF)
/* Unmap no longer used buffer */
dma_unmap_single(dma_dev, slot->dma_addr, len,
-@@ -284,10 +276,8 @@ static void bgmac_dma_tx_free(struct bgm
+@@ -284,10 +280,8 @@ static void bgmac_dma_tx_free(struct bgm
slot->skb = NULL;
}