* [PATCH 1/3] test/security_inline_proto: remove fast-free Tx flag
2026-06-22 11:18 [PATCH 0/3] Fixes for inline ipsec test cases Bruce Richardson
@ 2026-06-22 11:18 ` Bruce Richardson
2026-06-22 11:18 ` [PATCH 2/3] test/security_inline_proto: fix MTU calculation underflow Bruce Richardson
2026-06-22 11:18 ` [PATCH 3/3] test/security_inline_proto: check for capabilities Bruce Richardson
2 siblings, 0 replies; 4+ messages in thread
From: Bruce Richardson @ 2026-06-22 11:18 UTC (permalink / raw)
To: dev
Cc: Bruce Richardson, stable, Akhil Goyal, Anoob Joseph,
Nithin Dabilpuram, Fan Zhang
The FAST_FREE Tx offload flag is an optimization that may not be
supported by all drivers, but the test unconditionally sets this as part
of the Tx config. Since it's an optimization that should not affect test
correctness, and since this is a unit test, not perf test, just remove
the flag.
Fixes: 86e2487c5f2c ("test/security: add cases for inline IPsec offload")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
app/test/test_security_inline_proto.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/app/test/test_security_inline_proto.c b/app/test/test_security_inline_proto.c
index b0cce5ebd9..bc3ef54f71 100644
--- a/app/test/test_security_inline_proto.c
+++ b/app/test/test_security_inline_proto.c
@@ -94,8 +94,7 @@ static struct rte_eth_conf port_conf = {
},
.txmode = {
.mq_mode = RTE_ETH_MQ_TX_NONE,
- .offloads = RTE_ETH_TX_OFFLOAD_SECURITY |
- RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE,
+ .offloads = RTE_ETH_TX_OFFLOAD_SECURITY,
},
.lpbk_mode = 1, /* enable loopback */
};
--
2.53.0
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH 2/3] test/security_inline_proto: fix MTU calculation underflow
2026-06-22 11:18 [PATCH 0/3] Fixes for inline ipsec test cases Bruce Richardson
2026-06-22 11:18 ` [PATCH 1/3] test/security_inline_proto: remove fast-free Tx flag Bruce Richardson
@ 2026-06-22 11:18 ` Bruce Richardson
2026-06-22 11:18 ` [PATCH 3/3] test/security_inline_proto: check for capabilities Bruce Richardson
2 siblings, 0 replies; 4+ messages in thread
From: Bruce Richardson @ 2026-06-22 11:18 UTC (permalink / raw)
To: dev; +Cc: Bruce Richardson, stable, Akhil Goyal, Anoob Joseph,
Nithin Dabilpuram
When testing with some NICs it was observed that the max MTU calculation
could underflow. Despite the RTE_MIN, due to integer promotion, this
lead to the configuring of the port with an excessively large, invalid
value. For example, if lim_nb_seg_max == 0, that meant that
max_data_room - 256 is -256 for comparison purposes using standard
integers (promoted from uint16_t). That is lower than the max mtu so the
-256 value is chosen, which becomes >65000 when converted back to
uint16_t.
Fix this by a) checking for seg_max == 0 b) doing calculations using
uint32_t and c) checking explicitly for underflow before subtracting.
Fixes: 3edd1197a605 ("test/security: add multi-segment inline IPsec cases")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
app/test/test_security_inline_proto.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/app/test/test_security_inline_proto.c b/app/test/test_security_inline_proto.c
index bc3ef54f71..81fce7364c 100644
--- a/app/test/test_security_inline_proto.c
+++ b/app/test/test_security_inline_proto.c
@@ -2045,8 +2045,19 @@ inline_ipsec_testsuite_setup(void)
memcpy(&local_port_conf, &port_conf, sizeof(port_conf));
/* Add Multi seg flags */
if (sg_mode) {
- uint16_t max_data_room = RTE_MBUF_DEFAULT_DATAROOM *
- dev_info.rx_desc_lim.nb_seg_max;
+ uint32_t max_data_room;
+
+ if (dev_info.rx_desc_lim.nb_seg_max == 0) {
+ printf("SG mode unsupported: invalid max Rx segments (0)\n");
+ return TEST_SKIPPED;
+ }
+
+ max_data_room = RTE_MBUF_DEFAULT_DATAROOM * dev_info.rx_desc_lim.nb_seg_max;
+ if (max_data_room <= 256) {
+ printf("SG mode unsupported: max data room (%u) too small\n",
+ max_data_room);
+ return TEST_SKIPPED;
+ }
local_port_conf.rxmode.offloads |= RTE_ETH_RX_OFFLOAD_SCATTER;
local_port_conf.txmode.offloads |= RTE_ETH_TX_OFFLOAD_MULTI_SEGS;
--
2.53.0
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH 3/3] test/security_inline_proto: check for capabilities
2026-06-22 11:18 [PATCH 0/3] Fixes for inline ipsec test cases Bruce Richardson
2026-06-22 11:18 ` [PATCH 1/3] test/security_inline_proto: remove fast-free Tx flag Bruce Richardson
2026-06-22 11:18 ` [PATCH 2/3] test/security_inline_proto: fix MTU calculation underflow Bruce Richardson
@ 2026-06-22 11:18 ` Bruce Richardson
2 siblings, 0 replies; 4+ messages in thread
From: Bruce Richardson @ 2026-06-22 11:18 UTC (permalink / raw)
To: dev
Cc: Bruce Richardson, stable, Akhil Goyal, Anoob Joseph,
Nithin Dabilpuram, Fan Zhang
Skip the test cases when the HW doesn't support the necessary offloads,
skipping the whole suite if necessary, e.g. if no IPsec capabilities are
present. For event-based tests, skip those if no eventdev is present.
Fixes: 86e2487c5f2c ("test/security: add cases for inline IPsec offload")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
app/test/test_security_inline_proto.c | 57 ++++++++++++++++++++++++++-
1 file changed, 56 insertions(+), 1 deletion(-)
diff --git a/app/test/test_security_inline_proto.c b/app/test/test_security_inline_proto.c
index 81fce7364c..2e1ee17078 100644
--- a/app/test/test_security_inline_proto.c
+++ b/app/test/test_security_inline_proto.c
@@ -2043,10 +2043,25 @@ inline_ipsec_testsuite_setup(void)
}
memcpy(&local_port_conf, &port_conf, sizeof(port_conf));
+ local_port_conf.rxmode.offloads &= dev_info.rx_offload_capa;
+ local_port_conf.txmode.offloads &= dev_info.tx_offload_capa;
+
+ if (!(local_port_conf.rxmode.offloads & RTE_ETH_RX_OFFLOAD_SECURITY) ||
+ !(local_port_conf.txmode.offloads & RTE_ETH_TX_OFFLOAD_SECURITY)) {
+ printf("Inline IPsec unsupported: required security offloads are missing\n");
+ return TEST_SKIPPED;
+ }
+
/* Add Multi seg flags */
if (sg_mode) {
uint32_t max_data_room;
+ if (!(dev_info.rx_offload_capa & RTE_ETH_RX_OFFLOAD_SCATTER) ||
+ !(dev_info.tx_offload_capa & RTE_ETH_TX_OFFLOAD_MULTI_SEGS)) {
+ printf("SG mode unsupported: required scatter or multi-seg offloads are missing\n");
+ return TEST_SKIPPED;
+ }
+
if (dev_info.rx_desc_lim.nb_seg_max == 0) {
printf("SG mode unsupported: invalid max Rx segments (0)\n");
return TEST_SKIPPED;
@@ -2112,6 +2127,25 @@ inline_ipsec_testsuite_setup(void)
plaintext_len = 0;
}
+ /* Check that at least one inline IPsec capability is registered */
+ void *sec_ctx = rte_eth_dev_get_sec_ctx(port_id);
+ const struct rte_security_capability *cap;
+
+ if (sec_ctx == NULL) {
+ printf("No security context on port %d\n", port_id);
+ return TEST_SKIPPED;
+ }
+ for (cap = rte_security_capabilities_get(sec_ctx);
+ cap != NULL && cap->action != RTE_SECURITY_ACTION_TYPE_NONE; cap++) {
+ if (cap->action == RTE_SECURITY_ACTION_TYPE_INLINE_PROTOCOL &&
+ cap->protocol == RTE_SECURITY_PROTOCOL_IPSEC)
+ break;
+ }
+ if (cap == NULL || cap->action == RTE_SECURITY_ACTION_TYPE_NONE) {
+ printf("No inline IPsec capabilities registered\n");
+ return TEST_SKIPPED;
+ }
+
return 0;
}
@@ -2140,6 +2174,8 @@ event_inline_ipsec_testsuite_setup(void)
struct rte_event_dev_config eventdev_conf = {0};
struct rte_event_queue_conf eventq_conf = {0};
struct rte_event_port_conf ev_port_conf = {0};
+ struct rte_eth_conf local_port_conf;
+ struct rte_eth_dev_info dev_info;
const uint16_t nb_txd = 1024, nb_rxd = 1024;
uint16_t nb_rx_queue = 1, nb_tx_queue = 1;
uint8_t ev_queue_id = 0, tx_queue_id = 0;
@@ -2151,6 +2187,11 @@ event_inline_ipsec_testsuite_setup(void)
printf("Start event inline IPsec test.\n");
+ if (rte_event_dev_count() == 0) {
+ printf("Event inline IPsec unsupported: no event devices available\n");
+ return TEST_SKIPPED;
+ }
+
nb_ports = rte_eth_dev_count_avail();
if (nb_ports == 0) {
printf("Test require: 1 port, available: 0\n");
@@ -2182,9 +2223,23 @@ event_inline_ipsec_testsuite_setup(void)
/* configuring port 0 for the test is enough */
port_id = 0;
+ if (rte_eth_dev_info_get(port_id, &dev_info)) {
+ printf("Failed to get devinfo");
+ return -1;
+ }
+
+ memcpy(&local_port_conf, &port_conf, sizeof(port_conf));
+ local_port_conf.rxmode.offloads &= dev_info.rx_offload_capa;
+ local_port_conf.txmode.offloads &= dev_info.tx_offload_capa;
+ if ((local_port_conf.rxmode.offloads & RTE_ETH_RX_OFFLOAD_SECURITY) == 0 ||
+ (local_port_conf.txmode.offloads & RTE_ETH_TX_OFFLOAD_SECURITY) == 0) {
+ printf("Event inline IPsec unsupported: required security offloads are missing\n");
+ return TEST_SKIPPED;
+ }
+
/* port configure */
ret = rte_eth_dev_configure(port_id, nb_rx_queue,
- nb_tx_queue, &port_conf);
+ nb_tx_queue, &local_port_conf);
if (ret < 0) {
printf("Cannot configure device: err=%d, port=%d\n",
ret, port_id);
--
2.53.0
^ permalink raw reply related [flat|nested] 4+ messages in thread