* [PATCH] test/security: check MACSEC offload before configuration
@ 2025-01-24 18:22 Akhil Goyal
2025-02-06 12:36 ` Akhil Goyal
0 siblings, 1 reply; 2+ messages in thread
From: Akhil Goyal @ 2025-01-24 18:22 UTC (permalink / raw)
To: dev; +Cc: Akhil Goyal
rte_ethdev_dev_configure need application to check the
device info if the offload flags are supported or not.
Added check to verify MACsec is supported before configuring
ethernet inline device.
Signed-off-by: Akhil Goyal <gakhil@marvell.com>
---
app/test/test_security_inline_macsec.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/app/test/test_security_inline_macsec.c b/app/test/test_security_inline_macsec.c
index c921bf8ebb..4043667701 100644
--- a/app/test/test_security_inline_macsec.c
+++ b/app/test/test_security_inline_macsec.c
@@ -2358,6 +2358,7 @@ ut_teardown_inline_macsec(void)
static int
inline_macsec_testsuite_setup(void)
{
+ struct rte_eth_dev_info dev_info;
uint16_t nb_rxd;
uint16_t nb_txd;
uint16_t nb_ports;
@@ -2400,6 +2401,19 @@ inline_macsec_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;
+ }
+
+ if ((dev_info.rx_offload_capa & RTE_ETH_RX_OFFLOAD_MACSEC_STRIP) !=
+ RTE_ETH_RX_OFFLOAD_MACSEC_STRIP ||
+ (dev_info.tx_offload_capa & RTE_ETH_TX_OFFLOAD_MACSEC_INSERT) !=
+ RTE_ETH_TX_OFFLOAD_MACSEC_INSERT) {
+ printf("Device does not support MACsec\n");
+ return TEST_SKIPPED;
+ }
+
/* port configure */
ret = rte_eth_dev_configure(port_id, nb_rx_queue,
nb_tx_queue, &port_conf);
--
2.25.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* RE: [PATCH] test/security: check MACSEC offload before configuration
2025-01-24 18:22 [PATCH] test/security: check MACSEC offload before configuration Akhil Goyal
@ 2025-02-06 12:36 ` Akhil Goyal
0 siblings, 0 replies; 2+ messages in thread
From: Akhil Goyal @ 2025-02-06 12:36 UTC (permalink / raw)
To: Akhil Goyal, dev
> -----Original Message-----
> From: Akhil Goyal <gakhil@marvell.com>
> Sent: Friday, January 24, 2025 11:53 PM
> To: dev@dpdk.org
> Cc: Akhil Goyal <gakhil@marvell.com>
> Subject: [PATCH] test/security: check MACSEC offload before configuration
>
> rte_ethdev_dev_configure need application to check the
> device info if the offload flags are supported or not.
> Added check to verify MACsec is supported before configuring
> ethernet inline device.
>
> Signed-off-by: Akhil Goyal <gakhil@marvell.com>
Applied to dpdk-next-crypto
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-02-06 12:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-24 18:22 [PATCH] test/security: check MACSEC offload before configuration Akhil Goyal
2025-02-06 12:36 ` Akhil Goyal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).