From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Ananyev, Konstantin" Subject: Re: [PATCH v5 3/8] ethdev: reserve capability flags for PMD-specific API Date: Thu, 5 Jan 2017 11:32:38 +0000 Message-ID: <2601191342CEEE43887BDE71AB9772583F1006B7@irsmsx105.ger.corp.intel.com> References: <1482939691-34855-1-git-send-email-tiwei.bie@intel.com> <1483514502-32841-1-git-send-email-tiwei.bie@intel.com> <1483514502-32841-4-git-send-email-tiwei.bie@intel.com> <2601191342CEEE43887BDE71AB9772583F0FEE0C@irsmsx105.ger.corp.intel.com> <20170104143923.GA57552@dpdk19> <2601191342CEEE43887BDE71AB9772583F0FEE6D@irsmsx105.ger.corp.intel.com> <20170104170011.GB56511@dpdk19> <2601191342CEEE43887BDE71AB9772583F100375@irsmsx105.ger.corp.intel.com> <20170104235608.GA133542@dpdk19> <20170105083322.GK12822@6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: "dev@dpdk.org" , "Lu, Wenzhuo" , "Mcnamara, John" , "olivier.matz@6wind.com" , "thomas.monjalon@6wind.com" , "Zhang, Helin" , "Dai, Wei" , "Wang, Xiao W" To: Adrien Mazarguil , "Bie, Tiwei" Return-path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 7D39737A6 for ; Thu, 5 Jan 2017 12:32:41 +0100 (CET) In-Reply-To: <20170105083322.GK12822@6wind.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Adrien, >=20 > On Thu, Jan 05, 2017 at 07:56:08AM +0800, Tiwei Bie wrote: > > On Thu, Jan 05, 2017 at 01:44:18AM +0800, Ananyev, Konstantin wrote: > > [...] > > > > > > > > > > I understand that. > > > > > My question was: suppose user would like to create a bonded devic= e over 2 NICs. > > > > > One of them is ixgbe, while other would be some other type. > > > > > In future get_dev_info() for each of them might return DEV_RX_OFF= LOAD_RESERVED_0 bit as set. > > > > > But it would mean completely different thing. > > > > > How bonded device would know that to deal properly? > > > > > > > > > > Another example - user has 2 NICs of different type and would lik= e to send the same packet on both of them simultaneously. > > > > > As PKT_TX_RESERVED might mean different things for these devices,= and user would like to use let say > > > > > PKT_TX_IXGBE_MACSEC on one of them, he would need to do a copy of= them, instead just increment a refcnt. > > > > > > > > > > Similar issues might arise at RX handling: user got a packet with= PKT_RX_RESERVED_0 set. > > > > > What does it really mean if there are different NIC types in the = system? > > > > > The only way to answer that question, as I can see, is to keep t= rack from what NIC that packet was received. > > > > > Which I suppose, is not always convenient. > > > > > > > > > > > > > The main purpose is to put the PMD-specific APIs in a separate > > > > namespace instead of mixing the PMD-specific APIs and global APIs > > > > up, and also save the bits in mbuf.ol_flags. > > > > > > > > There are other ways to achieve this goal, such as introducing > > > > the PMD specific ol_flags in mbuf second cache line as you said. > > > > I just thought defining some reserved bits seems to be the most > > > > simple way which won't introduce many changes. > > > > > > > > What's your suggestions? Should I just revert the changes and > > > > define the generic flags directly? > > > > > > Yes, that would be my preference. > > > As I said above - spending extra bit in ol_flags doesn't look like a= big problem to me. > > > In return there would be no need to consider how to handle all that c= onfusing scenarios in future. > > > > Okay. I'll update my patches. Thanks a lot for your comments. >=20 > Well, I do not agree with Konstantin (no one saw this coming eh?) :) >and do not think you need to update your series again. >=20 > PMD-specific symbols have nothing to do in the global namespace in my > opinion, they are not versioned and may evolve without notice. Neither > applications nor the bonding PMD can rely on them. That's the trade-off. Not sure I do understand your reasoning. For me MACSEC offload is just one of many HW offloads that we support and should be treated in exactly the same way. Applications should be able to use it in a transparent and reliable way, not only under some limited conditions.=20 Otherwise what is the point to introduce it at all? Yes, right now it is supported only by ixgbe PMD, but why that should be th= e reason to treat is as second-class citizen? Let say PKT_TX_TUNNEL_* offloads also are supported only by one PMD right n= ow. >=20 > Therefore until APIs are made global, the safe compromise is to define > neutral, reserved symbols that any PMD can use to implement their own > temporary APIs for testing purposes. These can be renamed later without > changing their value as long as a single PMD uses them. Ok, so what we'll gain by introducing PKT_TX_RESERVED instead of PKT_TX_MAC= SEC? As I said in my previous mail the redefinition for the same ol_flag bit (an= d dev capabilities) by different PMD might create a lot of confusion in future. Does the potential saving of 1 bit really worth it? =20 Konstantin