Skip to contentSkip to conversation

event/octeontx2: fix queue removal from Rx adapter

PATCH Superseded Lukasz Bartosik 3 participants 5 messages Apr 16, 2020 – May 2, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 event/octeontx2: fix queue removal from Rx adapter

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.

---
 drivers/event/octeontx2/otx2_evdev_adptr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/event/octeontx2/otx2_evdev_adptr.c +2 -2
index 233cba2..8bdcfa3 100644
@@ -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;
 	}
 
Signature · 1 line
2.7.4
#1 lore raw
Quoted 10 lines · Lukasz Bartosik

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.

Quoted 30 lines
---
 drivers/event/octeontx2/otx2_evdev_adptr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/event/octeontx2/otx2_evdev_adptr.c +2 -3
index 233cba2..8bdcfa3 100644
@@ -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

#2 lore raw

PATCH v2 1/1 event/octeontx2: fix queue removal from Rx adapter

In reply to Lukasz Bartosik

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")
---
 drivers/event/octeontx2/otx2_evdev_adptr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/event/octeontx2/otx2_evdev_adptr.c +2 -2
index 233cba2..8bdcfa3 100644
@@ -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;
 	}
 
Signature · 1 line
2.7.4
Acked-by on v2 1/1
#3 lore raw
Quoted 10 lines

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.

Quoted 4 lines
Fixes 37720fc1fba8 ("event/octeontx2: add Rx adapter")
Quoted 31 lines

---
drivers/event/octeontx2/otx2_evdev_adptr.c | 4 ++--

1 file changed, 2 insertions(+), 2 deletions(-)
drivers/event/octeontx2/otx2_evdev_adptr.c +1 -1
index 233cba2..8bdcfa3 100644
@@ -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;
drivers/event/octeontx2/otx2_evdev_adptr.c +1 -2
@@ -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

Applied
#4 lore raw
Quoted 11 lines · Pavan Nikhilesh Bhagavatula
Quoted 11 lines

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.

Quoted 6 lines
Quoted 4 lines
Fixes 37720fc1fba8 ("event/octeontx2: add Rx adapter")

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

Quoted 33 lines
Quoted 32 lines

---
drivers/event/octeontx2/otx2_evdev_adptr.c | 4 ++--

1 file changed, 2 insertions(+), 2 deletions(-)
drivers/event/octeontx2/otx2_evdev_adptr.c +1 -1
index 233cba2..8bdcfa3 100644
@@ -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;
drivers/event/octeontx2/otx2_evdev_adptr.c +1 -2
@@ -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