net/ixgbe: restore TCP SYN filter
authorWei Zhao <wei.zhao1@intel.com>
Fri, 13 Jan 2017 08:13:00 +0000 (16:13 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 17 Jan 2017 18:41:43 +0000 (19:41 +0100)
Add support for restoring TCP SYN 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

index 8f6f98b..1cedec1 100644 (file)
@@ -8483,11 +8483,29 @@ ixgbe_ethertype_filter_restore(struct rte_eth_dev *dev)
        }
 }
 
+/* restore SYN filter */
+static inline void
+ixgbe_syn_filter_restore(struct rte_eth_dev *dev)
+{
+       struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+       struct ixgbe_filter_info *filter_info =
+               IXGBE_DEV_PRIVATE_TO_FILTER_INFO(dev->data->dev_private);
+       uint32_t synqf;
+
+       synqf = filter_info->syn_info;
+
+       if (synqf & IXGBE_SYN_FILTER_ENABLE) {
+               IXGBE_WRITE_REG(hw, IXGBE_SYNQF, synqf);
+               IXGBE_WRITE_FLUSH(hw);
+       }
+}
+
 static int
 ixgbe_filter_restore(struct rte_eth_dev *dev)
 {
        ixgbe_ntuple_filter_restore(dev);
        ixgbe_ethertype_filter_restore(dev);
+       ixgbe_syn_filter_restore(dev);
 
        return 0;
 }