patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH 1/2] net/octeontx: add channel to port id mapping
@ 2018-02-08  8:26 Pavan Nikhilesh
  2018-02-08  8:26 ` [dpdk-stable] [PATCH 2/2] event/octeontx: fix Rx adapter " Pavan Nikhilesh
  2018-02-08 14:03 ` [dpdk-stable] [PATCH 1/2] net/octeontx: add channel to " Yuanhan Liu
  0 siblings, 2 replies; 3+ messages in thread
From: Pavan Nikhilesh @ 2018-02-08  8:26 UTC (permalink / raw)
  To: jerin.jacob, santosh.shukla, yliu; +Cc: stable, Pavan Nikhilesh

The channel to port id map is used by event octeontx to map the received
wqe to the respective ethdev port.

[ backported from upstream commit 989d492620f1 ]

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
---
 drivers/net/octeontx/octeontx_ethdev.c            | 6 ++++++
 drivers/net/octeontx/octeontx_ethdev.h            | 6 ++++++
 drivers/net/octeontx/rte_pmd_octeontx_version.map | 3 +++
 3 files changed, 15 insertions(+)

diff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeontx/octeontx_ethdev.c
index b52700e4c..eca3a39fd 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..40d68c79e 100644
--- a/drivers/net/octeontx/rte_pmd_octeontx_version.map
+++ b/drivers/net/octeontx/rte_pmd_octeontx_version.map
@@ -1,4 +1,7 @@
 DPDK_17.11 {
+	global:
+
+	rte_octeontx_pchan_map;
 
 	local: *;
 };
-- 
2.16.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [dpdk-stable] [PATCH 2/2] event/octeontx: fix Rx adapter port id mapping
  2018-02-08  8:26 [dpdk-stable] [PATCH 1/2] net/octeontx: add channel to port id mapping Pavan Nikhilesh
@ 2018-02-08  8:26 ` Pavan Nikhilesh
  2018-02-08 14:03 ` [dpdk-stable] [PATCH 1/2] net/octeontx: add channel to " Yuanhan Liu
  1 sibling, 0 replies; 3+ messages in thread
From: Pavan Nikhilesh @ 2018-02-08  8:26 UTC (permalink / raw)
  To: jerin.jacob, santosh.shukla, yliu; +Cc: stable, Pavan Nikhilesh

When octeontx event dev receives a packet for the event Rx adapter, the
mbuf port id should contain the appropriate ethdev id instead of
internal channel info.

[ backported from upstream commit 9b4298339652 ]

Fixes: 45a914c5bd71 ("event/octeontx: support event Rx adapter")

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
---
 drivers/event/octeontx/Makefile       | 2 +-
 drivers/event/octeontx/ssovf_worker.h | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/event/octeontx/Makefile b/drivers/event/octeontx/Makefile
index fdf1b7385..260441281 100644
--- a/drivers/event/octeontx/Makefile
+++ b/drivers/event/octeontx/Makefile
@@ -41,7 +41,7 @@ CFLAGS += $(WERROR_FLAGS)
 CFLAGS += -I$(RTE_SDK)/drivers/mempool/octeontx/
 CFLAGS += -I$(RTE_SDK)/drivers/net/octeontx/
 
-LDLIBS += -lrte_eal -lrte_eventdev -lrte_mempool_octeontx
+LDLIBS += -lrte_eal -lrte_eventdev -lrte_mempool_octeontx -lrte_pmd_octeontx
 LDLIBS += -lrte_bus_pci
 LDLIBS += -lrte_bus_vdev
 
diff --git a/drivers/event/octeontx/ssovf_worker.h b/drivers/event/octeontx/ssovf_worker.h
index bf76ac880..4c9a4c471 100644
--- a/drivers/event/octeontx/ssovf_worker.h
+++ b/drivers/event/octeontx/ssovf_worker.h
@@ -53,7 +53,7 @@ enum {
 /* SSO Operations */
 
 static __rte_always_inline struct rte_mbuf *
-ssovf_octeontx_wqe_to_pkt(uint64_t work, uint16_t port_id)
+ssovf_octeontx_wqe_to_pkt(uint64_t work, uint16_t port_info)
 {
 	struct rte_mbuf *mbuf;
 	octtx_wqe_t *wqe = (octtx_wqe_t *)(uintptr_t)work;
@@ -69,7 +69,7 @@ ssovf_octeontx_wqe_to_pkt(uint64_t work, uint16_t port_id)
 	mbuf->data_len = mbuf->pkt_len;
 	mbuf->nb_segs = 1;
 	mbuf->ol_flags = 0;
-	mbuf->port = port_id;
+	mbuf->port = rte_octeontx_pchan_map[port_info >> 4][port_info & 0xF];
 	rte_mbuf_refcnt_set(mbuf, 1);
 	return mbuf;
 }
@@ -89,7 +89,7 @@ ssows_get_work(struct ssows *ws, struct rte_event *ev)
 	ev->event = sched_type_queue | (get_work0 & 0xffffffff);
 	if (get_work1 && ev->event_type == RTE_EVENT_TYPE_ETHDEV) {
 		ev->mbuf = ssovf_octeontx_wqe_to_pkt(get_work1,
-				(ev->event >> 20) & 0xF);
+				(ev->event >> 20) & 0x7F);
 	} else {
 		ev->u64 = get_work1;
 	}
-- 
2.16.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-stable] [PATCH 1/2] net/octeontx: add channel to port id mapping
  2018-02-08  8:26 [dpdk-stable] [PATCH 1/2] net/octeontx: add channel to port id mapping Pavan Nikhilesh
  2018-02-08  8:26 ` [dpdk-stable] [PATCH 2/2] event/octeontx: fix Rx adapter " Pavan Nikhilesh
@ 2018-02-08 14:03 ` Yuanhan Liu
  1 sibling, 0 replies; 3+ messages in thread
From: Yuanhan Liu @ 2018-02-08 14:03 UTC (permalink / raw)
  To: Pavan Nikhilesh; +Cc: jerin.jacob, santosh.shukla, stable

On Thu, Feb 08, 2018 at 01:56:02PM +0530, Pavan Nikhilesh wrote:
> The channel to port id map is used by event octeontx to map the received
> wqe to the respective ethdev port.
> 
> [ backported from upstream commit 989d492620f1 ]
> 
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>

Both patches applied to dpdk-stable/17.11.

Thanks!

	--yliu
> ---
>  drivers/net/octeontx/octeontx_ethdev.c            | 6 ++++++
>  drivers/net/octeontx/octeontx_ethdev.h            | 6 ++++++
>  drivers/net/octeontx/rte_pmd_octeontx_version.map | 3 +++
>  3 files changed, 15 insertions(+)
> 
> diff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeontx/octeontx_ethdev.c
> index b52700e4c..eca3a39fd 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..40d68c79e 100644
> --- a/drivers/net/octeontx/rte_pmd_octeontx_version.map
> +++ b/drivers/net/octeontx/rte_pmd_octeontx_version.map
> @@ -1,4 +1,7 @@
>  DPDK_17.11 {
> +	global:
> +
> +	rte_octeontx_pchan_map;
>  
>  	local: *;
>  };
> -- 
> 2.16.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-02-08 14:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-08  8:26 [dpdk-stable] [PATCH 1/2] net/octeontx: add channel to port id mapping Pavan Nikhilesh
2018-02-08  8:26 ` [dpdk-stable] [PATCH 2/2] event/octeontx: fix Rx adapter " Pavan Nikhilesh
2018-02-08 14:03 ` [dpdk-stable] [PATCH 1/2] net/octeontx: add channel to " Yuanhan Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).