From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pavan Nikhilesh Subject: Re: [PATCH v2 1/2] net/octeontx: add channel to port id mapping Date: Tue, 19 Dec 2017 03:22:27 +0530 Message-ID: <20171218215226.ls5s2jjziaquzbbl@Pavan-LT> References: <20171128145855.27106-1-pbhagavatula@caviumnetworks.com> <20171209125510.20592-1-pbhagavatula@caviumnetworks.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dev@dpdk.org To: santosh , ferruh.yigit@intel.com Return-path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0080.outbound.protection.outlook.com [104.47.32.80]) by dpdk.org (Postfix) with ESMTP id 8BBD11D7 for ; Mon, 18 Dec 2017 22:52:52 +0100 (CET) Content-Disposition: inline In-Reply-To: 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 Mon, Dec 18, 2017 at 03:11:15PM +0530, santosh wrote: > > On Saturday 09 December 2017 06:25 PM, 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 > > --- > > > > v2 changes: > > - Used extern instead of defining global variable > > > > drivers/net/octeontx/octeontx_ethdev.c | 6 ++++++ > > drivers/net/octeontx/octeontx_ethdev.h | 6 ++++++ > > drivers/net/octeontx/rte_pmd_octeontx_version.map | 6 ++++++ > > 3 files changed, 18 insertions(+) > > > > diff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeontx/octeontx_ethdev.c > > index bd24ec330..46cb061b4 100644 > > --- a/drivers/net/octeontx/octeontx_ethdev.c > > +++ b/drivers/net/octeontx/octeontx_ethdev.c > > @@ -54,6 +54,9 @@ struct octeontx_vdev_init_params { > > uint8_t nr_port; > > }; > > > > +uint16_t > > +octeontx_pchan_map[OCTEONTX_MAX_BGX_PORTS][OCTEONTX_MAX_LMAC_PER_BGX]; > > + > > enum octeontx_link_speed { > > OCTEONTX_LINK_SPEED_SGMII, > > OCTEONTX_LINK_SPEED_XAUI, > > @@ -1133,6 +1136,9 @@ octeontx_create(struct rte_vdev_device *dev, int port, uint8_t evdev, > > nic->num_tx_queues); > > PMD_INIT_LOG(DEBUG, "speed %d mtu %d", nic->speed, nic->mtu); > > > > + octeontx_pchan_map[(nic->base_ochan >> 8) & 0x7] > > + [(nic->base_ochan >> 4) & 0xF] = data->port_id; > > + > > return data->port_id; > > > > err: > > diff --git a/drivers/net/octeontx/octeontx_ethdev.h b/drivers/net/octeontx/octeontx_ethdev.h > > index c47d4c6d3..f046595a8 100644 > > --- a/drivers/net/octeontx/octeontx_ethdev.h > > +++ b/drivers/net/octeontx/octeontx_ethdev.h > > @@ -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; > > } > > > > +extern uint16_t > > +octeontx_pchan_map[OCTEONTX_MAX_BGX_PORTS][OCTEONTX_MAX_LMAC_PER_BGX]; > > + > > /* Octeontx ethdev nic */ > > struct octeontx_nic { > > struct rte_eth_dev *dev; > > diff --git a/drivers/net/octeontx/rte_pmd_octeontx_version.map b/drivers/net/octeontx/rte_pmd_octeontx_version.map > > index a70bd197b..3ec12ddb1 100644 > > --- a/drivers/net/octeontx/rte_pmd_octeontx_version.map > > +++ b/drivers/net/octeontx/rte_pmd_octeontx_version.map > > @@ -2,3 +2,9 @@ DPDK_17.11 { > > > > local: *; > > }; > > + > > +DPDK_18.04 { > > + global: > > + > > + octeontx_pchan_map; > > +}; > > nits: better be rte_octeontx_pchan_map > refer http://dpdk.org/browse/dpdk/tree/drivers/mempool/dpaa2/rte_mempool_dpaa2_version.map#n4 > > Acked-by: Santosh Shukla > Thanks for the review and ack, will send out v3 fixing the name. Pavan. >