提交 8a07a22d 编写于 作者: G Greg Rose 提交者: David S. Miller

ixgbe: Streamline MC filter setup for VFs

The driver was calling the set Rx mode function for every multicast
filter set by the VF.  When starting many VMs where each might have
multiple VLAN interfaces this would result in the function being
called hundreds or even thousands of times.  This is unnecessary
for the case of the imperfect filters used in the MTA and has been
streamlined to be more efficient.
Signed-off-by: NGreg Rose <gregory.v.rose@intel.com>
Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 73422913
...@@ -48,7 +48,11 @@ int ixgbe_set_vf_multicasts(struct ixgbe_adapter *adapter, ...@@ -48,7 +48,11 @@ int ixgbe_set_vf_multicasts(struct ixgbe_adapter *adapter,
int entries, u16 *hash_list, u32 vf) int entries, u16 *hash_list, u32 vf)
{ {
struct vf_data_storage *vfinfo = &adapter->vfinfo[vf]; struct vf_data_storage *vfinfo = &adapter->vfinfo[vf];
struct ixgbe_hw *hw = &adapter->hw;
int i; int i;
u32 vector_bit;
u32 vector_reg;
u32 mta_reg;
/* only so many hash values supported */ /* only so many hash values supported */
entries = min(entries, IXGBE_MAX_VF_MC_ENTRIES); entries = min(entries, IXGBE_MAX_VF_MC_ENTRIES);
...@@ -68,8 +72,13 @@ int ixgbe_set_vf_multicasts(struct ixgbe_adapter *adapter, ...@@ -68,8 +72,13 @@ int ixgbe_set_vf_multicasts(struct ixgbe_adapter *adapter,
vfinfo->vf_mc_hashes[i] = hash_list[i];; vfinfo->vf_mc_hashes[i] = hash_list[i];;
} }
/* Flush and reset the mta with the new values */ for (i = 0; i < vfinfo->num_vf_mc_hashes; i++) {
ixgbe_set_rx_mode(adapter->netdev); vector_reg = (vfinfo->vf_mc_hashes[i] >> 5) & 0x7F;
vector_bit = vfinfo->vf_mc_hashes[i] & 0x1F;
mta_reg = IXGBE_READ_REG(hw, IXGBE_MTA(vector_reg));
mta_reg |= (1 << vector_bit);
IXGBE_WRITE_REG(hw, IXGBE_MTA(vector_reg), mta_reg);
}
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册