summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWei Hu (Xavier) <xavier.huwei@huawei.com>2019-11-25 17:00:53 +0800
committerFerruh Yigit <ferruh.yigit@intel.com>2019-11-26 18:05:15 +0100
commit8f64f2846d8b42de638aa0318c8c9f5ac784d926 (patch)
tree27d8dd4d06a3c1c22105184635076b7f5f96388e
parente28bfe33552f294719889c48c0c050864b24c9ce (diff)
downloaddpdk-next-net-intel-8f64f2846d8b42de638aa0318c8c9f5ac784d926.zip
dpdk-next-net-intel-8f64f2846d8b42de638aa0318c8c9f5ac784d926.tar.gz
dpdk-next-net-intel-8f64f2846d8b42de638aa0318c8c9f5ac784d926.tar.xz
net/hns3: fix checking enough Tx BDs
In .tx_pkt_burst ops implementation function of hns3 PMD driver, there is one check whether there are enough BDs in the TX queue. If not, driver will stop sending the packets. Currently in the 'for' process loop, the next_to_use member of TX queue is not updated in time after processing BDs of one packet, which results in the invalid action of checking whether there are enough BDs and failure in sending packets. This patch fixes it by moving the assignment statment of the next_to_use member of TX queue to the place after porcessing TX BDs in the 'for' loop. Fixes: bba636698316 ("net/hns3: support Rx/Tx and related operations") Cc: stable@dpdk.org Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com> Signed-off-by: Huisong Li <lihuisong@huawei.com> Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
-rw-r--r--drivers/net/hns3/hns3_rxtx.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
index 34cb7fa..8166447 100644
--- a/drivers/net/hns3/hns3_rxtx.c
+++ b/drivers/net/hns3/hns3_rxtx.c
@@ -1649,6 +1649,7 @@ hns3_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
} while (m_seg != NULL);
nb_hold += i;
+ txq->next_to_use = tx_next_use;
}
end_of_tx:
@@ -1656,7 +1657,6 @@ end_of_tx:
if (likely(nb_tx)) {
hns3_queue_xmit(txq, nb_hold);
txq->next_to_clean = tx_next_clean;
- txq->next_to_use = tx_next_use;
txq->tx_bd_ready = tx_bd_ready - nb_hold;
}