From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3F3D6A04DD; Fri, 23 Oct 2020 18:23:33 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DBB6E5A8F; Fri, 23 Oct 2020 18:23:31 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id A14965A8C for ; Fri, 23 Oct 2020 18:23:29 +0200 (CEST) IronPort-SDR: PTnk2N8EY96mrx6Rdo0i+9+wAKYdGf6rw02MGokBOLx96XkJxpIBZUKt5F+ClXDKzEJ5lm1smi T0s5ltTTtY3w== X-IronPort-AV: E=McAfee;i="6000,8403,9782"; a="146989099" X-IronPort-AV: E=Sophos;i="5.77,409,1596524400"; d="scan'208";a="146989099" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Oct 2020 09:23:26 -0700 IronPort-SDR: A84tbPteQIEj6T2bjeG//wD21avMEKtDFUnpyjmDiTnDR3jqvEbxcQRuIjNFC+0cesTCi980hT 7YSFT8NFZYaA== X-IronPort-AV: E=Sophos;i="5.77,409,1596524400"; d="scan'208";a="534454659" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.213.224.253]) ([10.213.224.253]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Oct 2020 09:23:25 -0700 To: Long Li , Stephen Hemminger Cc: dev@dpdk.org, Long Li References: <1603395970-26797-1-git-send-email-longli@linuxonhyperv.com> <1603395970-26797-2-git-send-email-longli@linuxonhyperv.com> From: Ferruh Yigit Message-ID: Date: Fri, 23 Oct 2020 17:23:23 +0100 MIME-Version: 1.0 In-Reply-To: <1603395970-26797-2-git-send-email-longli@linuxonhyperv.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH 2/2] net/netvsc: introduce driver parameter to control the use of external mbuf on receiving data 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" On 10/22/2020 8:46 PM, Long Li wrote: > From: Long Li > > When receiving packets, netvsp puts data in a buffer mapped through UIO. > Depending on packet size, netvsc may attach the buffer as an external > mbuf. This is not a problem if this mbuf is consumed in the application, > and the application can correctly read data out of an external mbuf. > > However, there are two problems with data in an external mbuf. > 1. Due to the limitation of the kernel UIO implementation, physical > address of this external buffer is not exposed to the user-mode. If this > mbuf is passed to another driver, the other driver is unable to map this > buffer to iova. > 2. Some DPDK applications are not aware of external mbuf, and may bug when > they receive an mbuf with external buffer attached. > > Introduce a driver parameter "rx_extmbuf_enable" to control if netvsc > should use external mbuf for receiving packets. The default value is 0. > (netvsc doesn't use external mbuf, it always allocates mbuf and copy data > to mbuf) A non-zero value tells netvsc to attach external buffers to mbuf > on receiving packets, thus avoid copying memory. > > Signed-off-by: Long Li > --- > drivers/net/netvsc/hn_ethdev.c | 11 +++++++++++ > drivers/net/netvsc/hn_rxtx.c | 2 +- > drivers/net/netvsc/hn_var.h | 3 +++ > 3 files changed, 15 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c > index e4f13b962c..735fc6d236 100644 > --- a/drivers/net/netvsc/hn_ethdev.c > +++ b/drivers/net/netvsc/hn_ethdev.c > @@ -48,6 +48,7 @@ > #define NETVSC_ARG_LATENCY "latency" > #define NETVSC_ARG_RXBREAK "rx_copybreak" > #define NETVSC_ARG_TXBREAK "tx_copybreak" > +#define NETVSC_ARG_RX_EXTMBUF_ENABLE "rx_extmbuf_enable" > Same comments for with previous patch, can you please document the new devarg and 'rte_kvargs_process()' can be used to parse it.