Skip to content

Commit

Permalink
net/netvsc: handle Tx completions based on burst size
Browse files Browse the repository at this point in the history
[ upstream commit 56edef9 ]

If tx_free_thresh is quite low, it is possible that we need to
cleanup based on burst size.

Fixes: fc30efe ("net/netvsc: change Rx descriptor setup and sizing")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
  • Loading branch information
shemminger authored and kevintraynor committed May 27, 2020
1 parent 30779c9 commit cfb7a60
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/net/netvsc/hn_rxtx.c
Expand Up @@ -1359,7 +1359,7 @@ hn_xmit_pkts(void *ptxq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
struct hn_data *hv = txq->hv;
struct rte_eth_dev *vf_dev;
bool need_sig = false;
uint16_t nb_tx;
uint16_t nb_tx, avail;
int ret;

if (unlikely(hv->closed))
Expand All @@ -1374,7 +1374,8 @@ hn_xmit_pkts(void *ptxq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
return (*vf_dev->tx_pkt_burst)(sub_q, tx_pkts, nb_pkts);
}

if (rte_mempool_avail_count(txq->txdesc_pool) <= txq->free_thresh)
avail = rte_mempool_avail_count(txq->txdesc_pool);
if (nb_pkts > avail || avail <= txq->free_thresh)
hn_process_events(hv, txq->queue_id, 0);

for (nb_tx = 0; nb_tx < nb_pkts; nb_tx++) {
Expand Down

0 comments on commit cfb7a60

Please sign in to comment.