From: Gagandeep Singh Date: Mon, 25 Jan 2021 08:15:33 +0000 (+0800) Subject: test/ipsec: fix result code for not supported X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=8dda080a0938e527c95ace0f3203a239edec48f5;p=dpdk.git test/ipsec: fix result code for not supported During SA creation, if the required algorithm is not supported, drivers can return ENOTSUP. But in most of the IPsec test cases, if the SA creation does not success, it just returns TEST_FAILED. This patch fixes this issue by returning the actual return values from the driver to the application, so that it can make decisions whether the test case is passed, failed or unsupported. Fixes: 05fe65eb66b2 ("test/ipsec: introduce functional test") Cc: stable@dpdk.org Signed-off-by: Gagandeep Singh Acked-by: Akhil Goyal --- diff --git a/app/test/test_ipsec.c b/app/test/test_ipsec.c index 9ad07a1790..d18220a885 100644 --- a/app/test/test_ipsec.c +++ b/app/test/test_ipsec.c @@ -744,7 +744,7 @@ create_sa(enum rte_security_session_action_type action_type, ut->ss[j].type = action_type; rc = create_session(ut, &ts->qp_conf, ts->valid_dev, j); if (rc != 0) - return TEST_FAILED; + return rc; rc = rte_ipsec_sa_init(ut->ss[j].sa, &ut->sa_prm, sz); rc = (rc > 0 && (uint32_t)rc <= sz) ? 0 : -EINVAL; @@ -1247,7 +1247,7 @@ test_ipsec_crypto_inb_burst_null_null(int i) test_cfg[i].replay_win_sz, test_cfg[i].flags, 0); if (rc != 0) { RTE_LOG(ERR, USER1, "create_sa failed, cfg %d\n", i); - return TEST_FAILED; + return rc; } /* Generate test mbuf data */ @@ -1349,7 +1349,7 @@ test_ipsec_crypto_outb_burst_null_null(int i) test_cfg[i].replay_win_sz, test_cfg[i].flags, 0); if (rc != 0) { RTE_LOG(ERR, USER1, "create_sa failed, cfg %d\n", i); - return TEST_FAILED; + return rc; } /* Generate input mbuf data */ @@ -1458,7 +1458,7 @@ test_ipsec_inline_crypto_inb_burst_null_null(int i) test_cfg[i].replay_win_sz, test_cfg[i].flags, 0); if (rc != 0) { RTE_LOG(ERR, USER1, "create_sa failed, cfg %d\n", i); - return TEST_FAILED; + return rc; } /* Generate inbound mbuf data */ @@ -1536,7 +1536,7 @@ test_ipsec_inline_proto_inb_burst_null_null(int i) test_cfg[i].replay_win_sz, test_cfg[i].flags, 0); if (rc != 0) { RTE_LOG(ERR, USER1, "create_sa failed, cfg %d\n", i); - return TEST_FAILED; + return rc; } /* Generate inbound mbuf data */ @@ -1644,7 +1644,7 @@ test_ipsec_inline_crypto_outb_burst_null_null(int i) test_cfg[i].replay_win_sz, test_cfg[i].flags, 0); if (rc != 0) { RTE_LOG(ERR, USER1, "create_sa failed, cfg %d\n", i); - return TEST_FAILED; + return rc; } /* Generate test mbuf data */ @@ -1722,7 +1722,7 @@ test_ipsec_inline_proto_outb_burst_null_null(int i) test_cfg[i].replay_win_sz, test_cfg[i].flags, 0); if (rc != 0) { RTE_LOG(ERR, USER1, "create_sa failed, cfg %d\n", i); - return TEST_FAILED; + return rc; } /* Generate test mbuf data */ @@ -1798,7 +1798,7 @@ test_ipsec_lksd_proto_inb_burst_null_null(int i) test_cfg[i].replay_win_sz, test_cfg[i].flags, 0); if (rc != 0) { RTE_LOG(ERR, USER1, "create_sa failed, cfg %d\n", i); - return TEST_FAILED; + return rc; } /* Generate test mbuf data */ @@ -1911,7 +1911,7 @@ test_ipsec_replay_inb_inside_null_null(int i) test_cfg[i].replay_win_sz, test_cfg[i].flags, 0); if (rc != 0) { RTE_LOG(ERR, USER1, "create_sa failed, cfg %d\n", i); - return TEST_FAILED; + return rc; } /* Generate inbound mbuf data */ @@ -2004,7 +2004,7 @@ test_ipsec_replay_inb_outside_null_null(int i) test_cfg[i].replay_win_sz, test_cfg[i].flags, 0); if (rc != 0) { RTE_LOG(ERR, USER1, "create_sa failed, cfg %d\n", i); - return TEST_FAILED; + return rc; } /* Generate test mbuf data */ @@ -2104,7 +2104,7 @@ test_ipsec_replay_inb_repeat_null_null(int i) test_cfg[i].replay_win_sz, test_cfg[i].flags, 0); if (rc != 0) { RTE_LOG(ERR, USER1, "create_sa failed, cfg %d\n", i); - return TEST_FAILED; + return rc; } /* Generate test mbuf data */ @@ -2205,7 +2205,7 @@ test_ipsec_replay_inb_inside_burst_null_null(int i) test_cfg[i].replay_win_sz, test_cfg[i].flags, 0); if (rc != 0) { RTE_LOG(ERR, USER1, "create_sa failed, cfg %d\n", i); - return TEST_FAILED; + return rc; } /* Generate inbound mbuf data */ @@ -2338,7 +2338,7 @@ test_ipsec_crypto_inb_burst_2sa_null_null(int i) test_cfg[i].replay_win_sz, test_cfg[i].flags, 0); if (rc != 0) { RTE_LOG(ERR, USER1, "create_sa 0 failed, cfg %d\n", i); - return TEST_FAILED; + return rc; } /* create second rte_ipsec_sa */ @@ -2348,7 +2348,7 @@ test_ipsec_crypto_inb_burst_2sa_null_null(int i) if (rc != 0) { RTE_LOG(ERR, USER1, "create_sa 1 failed, cfg %d\n", i); destroy_sa(0); - return TEST_FAILED; + return rc; } /* Generate test mbuf data */ @@ -2424,7 +2424,7 @@ test_ipsec_crypto_inb_burst_2sa_4grp_null_null(int i) test_cfg[i].replay_win_sz, test_cfg[i].flags, 0); if (rc != 0) { RTE_LOG(ERR, USER1, "create_sa 0 failed, cfg %d\n", i); - return TEST_FAILED; + return rc; } /* create second rte_ipsec_sa */ @@ -2434,7 +2434,7 @@ test_ipsec_crypto_inb_burst_2sa_4grp_null_null(int i) if (rc != 0) { RTE_LOG(ERR, USER1, "create_sa 1 failed, cfg %d\n", i); destroy_sa(0); - return TEST_FAILED; + return rc; } /* Generate test mbuf data */