ixgbe/base: anti spoofing
authorOuyang Changchun <changchun.ouyang@intel.com>
Tue, 7 Oct 2014 12:45:16 +0000 (14:45 +0200)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Tue, 7 Oct 2014 14:51:59 +0000 (16:51 +0200)
Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
[Thomas: split patch]

lib/librte_pmd_ixgbe/ixgbe/ixgbe_api.c
lib/librte_pmd_ixgbe/ixgbe/ixgbe_api.h
lib/librte_pmd_ixgbe/ixgbe/ixgbe_type.h

index 787c4d9..5cbd055 100644 (file)
@@ -1109,6 +1109,19 @@ void ixgbe_set_source_address_pruning(struct ixgbe_hw *hw, bool enable,
                hw->mac.ops.set_source_address_pruning(hw, enable, pool);
 }
 
+/**
+ *  ixgbe_set_ethertype_anti_spoofing - Enable/Disable Ethertype anti-spoofing
+ *  @hw: pointer to hardware structure
+ *  @enable: enable or disable switch for Ethertype anti-spoofing
+ *  @vf: Virtual Function pool - VF Pool to set for Ethertype anti-spoofing
+ *
+ **/
+void ixgbe_set_ethertype_anti_spoofing(struct ixgbe_hw *hw, bool enable, int vf)
+{
+       if (hw->mac.ops.set_ethertype_anti_spoofing)
+               hw->mac.ops.set_ethertype_anti_spoofing(hw, enable, vf);
+}
+
 /**
  *  ixgbe_read_analog_reg8 - Reads 8 bit analog register
  *  @hw: pointer to hardware structure
index dfbe452..5c88278 100644 (file)
@@ -185,6 +185,8 @@ s32 ixgbe_dmac_config_tcs(struct ixgbe_hw *hw);
 s32 ixgbe_setup_eee(struct ixgbe_hw *hw, bool enable_eee);
 void ixgbe_set_source_address_pruning(struct ixgbe_hw *hw, bool enable,
                                      unsigned int vf);
+void ixgbe_set_ethertype_anti_spoofing(struct ixgbe_hw *hw, bool enable,
+                                      int vf);
 void ixgbe_disable_rx(struct ixgbe_hw *hw);
 void ixgbe_enable_rx(struct ixgbe_hw *hw);
 
index 826c39d..bc230e0 100644 (file)
@@ -413,6 +413,8 @@ struct ixgbe_thermal_sensor_data {
 #define IXGBE_SPOOF_MACAS_MASK         0xFF
 #define IXGBE_SPOOF_VLANAS_MASK                0xFF00
 #define IXGBE_SPOOF_VLANAS_SHIFT       8
+#define IXGBE_SPOOF_ETHERTYPEAS                0xFF000000
+#define IXGBE_SPOOF_ETHERTYPEAS_SHIFT  16
 #define IXGBE_PFVFSPOOF_REG_COUNT      8
 /* 16 of these (0-15) */
 #define IXGBE_DCA_TXCTRL(_i)           (0x07200 + ((_i) * 4))
@@ -1668,6 +1670,7 @@ enum {
 #define IXGBE_MAX_ETQF_FILTERS         8
 #define IXGBE_ETQF_FCOE                        0x08000000 /* bit 27 */
 #define IXGBE_ETQF_BCN                 0x10000000 /* bit 28 */
+#define IXGBE_ETQF_TX_ANTISPOOF                0x20000000 /* bit 29 */
 #define IXGBE_ETQF_1588                        0x40000000 /* bit 30 */
 #define IXGBE_ETQF_FILTER_EN           0x80000000 /* bit 31 */
 #define IXGBE_ETQF_POOL_ENABLE         (1 << 26) /* bit 26 */