From 6c48ee06a9f9d07801523732f86f9ddd49c22780 Mon Sep 17 00:00:00 2001 From: Ouyang Changchun Date: Tue, 7 Oct 2014 14:43:35 +0200 Subject: [PATCH] ixgbe/base: source address pruning Signed-off-by: Changchun Ouyang [Thomas: split patch] --- lib/librte_pmd_ixgbe/ixgbe/ixgbe_api.c | 13 +++++++++++++ lib/librte_pmd_ixgbe/ixgbe/ixgbe_api.h | 2 ++ lib/librte_pmd_ixgbe/ixgbe/ixgbe_type.h | 2 ++ 3 files changed, 17 insertions(+) diff --git a/lib/librte_pmd_ixgbe/ixgbe/ixgbe_api.c b/lib/librte_pmd_ixgbe/ixgbe/ixgbe_api.c index 7ad8eda27e..787c4d9be9 100644 --- a/lib/librte_pmd_ixgbe/ixgbe/ixgbe_api.c +++ b/lib/librte_pmd_ixgbe/ixgbe/ixgbe_api.c @@ -1096,6 +1096,19 @@ s32 ixgbe_setup_eee(struct ixgbe_hw *hw, bool enable_eee) IXGBE_NOT_IMPLEMENTED); } +/** + * ixgbe_set_source_address_pruning - Enable/Disable source address pruning + * @hw: pointer to hardware structure + * @enbale: enable or disable source address pruning + * @pool: Rx pool - Rx pool to toggle source address pruning + **/ +void ixgbe_set_source_address_pruning(struct ixgbe_hw *hw, bool enable, + unsigned int pool) +{ + if (hw->mac.ops.set_source_address_pruning) + hw->mac.ops.set_source_address_pruning(hw, enable, pool); +} + /** * ixgbe_read_analog_reg8 - Reads 8 bit analog register * @hw: pointer to hardware structure diff --git a/lib/librte_pmd_ixgbe/ixgbe/ixgbe_api.h b/lib/librte_pmd_ixgbe/ixgbe/ixgbe_api.h index 88a8ca04ff..dfbe452d1a 100644 --- a/lib/librte_pmd_ixgbe/ixgbe/ixgbe_api.h +++ b/lib/librte_pmd_ixgbe/ixgbe/ixgbe_api.h @@ -183,6 +183,8 @@ s32 ixgbe_dmac_config(struct ixgbe_hw *hw); s32 ixgbe_dmac_update_tcs(struct ixgbe_hw *hw); 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_disable_rx(struct ixgbe_hw *hw); void ixgbe_enable_rx(struct ixgbe_hw *hw); diff --git a/lib/librte_pmd_ixgbe/ixgbe/ixgbe_type.h b/lib/librte_pmd_ixgbe/ixgbe/ixgbe_type.h index f30ce39fcd..826c39d563 100644 --- a/lib/librte_pmd_ixgbe/ixgbe/ixgbe_type.h +++ b/lib/librte_pmd_ixgbe/ixgbe/ixgbe_type.h @@ -3252,6 +3252,8 @@ struct ixgbe_mac_operations { void (*get_rtrup2tc)(struct ixgbe_hw *hw, u8 *map); s32 (*setup_eee)(struct ixgbe_hw *hw, bool enable_eee); void (*set_ethertype_anti_spoofing)(struct ixgbe_hw *, bool, int); + void (*set_source_address_pruning)(struct ixgbe_hw *, bool, + unsigned int); void (*disable_rx)(struct ixgbe_hw *hw); void (*enable_rx)(struct ixgbe_hw *hw); }; -- 2.20.1