[v3,2/2] net/cpfl: fix +ve error codes for received ctlq messages

Message ID 20240705083032.2756071-3-soumyadeep.hore@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Bruce Richardson
Headers
Series Avoid rule duplication in CPFL PMD |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/github-robot: build success github build: passed
ci/intel-Functional success Functional PASS
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS

Commit Message

Soumyadeep Hore July 5, 2024, 8:30 a.m. UTC
Previously error codes were only -ve for
cpfl_receive_ctlq_msg() but now there are +ve error codes.
Hence code changes are made accordingly.

Fixes: db042ef09d26 ("net/cpfl: implement FXP rule creation and destroying")
Cc: stable@dpdk.org

Signed-off-by: Soumyadeep Hore <soumyadeep.hore@intel.com>
---
 drivers/net/cpfl/cpfl_flow_engine_fxp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Bruce Richardson July 5, 2024, 2:47 p.m. UTC | #1
On Fri, Jul 05, 2024 at 01:05:13PM +0000, Soumyadeep Hore wrote:
> This patchset avoids flow rule duplication which was possible
> previously in CPFL PMD.
> 
> ---
> v4:
> * Addressed pending review comments
> ---
> v3:
> * Addressed pending review comments
> ---
> v2:
> * Addressed review comments
> * Added Fixes tags
> * Fixed CI warnings
> ---
> 
> Soumyadeep Hore (2):
>   net/cpfl: fix check for opcodes of received ctlq messages
>   net/cpfl: fix +ve error codes for received ctlq messages
> 

Following discussion with the author, I've applied these two patches and
squashed them back into a single commit since both are needed together,
with the patch 2 being required because of the patch 1 changes - something
I missed on initial review.

Patches Acked-by: Bruce Richardson <bruce.richardson@intel.com>

Applied to dpdk-next-net-intel, with suggested minor changes.

Thanks,
/Bruce
  

Patch

diff --git a/drivers/net/cpfl/cpfl_flow_engine_fxp.c b/drivers/net/cpfl/cpfl_flow_engine_fxp.c
index 39a281fa61..b9e825ef57 100644
--- a/drivers/net/cpfl/cpfl_flow_engine_fxp.c
+++ b/drivers/net/cpfl/cpfl_flow_engine_fxp.c
@@ -95,7 +95,7 @@  cpfl_fxp_create(struct rte_eth_dev *dev,
 
 	ret = cpfl_rule_process(itf, ad->ctlqp[cpq_id], ad->ctlqp[cpq_id + 1],
 				rim->rules, rim->rule_num, true);
-	if (ret < 0) {
+	if (ret != 0) {
 		rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_HANDLE, NULL,
 				   "cpfl filter create flow fail");
 		rte_free(rim);