net/ixgbe: restore flow director filter
authorWei Zhao <wei.zhao1@intel.com>
Fri, 13 Jan 2017 08:13:01 +0000 (16:13 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 17 Jan 2017 18:41:43 +0000 (19:41 +0100)
Add support for storing flow director filter in SW.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Wei Dai <wei.dai@intel.com>
drivers/net/ixgbe/ixgbe_ethdev.c
drivers/net/ixgbe/ixgbe_ethdev.h
drivers/net/ixgbe/ixgbe_fdir.c

index 1cedec1..fb01f1a 100644 (file)
@@ -8506,6 +8506,7 @@ ixgbe_filter_restore(struct rte_eth_dev *dev)
        ixgbe_ntuple_filter_restore(dev);
        ixgbe_ethertype_filter_restore(dev);
        ixgbe_syn_filter_restore(dev);
+       ixgbe_fdir_filter_restore(dev);
 
        return 0;
 }
index 83ff9f9..bdc66bd 100644 (file)
@@ -538,6 +538,7 @@ uint32_t ixgbe_convert_vm_rx_mask_to_val(uint16_t rx_mask, uint32_t orig_val);
 
 int ixgbe_fdir_ctrl_func(struct rte_eth_dev *dev,
                        enum rte_filter_op filter_op, void *arg);
+void ixgbe_fdir_filter_restore(struct rte_eth_dev *dev);
 
 int ixgbe_disable_sec_tx_path_generic(struct ixgbe_hw *hw);
 
index 8bf5705..627c51a 100644 (file)
@@ -1479,3 +1479,38 @@ ixgbe_fdir_ctrl_func(struct rte_eth_dev *dev,
        }
        return ret;
 }
+
+/* restore flow director filter */
+void
+ixgbe_fdir_filter_restore(struct rte_eth_dev *dev)
+{
+       struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+       struct ixgbe_hw_fdir_info *fdir_info =
+               IXGBE_DEV_PRIVATE_TO_FDIR_INFO(dev->data->dev_private);
+       struct ixgbe_fdir_filter *node;
+       bool is_perfect = FALSE;
+       enum rte_fdir_mode fdir_mode = dev->data->dev_conf.fdir_conf.mode;
+
+       if (fdir_mode >= RTE_FDIR_MODE_PERFECT &&
+           fdir_mode <= RTE_FDIR_MODE_PERFECT_TUNNEL)
+               is_perfect = TRUE;
+
+       if (is_perfect) {
+               TAILQ_FOREACH(node, &fdir_info->fdir_list, entries) {
+                       (void)fdir_write_perfect_filter_82599(hw,
+                                                             &node->ixgbe_fdir,
+                                                             node->queue,
+                                                             node->fdirflags,
+                                                             node->fdirhash,
+                                                             fdir_mode);
+               }
+       } else {
+               TAILQ_FOREACH(node, &fdir_info->fdir_list, entries) {
+                       (void)fdir_add_signature_filter_82599(hw,
+                                                             &node->ixgbe_fdir,
+                                                             node->queue,
+                                                             node->fdirflags,
+                                                             node->fdirhash);
+               }
+       }
+}