Skip to content

Commit

Permalink
net/netvsc: split send buffers from Tx descriptors
Browse files Browse the repository at this point in the history
[ upstream commit cc02518 ]

The VMBus has reserved transmit area (per device) and transmit
descriptors (per queue). The previous code was always having a 1:1
mapping between send buffers and descriptors.
This can lead to one queue starving another and also buffer bloat.

Change to working more like FreeBSD where there is a pool of transmit
descriptors per queue. If send buffer is not available then no
aggregation happens but the queue can still drain.

Fixes: 4e9c73e ("net/netvsc: add Hyper-V network device")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
  • Loading branch information
shemminger authored and kevintraynor committed May 27, 2020
1 parent 67a8ca9 commit 570ceb4
Show file tree
Hide file tree
Showing 3 changed files with 180 additions and 110 deletions.
9 changes: 6 additions & 3 deletions drivers/net/netvsc/hn_ethdev.c
Expand Up @@ -240,6 +240,9 @@ static void hn_dev_info_get(struct rte_eth_dev *dev,
dev_info->max_rx_queues = hv->max_queues;
dev_info->max_tx_queues = hv->max_queues;

dev_info->tx_desc_lim.nb_min = 1;
dev_info->tx_desc_lim.nb_max = 4096;

if (rte_eal_process_type() != RTE_PROC_PRIMARY)
return;

Expand Down Expand Up @@ -776,7 +779,7 @@ eth_hn_dev_init(struct rte_eth_dev *eth_dev)
if (err)
goto failed;

err = hn_tx_pool_init(eth_dev);
err = hn_chim_init(eth_dev);
if (err)
goto failed;

Expand Down Expand Up @@ -812,7 +815,7 @@ eth_hn_dev_init(struct rte_eth_dev *eth_dev)
failed:
PMD_INIT_LOG(NOTICE, "device init failed");

hn_tx_pool_uninit(eth_dev);
hn_chim_uninit(eth_dev);
hn_detach(hv);
return err;
}
Expand All @@ -835,7 +838,7 @@ eth_hn_dev_uninit(struct rte_eth_dev *eth_dev)
eth_dev->rx_pkt_burst = NULL;

hn_detach(hv);
hn_tx_pool_uninit(eth_dev);
hn_chim_uninit(eth_dev);
rte_vmbus_chan_close(hv->primary->chan);
rte_free(hv->primary);
rte_eth_dev_owner_delete(hv->owner.id);
Expand Down

0 comments on commit 570ceb4

Please sign in to comment.