From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id CA23346128; Fri, 24 Jan 2025 19:22:43 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A710E40BA0; Fri, 24 Jan 2025 19:22:43 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id CFC664028A for ; Fri, 24 Jan 2025 19:22:41 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 50OGG1sw032229 for ; Fri, 24 Jan 2025 10:22:41 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=pfpt0220; bh=Yy4shqqh0J+18yA/w6sCBA6 sSvplbzJt5kfy4gHyF4A=; b=EJOzZH2egLxeeuhCd9huL5WnbEwcC2wNJQP15EZ n94V7NxwCcifFAMdA/GJToyGZNdZy7A5gQhhhvUpMqnWrgpDsfivNeE5fn8Sxgb0 yN3Om7lO9broXfw3U/0Du1a6wDeF9FaPqjjYdurVPSJFWi7+NzHlfOgvGqpHPLqI BLNk8UCvG7Uyed7pjju8wZ/xAem046OINO1sqe5OHmp56VuOPKS9egqnpNe4olKo urG/XzPTHeWVaBMnuxwSwh9zk8ezr8z+Df8+wvsrUAgRuvEvK282N42wEfxXPJeI hRAsWK3ajHRTaFQGZjb94kq03OeCXV/vemiG6y5dwGhjilg== Received: from dc5-exch05.marvell.com ([199.233.59.128]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 44ce6xg7pr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 24 Jan 2025 10:22:40 -0800 (PST) Received: from DC5-EXCH05.marvell.com (10.69.176.209) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Fri, 24 Jan 2025 10:22:39 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Fri, 24 Jan 2025 10:22:39 -0800 Received: from cavium-SR1-T640.marvell.com (unknown [10.28.36.102]) by maili.marvell.com (Postfix) with ESMTP id 6B8125B6934; Fri, 24 Jan 2025 10:22:38 -0800 (PST) From: Akhil Goyal To: CC: Akhil Goyal Subject: [PATCH] test/security: check MACSEC offload before configuration Date: Fri, 24 Jan 2025 23:52:35 +0530 Message-ID: <20250124182235.3587648-1-gakhil@marvell.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: cbwr9_DpVtWTclVytUJ31LQEL5j03OFw X-Proofpoint-ORIG-GUID: cbwr9_DpVtWTclVytUJ31LQEL5j03OFw X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-01-24_08,2025-01-23_01,2024-11-22_01 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 --- 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