2017-02-06 10:46:48 +00:00
|
|
|
--- a/drivers/net/ethernet/marvell/mvneta.c
|
|
|
|
+++ b/drivers/net/ethernet/marvell/mvneta.c
|
2017-11-20 09:51:09 +00:00
|
|
|
@@ -1720,8 +1720,10 @@ static struct mvneta_tx_queue *mvneta_tx
|
2017-02-06 10:46:48 +00:00
|
|
|
|
|
|
|
/* 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++) {
|
2017-11-20 09:51:09 +00:00
|
|
|
@@ -1729,6 +1731,11 @@ static void mvneta_txq_bufs_free(struct
|
2017-02-06 10:46:48 +00:00
|
|
|
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))
|
2017-11-20 09:51:09 +00:00
|
|
|
@@ -1739,6 +1746,8 @@ static void mvneta_txq_bufs_free(struct
|
2017-02-06 10:46:48 +00:00
|
|
|
continue;
|
|
|
|
dev_kfree_skb_any(skb);
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ netdev_tx_completed_queue(nq, pkts_compl, bytes_compl);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Handle end of transmission */
|
2017-11-20 09:51:09 +00:00
|
|
|
@@ -1752,7 +1761,7 @@ static void mvneta_txq_done(struct mvnet
|
2017-02-06 10:46:48 +00:00
|
|
|
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;
|
|
|
|
|
2017-11-20 09:51:09 +00:00
|
|
|
@@ -2359,6 +2368,8 @@ out:
|
2017-02-06 10:46:48 +00:00
|
|
|
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);
|
|
|
|
|
2017-11-20 09:51:09 +00:00
|
|
|
@@ -2383,9 +2394,10 @@ static void mvneta_txq_done_force(struct
|
2017-02-06 10:46:48 +00:00
|
|
|
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;
|
2017-11-20 09:51:09 +00:00
|
|
|
@@ -2881,6 +2893,8 @@ static int mvneta_txq_init(struct mvneta
|
2017-02-06 10:46:48 +00:00
|
|
|
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)
|
2017-11-20 09:51:09 +00:00
|
|
|
@@ -2892,6 +2906,8 @@ static void mvneta_txq_deinit(struct mvn
|
2017-02-06 10:46:48 +00:00
|
|
|
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;
|