From 989d492620f18ce062cb238fbbd51a14bc9bcef9 Mon Sep 17 00:00:00 2001 From: Pavan Nikhilesh Date: Tue, 19 Dec 2017 23:31:44 +0530 Subject: [PATCH] net/octeontx: add channel to port id mapping 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 Acked-by: Santosh Shukla --- drivers/net/octeontx/octeontx_ethdev.c | 6 ++++++ drivers/net/octeontx/octeontx_ethdev.h | 6 ++++++ drivers/net/octeontx/rte_pmd_octeontx_version.map | 7 +++++++ 3 files changed, 19 insertions(+) diff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeontx/octeontx_ethdev.c index 7b73817e57..aa00364b54 100644 --- a/drivers/net/octeontx/octeontx_ethdev.c +++ b/drivers/net/octeontx/octeontx_ethdev.c @@ -27,6 +27,9 @@ struct octeontx_vdev_init_params { uint8_t nr_port; }; +uint16_t +rte_octeontx_pchan_map[OCTEONTX_MAX_BGX_PORTS][OCTEONTX_MAX_LMAC_PER_BGX]; + enum octeontx_link_speed { OCTEONTX_LINK_SPEED_SGMII, OCTEONTX_LINK_SPEED_XAUI, @@ -1139,6 +1142,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); + rte_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 d787a33f96..637b92cf4d 100644 --- a/drivers/net/octeontx/octeontx_ethdev.h +++ b/drivers/net/octeontx/octeontx_ethdev.h @@ -25,12 +25,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 +rte_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 a70bd197b7..a3161b14d0 100644 --- a/drivers/net/octeontx/rte_pmd_octeontx_version.map +++ b/drivers/net/octeontx/rte_pmd_octeontx_version.map @@ -2,3 +2,10 @@ DPDK_17.11 { local: *; }; + +DPDK_18.02 { + global: + + rte_octeontx_pchan_map; + +} DPDK_17.11; -- 2.20.1