* [net PATCH v2] ixgbe: Reset interface after enabling SR-IOV
@ 2015-10-20 20:28 Alexander Duyck
2015-10-29 1:32 ` [Intel-wired-lan] " Miller, Darin J
0 siblings, 1 reply; 2+ messages in thread
From: Alexander Duyck @ 2015-10-20 20:28 UTC (permalink / raw)
To: netdev, intel-wired-lan; +Cc: jeffrey.t.kirsher
Enabling SR-IOV and then bringing the interface up was resulting in the PF
MAC addresses getting into a bad state. Specifically the MAC address was
enabled for both VF 0 and the PF. This resulted in some odd behaviors such
as VF 0 receiving a copy of the PFs traffic, which in turn enables the
ability for VF 0 to spoof the PF.
A workaround for this issue appears to be to bring up the interface first
and then enable SR-IOV as this way the reset is then triggered in the
existing code.
In order to correct this I have added a change to ixgbe_setup_tc where if
the interface is down we still will at least call ixgbe_reset so that the
MAC addresses for the device are reset to the correct pools.
Steps to reproduce issue:
modprobe ixgbe
echo 7 > /sys/bus/pci/devices/0000\:01\:00.1/sriov_numvfs
ifconfig enp1s0f1 up
ethregs -s 1:00.1 | grep MPSAR | grep -v 00000000
Result:
MPSAR[0] 00000081
MPSAR[254] 00000001
Expected Result, behavior after patch:
MPSAR[0] 00000080
MPSAR[254] 00000080
Signed-off-by: Alexander Duyck <aduyck@mirantis.com>
---
This is also a candidate for stable going back to 3.9 kernel as that
appears to be where the code for using ixgbe_setup_tc as a part of the
SR-IOV initialization was introduced.
v2: Replaced dev with adapter as parameter for ixgbe_reset().
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 191003901adb..7831346b483d 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -7912,6 +7912,9 @@ int ixgbe_setup_tc(struct net_device *dev, u8 tc)
*/
if (netif_running(dev))
ixgbe_close(dev);
+ else
+ ixgbe_reset(adapter);
+
ixgbe_clear_interrupt_scheme(adapter);
#ifdef CONFIG_IXGBE_DCB
^ permalink raw reply related [flat|nested] 2+ messages in thread
* RE: [Intel-wired-lan] [net PATCH v2] ixgbe: Reset interface after enabling SR-IOV
2015-10-20 20:28 [net PATCH v2] ixgbe: Reset interface after enabling SR-IOV Alexander Duyck
@ 2015-10-29 1:32 ` Miller, Darin J
0 siblings, 0 replies; 2+ messages in thread
From: Miller, Darin J @ 2015-10-29 1:32 UTC (permalink / raw)
To: 'Alexander Duyck', netdev@vger.kernel.org,
intel-wired-lan@lists.osuosl.org
-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces@lists.osuosl.org] On Behalf Of Alexander Duyck
Sent: Tuesday, October 20, 2015 1:28 PM
To: netdev@vger.kernel.org; intel-wired-lan@lists.osuosl.org
Subject: [Intel-wired-lan] [net PATCH v2] ixgbe: Reset interface after enabling SR-IOV
Enabling SR-IOV and then bringing the interface up was resulting in the PF MAC addresses getting into a bad state. Specifically the MAC address was enabled for both VF 0 and the PF. This resulted in some odd behaviors such as VF 0 receiving a copy of the PFs traffic, which in turn enables the ability for VF 0 to spoof the PF.
A workaround for this issue appears to be to bring up the interface first and then enable SR-IOV as this way the reset is then triggered in the existing code.
In order to correct this I have added a change to ixgbe_setup_tc where if the interface is down we still will at least call ixgbe_reset so that the MAC addresses for the device are reset to the correct pools.
Steps to reproduce issue:
modprobe ixgbe
echo 7 > /sys/bus/pci/devices/0000\:01\:00.1/sriov_numvfs
ifconfig enp1s0f1 up
ethregs -s 1:00.1 | grep MPSAR | grep -v 00000000
Result:
MPSAR[0] 00000081
MPSAR[254] 00000001
Expected Result, behavior after patch:
MPSAR[0] 00000080
MPSAR[254] 00000080
Signed-off-by: Alexander Duyck <aduyck@mirantis.com>
---
Tested-by: Darin Miller <darin.j.miller@intel.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-10-29 1:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-20 20:28 [net PATCH v2] ixgbe: Reset interface after enabling SR-IOV Alexander Duyck
2015-10-29 1:32 ` [Intel-wired-lan] " Miller, Darin J
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox