From patchwork Fri Jan 27 18:38:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Billy McFall X-Patchwork-Id: 20066 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 65539567F; Fri, 27 Jan 2017 19:38:37 +0100 (CET) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 4D6985323 for ; Fri, 27 Jan 2017 19:38:07 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx16.intmail.prod.int.phx2.redhat.com [10.5.11.28]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BB87D4E328; Fri, 27 Jan 2017 18:38:07 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-119-105.rdu2.redhat.com [10.10.119.105]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3C669B120B; Fri, 27 Jan 2017 18:38:07 +0000 (UTC) From: Billy McFall To: thomas.monjalon@6wind.com, wenzhuo.lu@intel.com, olivier.matz@6wind.com Cc: dev@dpdk.org, Billy McFall Date: Fri, 27 Jan 2017 13:38:00 -0500 Message-Id: <20170127183800.27466-4-bmcfall@redhat.com> In-Reply-To: <20170127183800.27466-1-bmcfall@redhat.com> References: <20170123211340.22570-1-bmcfall@redhat.com> <20170127183800.27466-1-bmcfall@redhat.com> X-Scanned-By: MIMEDefang 2.74 on 10.5.11.28 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 27 Jan 2017 18:38:07 +0000 (UTC) Subject: [dpdk-dev] [PATCH v5 3/3] net/vhost: vHost support to free consumed buffers X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 Acked-by: Maxime Coquelin --- doc/guides/nics/features/vhost.ini | 1 + drivers/net/vhost/rte_eth_vhost.c | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/doc/guides/nics/features/vhost.ini b/doc/guides/nics/features/vhost.ini index 23166fb..83fea03 100644 --- a/doc/guides/nics/features/vhost.ini +++ b/doc/guides/nics/features/vhost.ini @@ -9,5 +9,6 @@ Link status event = Y Queue status event = Y Basic stats = Y Extended stats = Y +Free TX ring buffers = Y x86-32 = Y x86-64 = Y diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c index 848a3da..6674536 100644 --- a/drivers/net/vhost/rte_eth_vhost.c +++ b/drivers/net/vhost/rte_eth_vhost.c @@ -934,6 +934,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) { @@ -974,6 +984,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,