From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 3AA851B1A8 for ; Fri, 8 Dec 2017 18:39:02 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Dec 2017 09:39:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,378,1508828400"; d="scan'208";a="10264425" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.241.225.68]) ([10.241.225.68]) by FMSMGA003.fm.intel.com with ESMTP; 08 Dec 2017 09:39:01 -0800 To: Pavan Nikhilesh Bhagavatula , santosh.shukla@cavium.com Cc: dev@dpdk.org References: <20171128145855.27106-1-pbhagavatula@caviumnetworks.com> <20171208110807.wafb4z6q74t7hzht@Pavan-LT> From: Ferruh Yigit Message-ID: <7ebbd6b4-e7ea-4ed0-f06d-572fb1cc3957@intel.com> Date: Fri, 8 Dec 2017 09:39:00 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20171208110807.wafb4z6q74t7hzht@Pavan-LT> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH 1/2] net/octeontx: add channel to port id mapping 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: Fri, 08 Dec 2017 17:39:03 -0000 On 12/8/2017 3:08 AM, Pavan Nikhilesh Bhagavatula wrote: > On Thu, Dec 07, 2017 at 04:41:04PM -0800, Ferruh Yigit wrote: >> On 11/28/2017 6:58 AM, Pavan Nikhilesh wrote: >>> The channel to port id map is used by event octeontx to map the received >>> wqe to the respective ethdev port. >>> >>> Signed-off-by: Pavan Nikhilesh >> >> <...> >> >>> @@ -52,12 +52,18 @@ >>> #define OCTEONTX_VDEV_NR_PORT_ARG ("nr_port") >>> #define OCTEONTX_MAX_NAME_LEN 32 >>> >>> +#define OCTEONTX_MAX_BGX_PORTS 4 >>> +#define OCTEONTX_MAX_LMAC_PER_BGX 4 >>> + >>> static inline struct octeontx_nic * >>> octeontx_pmd_priv(struct rte_eth_dev *dev) >>> { >>> return dev->data->dev_private; >>> } >>> >>> +uint16_t __rte_cache_aligned >>> +octeontx_pchan_map[OCTEONTX_MAX_BGX_PORTS][OCTEONTX_MAX_LMAC_PER_BGX]; >> >> defining global variable in header is generally not good a idea, is there a >> reason why not variable defined in octeontx_ethdev.c and exported here, so that >> both octeontx ethdev and eventdev can use it? > > The reason extern definition in .h and declaration in .c is not done is that > it would break shared compilation. This should work, you can put object into .so and access from application and/or other shared libraries. I did a quick test, and seems working, is there anything I am missing. > The other approach is to do it in octeontx_mempool area but it wouldnt make > sense. > I could use the mempool approach if it sounds good to you (or) let me know > if any alternate approach comes to your mind. > >> >> btw, is build time dependency between octeontx ethdev and eventdev documented >> somewhere? > > Currently, there is no build time dependency between event_octeontx and > eth_octeontx i.e everything builds fine with CONFIG_RTE_LIBRTE_OCTEONTX_PMD=n. octeontx eventdev is using a variable from octeontx ethdev header, how can be there is no build time dependency? > > Thanks, > Pavan >