diff options
author | John Hurley <john.hurley@netronome.com> | 2019-01-15 19:06:58 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-01-16 15:23:15 -0800 |
commit | 13cf71031d797d37bbc960a8260ba47505f6b597 (patch) | |
tree | 7394d7b3704720b8b053bf8da49bf0220c9f50c5 /drivers/net/ethernet/netronome/nfp/flower/main.h | |
parent | 05d2bee6bd76164f7d81f3fde83f7461d0ff12af (diff) |
nfp: flower: ensure MAC cleanup on address change
It is possible to receive a MAC address change notification without the
net device being down (e.g. when an OvS bridge is assigned the same MAC as
a port added to it). This means that an offloaded MAC address may not be
removed if its device gets a new address.
Maintain a record of the offloaded MAC addresses for each repr and netdev
assigned a MAC offload index. Use this to delete the (now expired) MAC if
a change of address event occurs. Only handle change address events if the
device is already up - if not then the netdev up event will handle it.
Signed-off-by: John Hurley <john.hurley@netronome.com>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/netronome/nfp/flower/main.h')
-rw-r--r-- | drivers/net/ethernet/netronome/nfp/flower/main.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/ethernet/netronome/nfp/flower/main.h b/drivers/net/ethernet/netronome/nfp/flower/main.h index 2ce898bfc5be..15b794d0d1e4 100644 --- a/drivers/net/ethernet/netronome/nfp/flower/main.h +++ b/drivers/net/ethernet/netronome/nfp/flower/main.h @@ -179,9 +179,13 @@ struct nfp_flower_priv { /** * struct nfp_flower_repr_priv - Flower APP per-repr priv data * @lag_port_flags: Extended port flags to record lag state of repr + * @mac_offloaded: Flag indicating a MAC address is offloaded for repr + * @offloaded_mac_addr: MAC address that has been offloaded for repr */ struct nfp_flower_repr_priv { unsigned long lag_port_flags; + bool mac_offloaded; + u8 offloaded_mac_addr[ETH_ALEN]; }; /** @@ -189,11 +193,15 @@ struct nfp_flower_repr_priv { * @list: List entry of offloaded reprs * @netdev: Pointer to non-repr net_device * @ref_count: Number of references held for this priv data + * @mac_offloaded: Flag indicating a MAC address is offloaded for device + * @offloaded_mac_addr: MAC address that has been offloaded for dev */ struct nfp_flower_non_repr_priv { struct list_head list; struct net_device *netdev; int ref_count; + bool mac_offloaded; + u8 offloaded_mac_addr[ETH_ALEN]; }; struct nfp_fl_key_ls { |