net/ixgbe: add private APIs for flow filtering
authorChenxu Di <chenxux.di@intel.com>
Wed, 8 Jul 2020 01:18:38 +0000 (01:18 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Sat, 11 Jul 2020 04:18:52 +0000 (06:18 +0200)
The legacy filter API will be superseded by rte_flow.
There are also several small features which can not be
implemented in rte_flow. This patch re-implemented these
features as private API.
Two APIs are added:
rte_pmd_ixgbe_get_fdir_info.
rte_pmd_ixgbe_get_fdir_stats.

Signed-off-by: Chenxu Di <chenxux.di@intel.com>
Acked-by: Jeff Guo <jia.guo@intel.com>
doc/guides/rel_notes/release_20_08.rst
drivers/net/ixgbe/ixgbe_ethdev.h
drivers/net/ixgbe/ixgbe_fdir.c
drivers/net/ixgbe/rte_pmd_ixgbe.c
drivers/net/ixgbe/rte_pmd_ixgbe.h
drivers/net/ixgbe/rte_pmd_ixgbe_version.map

index a638fe7..17c3af4 100644 (file)
@@ -135,6 +135,12 @@ New Features
   * Re-implemented get_fdir_info and get_fdir_stat in private API.
   * Re-implemented set_gre_key_len in private API.
 
+* **Updated the Intel ixgbe driver.**
+
+  Updated the Intel ixgbe driver with new features and improvements, including:
+
+  * Re-implemented get_fdir_info and get_fdir_stat in private API.
+
 * **Added DOCSIS protocol to rte_security.**
 
   Added support for combined crypto and CRC operations for the DOCSIS protocol
index 3d78b2e..9bdef87 100644 (file)
@@ -697,6 +697,10 @@ int ixgbe_fdir_set_flexbytes_offset(struct rte_eth_dev *dev,
 int ixgbe_fdir_filter_program(struct rte_eth_dev *dev,
                              struct ixgbe_fdir_rule *rule,
                              bool del, bool update);
+void ixgbe_fdir_info_get(struct rte_eth_dev *dev,
+                        struct rte_eth_fdir_info *fdir_info);
+void ixgbe_fdir_stats_get(struct rte_eth_dev *dev,
+                         struct rte_eth_fdir_stats *fdir_stats);
 
 void ixgbe_configure_dcb(struct rte_eth_dev *dev);
 
index 166dae1..6faaa8f 100644 (file)
@@ -109,10 +109,6 @@ static int ixgbe_add_del_fdir_filter(struct rte_eth_dev *dev,
                              bool del,
                              bool update);
 static int ixgbe_fdir_flush(struct rte_eth_dev *dev);
-static void ixgbe_fdir_info_get(struct rte_eth_dev *dev,
-                       struct rte_eth_fdir_info *fdir_info);
-static void ixgbe_fdir_stats_get(struct rte_eth_dev *dev,
-                       struct rte_eth_fdir_stats *fdir_stats);
 
 /**
  * This function is based on ixgbe_fdir_enable_82599() in base/ixgbe_82599.c.
@@ -1414,7 +1410,7 @@ ixgbe_fdir_flush(struct rte_eth_dev *dev)
 }
 
 #define FDIRENTRIES_NUM_SHIFT 10
-static void
+void
 ixgbe_fdir_info_get(struct rte_eth_dev *dev, struct rte_eth_fdir_info *fdir_info)
 {
        struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
@@ -1473,7 +1469,7 @@ ixgbe_fdir_info_get(struct rte_eth_dev *dev, struct rte_eth_fdir_info *fdir_info
                        (uint8_t)((info->mask.flex_bytes_mask & 0xFF00) >> 8);
 }
 
-static void
+void
 ixgbe_fdir_stats_get(struct rte_eth_dev *dev, struct rte_eth_fdir_stats *fdir_stats)
 {
        struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
index 9bff557..d2f7082 100644 (file)
@@ -1139,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;
+}
index f62fd76..8b6bb99 100644 (file)
@@ -726,4 +726,37 @@ enum {
 __rte_experimental
 int
 rte_pmd_ixgbe_upd_fctrl_sbp(uint16_t port, int enable);
+
+/**
+ * Get port fdir info
+ *
+ * @param port
+ *   The port identifier of the Ethernet device.
+ * @param fdir_info
+ *   The fdir info of the port
+ * @return
+ *   - (0) if successful.
+ *   - (-ENODEV) if *port* invalid.
+ *   - (-ENOTSUP) if operation not supported.
+ */
+__rte_experimental
+int
+rte_pmd_ixgbe_get_fdir_info(uint16_t port, struct rte_eth_fdir_info *fdir_info);
+
+/**
+ * Get port fdir status
+ *
+ * @param port
+ *   The port identifier of the Ethernet device.
+ * @param fdir_stats
+ *   The fdir status of the port
+ * @return
+ *   - (0) if successful.
+ *   - (-ENODEV) if *port* invalid.
+ *   - (-ENOTSUP) if operation not supported.
+ */
+__rte_experimental
+int
+rte_pmd_ixgbe_get_fdir_stats(uint16_t port,
+                            struct rte_eth_fdir_stats *fdir_stats);
 #endif /* _PMD_IXGBE_H_ */
index 21534db..911f808 100644 (file)
@@ -38,6 +38,8 @@ DPDK_20.0 {
 EXPERIMENTAL {
        global:
 
+       rte_pmd_ixgbe_get_fdir_info;
+       rte_pmd_ixgbe_get_fdir_stats;
        rte_pmd_ixgbe_mdio_lock;
        rte_pmd_ixgbe_mdio_unlock;
        rte_pmd_ixgbe_mdio_unlocked_read;