From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f50.google.com (mail-wm0-f50.google.com [74.125.82.50]) by dpdk.org (Postfix) with ESMTP id 2774C29CF for ; Thu, 5 Jan 2017 19:21:50 +0100 (CET) Received: by mail-wm0-f50.google.com with SMTP id t79so495059118wmt.0 for ; Thu, 05 Jan 2017 10:21:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=YlK4vS6AgM5hRUiRZYGMyvzMR8S8tQFiAFrFsvCSTGc=; b=ZCZGmTYimgBiecZ0yY9xxLgzZw8uwxGUG3aJ7GlF0LJRE47LKQvO0TxWnD5Nj+IeWX 1+y16gFBOzDaRy8y1T/IxQPJWl/sgrieSo8F8/Wlhkq6efbO8OclsdTZy87/YxkvwbE+ 4yz+i09bD+AK6QLX2epzfrbXLSIQx7syHobKuBQCTcYbsOEMrv9oAjcyYsEbwwsXXECq noslmo8ZFMyauswIYQetSjohpnegbsaVQttHqY5jGJAA+H/87T3mg34zMkvjPHWpEbCm kxG+BhtaX2XVViPTuw2m8ydQsrzPtBFNitXTumf4QB3PlQpFJ+OfvcPAPBNG/noIB0X3 dNjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=YlK4vS6AgM5hRUiRZYGMyvzMR8S8tQFiAFrFsvCSTGc=; b=Tjl1zQVlJm34zHdiFQ4NTr79HzLFkFvGDAQuQPUqB2NPAT3hZPfTLbhoB1DVz9zeDv G84FJ33akf/1TulHtNUSn9Oiv8BHX07Rxc6UzumzymiLBJzEBj1InAqhpP2Hnx+i/K3K aEFigKxXK+HelljgNV/ox+yD6kHozITeDfNwsXLQ26rSWqHh1si6P4Sl/H6JrpFzGVI5 juxrkig2dJxI+2/UJ28DKRMog2eMpwDDqyEqZebQmCuIjZwxrj31XOyZtWST8cIugc/+ f9yAvBey3ropa7/iRVvL7hpJPojZpn04gFufBiSJ3iTu/LFKcyO1gDtwH6O3bHK5lF6+ g9VQ== X-Gm-Message-State: AIkVDXJ2JIKIqRxnxkdKorM8Lpq6L+SXYQjaVjwv1rFqUoqK3cLtEUOJ73Ogm2dnWujTzr75 X-Received: by 10.28.126.146 with SMTP id z140mr67501363wmc.84.1483640509730; Thu, 05 Jan 2017 10:21:49 -0800 (PST) Received: from 6wind.com (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by smtp.gmail.com with ESMTPSA id w8sm101004614wmw.4.2017.01.05.10.21.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Jan 2017 10:21:48 -0800 (PST) Date: Thu, 5 Jan 2017 19:21:41 +0100 From: Adrien Mazarguil To: "Ananyev, Konstantin" Cc: "Bie, Tiwei" , "dev@dpdk.org" , "Lu, Wenzhuo" , "Mcnamara, John" , "olivier.matz@6wind.com" , "thomas.monjalon@6wind.com" , "Zhang, Helin" , "Dai, Wei" , "Wang, Xiao W" Message-ID: <20170105182141.GS12822@6wind.com> References: <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> <2601191342CEEE43887BDE71AB9772583F1006B7@irsmsx105.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2601191342CEEE43887BDE71AB9772583F1006B7@irsmsx105.ger.corp.intel.com> Subject: Re: [dpdk-dev] [PATCH v5 3/8] ethdev: reserve capability flags for PMD-specific API 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: , X-List-Received-Date: Thu, 05 Jan 2017 18:21:50 -0000 Hi Konstantin, On Thu, Jan 05, 2017 at 11:32:38AM +0000, Ananyev, Konstantin wrote: > Hi Adrien, > > > > > 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 device 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_OFFLOAD_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 like 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 track 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 confusing scenarios in future. > > > > > > Okay. I'll update my patches. Thanks a lot for your comments. > > > > Well, I do not agree with Konstantin (no one saw this coming eh?) > > :) > > >and do not think you need to update your series again. > > > > 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. > Otherwise what is the point to introduce it at all? Well my first reply to this thread was asking why isn't the whole API global from the start then? Given there are valid reasons for it not to and no plan to make it so in the near future, applications must be aware that they are including rte_pmd_ixgbe.h to use it. That in itself is a limiting condition, right? > Yes, right now it is supported only by ixgbe PMD, but why that should be the > reason to treat is as second-class citizen? > Let say PKT_TX_TUNNEL_* offloads also are supported only by one PMD right now. You are right about PKT_TX_TUNNEL_*, however these flags exist on their own and are not tied to any API function calls, unlike in this series where PKT_TX_MACSEC can only be used if the DEV_TX_OFFLOAD_MACSEC_INSERT capability is present and the whole thing was configured through rte_pmd_ixgbe_macsec_*() calls after including rte_pmd_ixgbe.h. To be clear it is not about MACsec per se (as a standardized protocol, I think related definitions for offloads have their place), but it has to do with the fact that the rest of the API is PMD-specific and there is a dependency between them. > > 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_MACSEC? > As I said in my previous mail the redefinition for the same ol_flag bit (and dev capabilities) > by different PMD might create a lot of confusion in future. > Does the potential saving of 1 bit really worth it? That is one benefit, but my point is mainly to keep applications aware that they are using an API defined by a single PMD, which may be temporary and whose symbols are not versioned. Consider this: rte_mbuf.h: #define PKT_TX_RESERVED_0 (1 << 42) rte_pmd_ixgbe.h: #define PKT_TX_MACSEC PKT_TX_RESERVED_0 That way, applications have to get the PKT_TX_MACSEC definition where the rest of the API is also defined. Other PMDs may reuse PKT_TX_RESERVED_0 and other reserved flags to implement their own experimental APIs. Applications and the bonding PMD can easily be made aware that such reserved flags cannot be shared between ports unless they know what the underlying PMD is, which is already a requirement to use this API in the first place (for instance, calling rte_pmd_ixgbe_macsec_*() functions with another vendor's port_id may crash the application). So the idea if/when the API is made global is to rename PKT_TX_RESERVED_0 to PKT_TX_MACSEC and keep its original value. If other PMDs also implemented PKT_TX_RESERVED_0 in the meantime, it is redefined using a different value. If there is no room left to do so, these PMDs are out of luck I guess, and their specific API is disabled/removed until something gets re-designed. How about this? -- Adrien Mazarguil 6WIND