DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 0/2] DLB2: cq_weight fixes
@ 2022-07-06 21:31 Timothy McDaniel
  2022-07-06 21:31 ` [PATCH 1/2] event/dlb2: fix cq_weight array overflow Timothy McDaniel
  2022-07-06 21:31 ` [PATCH 2/2] event/dlb2: improve cq_weight error messages Timothy McDaniel
  0 siblings, 2 replies; 10+ messages in thread
From: Timothy McDaniel @ 2022-07-06 21:31 UTC (permalink / raw)
  To: jerinj; +Cc: jerinjacobk, dev

This patch series contains the following:
- fix coverity issue 379234
- improve error reporting for cq_weight feature

Timothy McDaniel (2):
  event/dlb2: fix cq_weight array overflow
  event/dlb2: improve cq_weight error messages

 drivers/event/dlb2/dlb2.c                  | 8 ++++----
 drivers/event/dlb2/dlb2_priv.h             | 2 +-
 drivers/event/dlb2/pf/base/dlb2_resource.c | 3 +++
 3 files changed, 8 insertions(+), 5 deletions(-)

-- 
2.25.1


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

* [PATCH 1/2] event/dlb2: fix cq_weight array overflow
  2022-07-06 21:31 [PATCH 0/2] DLB2: cq_weight fixes Timothy McDaniel
@ 2022-07-06 21:31 ` Timothy McDaniel
  2022-07-06 21:46   ` [PATCH v2 0/2] DLB2: cq_weight fixes Timothy McDaniel
  2022-07-06 21:31 ` [PATCH 2/2] event/dlb2: improve cq_weight error messages Timothy McDaniel
  1 sibling, 1 reply; 10+ messages in thread
From: Timothy McDaniel @ 2022-07-06 21:31 UTC (permalink / raw)
  To: jerinj; +Cc: jerinjacobk, dev, stable

The cq_weight array must be sized for the maximum number
of eventdev ports, not the the maximum number of DLB2
load balanced ports.

This commit fixes the above array sizing bug and resultant
coverity warning.

Coverity issue: 379234
Fixes: ffa46fc4a2b5 ("event/dlb2: support CQ weight")
Cc: stable@dpdk.org

Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
---
 drivers/event/dlb2/dlb2.c      | 4 ++--
 drivers/event/dlb2/dlb2_priv.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/event/dlb2/dlb2.c b/drivers/event/dlb2/dlb2.c
index 26af75beb8..93bf215762 100644
--- a/drivers/event/dlb2/dlb2.c
+++ b/drivers/event/dlb2/dlb2.c
@@ -137,7 +137,7 @@ set_cq_weight(const char *key __rte_unused,
 	 */
 	if (sscanf(value, "all:%d", &weight) == 1) {
 		first = 0;
-		last = DLB2_MAX_NUM_LDB_PORTS - 1;
+		last = DLB2_MAX_NUM_PORTS_ALL - 1;
 	} else if (sscanf(value, "%d-%d:%d", &first, &last, &weight) == 3) {
 		/* we have everything we need */
 	} else if (sscanf(value, "%d:%d", &first, &weight) == 2) {
@@ -148,7 +148,7 @@ set_cq_weight(const char *key __rte_unused,
 	}
 
 	if (first > last || first < 0 ||
-		last >= DLB2_MAX_NUM_LDB_PORTS) {
+		last >= DLB2_MAX_NUM_PORTS_ALL) {
 		DLB2_LOG_ERR("Error parsing ldb port qe weight arg, invalid port value\n");
 		return -EINVAL;
 	}
diff --git a/drivers/event/dlb2/dlb2_priv.h b/drivers/event/dlb2/dlb2_priv.h
index 1edea83a5b..db431f7d8b 100644
--- a/drivers/event/dlb2/dlb2_priv.h
+++ b/drivers/event/dlb2/dlb2_priv.h
@@ -641,7 +641,7 @@ struct dlb2_qid_depth_thresholds {
 };
 
 struct dlb2_cq_weight {
-	int limit[DLB2_MAX_NUM_LDB_PORTS];
+	int limit[DLB2_MAX_NUM_PORTS_ALL];
 };
 
 struct dlb2_port_cos {
-- 
2.25.1


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

* [PATCH 2/2] event/dlb2: improve cq_weight error messages
  2022-07-06 21:31 [PATCH 0/2] DLB2: cq_weight fixes Timothy McDaniel
  2022-07-06 21:31 ` [PATCH 1/2] event/dlb2: fix cq_weight array overflow Timothy McDaniel
@ 2022-07-06 21:31 ` Timothy McDaniel
  1 sibling, 0 replies; 10+ messages in thread
From: Timothy McDaniel @ 2022-07-06 21:31 UTC (permalink / raw)
  To: jerinj; +Cc: jerinjacobk, dev, stable

This commit changes 2 error messages to better
describe cq_weight related errors, should one occur.

Fixes: ffa46fc4a2b5 ("event/dlb2: support CQ weight")
Cc: stable@dpdk.org

Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
---
 drivers/event/dlb2/dlb2.c                  | 4 ++--
 drivers/event/dlb2/pf/base/dlb2_resource.c | 3 +++
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/event/dlb2/dlb2.c b/drivers/event/dlb2/dlb2.c
index 93bf215762..5a443acff8 100644
--- a/drivers/event/dlb2/dlb2.c
+++ b/drivers/event/dlb2/dlb2.c
@@ -1527,8 +1527,8 @@ dlb2_hw_create_ldb_port(struct dlb2_eventdev *dlb2,
 
 	if (dlb2->version == DLB2_HW_V2 && ev_port->cq_weight != 0 &&
 	    ev_port->cq_weight > dequeue_depth) {
-		DLB2_LOG_ERR("dlb2: invalid cq depth, must be >= cq weight%d\n",
-			     DLB2_MIN_ENQUEUE_DEPTH);
+		DLB2_LOG_ERR("dlb2: invalid cq dequeue depth %d, must be >= cq weight %d\n",
+			     dequeue_depth, ev_port->cq_weight);
 		return -EINVAL;
 	}
 
diff --git a/drivers/event/dlb2/pf/base/dlb2_resource.c b/drivers/event/dlb2/pf/base/dlb2_resource.c
index e73d289445..0731416a43 100644
--- a/drivers/event/dlb2/pf/base/dlb2_resource.c
+++ b/drivers/event/dlb2/pf/base/dlb2_resource.c
@@ -6397,6 +6397,9 @@ dlb2_verify_enable_cq_weight_args(struct dlb2_hw *hw,
 	struct dlb2_ldb_port *port;
 
 	if (hw->ver == DLB2_HW_V2) {
+		DLB2_HW_ERR(hw,
+			    "[%s():%d] CQ weight feature requires DLB 2.5 or later\n",
+			    __func__, __LINE__);
 		resp->status = DLB2_ST_FEATURE_UNAVAILABLE;
 		return -EINVAL;
 	}
-- 
2.25.1


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

* [PATCH v2 0/2] DLB2: cq_weight fixes
  2022-07-06 21:31 ` [PATCH 1/2] event/dlb2: fix cq_weight array overflow Timothy McDaniel
@ 2022-07-06 21:46   ` Timothy McDaniel
  2022-07-06 21:46     ` [PATCH v2 1/2] event/dlb2: fix cq_weight array overflow Timothy McDaniel
                       ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Timothy McDaniel @ 2022-07-06 21:46 UTC (permalink / raw)
  To: timothy.mcdaniel; +Cc: dev, jerinj, jerinjacobk, stable

This patch series contains the following:
- fix coverity issue 379234
- improve error reporting for cq_weight feature

Changes since V1
- fixed a repeated word in the commit message of patch 1

Timothy McDaniel (2):
  event/dlb2: fix cq_weight array overflow
  event/dlb2: improve cq_weight error messages

 drivers/event/dlb2/dlb2.c                  | 8 ++++----
 drivers/event/dlb2/dlb2_priv.h             | 2 +-
 drivers/event/dlb2/pf/base/dlb2_resource.c | 3 +++
 3 files changed, 8 insertions(+), 5 deletions(-)

-- 
2.25.1


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

* [PATCH v2 1/2] event/dlb2: fix cq_weight array overflow
  2022-07-06 21:46   ` [PATCH v2 0/2] DLB2: cq_weight fixes Timothy McDaniel
@ 2022-07-06 21:46     ` Timothy McDaniel
  2022-07-06 21:46     ` [PATCH v2 2/2] event/dlb2: improve cq_weight error messages Timothy McDaniel
  2022-07-08 14:26     ` [PATCH v2 0/2] DLB2: cq_weight fixes Thomas Monjalon
  2 siblings, 0 replies; 10+ messages in thread
From: Timothy McDaniel @ 2022-07-06 21:46 UTC (permalink / raw)
  To: timothy.mcdaniel; +Cc: dev, jerinj, jerinjacobk, stable

The cq_weight array must be sized for the maximum number
of eventdev ports, not the maximum number of DLB2
load balanced ports.

This commit fixes the above array sizing bug and resultant
coverity warning.

Coverity issue: 379234
Fixes: ffa46fc4a2b5 ("event/dlb2: support CQ weight")
Cc: stable@dpdk.org

Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
---
 drivers/event/dlb2/dlb2.c      | 4 ++--
 drivers/event/dlb2/dlb2_priv.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/event/dlb2/dlb2.c b/drivers/event/dlb2/dlb2.c
index 26af75beb8..93bf215762 100644
--- a/drivers/event/dlb2/dlb2.c
+++ b/drivers/event/dlb2/dlb2.c
@@ -137,7 +137,7 @@ set_cq_weight(const char *key __rte_unused,
 	 */
 	if (sscanf(value, "all:%d", &weight) == 1) {
 		first = 0;
-		last = DLB2_MAX_NUM_LDB_PORTS - 1;
+		last = DLB2_MAX_NUM_PORTS_ALL - 1;
 	} else if (sscanf(value, "%d-%d:%d", &first, &last, &weight) == 3) {
 		/* we have everything we need */
 	} else if (sscanf(value, "%d:%d", &first, &weight) == 2) {
@@ -148,7 +148,7 @@ set_cq_weight(const char *key __rte_unused,
 	}
 
 	if (first > last || first < 0 ||
-		last >= DLB2_MAX_NUM_LDB_PORTS) {
+		last >= DLB2_MAX_NUM_PORTS_ALL) {
 		DLB2_LOG_ERR("Error parsing ldb port qe weight arg, invalid port value\n");
 		return -EINVAL;
 	}
diff --git a/drivers/event/dlb2/dlb2_priv.h b/drivers/event/dlb2/dlb2_priv.h
index 1edea83a5b..db431f7d8b 100644
--- a/drivers/event/dlb2/dlb2_priv.h
+++ b/drivers/event/dlb2/dlb2_priv.h
@@ -641,7 +641,7 @@ struct dlb2_qid_depth_thresholds {
 };
 
 struct dlb2_cq_weight {
-	int limit[DLB2_MAX_NUM_LDB_PORTS];
+	int limit[DLB2_MAX_NUM_PORTS_ALL];
 };
 
 struct dlb2_port_cos {
-- 
2.25.1


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

* [PATCH v2 2/2] event/dlb2: improve cq_weight error messages
  2022-07-06 21:46   ` [PATCH v2 0/2] DLB2: cq_weight fixes Timothy McDaniel
  2022-07-06 21:46     ` [PATCH v2 1/2] event/dlb2: fix cq_weight array overflow Timothy McDaniel
@ 2022-07-06 21:46     ` Timothy McDaniel
  2022-07-08 14:26     ` [PATCH v2 0/2] DLB2: cq_weight fixes Thomas Monjalon
  2 siblings, 0 replies; 10+ messages in thread
From: Timothy McDaniel @ 2022-07-06 21:46 UTC (permalink / raw)
  To: timothy.mcdaniel; +Cc: dev, jerinj, jerinjacobk, stable

This commit changes 2 error messages to better
describe cq_weight related errors, should one occur.

Fixes: ffa46fc4a2b5 ("event/dlb2: support CQ weight")
Cc: stable@dpdk.org

Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
---
 drivers/event/dlb2/dlb2.c                  | 4 ++--
 drivers/event/dlb2/pf/base/dlb2_resource.c | 3 +++
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/event/dlb2/dlb2.c b/drivers/event/dlb2/dlb2.c
index 93bf215762..5a443acff8 100644
--- a/drivers/event/dlb2/dlb2.c
+++ b/drivers/event/dlb2/dlb2.c
@@ -1527,8 +1527,8 @@ dlb2_hw_create_ldb_port(struct dlb2_eventdev *dlb2,
 
 	if (dlb2->version == DLB2_HW_V2 && ev_port->cq_weight != 0 &&
 	    ev_port->cq_weight > dequeue_depth) {
-		DLB2_LOG_ERR("dlb2: invalid cq depth, must be >= cq weight%d\n",
-			     DLB2_MIN_ENQUEUE_DEPTH);
+		DLB2_LOG_ERR("dlb2: invalid cq dequeue depth %d, must be >= cq weight %d\n",
+			     dequeue_depth, ev_port->cq_weight);
 		return -EINVAL;
 	}
 
diff --git a/drivers/event/dlb2/pf/base/dlb2_resource.c b/drivers/event/dlb2/pf/base/dlb2_resource.c
index e73d289445..0731416a43 100644
--- a/drivers/event/dlb2/pf/base/dlb2_resource.c
+++ b/drivers/event/dlb2/pf/base/dlb2_resource.c
@@ -6397,6 +6397,9 @@ dlb2_verify_enable_cq_weight_args(struct dlb2_hw *hw,
 	struct dlb2_ldb_port *port;
 
 	if (hw->ver == DLB2_HW_V2) {
+		DLB2_HW_ERR(hw,
+			    "[%s():%d] CQ weight feature requires DLB 2.5 or later\n",
+			    __func__, __LINE__);
 		resp->status = DLB2_ST_FEATURE_UNAVAILABLE;
 		return -EINVAL;
 	}
-- 
2.25.1


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

* Re: [PATCH v2 0/2] DLB2: cq_weight fixes
  2022-07-06 21:46   ` [PATCH v2 0/2] DLB2: cq_weight fixes Timothy McDaniel
  2022-07-06 21:46     ` [PATCH v2 1/2] event/dlb2: fix cq_weight array overflow Timothy McDaniel
  2022-07-06 21:46     ` [PATCH v2 2/2] event/dlb2: improve cq_weight error messages Timothy McDaniel
@ 2022-07-08 14:26     ` Thomas Monjalon
  2022-07-08 15:02       ` McDaniel, Timothy
  2 siblings, 1 reply; 10+ messages in thread
From: Thomas Monjalon @ 2022-07-08 14:26 UTC (permalink / raw)
  To: Timothy McDaniel; +Cc: dev, jerinj, jerinjacobk, stable

06/07/2022 23:46, Timothy McDaniel:
> This patch series contains the following:
> - fix coverity issue 379234
> - improve error reporting for cq_weight feature
> 
> Changes since V1
> - fixed a repeated word in the commit message of patch 1
> 
> Timothy McDaniel (2):
>   event/dlb2: fix cq_weight array overflow
>   event/dlb2: improve cq_weight error messages

Should we merge those patches in 22.07-rc4? No risk?



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

* RE: [PATCH v2 0/2] DLB2: cq_weight fixes
  2022-07-08 14:26     ` [PATCH v2 0/2] DLB2: cq_weight fixes Thomas Monjalon
@ 2022-07-08 15:02       ` McDaniel, Timothy
  2022-07-11 20:30         ` Thomas Monjalon
  0 siblings, 1 reply; 10+ messages in thread
From: McDaniel, Timothy @ 2022-07-08 15:02 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev, jerinj, jerinjacobk, stable



> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Friday, July 8, 2022 9:26 AM
> To: McDaniel, Timothy <timothy.mcdaniel@intel.com>
> Cc: dev@dpdk.org; jerinj@marvell.com; jerinjacobk@gmail.com;
> stable@dpdk.org
> Subject: Re: [PATCH v2 0/2] DLB2: cq_weight fixes
> 
> 06/07/2022 23:46, Timothy McDaniel:
> > This patch series contains the following:
> > - fix coverity issue 379234
> > - improve error reporting for cq_weight feature
> >
> > Changes since V1
> > - fixed a repeated word in the commit message of patch 1
> >
> > Timothy McDaniel (2):
> >   event/dlb2: fix cq_weight array overflow
> >   event/dlb2: improve cq_weight error messages
> 
> Should we merge those patches in 22.07-rc4? No risk?

I see no risk in merging these changes. I retested with them, and one fixes a coverity issue.




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

* Re: [PATCH v2 0/2] DLB2: cq_weight fixes
  2022-07-08 15:02       ` McDaniel, Timothy
@ 2022-07-11 20:30         ` Thomas Monjalon
  2022-07-11 20:33           ` McDaniel, Timothy
  0 siblings, 1 reply; 10+ messages in thread
From: Thomas Monjalon @ 2022-07-11 20:30 UTC (permalink / raw)
  To: McDaniel, Timothy; +Cc: stable, dev, jerinj, jerinjacobk, stable

08/07/2022 17:02, McDaniel, Timothy:
> From: Thomas Monjalon <thomas@monjalon.net>
> > 06/07/2022 23:46, Timothy McDaniel:
> > > This patch series contains the following:
> > > - fix coverity issue 379234
> > > - improve error reporting for cq_weight feature
> > >
> > > Changes since V1
> > > - fixed a repeated word in the commit message of patch 1
> > >
> > > Timothy McDaniel (2):
> > >   event/dlb2: fix cq_weight array overflow
> > >   event/dlb2: improve cq_weight error messages
> > 
> > Should we merge those patches in 22.07-rc4? No risk?
> 
> I see no risk in merging these changes. I retested with them, and one fixes a coverity issue.

Applied, thanks.




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

* RE: [PATCH v2 0/2] DLB2: cq_weight fixes
  2022-07-11 20:30         ` Thomas Monjalon
@ 2022-07-11 20:33           ` McDaniel, Timothy
  0 siblings, 0 replies; 10+ messages in thread
From: McDaniel, Timothy @ 2022-07-11 20:33 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: stable, dev, jerinj, jerinjacobk, stable



> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Monday, July 11, 2022 3:31 PM
> To: McDaniel, Timothy <timothy.mcdaniel@intel.com>
> Cc: stable@dpdk.org; dev@dpdk.org; jerinj@marvell.com;
> jerinjacobk@gmail.com; stable@dpdk.org
> Subject: Re: [PATCH v2 0/2] DLB2: cq_weight fixes
> 
> 08/07/2022 17:02, McDaniel, Timothy:
> > From: Thomas Monjalon <thomas@monjalon.net>
> > > 06/07/2022 23:46, Timothy McDaniel:
> > > > This patch series contains the following:
> > > > - fix coverity issue 379234
> > > > - improve error reporting for cq_weight feature
> > > >
> > > > Changes since V1
> > > > - fixed a repeated word in the commit message of patch 1
> > > >
> > > > Timothy McDaniel (2):
> > > >   event/dlb2: fix cq_weight array overflow
> > > >   event/dlb2: improve cq_weight error messages
> > >
> > > Should we merge those patches in 22.07-rc4? No risk?
> >
> > I see no risk in merging these changes. I retested with them, and one fixes a
> coverity issue.
> 
> Applied, thanks.
> 

Thank you, Thomas!

--Tim


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

end of thread, other threads:[~2022-07-11 20:33 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-06 21:31 [PATCH 0/2] DLB2: cq_weight fixes Timothy McDaniel
2022-07-06 21:31 ` [PATCH 1/2] event/dlb2: fix cq_weight array overflow Timothy McDaniel
2022-07-06 21:46   ` [PATCH v2 0/2] DLB2: cq_weight fixes Timothy McDaniel
2022-07-06 21:46     ` [PATCH v2 1/2] event/dlb2: fix cq_weight array overflow Timothy McDaniel
2022-07-06 21:46     ` [PATCH v2 2/2] event/dlb2: improve cq_weight error messages Timothy McDaniel
2022-07-08 14:26     ` [PATCH v2 0/2] DLB2: cq_weight fixes Thomas Monjalon
2022-07-08 15:02       ` McDaniel, Timothy
2022-07-11 20:30         ` Thomas Monjalon
2022-07-11 20:33           ` McDaniel, Timothy
2022-07-06 21:31 ` [PATCH 2/2] event/dlb2: improve cq_weight error messages Timothy McDaniel

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