Add support for NETIF_F_HW_FDB flag when SR-IOV is enabled. This allows the bridge to push fdb entries into the hardware so the VF can communicate with virtual devices attached to the bridge. veth0 veth2 | | ------------ | bridge0 | <---- software bridging ------------ / / ethx.y ethx VF PF \ \ <---- propagate FDB entries to HW \ \ -------------------- | Embedded Bridge | <---- hardware offloaded switching -------------------- Signed-off-by: John Fastabend <john.r.fastabend@xxxxxxxxx> --- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 35 +++++++++++++++++-------- 1 files changed, 24 insertions(+), 11 deletions(-) diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c index ecc46ce..66261fa 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c @@ -3207,6 +3207,11 @@ static int ixgbe_write_uc_addr_list(struct net_device *netdev) netdev_for_each_uc_addr(ha, netdev) { if (!rar_entries) break; + + netif_printk(adapter, hw, KERN_DEBUG, adapter->netdev, + "%s %s: write vfn %i %pM\n", + __func__, netdev->name, vfn, ha->addr); + hw->mac.ops.set_rar(hw, rar_entries--, ha->addr, vfn, IXGBE_RAH_AV); count++; @@ -3268,16 +3273,17 @@ void ixgbe_set_rx_mode(struct net_device *netdev) } ixgbe_vlan_filter_enable(adapter); hw->addr_ctrl.user_set_promisc = false; - /* - * Write addresses to available RAR registers, if there is not - * sufficient space to store all the addresses then enable - * unicast promiscuous mode - */ - count = ixgbe_write_uc_addr_list(netdev); - if (count < 0) { - fctrl |= IXGBE_FCTRL_UPE; - vmolr |= IXGBE_VMOLR_ROPE; - } + } + + /* + * Write addresses to available RAR registers, if there is not + * sufficient space to store all the addresses then enable + * unicast promiscuous mode + */ + count = ixgbe_write_uc_addr_list(netdev); + if (count < 0) { + fctrl |= IXGBE_FCTRL_UPE; + vmolr |= IXGBE_VMOLR_ROPE; } if (adapter->num_vfs) { @@ -7214,6 +7220,10 @@ static netdev_features_t ixgbe_fix_features(struct net_device *netdev, e_info(probe, "rx-usecs set too low, not enabling RSC\n"); } + /* Only use offloaded FDB if SR-IOV is enabled */ + if (!(adapter->flags & IXGBE_FLAG_SRIOV_ENABLED)) + data &= ~NETIF_F_HW_FDB; + return data; } @@ -7549,9 +7559,12 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev, netdev->priv_flags |= IFF_UNICAST_FLT; - if (adapter->flags & IXGBE_FLAG_SRIOV_ENABLED) + if (adapter->flags & IXGBE_FLAG_SRIOV_ENABLED) { adapter->flags &= ~(IXGBE_FLAG_RSS_ENABLED | IXGBE_FLAG_DCB_ENABLED); + netdev->hw_features |= NETIF_F_HW_FDB; + netdev->features |= NETIF_F_HW_FDB; + } #ifdef CONFIG_IXGBE_DCB netdev->dcbnl_ops = &dcbnl_ops; -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html