net/ixgbe: fix FSP check for X550EM devices
[dpdk.git] / drivers / net / ixgbe / rte_pmd_ixgbe.c
index 073fe1e..9729f85 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright(c) 2010-2017 Intel Corporation
  */
 
-#include <rte_ethdev_driver.h>
+#include <ethdev_driver.h>
 
 #include "base/ixgbe_api.h"
 #include "base/ixgbe_x550.h"
@@ -303,10 +303,10 @@ rte_pmd_ixgbe_set_vf_vlan_stripq(uint16_t port, uint16_t vf, uint8_t on)
         */
        if (hw->mac.type == ixgbe_mac_82598EB)
                queues_per_pool = (uint16_t)hw->mac.max_rx_queues /
-                                 ETH_16_POOLS;
+                                 RTE_ETH_16_POOLS;
        else
                queues_per_pool = (uint16_t)hw->mac.max_rx_queues /
-                                 ETH_64_POOLS;
+                                 RTE_ETH_64_POOLS;
 
        for (q = 0; q < queues_per_pool; q++)
                (*dev->dev_ops->vlan_strip_queue_set)(dev,
@@ -522,6 +522,10 @@ rte_pmd_ixgbe_macsec_enable(uint16_t port, uint8_t en, uint8_t rp)
 
        dev = &rte_eth_devices[port];
 
+       if (!is_ixgbe_supported(dev))
+               return -ENOTSUP;
+
+       macsec_setting.offload_en = 1;
        macsec_setting.encrypt_en = en;
        macsec_setting.replayprotect_en = rp;
 
@@ -541,6 +545,9 @@ rte_pmd_ixgbe_macsec_disable(uint16_t port)
 
        dev = &rte_eth_devices[port];
 
+       if (!is_ixgbe_supported(dev))
+               return -ENOTSUP;
+
        ixgbe_dev_macsec_setting_reset(dev);
 
        ixgbe_dev_macsec_register_disable(dev);
@@ -729,14 +736,14 @@ rte_pmd_ixgbe_set_tc_bw_alloc(uint16_t port,
        bw_conf = IXGBE_DEV_PRIVATE_TO_BW_CONF(dev->data->dev_private);
        eth_conf = &dev->data->dev_conf;
 
-       if (eth_conf->txmode.mq_mode == ETH_MQ_TX_DCB) {
+       if (eth_conf->txmode.mq_mode == RTE_ETH_MQ_TX_DCB) {
                nb_tcs = eth_conf->tx_adv_conf.dcb_tx_conf.nb_tcs;
-       } else if (eth_conf->txmode.mq_mode == ETH_MQ_TX_VMDQ_DCB) {
+       } else if (eth_conf->txmode.mq_mode == RTE_ETH_MQ_TX_VMDQ_DCB) {
                if (eth_conf->tx_adv_conf.vmdq_dcb_tx_conf.nb_queue_pools ==
-                   ETH_32_POOLS)
-                       nb_tcs = ETH_4_TCS;
+                   RTE_ETH_32_POOLS)
+                       nb_tcs = RTE_ETH_4_TCS;
                else
-                       nb_tcs = ETH_8_TCS;
+                       nb_tcs = RTE_ETH_8_TCS;
        } else {
                nb_tcs = 1;
        }
@@ -1132,3 +1139,36 @@ rte_pmd_ixgbe_mdio_unlocked_write(uint16_t port, uint32_t reg_addr,
        }
        return 0;
 }
+
+int
+rte_pmd_ixgbe_get_fdir_info(uint16_t port, struct rte_eth_fdir_info *fdir_info)
+{
+       struct rte_eth_dev *dev;
+
+       RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
+
+       dev = &rte_eth_devices[port];
+       if (!is_ixgbe_supported(dev))
+               return -ENOTSUP;
+
+       ixgbe_fdir_info_get(dev, fdir_info);
+
+       return 0;
+}
+
+int
+rte_pmd_ixgbe_get_fdir_stats(uint16_t port,
+                            struct rte_eth_fdir_stats *fdir_stats)
+{
+       struct rte_eth_dev *dev;
+
+       RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
+
+       dev = &rte_eth_devices[port];
+       if (!is_ixgbe_supported(dev))
+               return -ENOTSUP;
+
+       ixgbe_fdir_stats_get(dev, fdir_stats);
+
+       return 0;
+}