* [dpdk-dev] [PATCH 2/2] event/octeontx: fix Rx adapter port id mapping
2017-11-28 14:58 [dpdk-dev] [PATCH 1/2] net/octeontx: add channel to port id mapping Pavan Nikhilesh
@ 2017-11-28 14:58 ` Pavan Nikhilesh
2017-12-08 0:41 ` [dpdk-dev] [PATCH 1/2] net/octeontx: add channel to " Ferruh Yigit
` (2 subsequent siblings)
3 siblings, 0 replies; 16+ messages in thread
From: Pavan Nikhilesh @ 2017-11-28 14:58 UTC (permalink / raw)
To: santosh.shukla, ferruh.yigit; +Cc: dev, 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.
Fixes: 45a914c5bd71 ("event/octeontx: support event Rx adapter")
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
---
drivers/event/octeontx/ssovf_worker.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/event/octeontx/ssovf_worker.h b/drivers/event/octeontx/ssovf_worker.h
index bf76ac880..b382232b0 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 = 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.14.1
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [dpdk-dev] [PATCH 1/2] net/octeontx: add channel to port id mapping
2017-11-28 14:58 [dpdk-dev] [PATCH 1/2] net/octeontx: add channel to port id mapping Pavan Nikhilesh
2017-11-28 14:58 ` [dpdk-dev] [PATCH 2/2] event/octeontx: fix Rx adapter " Pavan Nikhilesh
@ 2017-12-08 0:41 ` Ferruh Yigit
2017-12-08 11:08 ` Pavan Nikhilesh Bhagavatula
2017-12-09 12:55 ` [dpdk-dev] [PATCH v2 " Pavan Nikhilesh
2017-12-19 18:01 ` [dpdk-dev] [PATCH v3 " Pavan Nikhilesh
3 siblings, 1 reply; 16+ messages in thread
From: Ferruh Yigit @ 2017-12-08 0:41 UTC (permalink / raw)
To: Pavan Nikhilesh, santosh.shukla; +Cc: dev
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 <pbhagavatula@caviumnetworks.com>
<...>
> @@ -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?
btw, is build time dependency between octeontx ethdev and eventdev documented
somewhere?
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [dpdk-dev] [PATCH 1/2] net/octeontx: add channel to port id mapping
2017-12-08 0:41 ` [dpdk-dev] [PATCH 1/2] net/octeontx: add channel to " Ferruh Yigit
@ 2017-12-08 11:08 ` Pavan Nikhilesh Bhagavatula
2017-12-08 17:39 ` Ferruh Yigit
0 siblings, 1 reply; 16+ messages in thread
From: Pavan Nikhilesh Bhagavatula @ 2017-12-08 11:08 UTC (permalink / raw)
To: Ferruh Yigit, santosh.shukla; +Cc: dev
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 <pbhagavatula@caviumnetworks.com>
>
> <...>
>
> > @@ -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.
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.
Thanks,
Pavan
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [dpdk-dev] [PATCH 1/2] net/octeontx: add channel to port id mapping
2017-12-08 11:08 ` Pavan Nikhilesh Bhagavatula
@ 2017-12-08 17:39 ` Ferruh Yigit
2017-12-09 9:25 ` Pavan Nikhilesh Bhagavatula
0 siblings, 1 reply; 16+ messages in thread
From: Ferruh Yigit @ 2017-12-08 17:39 UTC (permalink / raw)
To: Pavan Nikhilesh Bhagavatula, santosh.shukla; +Cc: dev
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 <pbhagavatula@caviumnetworks.com>
>>
>> <...>
>>
>>> @@ -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
>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [dpdk-dev] [PATCH 1/2] net/octeontx: add channel to port id mapping
2017-12-08 17:39 ` Ferruh Yigit
@ 2017-12-09 9:25 ` Pavan Nikhilesh Bhagavatula
0 siblings, 0 replies; 16+ messages in thread
From: Pavan Nikhilesh Bhagavatula @ 2017-12-09 9:25 UTC (permalink / raw)
To: Ferruh Yigit, santosh.shukla; +Cc: dev
On Fri, Dec 08, 2017 at 09:39:00AM -0800, Ferruh Yigit wrote:
> 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 <pbhagavatula@caviumnetworks.com>
> >>
> >> <...>
> >>
> >>> @@ -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?
>
Hi Ferruh,
I misread the order in which thing are built. I will send out a v2 with the
suggested changes soon.
Thanks,
Pavan
> >
> > Thanks,
> > Pavan
> >
>
^ permalink raw reply [flat|nested] 16+ messages in thread
* [dpdk-dev] [PATCH v2 1/2] net/octeontx: add channel to port id mapping
2017-11-28 14:58 [dpdk-dev] [PATCH 1/2] net/octeontx: add channel to port id mapping Pavan Nikhilesh
2017-11-28 14:58 ` [dpdk-dev] [PATCH 2/2] event/octeontx: fix Rx adapter " Pavan Nikhilesh
2017-12-08 0:41 ` [dpdk-dev] [PATCH 1/2] net/octeontx: add channel to " Ferruh Yigit
@ 2017-12-09 12:55 ` Pavan Nikhilesh
2017-12-09 12:55 ` [dpdk-dev] [PATCH v2 2/2] event/octeontx: fix Rx adapter " Pavan Nikhilesh
2017-12-18 9:41 ` [dpdk-dev] [PATCH v2 1/2] net/octeontx: add channel to " santosh
2017-12-19 18:01 ` [dpdk-dev] [PATCH v3 " Pavan Nikhilesh
3 siblings, 2 replies; 16+ messages in thread
From: Pavan Nikhilesh @ 2017-12-09 12:55 UTC (permalink / raw)
To: ferruh.yigit, santosh.shukla; +Cc: dev, Pavan Nikhilesh
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>
---
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;
+};
--
2.14.1
^ permalink raw reply [flat|nested] 16+ messages in thread
* [dpdk-dev] [PATCH v2 2/2] event/octeontx: fix Rx adapter port id mapping
2017-12-09 12:55 ` [dpdk-dev] [PATCH v2 " Pavan Nikhilesh
@ 2017-12-09 12:55 ` Pavan Nikhilesh
2017-12-18 9:43 ` santosh
2017-12-18 9:41 ` [dpdk-dev] [PATCH v2 1/2] net/octeontx: add channel to " santosh
1 sibling, 1 reply; 16+ messages in thread
From: Pavan Nikhilesh @ 2017-12-09 12:55 UTC (permalink / raw)
To: ferruh.yigit, santosh.shukla; +Cc: dev, 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.
Fixes: 45a914c5bd71 ("event/octeontx: support event Rx adapter")
Signed-off-by: Pavan Nikhilesh <pbhagavatula@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..b382232b0 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 = 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.14.1
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [dpdk-dev] [PATCH v2 2/2] event/octeontx: fix Rx adapter port id mapping
2017-12-09 12:55 ` [dpdk-dev] [PATCH v2 2/2] event/octeontx: fix Rx adapter " Pavan Nikhilesh
@ 2017-12-18 9:43 ` santosh
0 siblings, 0 replies; 16+ messages in thread
From: santosh @ 2017-12-18 9:43 UTC (permalink / raw)
To: Pavan Nikhilesh, ferruh.yigit, santosh.shukla; +Cc: dev
On Saturday 09 December 2017 06:25 PM, Pavan Nikhilesh wrote:
> 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.
>
> Fixes: 45a914c5bd71 ("event/octeontx: support event Rx adapter")
>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> ---
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [dpdk-dev] [PATCH v2 1/2] net/octeontx: add channel to port id mapping
2017-12-09 12:55 ` [dpdk-dev] [PATCH v2 " Pavan Nikhilesh
2017-12-09 12:55 ` [dpdk-dev] [PATCH v2 2/2] event/octeontx: fix Rx adapter " Pavan Nikhilesh
@ 2017-12-18 9:41 ` santosh
2017-12-18 21:52 ` Pavan Nikhilesh
1 sibling, 1 reply; 16+ messages in thread
From: santosh @ 2017-12-18 9:41 UTC (permalink / raw)
To: Pavan Nikhilesh, ferruh.yigit, santosh.shukla; +Cc: dev
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 <pbhagavatula@caviumnetworks.com>
> ---
>
> 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 <santosh.shukla@caviumnetworks.com>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [dpdk-dev] [PATCH v2 1/2] net/octeontx: add channel to port id mapping
2017-12-18 9:41 ` [dpdk-dev] [PATCH v2 1/2] net/octeontx: add channel to " santosh
@ 2017-12-18 21:52 ` Pavan Nikhilesh
0 siblings, 0 replies; 16+ messages in thread
From: Pavan Nikhilesh @ 2017-12-18 21:52 UTC (permalink / raw)
To: santosh, ferruh.yigit; +Cc: 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 <pbhagavatula@caviumnetworks.com>
> > ---
> >
> > 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 <santosh.shukla@caviumnetworks.com>
>
Thanks for the review and ack, will send out v3 fixing the name.
Pavan.
>
^ permalink raw reply [flat|nested] 16+ messages in thread
* [dpdk-dev] [PATCH v3 1/2] net/octeontx: add channel to port id mapping
2017-11-28 14:58 [dpdk-dev] [PATCH 1/2] net/octeontx: add channel to port id mapping Pavan Nikhilesh
` (2 preceding siblings ...)
2017-12-09 12:55 ` [dpdk-dev] [PATCH v2 " Pavan Nikhilesh
@ 2017-12-19 18:01 ` Pavan Nikhilesh
2017-12-19 18:01 ` [dpdk-dev] [PATCH v3 2/2] event/octeontx: fix Rx adapter " Pavan Nikhilesh
2018-01-09 12:47 ` [dpdk-dev] [PATCH v3 1/2] net/octeontx: add channel to " Ferruh Yigit
3 siblings, 2 replies; 16+ messages in thread
From: Pavan Nikhilesh @ 2017-12-19 18:01 UTC (permalink / raw)
To: santosh.shukla, ferruh.yigit; +Cc: dev, Pavan Nikhilesh
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(+)
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;
+
+};
--
2.14.1
^ permalink raw reply [flat|nested] 16+ messages in thread
* [dpdk-dev] [PATCH v3 2/2] event/octeontx: fix Rx adapter port id mapping
2017-12-19 18:01 ` [dpdk-dev] [PATCH v3 " Pavan Nikhilesh
@ 2017-12-19 18:01 ` Pavan Nikhilesh
2018-01-09 12:47 ` [dpdk-dev] [PATCH v3 1/2] net/octeontx: add channel to " Ferruh Yigit
1 sibling, 0 replies; 16+ messages in thread
From: Pavan Nikhilesh @ 2017-12-19 18:01 UTC (permalink / raw)
To: santosh.shukla, ferruh.yigit; +Cc: dev, 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.
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.14.1
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [dpdk-dev] [PATCH v3 1/2] net/octeontx: add channel to port id mapping
2017-12-19 18:01 ` [dpdk-dev] [PATCH v3 " Pavan Nikhilesh
2017-12-19 18:01 ` [dpdk-dev] [PATCH v3 2/2] event/octeontx: fix Rx adapter " Pavan Nikhilesh
@ 2018-01-09 12:47 ` Ferruh Yigit
2018-01-09 12:49 ` Ferruh Yigit
1 sibling, 1 reply; 16+ messages in thread
From: Ferruh Yigit @ 2018-01-09 12:47 UTC (permalink / raw)
To: Pavan Nikhilesh, santosh.shukla; +Cc: dev
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.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [dpdk-dev] [PATCH v3 1/2] net/octeontx: add channel to port id mapping
2018-01-09 12:47 ` [dpdk-dev] [PATCH v3 1/2] net/octeontx: add channel to " Ferruh Yigit
@ 2018-01-09 12:49 ` Ferruh Yigit
2018-01-10 7:59 ` Pavan Nikhilesh
0 siblings, 1 reply; 16+ messages in thread
From: Ferruh Yigit @ 2018-01-09 12:49 UTC (permalink / raw)
To: Pavan Nikhilesh, santosh.shukla; +Cc: dev
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.
>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [dpdk-dev] [PATCH v3 1/2] net/octeontx: add channel to port id mapping
2018-01-09 12:49 ` Ferruh Yigit
@ 2018-01-10 7:59 ` Pavan Nikhilesh
0 siblings, 0 replies; 16+ messages in thread
From: Pavan Nikhilesh @ 2018-01-10 7:59 UTC (permalink / raw)
To: Ferruh Yigit, santosh.shukla, jerin.jacob; +Cc: dev
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.
> >
>
^ permalink raw reply [flat|nested] 16+ messages in thread