DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] event/octeontx2: fix queue removal from Rx adapter
@ 2020-04-16 13:23 Lukasz Bartosik
  2020-04-16 13:25 ` Jerin Jacob
  2020-04-16 15:47 ` [dpdk-dev] [PATCH v2] " Lukasz Bartosik
  0 siblings, 2 replies; 5+ messages in thread
From: Lukasz Bartosik @ 2020-04-16 13:23 UTC (permalink / raw)
  To: pbhagavatula, jerinj; +Cc: anoobj, pathreya, dev

When eth port queue is removed from Rx adapter using
rte_event_eth_rx_adapter_queue_del() it incorrectly
initializes CQ context instead of modifying it. This
might lead to a crash when CQ context is modified
as a part of rte_eth_dev_stop() sequence as CQ will
hold invalid entries. This is responsibility of an
application to call rte_event_eth_rx_adapter_queue_del()
to remove eth port queue from Rx adapter in tear down
sequence.

Signed-off-by: Lukasz Bartosik <lbartosik@marvell.com>
---
 drivers/event/octeontx2/otx2_evdev_adptr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/event/octeontx2/otx2_evdev_adptr.c b/drivers/event/octeontx2/otx2_evdev_adptr.c
index 233cba2..8bdcfa3 100644
--- a/drivers/event/octeontx2/otx2_evdev_adptr.c
+++ b/drivers/event/octeontx2/otx2_evdev_adptr.c
@@ -133,7 +133,7 @@ sso_rxq_disable(struct otx2_eth_dev *dev, uint16_t qid)
 	aq = otx2_mbox_alloc_msg_nix_aq_enq(mbox);
 	aq->qidx = qid;
 	aq->ctype = NIX_AQ_CTYPE_CQ;
-	aq->op = NIX_AQ_INSTOP_INIT;
+	aq->op = NIX_AQ_INSTOP_WRITE;
 
 	aq->cq.ena = 1;
 	aq->cq.caching = 1;
@@ -144,7 +144,7 @@ sso_rxq_disable(struct otx2_eth_dev *dev, uint16_t qid)
 
 	rc = otx2_mbox_process(mbox);
 	if (rc < 0) {
-		otx2_err("Failed to init cq context");
+		otx2_err("Failed to enable cq context");
 		goto fail;
 	}
 
-- 
2.7.4


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

* Re: [dpdk-dev] [PATCH] event/octeontx2: fix queue removal from Rx adapter
  2020-04-16 13:23 [dpdk-dev] [PATCH] event/octeontx2: fix queue removal from Rx adapter Lukasz Bartosik
@ 2020-04-16 13:25 ` Jerin Jacob
  2020-04-16 15:47 ` [dpdk-dev] [PATCH v2] " Lukasz Bartosik
  1 sibling, 0 replies; 5+ messages in thread
From: Jerin Jacob @ 2020-04-16 13:25 UTC (permalink / raw)
  To: Lukasz Bartosik
  Cc: Pavan Nikhilesh, Jerin Jacob, Anoob Joseph, Narayana Prasad, dpdk-dev

On Thu, Apr 16, 2020 at 6:54 PM Lukasz Bartosik <lbartosik@marvell.com> wrote:
>
> When eth port queue is removed from Rx adapter using
> rte_event_eth_rx_adapter_queue_del() it incorrectly
> initializes CQ context instead of modifying it. This
> might lead to a crash when CQ context is modified
> as a part of rte_eth_dev_stop() sequence as CQ will
> hold invalid entries. This is responsibility of an
> application to call rte_event_eth_rx_adapter_queue_del()
> to remove eth port queue from Rx adapter in tear down
> sequence.

Please add Fixes: tag and cc stable.

> Signed-off-by: Lukasz Bartosik <lbartosik@marvell.com>
> ---
>  drivers/event/octeontx2/otx2_evdev_adptr.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/event/octeontx2/otx2_evdev_adptr.c b/drivers/event/octeontx2/otx2_evdev_adptr.c
> index 233cba2..8bdcfa3 100644
> --- a/drivers/event/octeontx2/otx2_evdev_adptr.c
> +++ b/drivers/event/octeontx2/otx2_evdev_adptr.c
> @@ -133,7 +133,7 @@ sso_rxq_disable(struct otx2_eth_dev *dev, uint16_t qid)
>         aq = otx2_mbox_alloc_msg_nix_aq_enq(mbox);
>         aq->qidx = qid;
>         aq->ctype = NIX_AQ_CTYPE_CQ;
> -       aq->op = NIX_AQ_INSTOP_INIT;
> +       aq->op = NIX_AQ_INSTOP_WRITE;
>
>         aq->cq.ena = 1;
>         aq->cq.caching = 1;
> @@ -144,7 +144,7 @@ sso_rxq_disable(struct otx2_eth_dev *dev, uint16_t qid)
>
>         rc = otx2_mbox_process(mbox);
>         if (rc < 0) {
> -               otx2_err("Failed to init cq context");
> +               otx2_err("Failed to enable cq context");
>                 goto fail;
>         }
>
> --
> 2.7.4
>

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

* [dpdk-dev] [PATCH v2] event/octeontx2: fix queue removal from Rx adapter
  2020-04-16 13:23 [dpdk-dev] [PATCH] event/octeontx2: fix queue removal from Rx adapter Lukasz Bartosik
  2020-04-16 13:25 ` Jerin Jacob
@ 2020-04-16 15:47 ` Lukasz Bartosik
  2020-05-01 11:14   ` Pavan Nikhilesh Bhagavatula
  1 sibling, 1 reply; 5+ messages in thread
From: Lukasz Bartosik @ 2020-04-16 15:47 UTC (permalink / raw)
  To: pbhagavatula, jerinj; +Cc: anoobj, pathreya, dev, stable

When eth port queue is removed from Rx adapter using
rte_event_eth_rx_adapter_queue_del() it incorrectly
initializes CQ context instead of modifying it. This
might lead to a crash when CQ context is modified
as a part of rte_eth_dev_stop() sequence as CQ will
hold invalid entries. This is responsibility of an
application to call rte_event_eth_rx_adapter_queue_del()
to remove eth port queue from Rx adapter in tear down
sequence.

Fixes: 37720fc1fba8 ("event/octeontx2: add Rx adapter")
Cc: stable@dpdk.org

Signed-off-by: Lukasz Bartosik <lbartosik@marvell.com>
---
 drivers/event/octeontx2/otx2_evdev_adptr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/event/octeontx2/otx2_evdev_adptr.c b/drivers/event/octeontx2/otx2_evdev_adptr.c
index 233cba2..8bdcfa3 100644
--- a/drivers/event/octeontx2/otx2_evdev_adptr.c
+++ b/drivers/event/octeontx2/otx2_evdev_adptr.c
@@ -133,7 +133,7 @@ sso_rxq_disable(struct otx2_eth_dev *dev, uint16_t qid)
 	aq = otx2_mbox_alloc_msg_nix_aq_enq(mbox);
 	aq->qidx = qid;
 	aq->ctype = NIX_AQ_CTYPE_CQ;
-	aq->op = NIX_AQ_INSTOP_INIT;
+	aq->op = NIX_AQ_INSTOP_WRITE;
 
 	aq->cq.ena = 1;
 	aq->cq.caching = 1;
@@ -144,7 +144,7 @@ sso_rxq_disable(struct otx2_eth_dev *dev, uint16_t qid)
 
 	rc = otx2_mbox_process(mbox);
 	if (rc < 0) {
-		otx2_err("Failed to init cq context");
+		otx2_err("Failed to enable cq context");
 		goto fail;
 	}
 
-- 
2.7.4


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

* Re: [dpdk-dev] [PATCH v2] event/octeontx2: fix queue removal from Rx adapter
  2020-04-16 15:47 ` [dpdk-dev] [PATCH v2] " Lukasz Bartosik
@ 2020-05-01 11:14   ` Pavan Nikhilesh Bhagavatula
  2020-05-02  9:46     ` Jerin Jacob
  0 siblings, 1 reply; 5+ messages in thread
From: Pavan Nikhilesh Bhagavatula @ 2020-05-01 11:14 UTC (permalink / raw)
  To: Lukas Bartosik [C], Jerin Jacob Kollanukkaran
  Cc: Anoob Joseph, Narayana Prasad Raju Athreya, dev, stable

>When eth port queue is removed from Rx adapter using
>rte_event_eth_rx_adapter_queue_del() it incorrectly
>initializes CQ context instead of modifying it. This
>might lead to a crash when CQ context is modified
>as a part of rte_eth_dev_stop() sequence as CQ will
>hold invalid entries. This is responsibility of an
>application to call rte_event_eth_rx_adapter_queue_del()
>to remove eth port queue from Rx adapter in tear down
>sequence.
>
>Fixes: 37720fc1fba8 ("event/octeontx2: add Rx adapter")
>Cc: stable@dpdk.org
>
>Signed-off-by: Lukasz Bartosik <lbartosik@marvell.com>

Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>

>---
> drivers/event/octeontx2/otx2_evdev_adptr.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
>diff --git a/drivers/event/octeontx2/otx2_evdev_adptr.c
>b/drivers/event/octeontx2/otx2_evdev_adptr.c
>index 233cba2..8bdcfa3 100644
>--- a/drivers/event/octeontx2/otx2_evdev_adptr.c
>+++ b/drivers/event/octeontx2/otx2_evdev_adptr.c
>@@ -133,7 +133,7 @@ sso_rxq_disable(struct otx2_eth_dev *dev,
>uint16_t qid)
> 	aq = otx2_mbox_alloc_msg_nix_aq_enq(mbox);
> 	aq->qidx = qid;
> 	aq->ctype = NIX_AQ_CTYPE_CQ;
>-	aq->op = NIX_AQ_INSTOP_INIT;
>+	aq->op = NIX_AQ_INSTOP_WRITE;
>
> 	aq->cq.ena = 1;
> 	aq->cq.caching = 1;
>@@ -144,7 +144,7 @@ sso_rxq_disable(struct otx2_eth_dev *dev,
>uint16_t qid)
>
> 	rc = otx2_mbox_process(mbox);
> 	if (rc < 0) {
>-		otx2_err("Failed to init cq context");
>+		otx2_err("Failed to enable cq context");
> 		goto fail;
> 	}
>
>--
>2.7.4


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

* Re: [dpdk-dev] [PATCH v2] event/octeontx2: fix queue removal from Rx adapter
  2020-05-01 11:14   ` Pavan Nikhilesh Bhagavatula
@ 2020-05-02  9:46     ` Jerin Jacob
  0 siblings, 0 replies; 5+ messages in thread
From: Jerin Jacob @ 2020-05-02  9:46 UTC (permalink / raw)
  To: Pavan Nikhilesh Bhagavatula
  Cc: Lukas Bartosik [C],
	Jerin Jacob Kollanukkaran, Anoob Joseph,
	Narayana Prasad Raju Athreya, dev, stable

On Fri, May 1, 2020 at 4:44 PM Pavan Nikhilesh Bhagavatula
<pbhagavatula@marvell.com> wrote:
>
> >When eth port queue is removed from Rx adapter using
> >rte_event_eth_rx_adapter_queue_del() it incorrectly
> >initializes CQ context instead of modifying it. This
> >might lead to a crash when CQ context is modified
> >as a part of rte_eth_dev_stop() sequence as CQ will
> >hold invalid entries. This is responsibility of an
> >application to call rte_event_eth_rx_adapter_queue_del()
> >to remove eth port queue from Rx adapter in tear down
> >sequence.
> >
> >Fixes: 37720fc1fba8 ("event/octeontx2: add Rx adapter")
> >Cc: stable@dpdk.org
> >
> >Signed-off-by: Lukasz Bartosik <lbartosik@marvell.com>
>
> Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>


Applied to dpdk-next-eventdev/master. Thanks.


>
> >---
> > drivers/event/octeontx2/otx2_evdev_adptr.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> >diff --git a/drivers/event/octeontx2/otx2_evdev_adptr.c
> >b/drivers/event/octeontx2/otx2_evdev_adptr.c
> >index 233cba2..8bdcfa3 100644
> >--- a/drivers/event/octeontx2/otx2_evdev_adptr.c
> >+++ b/drivers/event/octeontx2/otx2_evdev_adptr.c
> >@@ -133,7 +133,7 @@ sso_rxq_disable(struct otx2_eth_dev *dev,
> >uint16_t qid)
> >       aq = otx2_mbox_alloc_msg_nix_aq_enq(mbox);
> >       aq->qidx = qid;
> >       aq->ctype = NIX_AQ_CTYPE_CQ;
> >-      aq->op = NIX_AQ_INSTOP_INIT;
> >+      aq->op = NIX_AQ_INSTOP_WRITE;
> >
> >       aq->cq.ena = 1;
> >       aq->cq.caching = 1;
> >@@ -144,7 +144,7 @@ sso_rxq_disable(struct otx2_eth_dev *dev,
> >uint16_t qid)
> >
> >       rc = otx2_mbox_process(mbox);
> >       if (rc < 0) {
> >-              otx2_err("Failed to init cq context");
> >+              otx2_err("Failed to enable cq context");
> >               goto fail;
> >       }
> >
> >--
> >2.7.4
>

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

end of thread, other threads:[~2020-05-02  9:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-16 13:23 [dpdk-dev] [PATCH] event/octeontx2: fix queue removal from Rx adapter Lukasz Bartosik
2020-04-16 13:25 ` Jerin Jacob
2020-04-16 15:47 ` [dpdk-dev] [PATCH v2] " Lukasz Bartosik
2020-05-01 11:14   ` Pavan Nikhilesh Bhagavatula
2020-05-02  9:46     ` Jerin Jacob

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