[v2,3/6] test/security: update antireplay unit test for event mode

Message ID 20221021072651.1985340-4-ktejasree@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series update autotest with new algorithms |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Tejasree Kondoj Oct. 21, 2022, 7:26 a.m. UTC
  From: Vidya Sagar Velumuri <vvelumuri@marvell.com>

With event mode is enabled, send and receive packets via event dev

Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
---
 app/test/test_security_inline_proto.c | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)
  

Patch

diff --git a/app/test/test_security_inline_proto.c b/app/test/test_security_inline_proto.c
index feef54f538..700ed3844b 100644
--- a/app/test/test_security_inline_proto.c
+++ b/app/test/test_security_inline_proto.c
@@ -1378,8 +1378,13 @@  test_ipsec_inline_proto_process_with_esn(struct ipsec_test_data td[],
 						tx_pkt, NULL);
 			tx_pkt->ol_flags |= RTE_MBUF_F_TX_SEC_OFFLOAD;
 		}
+
 		/* Send packet to ethdev for inline IPsec processing. */
-		nb_sent = rte_eth_tx_burst(port_id, 0, &tx_pkt, 1);
+		if (event_mode_enabled)
+			nb_sent = event_tx_burst(&tx_pkt, 1);
+		else
+			nb_sent = rte_eth_tx_burst(port_id, 0, &tx_pkt, 1);
+
 		if (nb_sent != 1) {
 			printf("\nUnable to TX packets");
 			rte_pktmbuf_free(tx_pkt);
@@ -1390,11 +1395,14 @@  test_ipsec_inline_proto_process_with_esn(struct ipsec_test_data td[],
 		rte_pause();
 
 		/* Receive back packet on loopback interface. */
-		do {
-			rte_delay_ms(1);
-			nb_rx = rte_eth_rx_burst(port_id, 0, &rx_pkt, 1);
-		} while (nb_rx == 0);
-
+		if (event_mode_enabled)
+			nb_rx = event_rx_burst(&rx_pkt, nb_sent);
+		else {
+			do {
+				rte_delay_ms(1);
+				nb_rx = rte_eth_rx_burst(port_id, 0, &rx_pkt, 1);
+			} while (nb_rx == 0);
+		}
 		rte_pktmbuf_adj(rx_pkt, RTE_ETHER_HDR_LEN);
 
 		if (res_d != NULL)