[dpdk-dev,v3,1/2] net/octeontx: add channel to port id mapping

Message ID 20171219180145.1858-1-pbhagavatula@caviumnetworks.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Pavan Nikhilesh Dec. 19, 2017, 6:01 p.m. UTC
  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 <pbhagavatula@caviumnetworks.com>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
---

 v3 changes:
  - Add rte_ prefix to shared variable octeontx_pchan_map.

 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 | 7 +++++++
 3 files changed, 19 insertions(+)

--
2.14.1
  

Comments

Ferruh Yigit Jan. 9, 2018, 12:47 p.m. UTC | #1
On 12/19/2017 6:01 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 <pbhagavatula@caviumnetworks.com>
> Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>

Series applied to dpdk-next-net/master, thanks.

> +DPDK_18.04 {

Fixed while applying.
  
Ferruh Yigit Jan. 9, 2018, 12:49 p.m. UTC | #2
On 1/9/2018 12:47 PM, Ferruh Yigit wrote:
> On 12/19/2017 6:01 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 <pbhagavatula@caviumnetworks.com>
>> Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
> 
> Series applied to dpdk-next-net/master, thanks.

octeontx is enabled in config by default, which mean for all architectures, but
in documentation it shows only supports armv8 arch.

Can you please fix one or other, according which one is the correct?

> 
>> +DPDK_18.04 {
> 
> Fixed while applying.
>
  
Pavan Nikhilesh Jan. 10, 2018, 7:59 a.m. UTC | #3
On Tue, Jan 09, 2018 at 12:49:20PM +0000, Ferruh Yigit wrote:
> On 1/9/2018 12:47 PM, Ferruh Yigit wrote:
> > On 12/19/2017 6:01 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 <pbhagavatula@caviumnetworks.com>
> >> Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
> >
> > Series applied to dpdk-next-net/master, thanks.
>
> octeontx is enabled in config by default, which mean for all architectures, but
> in documentation it shows only supports armv8 arch.

Octeontx is an integrated controller but there is no build time dependency, we
would like to keep it enabled by default so that it would be easier to detect
build breaks caused by other patches.

>
> Can you please fix one or other, according which one is the correct?
>
> >
> >> +DPDK_18.04 {
> >
> > Fixed while applying.
> >
>
  

Patch

diff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeontx/octeontx_ethdev.c
index bd24ec330..deb41d80b 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
+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,
@@ -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);

+	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 c47d4c6d3..d37bb8a23 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
+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 a70bd197b..a741274ce 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.04 {
+	global:
+
+	rte_octeontx_pchan_map;
+
+};