aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/mvebu/patches-4.9/120-net-mvneta-add-BQL-support.patch
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2017-02-06 11:46:48 +0100
committerFelix Fietkau <nbd@nbd.name>2017-02-16 17:17:15 +0100
commit2bf9ea6a31736db059aa97addce3a34b933dacc1 (patch)
treeecfe628aabaf38e6bd40ca841443d19079105a83 /target/linux/mvebu/patches-4.9/120-net-mvneta-add-BQL-support.patch
parent237454991618e0e8b7ceb8a8a2a43fca12c1a454 (diff)
downloadupstream-2bf9ea6a31736db059aa97addce3a34b933dacc1.tar.gz
upstream-2bf9ea6a31736db059aa97addce3a34b933dacc1.tar.bz2
upstream-2bf9ea6a31736db059aa97addce3a34b933dacc1.zip
mvebu: add linux 4.9 support
Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
Diffstat (limited to 'target/linux/mvebu/patches-4.9/120-net-mvneta-add-BQL-support.patch')
-rw-r--r--target/linux/mvebu/patches-4.9/120-net-mvneta-add-BQL-support.patch83
1 files changed, 83 insertions, 0 deletions
diff --git a/target/linux/mvebu/patches-4.9/120-net-mvneta-add-BQL-support.patch b/target/linux/mvebu/patches-4.9/120-net-mvneta-add-BQL-support.patch
new file mode 100644
index 0000000000..0b822f3863
--- /dev/null
+++ b/target/linux/mvebu/patches-4.9/120-net-mvneta-add-BQL-support.patch
@@ -0,0 +1,83 @@
+--- a/drivers/net/ethernet/marvell/mvneta.c
++++ b/drivers/net/ethernet/marvell/mvneta.c
+@@ -1719,8 +1719,10 @@ static struct mvneta_tx_queue *mvneta_tx
+
+ /* Free tx queue skbuffs */
+ static void mvneta_txq_bufs_free(struct mvneta_port *pp,
+- struct mvneta_tx_queue *txq, int num)
++ struct mvneta_tx_queue *txq, int num,
++ struct netdev_queue *nq)
+ {
++ unsigned int bytes_compl = 0, pkts_compl = 0;
+ int i;
+
+ for (i = 0; i < num; i++) {
+@@ -1728,6 +1730,11 @@ static void mvneta_txq_bufs_free(struct
+ txq->txq_get_index;
+ struct sk_buff *skb = txq->tx_skb[txq->txq_get_index];
+
++ if (skb) {
++ bytes_compl += skb->len;
++ pkts_compl++;
++ }
++
+ mvneta_txq_inc_get(txq);
+
+ if (!IS_TSO_HEADER(txq, tx_desc->buf_phys_addr))
+@@ -1738,6 +1745,8 @@ static void mvneta_txq_bufs_free(struct
+ continue;
+ dev_kfree_skb_any(skb);
+ }
++
++ netdev_tx_completed_queue(nq, pkts_compl, bytes_compl);
+ }
+
+ /* Handle end of transmission */
+@@ -1751,7 +1760,7 @@ static void mvneta_txq_done(struct mvnet
+ if (!tx_done)
+ return;
+
+- mvneta_txq_bufs_free(pp, txq, tx_done);
++ mvneta_txq_bufs_free(pp, txq, tx_done, nq);
+
+ txq->count -= tx_done;
+
+@@ -2358,6 +2367,8 @@ out:
+ struct mvneta_pcpu_stats *stats = this_cpu_ptr(pp->stats);
+ struct netdev_queue *nq = netdev_get_tx_queue(dev, txq_id);
+
++ netdev_tx_sent_queue(nq, len);
++
+ txq->count += frags;
+ mvneta_txq_pend_desc_add(pp, txq, frags);
+
+@@ -2382,9 +2393,10 @@ static void mvneta_txq_done_force(struct
+ struct mvneta_tx_queue *txq)
+
+ {
++ struct netdev_queue *nq = netdev_get_tx_queue(pp->dev, txq->id);
+ int tx_done = txq->count;
+
+- mvneta_txq_bufs_free(pp, txq, tx_done);
++ mvneta_txq_bufs_free(pp, txq, tx_done, nq);
+
+ /* reset txq */
+ txq->count = 0;
+@@ -2882,6 +2894,8 @@ static int mvneta_txq_init(struct mvneta
+ static void mvneta_txq_deinit(struct mvneta_port *pp,
+ struct mvneta_tx_queue *txq)
+ {
++ struct netdev_queue *nq = netdev_get_tx_queue(pp->dev, txq->id);
++
+ kfree(txq->tx_skb);
+
+ if (txq->tso_hdrs)
+@@ -2893,6 +2907,8 @@ static void mvneta_txq_deinit(struct mvn
+ txq->size * MVNETA_DESC_ALIGNED_SIZE,
+ txq->descs, txq->descs_phys);
+
++ netdev_tx_reset_queue(nq);
++
+ txq->descs = NULL;
+ txq->last_desc = 0;
+ txq->next_desc_to_proc = 0;