summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBilly McFall <bmcfall@redhat.com>2017-03-24 14:55:55 -0400
committerThomas Monjalon <thomas.monjalon@6wind.com>2017-03-27 17:17:33 +0200
commit5b2976c718e0717f5e1b39b50ac71fb2ce80e47c (patch)
tree074e93bca2044fffd98fa91d5f26579c2bead610
parent8d907d2b79f7a54c809f1c44970ff455fa2865e1 (diff)
downloaddpdk-5b2976c718e0717f5e1b39b50ac71fb2ce80e47c.zip
dpdk-5b2976c718e0717f5e1b39b50ac71fb2ce80e47c.tar.gz
dpdk-5b2976c718e0717f5e1b39b50ac71fb2ce80e47c.tar.xz
net/vhost: free consumed Tx buffers on demand
Add support to the vHostdriver for the new API to force free consumed buffers on Tx ring. vHost does not cache the mbufs so there is no work to do. Signed-off-by: Billy McFall <bmcfall@redhat.com> Acked-by: Maxime Coquelin <maxime.coquelin@redhat.com> Acked-by: Keith Wiles <keith.wiles@intel.com>
-rw-r--r--doc/guides/nics/features/vhost.ini1
-rw-r--r--drivers/net/vhost/rte_eth_vhost.c11
2 files changed, 12 insertions, 0 deletions
diff --git a/doc/guides/nics/features/vhost.ini b/doc/guides/nics/features/vhost.ini
index 23166fb..dffd1f4 100644
--- a/doc/guides/nics/features/vhost.ini
+++ b/doc/guides/nics/features/vhost.ini
@@ -6,6 +6,7 @@
[Features]
Link status = Y
Link status event = Y
+Free Tx mbuf on demand = Y
Queue status event = Y
Basic stats = Y
Extended stats = Y
diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c
index e98cffd..abe91c7 100644
--- a/drivers/net/vhost/rte_eth_vhost.c
+++ b/drivers/net/vhost/rte_eth_vhost.c
@@ -960,6 +960,16 @@ eth_queue_release(void *q)
}
static int
+eth_tx_done_cleanup(void *txq __rte_unused, uint32_t free_cnt __rte_unused)
+{
+ /*
+ * vHost does not hang onto mbuf. eth_vhost_tx() copies packet data
+ * and releases mbuf, so nothing to cleanup.
+ */
+ return 0;
+}
+
+static int
eth_link_update(struct rte_eth_dev *dev __rte_unused,
int wait_to_complete __rte_unused)
{
@@ -1001,6 +1011,7 @@ static const struct eth_dev_ops ops = {
.tx_queue_setup = eth_tx_queue_setup,
.rx_queue_release = eth_queue_release,
.tx_queue_release = eth_queue_release,
+ .tx_done_cleanup = eth_tx_done_cleanup,
.link_update = eth_link_update,
.stats_get = eth_stats_get,
.stats_reset = eth_stats_reset,