]> git.droids-corp.org - dpdk.git/commitdiff
net/vhost: free consumed Tx buffers on demand
authorBilly McFall <bmcfall@redhat.com>
Fri, 24 Mar 2017 18:55:55 +0000 (14:55 -0400)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Mon, 27 Mar 2017 15:17:33 +0000 (17:17 +0200)
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>
doc/guides/nics/features/vhost.ini
drivers/net/vhost/rte_eth_vhost.c

index 23166fba02909d769dc135140e2aa5c836006d98..dffd1f49399ef6bdbab512cd7b8521c8b8b0a374 100644 (file)
@@ -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
index e98cffdf4b7a01158f5036fabce86d259c616682..abe91c7738086aa3987bf5d146bf706c01546a54 100644 (file)
@@ -959,6 +959,16 @@ eth_queue_release(void *q)
        rte_free(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,