From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH v2 3/3] net/vhost: vHost support to free consumed buffers Date: Wed, 11 Jan 2017 17:39:50 -0800 Message-ID: <20170111173950.4e2c87ae@xeon-e3> References: <20170111200323.12938-1-bmcfall@redhat.com> <20170111200323.12938-4-bmcfall@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: thomas.monjalon@6wind.com, wenzhuo.lu@intel.com, dev@dpdk.org To: Billy McFall Return-path: Received: from mail-pf0-f178.google.com (mail-pf0-f178.google.com [209.85.192.178]) by dpdk.org (Postfix) with ESMTP id 9864E558D for ; Thu, 12 Jan 2017 02:40:03 +0100 (CET) Received: by mail-pf0-f178.google.com with SMTP id y143so3485565pfb.0 for ; Wed, 11 Jan 2017 17:40:03 -0800 (PST) In-Reply-To: <20170111200323.12938-4-bmcfall@redhat.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, 11 Jan 2017 15:03:23 -0500 Billy McFall wrote: > 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 > --- > drivers/net/vhost/rte_eth_vhost.c | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c > index 766d4ef..6493d56 100644 > --- a/drivers/net/vhost/rte_eth_vhost.c > +++ b/drivers/net/vhost/rte_eth_vhost.c > @@ -939,6 +939,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) > { > @@ -979,6 +989,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, Rather than change drivers, since this is not critical path, make it optional to have tx_done_cleanup.