net/ixgbe: fix build without security library
[dpdk.git] / drivers / net / ixgbe / ixgbe_ethdev.c
index 4339347..cc27065 100644 (file)
@@ -61,7 +61,9 @@
 #include <rte_random.h>
 #include <rte_dev.h>
 #include <rte_hash_crc.h>
+#ifdef RTE_LIBRTE_SECURITY
 #include <rte_security_driver.h>
+#endif
 
 #include "ixgbe_logs.h"
 #include "base/ixgbe_api.h"
@@ -1168,10 +1170,12 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev)
                return 0;
        }
 
+#ifdef RTE_LIBRTE_SECURITY
        /* Initialize security_ctx only for primary process*/
        eth_dev->security_ctx = ixgbe_ipsec_ctx_create(eth_dev);
        if (eth_dev->security_ctx == NULL)
                return -ENOMEM;
+#endif
 
        rte_eth_copy_pci_info(eth_dev, pci_dev);
 
@@ -1406,7 +1410,9 @@ eth_ixgbe_dev_uninit(struct rte_eth_dev *eth_dev)
        /* Remove all Traffic Manager configuration */
        ixgbe_tm_conf_uninit(eth_dev);
 
+#ifdef RTE_LIBRTE_SECURITY
        rte_free(eth_dev->security_ctx);
+#endif
 
        return 0;
 }
@@ -3707,8 +3713,10 @@ ixgbe_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
            hw->mac.type == ixgbe_mac_X550EM_a)
                dev_info->tx_offload_capa |= DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM;
 
+#ifdef RTE_LIBRTE_SECURITY
        dev_info->rx_offload_capa |= DEV_RX_OFFLOAD_SECURITY;
        dev_info->tx_offload_capa |= DEV_TX_OFFLOAD_SECURITY;
+#endif
 
        dev_info->default_rxconf = (struct rte_eth_rxconf) {
                .rx_thresh = {