DLB2: cq_weight fixes
cover DLB2: cq_weight fixes
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(-)
Signature · 1 line
2.25.1
PATCH 1/2 event/dlb2: fix cq_weight array overflow
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
--- drivers/event/dlb2/dlb2.c | 4 ++-- drivers/event/dlb2/dlb2_priv.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/event/dlb2/dlb2.c +2 -2
@@ -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 ; }
drivers/event/dlb2/dlb2_priv.h +1 -1
@@ -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 {
Signature · 1 line
2.25.1
v2 cover DLB2: cq_weight fixes
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(-)
Signature · 1 line
2.25.1
PATCH v2 1/2 event/dlb2: fix cq_weight array overflow
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
--- drivers/event/dlb2/dlb2.c | 4 ++-- drivers/event/dlb2/dlb2_priv.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/event/dlb2/dlb2.c +2 -2
@@ -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 ; }
drivers/event/dlb2/dlb2_priv.h +1 -1
@@ -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 {
Signature · 1 line
2.25.1
PATCH v2 2/2 event/dlb2: improve cq_weight error messages
In reply to Timothy McDanielThis commit changes 2 error messages to better describe cq_weight related errors, should one occur.
--- drivers/event/dlb2/dlb2.c | 4 ++-- drivers/event/dlb2/pf/base/dlb2_resource.c | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-)
drivers/event/dlb2/dlb2.c +2 -2
@@ -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 ; }
drivers/event/dlb2/pf/base/dlb2_resource.c +3 -0
@@ -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 ; }
Signature · 1 line
2.25.1
06/07/2022 23:46, Timothy McDaniel:
Quoted 10 lines
This patch series contains the following:
- fix coverity issue 379234
- improve error reporting forcq_weightfeatureChanges since V1
- fixed a repeated word in the commit message of patch 1Timothy McDaniel (2):
event/dlb2: fixcq_weightarray overflow
event/dlb2: improvecq_weighterror messages
Should we merge those patches in 22.07-rc4? No risk?
Quoted 15 lines
-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Friday, July 8, 2022 9:26 AM
To: McDaniel, Timothy <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH v2 0/2] DLB2:cq_weightfixes06/07/2022 23:46, Timothy McDaniel:
Quoted 4 lines
This patch series contains the following:
- fix coverity issue 379234
- improve error reporting forcq_weightfeature
Quoted 8 lines
Quoted 6 lines
Changes since V1
- fixed a repeated word in the commit message of patch 1Timothy McDaniel (2):
event/dlb2: fixcq_weightarray overflow
event/dlb2: improvecq_weighterror messagesShould 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.
Thomas Monjalon
Applied08/07/2022 17:02, McDaniel, Timothy:
Quoted 9 lines
From: Thomas Monjalon <[email protected]>
Quoted 8 lines
06/07/2022 23:46, Timothy McDaniel:
Quoted 7 lines
This patch series contains the following:
- fix coverity issue 379234
- improve error reporting forcq_weightfeatureChanges since V1
- fixed a repeated word in the commit message of patch 1
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Timothy McDaniel (2):
event/dlb2: fixcq_weightarray overflow
event/dlb2: improvecq_weighterror messagesShould 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.
Quoted 24 lines
-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Monday, July 11, 2022 3:31 PM
To: McDaniel, Timothy <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH v2 0/2] DLB2:cq_weightfixes08/07/2022 17:02, McDaniel, Timothy:
Quoted 13 lines
From: Thomas Monjalon <[email protected]>
Quoted 12 lines
06/07/2022 23:46, Timothy McDaniel:
Quoted 10 lines
This patch series contains the following:
- fix coverity issue 379234
- improve error reporting forcq_weightfeatureChanges since V1
- fixed a repeated word in the commit message of patch 1Timothy McDaniel (2):
event/dlb2: fixcq_weightarray overflow
event/dlb2: improvecq_weighterror messages
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
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
PATCH 2/2 event/dlb2: improve cq_weight error messages
In reply to Timothy McDanielThis commit changes 2 error messages to better describe cq_weight related errors, should one occur.
--- drivers/event/dlb2/dlb2.c | 4 ++-- drivers/event/dlb2/pf/base/dlb2_resource.c | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-)
drivers/event/dlb2/dlb2.c +2 -2
@@ -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 ; }
drivers/event/dlb2/pf/base/dlb2_resource.c +3 -0
@@ -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 ; }
Signature · 1 line
2.25.1