[02/10] app/testpmd: use generic MACSEC API calls

Message ID 123a93a371be657e3e8481379db6f151350d4f90.1554894242.git.igor.russkikh@aquantia.com (mailing list archive)
State Changes Requested, archived
Delegated to: Ferruh Yigit
Headers
Series add MACSEC hw offload to atlantic PMD |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/Intel-compilation success Compilation OK

Commit Message

Igor Russkikh April 10, 2019, 11:18 a.m. UTC
  Here we do repace testpmd direct usage of IXGBE driver calls
with generic ethdev macsec API calls

Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
---
 app/test-pmd/cmdline.c | 20 ++++++--------------
 1 file changed, 6 insertions(+), 14 deletions(-)
  

Comments

Thomas Monjalon April 10, 2019, 11:50 a.m. UTC | #1
10/04/2019 13:18, Igor Russkikh:
> Here we do repace testpmd direct usage of IXGBE driver calls
> with generic ethdev macsec API calls

The generic API is implemented in ixgbe in next patch.
You should reverse them, or completely move this patch at the end.
  

Patch

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 2ab03c111316..1730c76fe65c 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -13958,9 +13958,7 @@  cmd_set_macsec_offload_on_parsed(
 
 	rte_eth_dev_info_get(port_id, &dev_info);
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MACSEC_INSERT) {
-#ifdef RTE_LIBRTE_IXGBE_PMD
-		ret = rte_pmd_ixgbe_macsec_enable(port_id, en, rp);
-#endif
+		ret = rte_eth_macsec_enable(port_id, en, rp);
 	}
 	RTE_SET_USED(en);
 	RTE_SET_USED(rp);
@@ -14052,9 +14050,7 @@  cmd_set_macsec_offload_off_parsed(
 
 	rte_eth_dev_info_get(port_id, &dev_info);
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MACSEC_INSERT) {
-#ifdef RTE_LIBRTE_IXGBE_PMD
-		ret = rte_pmd_ixgbe_macsec_disable(port_id);
-#endif
+		ret = rte_eth_macsec_disable(port_id);
 	}
 	switch (ret) {
 	case 0:
@@ -14138,13 +14134,11 @@  cmd_set_macsec_sc_parsed(
 	int ret = -ENOTSUP;
 	int is_tx = (strcmp(res->tx_rx, "tx") == 0) ? 1 : 0;
 
-#ifdef RTE_LIBRTE_IXGBE_PMD
 	ret = is_tx ?
-		rte_pmd_ixgbe_macsec_config_txsc(res->port_id,
+		rte_eth_macsec_config_txsc(res->port_id,
 				res->mac.addr_bytes) :
-		rte_pmd_ixgbe_macsec_config_rxsc(res->port_id,
+		rte_eth_macsec_config_rxsc(res->port_id,
 				res->mac.addr_bytes, res->pi);
-#endif
 	RTE_SET_USED(is_tx);
 
 	switch (ret) {
@@ -14257,13 +14251,11 @@  cmd_set_macsec_sa_parsed(
 		key[i] = (uint8_t) ((xdgt0 * 16) + xdgt1);
 	}
 
-#ifdef RTE_LIBRTE_IXGBE_PMD
 	ret = is_tx ?
-		rte_pmd_ixgbe_macsec_select_txsa(res->port_id,
+		rte_eth_macsec_select_txsa(res->port_id,
 			res->idx, res->an, res->pn, key) :
-		rte_pmd_ixgbe_macsec_select_rxsa(res->port_id,
+		rte_eth_macsec_select_rxsa(res->port_id,
 			res->idx, res->an, res->pn, key);
-#endif
 	RTE_SET_USED(is_tx);
 	RTE_SET_USED(key);