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 2557FA04AC; Mon, 31 Aug 2020 14:25:41 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CAD731C05C; Mon, 31 Aug 2020 14:25:40 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 9091A2B89 for ; Mon, 31 Aug 2020 14:25:39 +0200 (CEST) IronPort-SDR: oyIgyTO4oBO79wy1+lJ56grOMY5LmLItUVthOgcs4qJ/6mjU99/Cy54DyCFi+6acmt9O17Eqy/ Rdwpu+mYbqUA== X-IronPort-AV: E=McAfee;i="6000,8403,9729"; a="156215879" X-IronPort-AV: E=Sophos;i="5.76,375,1592895600"; d="scan'208";a="156215879" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Aug 2020 05:25:38 -0700 IronPort-SDR: ytUxzb1aPn/3YLqSSBAtCBZHwCvriLmMS2Z+5eLwjkRya+RihmfnuxXiIUbJCfC8Ulflxh3R7f 8MuG13b1juQw== X-IronPort-AV: E=Sophos;i="5.76,375,1592895600"; d="scan'208";a="501834901" Received: from fyigit-mobl.ger.corp.intel.com (HELO [10.213.245.181]) ([10.213.245.181]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Aug 2020 05:25:30 -0700 To: Andrew Rybchenko , dev@dpdk.org, Shepard Siegel , Ed Czeck , John Miller , Igor Russkikh , Pavel Belous , Somalapuram Amaranath , Ajit Khaparde , Somnath Kotur , Hemant Agrawal , Sachin Saxena , Wei Zhao , Jeff Guo , John Daley , Hyong Youb Kim , Qi Zhang , Xiao Wang , Beilei Xing , Jingjing Wu , Qiming Yang , Matan Azrad , Shahaf Shuler , Viacheslav Ovsiienko , Stephen Hemminger , "K. Y. Srinivasan" , Haiyang Zhang , Long Li , Heinrich Kuhn , Jerin Jacob , Nithin Dabilpuram , Kiran Kumar K , Rasesh Mody , Shahed Shaikh , Maciej Czekaj , Maxime Coquelin , Chenbo Xia , Zhihong Wang , Thomas Monjalon References: <20200824094021.2323605-1-ferruh.yigit@intel.com> <20200824094021.2323605-2-ferruh.yigit@intel.com> <8da6077c-ab19-f819-3a3c-b4575bc512d9@solarflare.com> From: Ferruh Yigit Message-ID: Date: Mon, 31 Aug 2020 13:25:27 +0100 MIME-Version: 1.0 In-Reply-To: <8da6077c-ab19-f819-3a3c-b4575bc512d9@solarflare.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH 2/7] ethdev: move inline device operations 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 8/29/2020 12:57 PM, Andrew Rybchenko wrote: > On 8/24/20 12:40 PM, Ferruh Yigit wrote: >> This patch is a preparation to hide the 'struct eth_dev_ops' from >> applications by moving some device operations from 'struct eth_dev_ops' >> to 'struct rte_eth_dev'. >> >> Mentioned ethdev APIs are in the data path and implemented as inline >> because of performance reasons. >> >> Exposing 'struct eth_dev_ops' to applications is bad because it is a >> contract between ethdev and PMDs, not really needs to be known by >> applications, also changes in the struct causing ABI breakages which >> shouldn't. >> >> To be able to both keep APIs inline and hide the 'struct eth_dev_ops', >> moving device operations used in ethdev inline APIs to 'struct >> rte_eth_dev' to the same level with Rx/Tx burst functions. >> >> The list of dev_ops moved: >> eth_rx_queue_count_t rx_queue_count; >> eth_rx_descriptor_status_t rx_descriptor_status; >> eth_tx_descriptor_status_t tx_descriptor_status; >> >> Signed-off-by: Ferruh Yigit > > Reviewed-by: Andrew Rybchenko > > doc/guides/nics/features.rst should be updated since it says > that status callbacks live in eth_dev_ops. > Yep, I will fix in v2, thanks for review. > plus an net/sfc-related nit below: > > [snip] > >> diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c >> index 65e0ff7d48..0b06bf91a0 100644 >> --- a/drivers/net/sfc/sfc_ethdev.c >> +++ b/drivers/net/sfc/sfc_ethdev.c > > [snip] > >> @@ -1962,6 +1959,9 @@ sfc_eth_dev_set_ops(struct rte_eth_dev *dev) >> dev->tx_pkt_burst = dp_tx->pkt_burst; >> >> dev->dev_ops = &sfc_eth_dev_ops; >> + dev->rx_queue_count = sfc_rx_queue_count; >> + dev->rx_descriptor_status = sfc_rx_descriptor_status; >> + dev->tx_descriptor_status = sfc_tx_descriptor_status; > > May I ask to put it just after dev->tx_pkt_burst = ... line > since these callbacks go before dev_ops in the structure. > ok >> >> return 0; >> >> @@ -2001,9 +2001,6 @@ sfc_eth_dev_clear_ops(struct rte_eth_dev *dev) >> >> static const struct eth_dev_ops sfc_eth_dev_secondary_ops = { >> .dev_supported_ptypes_get = sfc_dev_supported_ptypes_get, >> - .rx_queue_count = sfc_rx_queue_count, >> - .rx_descriptor_status = sfc_rx_descriptor_status, >> - .tx_descriptor_status = sfc_tx_descriptor_status, >> .reta_query = sfc_dev_rss_reta_query, >> .rss_hash_conf_get = sfc_dev_rss_hash_conf_get, >> .rxq_info_get = sfc_rx_queue_info_get, >> @@ -2069,6 +2066,9 @@ sfc_eth_dev_secondary_init(struct rte_eth_dev *dev, uint32_t logtype_main) >> dev->tx_pkt_prepare = dp_tx->pkt_prepare; >> dev->tx_pkt_burst = dp_tx->pkt_burst; >> dev->dev_ops = &sfc_eth_dev_secondary_ops; >> + dev->rx_queue_count = sfc_rx_queue_count; >> + dev->rx_descriptor_status = sfc_rx_descriptor_status; >> + dev->tx_descriptor_status = sfc_tx_descriptor_status; > > Same here. > ok