examples/ipsec-secgw: fix Rx queue ID in Rx callback

Message ID 20240311023247.2520028-1-chaoyong.he@corigine.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series examples/ipsec-secgw: fix Rx queue ID in Rx callback |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/github-robot: build success github build: passed
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-unit-amd64-testing fail Testing issues
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS

Commit Message

Chaoyong He March 11, 2024, 2:32 a.m. UTC
  From: Shihong Wang <shihong.wang@corigine.com>

The Rx queue ID on the core and on the port are not necessarily
equal, for example, there are two RX queues on core0, queue0 and
queue1, queue0 is the rx_queueid0 on port0 and queue1 is the
rx_queueid0 on port1.

The 'rte_eth_add_rx_callback()' function is based on the port
registration callback function, so should be the RX queue ID on
the port.

Fixes: d04bb1c52647 ("examples/ipsec-secgw: use HW parsed packet type in poll mode")
Cc: stable@dpdk.org
Cc: Akhil Goyal <gakhil@marvell.com>
Cc: Radu Nicolau <radu.nicolau@intel.com>

Signed-off-by: Shihong Wang <shihong.wang@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
---
 examples/ipsec-secgw/ipsec-secgw.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Thomas Monjalon March 18, 2024, 3:20 a.m. UTC | #1
11/03/2024 03:32, Chaoyong He:
> From: Shihong Wang <shihong.wang@corigine.com>
> 
> The Rx queue ID on the core and on the port are not necessarily
> equal, for example, there are two RX queues on core0, queue0 and
> queue1, queue0 is the rx_queueid0 on port0 and queue1 is the
> rx_queueid0 on port1.
> 
> The 'rte_eth_add_rx_callback()' function is based on the port
> registration callback function, so should be the RX queue ID on
> the port.
> 
> Fixes: d04bb1c52647 ("examples/ipsec-secgw: use HW parsed packet type in poll mode")
> Cc: stable@dpdk.org
> Cc: Akhil Goyal <gakhil@marvell.com>
> Cc: Radu Nicolau <radu.nicolau@intel.com>
> 
> Signed-off-by: Shihong Wang <shihong.wang@corigine.com>
> Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
> Reviewed-by: Peng Zhang <peng.zhang@corigine.com>

Applied, thanks.
  

Patch

diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c
index a61bea400a..45a303850d 100644
--- a/examples/ipsec-secgw/ipsec-secgw.c
+++ b/examples/ipsec-secgw/ipsec-secgw.c
@@ -2093,10 +2093,10 @@  port_init(uint16_t portid, uint64_t req_rx_offloads, uint64_t req_tx_offloads,
 
 			/* Register Rx callback if ptypes are not supported */
 			if (!ptype_supported &&
-			    !rte_eth_add_rx_callback(portid, queue,
+			    !rte_eth_add_rx_callback(portid, rx_queueid,
 						     parse_ptype_cb, NULL)) {
 				printf("Failed to add rx callback: port=%d, "
-				       "queue=%d\n", portid, queue);
+				       "rx_queueid=%d\n", portid, rx_queueid);
 			}