From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9C3EEA0032; Wed, 14 Sep 2022 11:20:09 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7DD4940156; Wed, 14 Sep 2022 11:20:09 +0200 (CEST) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by mails.dpdk.org (Postfix) with ESMTP id 21F2A40151 for ; Wed, 14 Sep 2022 11:20:08 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id A662B5C00EB; Wed, 14 Sep 2022 05:20:07 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 14 Sep 2022 05:20:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1663147207; x= 1663233607; bh=XmoVScKSVKT9lcI/b2zbqUReyYZ3BzBB1VJlFV+BJAk=; b=p yK+l9x5ttdeUIVqP1dyh66fB9bowwgceoxIaLyNmuOMMR1BKyT7LYB3AqPP/hiqB C7Lr37SWxGqwItdbGtQAIGlHEEUIaSLXLTYs3xO7MQ4gUp3vGP7kuxFPFMdG7RGw uZ7rf6oiVDOagMyUgUZ9ZypEV0iTLz9KjbYJqUF/q4ePsm/viYaJIQpy8pcaSyLh hJTqmN1LKgNeaIVLwnLVdi9MsHOXEYbM9uAL0YOPJrF0xR7BeSDs8OBMbAvSpucf t292YJLyIT3VfleNJ4flT1DDCXeseoyCTOGJk9zrdwuonWc+ltLWU8xFdvh1rxJN Kny25ZUkBpI6y8aUmMYjg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1663147207; x= 1663233607; bh=XmoVScKSVKT9lcI/b2zbqUReyYZ3BzBB1VJlFV+BJAk=; b=f k6frvdN2JDfF2JDg5j6WbHcG+At+/o7/W0DmwYwvZh5/LxB0t5a0x/Nz5KJ3pK0Z sDRjzsoYwMEk+uRrW/WSFWhpWSVXzC9saJfVq+TrELJjNr0+ogDycaCM8uVLTgRq cc5BPeGtFm9lwvqZqYfZoRfJDRdfMRczglIe8b3Gp5ug2lpodKnINN+QWLaeW4GK PPKvPqzo7VmzccHhdgqVfcGvj6cU6mvcSu8ziSCS4aq92ESVXjN/CUIEuecK2i0Y ylkdKaTf/t7p0y+PuCLzDw5jZF0jLBSGORDXNKwlHdZnSaDwSVkKWs3pX9IYU0af RzYKDD6z5TBeqiVeO3k2Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeduiedgudegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkjghfggfgtgesthhqredttddtudenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc ggtffrrghtthgvrhhnpeefhfejleeuvdevtddutdeutdevhfeijeethfffueejhfetuddu vedtkedtieekffenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 14 Sep 2022 05:20:05 -0400 (EDT) From: Thomas Monjalon To: Chaoyong He , David Marchand , Ian Stokes , dev@dpdk.org Cc: oss-drivers , Niklas Soderlund , "dev@dpdk.org" , Ferruh Yigit Subject: Re: [PATCH v8 05/12] net/nfp: add flower PF setup logic Date: Wed, 14 Sep 2022 11:20:03 +0200 Message-ID: <4087621.1IzOArtZ34@thomas> In-Reply-To: References: <1662626702-17254-1-git-send-email-chaoyong.he@corigine.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 09/09/2022 14:13, Ferruh Yigit: > On 9/9/2022 3:36 AM, Chaoyong He wrote: > >> On 9/8/2022 9:44 AM, Chaoyong He wrote: > >>> Adds the vNIC initialization logic for the flower PF vNIC. The flower > >>> firmware exposes this vNIC for the purposes of fallback traffic in the > >>> switchdev use-case. > >>> > >>> Adds minimal dev_ops for this PF device. Because the device is being > >>> exposed externally to DPDK it should also be configured using DPDK > >>> helpers like rte_eth_configure(). For these helpers to work the flower > >>> logic needs to implements a minimal set of dev_ops. > >>> > >>> Signed-off-by: Chaoyong He > >>> Reviewed-by: Niklas S=F6derlund > >>> --- > >>> drivers/net/nfp/flower/nfp_flower.c | 398 > >> ++++++++++++++++++++++++- > >>> drivers/net/nfp/flower/nfp_flower.h | 6 + > >>> drivers/net/nfp/flower/nfp_flower_ovs_compat.h | 37 +++ > >> > >> Can you please detail why OVS specific header is required? Having appl= ication > >> specific code in PMD can be sign of some design issue, that is why can= you > >> please explain more what it does? > >> > >=20 > > Basically, there exist two layers polling mode to move a pkt from firmw= are to OVS. > >=20 > > When our card using flower application firmware receive pkt and find th= e pkt can't be offloaded, > > it will record the input port in a place of the pkt, we call it metadat= a. > >=20 > > There exist a rte_ring for each representor port. > >=20 > > We use the pf device as a multiplexer, which keeps polling pkts from th= e firmware. > > Based on the metadata, it will enqueue the pkt into the rte_ring of the= corresponding representor port. > >=20 > > On the OVS side, it will keeps try to dequeue the pkt from the rte_ring= of the representor port. > > Once it gets the pkt, the OVS will go its logic and treat the pkt as `s= truct dp_packet`. > >=20 > > So we copy the definition of `struct dp_packet` from OVS to prevent the= coredump caused by memory read/write out of range. > >=20 > > Another possible way is defining a big enough mbuf_priv_len using macro= to prevent this structure definition from OVS. > > Is this the right way? > >=20 >=20 > Thanks for clarification. >=20 > PMD is creating a mempool to hold 'struct dp_packet', that is why it is=20 > duplicating OvS 'struct dp_packet' struct definition to DPDK. >=20 > But many PMDs are used with OvS, why only nfp need to duplicate the=20 > struct or create OvS specific mempool? > Having application specific code in driver looks wrong anyway. +1 to be application agnostic