git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
net/hns3: extract common function to obtain revision ID
[dpdk.git]
/
drivers
/
net
/
hns3
/
hns3_rxtx_vec.h
diff --git
a/drivers/net/hns3/hns3_rxtx_vec.h
b/drivers/net/hns3/hns3_rxtx_vec.h
index
35d9903
..
4985a7c
100644
(file)
--- a/
drivers/net/hns3/hns3_rxtx_vec.h
+++ b/
drivers/net/hns3/hns3_rxtx_vec.h
@@
-1,5
+1,5
@@
/* SPDX-License-Identifier: BSD-3-Clause
/* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2020
His
ilicon Limited.
+ * Copyright(c) 2020
-2021 HiS
ilicon Limited.
*/
#ifndef _HNS3_RXTX_VEC_H_
*/
#ifndef _HNS3_RXTX_VEC_H_
@@
-18,6
+18,14
@@
hns3_tx_bulk_free_buffers(struct hns3_tx_queue *txq)
int i;
tx_entry = &txq->sw_ring[txq->next_to_clean];
int i;
tx_entry = &txq->sw_ring[txq->next_to_clean];
+ if (txq->mbuf_fast_free_en) {
+ rte_mempool_put_bulk(tx_entry->mbuf->pool, (void **)tx_entry,
+ txq->tx_rs_thresh);
+ for (i = 0; i < txq->tx_rs_thresh; i++)
+ tx_entry[i].mbuf = NULL;
+ goto update_field;
+ }
+
for (i = 0; i < txq->tx_rs_thresh; i++, tx_entry++) {
m = rte_pktmbuf_prefree_seg(tx_entry->mbuf);
tx_entry->mbuf = NULL;
for (i = 0; i < txq->tx_rs_thresh; i++, tx_entry++) {
m = rte_pktmbuf_prefree_seg(tx_entry->mbuf);
tx_entry->mbuf = NULL;
@@
-36,6
+44,7
@@
hns3_tx_bulk_free_buffers(struct hns3_tx_queue *txq)
if (nb_free)
rte_mempool_put_bulk(free[0]->pool, (void **)free, nb_free);
if (nb_free)
rte_mempool_put_bulk(free[0]->pool, (void **)free, nb_free);
+update_field:
/* Update numbers of available descriptor due to buffer freed */
txq->tx_bd_ready += txq->tx_rs_thresh;
txq->next_to_clean += txq->tx_rs_thresh;
/* Update numbers of available descriptor due to buffer freed */
txq->tx_bd_ready += txq->tx_rs_thresh;
txq->next_to_clean += txq->tx_rs_thresh;
@@
-71,6
+80,9
@@
hns3_rx_reassemble_pkts(struct rte_mbuf **rx_pkts,
uint16_t count, i;
uint64_t mask;
uint16_t count, i;
uint64_t mask;
+ if (likely(pkt_err_mask == 0))
+ return nb_pkts;
+
count = 0;
for (i = 0; i < nb_pkts; i++) {
mask = ((uint64_t)1u) << i;
count = 0;
for (i = 0; i < nb_pkts; i++) {
mask = ((uint64_t)1u) << i;