DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] event/octeontx: handle partial receive packets
@ 2019-11-27 11:05 pbhagavatula
  2019-11-27 11:43 ` Jerin Jacob
  0 siblings, 1 reply; 3+ messages in thread
From: pbhagavatula @ 2019-11-27 11:05 UTC (permalink / raw)
  To: jerinj; +Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

When net/octeontx is connected to event/octeontx as an event Rx adapter,
PKI aka 'net/octeontx' can forward packets directly to SSO aka
'event/octeontx'.
When pumping traffic to PKI if flow control is disabled internal FIFOs
might be overrun causing partial l2 packets to be enqueued.
SSO receives <31:0> TAG tag calculated by PKI, in normal cases <31:28>
is always 0 which signifies RTE_EVENT_TYPE_ETHDEV. But in case of
partial received packets PKI sets the <31:0> TAG as 0xFFFFFFFF which
is an invalid event type.

Add a check to see if TAG is 0xFFFFFFFF and free the partial receive
packet.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 drivers/event/octeontx/ssovf_worker.h        | 17 +++++++++++++++--
 drivers/net/octeontx/base/octeontx_pki_var.h |  2 +-
 2 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/drivers/event/octeontx/ssovf_worker.h b/drivers/event/octeontx/ssovf_worker.h
index d1d3a52ae..9c715d389 100644
--- a/drivers/event/octeontx/ssovf_worker.h
+++ b/drivers/event/octeontx/ssovf_worker.h
@@ -30,8 +30,7 @@ ssovf_octeontx_wqe_to_pkt(uint64_t work, uint16_t port_info)
 	octtx_wqe_t *wqe = (octtx_wqe_t *)(uintptr_t)work;
 
 	/* Get mbuf from wqe */
-	mbuf = (struct rte_mbuf *)((uintptr_t)wqe -
-			OCTTX_PACKET_WQE_SKIP);
+	mbuf = (struct rte_mbuf *)((uintptr_t)wqe - OCTTX_PACKET_WQE_SKIP);
 	rte_prefetch_non_temporal(mbuf);
 	mbuf->packet_type =
 		ptype_table[wqe->s.w2.lcty][wqe->s.w2.lety][wqe->s.w2.lfty];
@@ -46,6 +45,16 @@ ssovf_octeontx_wqe_to_pkt(uint64_t work, uint16_t port_info)
 	return mbuf;
 }
 
+static __rte_always_inline void
+ssovf_octeontx_wqe_free(uint64_t work)
+{
+	octtx_wqe_t *wqe = (octtx_wqe_t *)(uintptr_t)work;
+	struct rte_mbuf *mbuf;
+
+	mbuf = (struct rte_mbuf *)((uintptr_t)wqe - OCTTX_PACKET_WQE_SKIP);
+	rte_pktmbuf_free(mbuf);
+}
+
 static __rte_always_inline uint16_t
 ssows_get_work(struct ssows *ws, struct rte_event *ev)
 {
@@ -59,9 +68,13 @@ ssows_get_work(struct ssows *ws, struct rte_event *ev)
 	ws->cur_grp = sched_type_queue >> 2;
 	sched_type_queue = sched_type_queue << 38;
 	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) & 0x7F);
+	} else if ((get_work0 & 0xFFFFFFFF) == 0xFFFFFFFF) {
+		ssovf_octeontx_wqe_free(get_work1);
+		return 0;
 	} else {
 		ev->u64 = get_work1;
 	}
diff --git a/drivers/net/octeontx/base/octeontx_pki_var.h b/drivers/net/octeontx/base/octeontx_pki_var.h
index f4661d24e..2ef98964b 100644
--- a/drivers/net/octeontx/base/octeontx_pki_var.h
+++ b/drivers/net/octeontx/base/octeontx_pki_var.h
@@ -139,7 +139,7 @@ typedef union octtx_wqe_s {
 			uint64_t	l2b	: 1;
 			uint64_t	l2m	: 1;
 			uint64_t	raw	: 1;
-	uint64_t	err_lev : 3;
+			uint64_t	err_lev : 3;
 			uint64_t	op_code : 8;
 		} w2;
 
-- 
2.17.1


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

* Re: [dpdk-dev] [PATCH] event/octeontx: handle partial receive packets
  2019-11-27 11:05 [dpdk-dev] [PATCH] event/octeontx: handle partial receive packets pbhagavatula
@ 2019-11-27 11:43 ` Jerin Jacob
  2019-11-27 11:52   ` [dpdk-dev] [EXT] " Pavan Nikhilesh Bhagavatula
  0 siblings, 1 reply; 3+ messages in thread
From: Jerin Jacob @ 2019-11-27 11:43 UTC (permalink / raw)
  To: Pavan Nikhilesh; +Cc: Jerin Jacob, dpdk-dev

On Wed, Nov 27, 2019 at 8:05 PM <pbhagavatula@marvell.com> wrote:
>
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
> When net/octeontx is connected to event/octeontx as an event Rx adapter,
> PKI aka 'net/octeontx' can forward packets directly to SSO aka
> 'event/octeontx'.
> When pumping traffic to PKI if flow control is disabled internal FIFOs
> might be overrun causing partial l2 packets to be enqueued.
> SSO receives <31:0> TAG tag calculated by PKI, in normal cases <31:28>
> is always 0 which signifies RTE_EVENT_TYPE_ETHDEV. But in case of
> partial received packets PKI sets the <31:0> TAG as 0xFFFFFFFF which
> is an invalid event type.
>
> Add a check to see if TAG is 0xFFFFFFFF and free the partial receive
> packet.
>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>

# Could you add Fixes:
# Change the subject to "net/octeontx: fix partial Rx packet handling"
# Cc stable
# Fix the following check-git-log

Wrong headline prefix:
        event/octeontx: handle partial receive packets

Please see inline

> ---
>  drivers/event/octeontx/ssovf_worker.h        | 17 +++++++++++++++--
>  drivers/net/octeontx/base/octeontx_pki_var.h |  2 +-
>  2 files changed, 16 insertions(+), 3 deletions(-)
>

>  ssows_get_work(struct ssows *ws, struct rte_event *ev)
>  {
> @@ -59,9 +68,13 @@ ssows_get_work(struct ssows *ws, struct rte_event *ev)
>         ws->cur_grp = sched_type_queue >> 2;
>         sched_type_queue = sched_type_queue << 38;
>         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) & 0x7F);
> +       } else if ((get_work0 & 0xFFFFFFFF) == 0xFFFFFFFF) {

Can we make it as unlikely()?

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

* Re: [dpdk-dev] [EXT] Re: [PATCH] event/octeontx: handle partial receive packets
  2019-11-27 11:43 ` Jerin Jacob
@ 2019-11-27 11:52   ` Pavan Nikhilesh Bhagavatula
  0 siblings, 0 replies; 3+ messages in thread
From: Pavan Nikhilesh Bhagavatula @ 2019-11-27 11:52 UTC (permalink / raw)
  To: Jerin Jacob; +Cc: Jerin Jacob Kollanukkaran, dpdk-dev



>-----Original Message-----
>From: Jerin Jacob <jerinjacobk@gmail.com>
>Sent: Wednesday, November 27, 2019 5:14 PM
>To: Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com>
>Cc: Jerin Jacob Kollanukkaran <jerinj@marvell.com>; dpdk-dev
><dev@dpdk.org>
>Subject: [EXT] Re: [dpdk-dev] [PATCH] event/octeontx: handle partial
>receive packets
>
>External Email
>
>----------------------------------------------------------------------
>On Wed, Nov 27, 2019 at 8:05 PM <pbhagavatula@marvell.com> wrote:
>>
>> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>>
>> When net/octeontx is connected to event/octeontx as an event Rx
>adapter,
>> PKI aka 'net/octeontx' can forward packets directly to SSO aka
>> 'event/octeontx'.
>> When pumping traffic to PKI if flow control is disabled internal FIFOs
>> might be overrun causing partial l2 packets to be enqueued.
>> SSO receives <31:0> TAG tag calculated by PKI, in normal cases
><31:28>
>> is always 0 which signifies RTE_EVENT_TYPE_ETHDEV. But in case of
>> partial received packets PKI sets the <31:0> TAG as 0xFFFFFFFF which
>> is an invalid event type.
>>
>> Add a check to see if TAG is 0xFFFFFFFF and free the partial receive
>> packet.
>>
>> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
># Could you add Fixes:
># Change the subject to "net/octeontx: fix partial Rx packet handling"
># Cc stable
># Fix the following check-git-log
>
>Wrong headline prefix:
>        event/octeontx: handle partial receive packets
>

Will send v2 with updated git log

>Please see inline
>
>> ---
>>  drivers/event/octeontx/ssovf_worker.h        | 17 +++++++++++++++-
>-
>>  drivers/net/octeontx/base/octeontx_pki_var.h |  2 +-
>>  2 files changed, 16 insertions(+), 3 deletions(-)
>>
>
>>  ssows_get_work(struct ssows *ws, struct rte_event *ev)
>>  {
>> @@ -59,9 +68,13 @@ ssows_get_work(struct ssows *ws, struct
>rte_event *ev)
>>         ws->cur_grp = sched_type_queue >> 2;
>>         sched_type_queue = sched_type_queue << 38;
>>         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) & 0x7F);
>> +       } else if ((get_work0 & 0xFFFFFFFF) == 0xFFFFFFFF) {
>
>Can we make it as unlikely()?

Since it's  error case I Will add in v2.

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

end of thread, other threads:[~2019-11-27 11:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-27 11:05 [dpdk-dev] [PATCH] event/octeontx: handle partial receive packets pbhagavatula
2019-11-27 11:43 ` Jerin Jacob
2019-11-27 11:52   ` [dpdk-dev] [EXT] " Pavan Nikhilesh Bhagavatula

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).