From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9721DC3A5A2 for ; Tue, 10 Sep 2019 12:22:24 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id 3172121019 for ; Tue, 10 Sep 2019 12:22:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3172121019 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 498301EDE8; Tue, 10 Sep 2019 14:22:23 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 7481D1EC6A for ; Tue, 10 Sep 2019 14:22:21 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Sep 2019 05:22:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,489,1559545200"; d="scan'208";a="335902310" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga004.jf.intel.com with ESMTP; 10 Sep 2019 05:22:18 -0700 Received: from fmsmsx111.amr.corp.intel.com (10.18.116.5) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 10 Sep 2019 05:22:16 -0700 Received: from lcsmsx154.ger.corp.intel.com (10.186.165.229) by fmsmsx111.amr.corp.intel.com (10.18.116.5) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 10 Sep 2019 05:22:16 -0700 Received: from hasmsx113.ger.corp.intel.com ([169.254.13.177]) by LCSMSX154.ger.corp.intel.com ([169.254.7.161]) with mapi id 14.03.0439.000; Tue, 10 Sep 2019 15:22:13 +0300 From: "Zapolski, MarcinX A" To: "Richardson, Bruce" CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [RFC 19.11 v2 1/3] ethdev: hide key ethdev structures from public API Thread-Index: AQHVZLYTzdmBMJkf+0y1UM2/wAYG6Kcksf5g///RQoCAADKvcP//8nIAgAAyqjA= Date: Tue, 10 Sep 2019 12:22:12 +0000 Message-ID: <51FEE37A1339864DB0A4E34597F561E30D5D705F@HASMSX113.ger.corp.intel.com> References: <20190730124950.1293-1-marcinx.a.zapolski@intel.com> <20190906131813.1343-2-marcinx.a.zapolski@intel.com> <51FEE37A1339864DB0A4E34597F561E30D5D6FCC@HASMSX113.ger.corp.intel.com> <20190910100659.GA1894@bricha3-MOBL.ger.corp.intel.com> <51FEE37A1339864DB0A4E34597F561E30D5D6FFB@HASMSX113.ger.corp.intel.com> <20190910121952.GA1898@bricha3-MOBL.ger.corp.intel.com> In-Reply-To: <20190910121952.GA1898@bricha3-MOBL.ger.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNzJiYTUzZWYtMjBjZi00OGI4LThlOGEtZTU5MjhhOTBlNGIxIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiR0xwYU5rejIwVElBMmJ2QjN6b2pzbExQeE0rbkRcL0piakdkODRQck9aeE9waXBsR1BsZWpDRVdlbUJkYlwvajF1In0= x-ctpclassification: CTP_NT x-originating-ip: [10.184.70.11] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [RFC 19.11 v2 1/3] ethdev: hide key ethdev structures from public 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > -----Original Message----- > From: Bruce Richardson [mailto:bruce.richardson@intel.com] > Sent: Tuesday, September 10, 2019 2:20 PM > To: Zapolski, MarcinX A > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] [RFC 19.11 v2 1/3] ethdev: hide key ethdev > structures from public API >=20 > On Tue, Sep 10, 2019 at 11:13:50AM +0100, Zapolski, MarcinX A wrote: > > > -----Original Message----- > > > From: Bruce Richardson [mailto:bruce.richardson@intel.com] > > > Sent: Tuesday, September 10, 2019 12:07 PM > > > To: Zapolski, MarcinX A > > > Cc: dev@dpdk.org > > > Subject: Re: [dpdk-dev] [RFC 19.11 v2 1/3] ethdev: hide key ethdev > > > structures from public API > > > > > > On Tue, Sep 10, 2019 at 09:59:51AM +0000, Zapolski, MarcinX A wrote: > > > > <...> > > > > > @@ -3994,7 +4054,55 @@ void * > > > > > rte_eth_dev_get_sec_ctx(uint16_t port_id); > > > > > > > > > > > > > > > -#include > > > > > +struct rte_eth_dev_callback; > > > > > +/** Structure to keep track of registered callbacks */ > > > > > +TAILQ_HEAD(rte_eth_dev_cb_list, rte_eth_dev_callback); > > > > > + > > > > > +/** > > > > > + * Structure used to hold information about the callbacks to be > > > > > +called for a > > > > > + * queue on RX and TX. > > > > > + */ > > > > > +struct rte_eth_rxtx_callback { > > > > > + struct rte_eth_rxtx_callback *next; > > > > > + union{ > > > > > + rte_rx_callback_fn rx; > > > > > + rte_tx_callback_fn tx; > > > > > + } fn; > > > > > + void *param; > > > > > +}; > > > > > + > > > > > +/** > > > > > + * The generic data structure associated with each ethernet devi= ce. > > > > > + * > > > > > + * Pointers to burst-oriented packet receive and transmit > > > > > +functions are > > > > > + * located at the beginning of the structure, along with the > > > > > +pointer to > > > > > + * where all the data elements for the particular device are > > > > > +stored in shared > > > > > + * memory. This split allows the function pointer and driver > > > > > +data to be per- > > > > > + * process, while the actual configuration data for the device i= s > shared. > > > > > + */ > > > > I would like to raise one more concern (maybe not the smartest > > > > thing to do involving my own patch, but I will sleep better when th= is is > resolved). > > > > Does anyone know what the author of this comment had in mind? I > > > > could not find any code that utilizes this split, and this patch > > > > clearly breaks it. If it is obsolete, I guess this comment could be > removed. > > > > > > As the comment suggest the split is for multi-process suport. The > > > data structures for the RX/TX queues etc. all need to be common > > > across processes, while the function pointers need to be > > > per-process. Originally, in very early versions of DPDK there was no > > > rte_eth_dev_data structure, all fields - both data and function point= ers - > were in rte_eth_dev itself. > > > > > > /Bruce > > > > Yes, I see the need to have the elements separated. But the comment > > suggests that the order of variables in structure is important. I just > > want to make sure that it is not. >=20 > I don't believe it's particularly significant. The main thing was to ensu= re that > we kept the fast-path accessed data on the same cacheline. Thank you for clarifying.