* [Intel-wired-lan] [PATCH 0/2] do not reuse old MACs on VF reload
@ 2018-05-14 18:16 Emil Tantilov
2018-05-14 18:16 ` [Intel-wired-lan] [PATCH 1/2] ixgbe: force VF to grab new MAC on driver reload Emil Tantilov
2018-05-14 18:16 ` [Intel-wired-lan] [PATCH 2/2] ixgbevf: fix MAC address changes through ixgbevf_set_mac() Emil Tantilov
0 siblings, 2 replies; 5+ messages in thread
From: Emil Tantilov @ 2018-05-14 18:16 UTC (permalink / raw)
To: intel-wired-lan
The following series changes the logic associated with MAC address handling.
In particular it aims to avoid re-using MAC addresses from older VFs.
On the PF side we NACK the validation of the MAC on VF reset unless the
MAC was set by the PF and remove the warning so it does not get spammed.
On the VF we need to set hw->mac.perm_addr in ixgbevf_set_mac() in order
to avoid the driver keeping 2 MACs and lose the manually set MAC in case
of a reset which will then lead to spoofed packets.
---
Emil Tantilov (2):
ixgbe: force VF to grab new MAC on driver reload
ixgbevf: fix MAC address changes through ixgbevf_set_mac()
drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 5 +----
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 1 +
2 files changed, 2 insertions(+), 4 deletions(-)
--
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Intel-wired-lan] [PATCH 1/2] ixgbe: force VF to grab new MAC on driver reload
2018-05-14 18:16 [Intel-wired-lan] [PATCH 0/2] do not reuse old MACs on VF reload Emil Tantilov
@ 2018-05-14 18:16 ` Emil Tantilov
2018-05-15 22:52 ` Bowers, AndrewX
2018-05-14 18:16 ` [Intel-wired-lan] [PATCH 2/2] ixgbevf: fix MAC address changes through ixgbevf_set_mac() Emil Tantilov
1 sibling, 1 reply; 5+ messages in thread
From: Emil Tantilov @ 2018-05-14 18:16 UTC (permalink / raw)
To: intel-wired-lan
Do not validate the MAC address during a reset, unless the MAC was set on
the host. This way the VF will get a new MAC address every time it reloads.
Remove the "no MAC address assigned" message since it will get spammed on
reset and it doesn't help much as the MAC on the VF is randomly generated.
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
---
drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
index 2649c06..6f59933 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
@@ -854,14 +854,11 @@ static int ixgbe_vf_reset_msg(struct ixgbe_adapter *adapter, u32 vf)
/* reply to reset with ack and vf mac address */
msgbuf[0] = IXGBE_VF_RESET;
- if (!is_zero_ether_addr(vf_mac)) {
+ if (!is_zero_ether_addr(vf_mac) && adapter->vfinfo[vf].pf_set_mac) {
msgbuf[0] |= IXGBE_VT_MSGTYPE_ACK;
memcpy(addr, vf_mac, ETH_ALEN);
} else {
msgbuf[0] |= IXGBE_VT_MSGTYPE_NACK;
- dev_warn(&adapter->pdev->dev,
- "VF %d has no MAC address assigned, you may have to assign one manually\n",
- vf);
}
/*
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [Intel-wired-lan] [PATCH 2/2] ixgbevf: fix MAC address changes through ixgbevf_set_mac()
2018-05-14 18:16 [Intel-wired-lan] [PATCH 0/2] do not reuse old MACs on VF reload Emil Tantilov
2018-05-14 18:16 ` [Intel-wired-lan] [PATCH 1/2] ixgbe: force VF to grab new MAC on driver reload Emil Tantilov
@ 2018-05-14 18:16 ` Emil Tantilov
2018-05-15 22:52 ` Bowers, AndrewX
1 sibling, 1 reply; 5+ messages in thread
From: Emil Tantilov @ 2018-05-14 18:16 UTC (permalink / raw)
To: intel-wired-lan
Set hw->mac.perm_addr in ixgbevf_set_mac() in order to avoid losing the
custom MAC on reset. This can happen in the following case:
>ip link set $vf address $mac
>ethtool -r $vf
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
---
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
index 9a939dc..0830411 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
@@ -4164,6 +4164,7 @@ static int ixgbevf_set_mac(struct net_device *netdev, void *p)
return -EPERM;
ether_addr_copy(hw->mac.addr, addr->sa_data);
+ ether_addr_copy(hw->mac.perm_addr, addr->sa_data);
ether_addr_copy(netdev->dev_addr, addr->sa_data);
return 0;
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [Intel-wired-lan] [PATCH 1/2] ixgbe: force VF to grab new MAC on driver reload
2018-05-14 18:16 ` [Intel-wired-lan] [PATCH 1/2] ixgbe: force VF to grab new MAC on driver reload Emil Tantilov
@ 2018-05-15 22:52 ` Bowers, AndrewX
0 siblings, 0 replies; 5+ messages in thread
From: Bowers, AndrewX @ 2018-05-15 22:52 UTC (permalink / raw)
To: intel-wired-lan
> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On
> Behalf Of Emil Tantilov
> Sent: Monday, May 14, 2018 11:16 AM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [PATCH 1/2] ixgbe: force VF to grab new MAC on
> driver reload
>
> Do not validate the MAC address during a reset, unless the MAC was set on
> the host. This way the VF will get a new MAC address every time it reloads.
>
> Remove the "no MAC address assigned" message since it will get spammed
> on reset and it doesn't help much as the MAC on the VF is randomly
> generated.
>
> Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
> ---
> drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Intel-wired-lan] [PATCH 2/2] ixgbevf: fix MAC address changes through ixgbevf_set_mac()
2018-05-14 18:16 ` [Intel-wired-lan] [PATCH 2/2] ixgbevf: fix MAC address changes through ixgbevf_set_mac() Emil Tantilov
@ 2018-05-15 22:52 ` Bowers, AndrewX
0 siblings, 0 replies; 5+ messages in thread
From: Bowers, AndrewX @ 2018-05-15 22:52 UTC (permalink / raw)
To: intel-wired-lan
> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On
> Behalf Of Emil Tantilov
> Sent: Monday, May 14, 2018 11:16 AM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [PATCH 2/2] ixgbevf: fix MAC address changes
> through ixgbevf_set_mac()
>
> Set hw->mac.perm_addr in ixgbevf_set_mac() in order to avoid losing the
> custom MAC on reset. This can happen in the following case:
>
> >ip link set $vf address $mac
> >ethtool -r $vf
>
> Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
> ---
> drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 1 +
> 1 file changed, 1 insertion(+)
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-05-15 22:52 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-14 18:16 [Intel-wired-lan] [PATCH 0/2] do not reuse old MACs on VF reload Emil Tantilov
2018-05-14 18:16 ` [Intel-wired-lan] [PATCH 1/2] ixgbe: force VF to grab new MAC on driver reload Emil Tantilov
2018-05-15 22:52 ` Bowers, AndrewX
2018-05-14 18:16 ` [Intel-wired-lan] [PATCH 2/2] ixgbevf: fix MAC address changes through ixgbevf_set_mac() Emil Tantilov
2018-05-15 22:52 ` Bowers, AndrewX
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox