All of lore.kernel.org
 help / color / mirror / Atom feed
* [net 0/4][pull request] Intel Wired LAN Driver Updates 2015-12-03
@ 2015-12-03 21:57 Jeff Kirsher
  2015-12-03 21:57 ` [net 1/4] ixgbe: Reset interface after enabling SR-IOV Jeff Kirsher
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Jeff Kirsher @ 2015-12-03 21:57 UTC (permalink / raw)
  To: davem; +Cc: Jeff Kirsher, netdev, nhorman, sassmann, jogreene, john.ronciak

This series contains updates to ixgbe, i40e/i40evf, MAINTAINERS and e100.txt

Alex provides a fix for ixgbe where enabling SR-IOV and then bringing the
interface up was resulting in the PF MAC addresses getting into a bad state.
The workaround for this issue is to bring up the interface first and then
enable SR-IOV as this will trigger the reset in the existing code.

I clean up legacy license stuff in the e100.txt documentation and then
update the maintainers/reviewers list for our drivers.

Jesse fixes an issue with the i40e/i40evf drivers, where if the driver were
to happen to have a mutex held while the i40e_init_adminq() call was called,
the init_adminq might inadvertently call mutex_init on a lock that was held
which is a violation of the calling semantices.

The following are changes since commit cf18b7788fe1bf99e9c2ab580b065bf2d3cb1a34:
  net: phy: reset only targeted phy
and are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-queue master

Alexander Duyck (1):
  ixgbe: Reset interface after enabling SR-IOV

Jeff Kirsher (2):
  e100.txt: Cleanup license info in kernel doc
  MAINTAINERS: Update Intel Wired LAN reviewers

Jesse Brandeburg (1):
  i40e/i40evf: avoid mutex re-init

 Documentation/networking/e100.txt               | 14 --------------
 MAINTAINERS                                     |  2 +-
 drivers/net/ethernet/intel/i40e/i40e_adminq.c   |  6 ------
 drivers/net/ethernet/intel/i40e/i40e_main.c     | 11 ++++++++++-
 drivers/net/ethernet/intel/i40evf/i40e_adminq.c |  6 ------
 drivers/net/ethernet/intel/i40evf/i40evf_main.c | 10 ++++++++++
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c   |  3 +++
 7 files changed, 24 insertions(+), 28 deletions(-)

-- 
2.5.0

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [net 1/4] ixgbe: Reset interface after enabling SR-IOV
  2015-12-03 21:57 [net 0/4][pull request] Intel Wired LAN Driver Updates 2015-12-03 Jeff Kirsher
@ 2015-12-03 21:57 ` Jeff Kirsher
  2015-12-03 21:57 ` [net 2/4] e100.txt: Cleanup license info in kernel doc Jeff Kirsher
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Jeff Kirsher @ 2015-12-03 21:57 UTC (permalink / raw)
  To: davem; +Cc: Alexander Duyck, netdev, nhorman, sassmann, jogreene, Jeff Kirsher

From: Alexander Duyck <aduyck@mirantis.com>

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>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 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 47395ff..aed8d02 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -7920,6 +7920,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
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [net 2/4] e100.txt: Cleanup license info in kernel doc
  2015-12-03 21:57 [net 0/4][pull request] Intel Wired LAN Driver Updates 2015-12-03 Jeff Kirsher
  2015-12-03 21:57 ` [net 1/4] ixgbe: Reset interface after enabling SR-IOV Jeff Kirsher
@ 2015-12-03 21:57 ` Jeff Kirsher
  2015-12-03 21:57 ` [net 3/4] MAINTAINERS: Update Intel Wired LAN reviewers Jeff Kirsher
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Jeff Kirsher @ 2015-12-03 21:57 UTC (permalink / raw)
  To: davem; +Cc: Jeff Kirsher, netdev, nhorman, sassmann, jogreene, John Ronciak

Apparently the e100.txt document contained a "License" section left
over from days of old, which does not need to be in the kernel
documentation.  So clean it up..

CC: John Ronciak <john.ronciak@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
---
 Documentation/networking/e100.txt | 14 --------------
 1 file changed, 14 deletions(-)

diff --git a/Documentation/networking/e100.txt b/Documentation/networking/e100.txt
index f862cf3..42ddbd4 100644
--- a/Documentation/networking/e100.txt
+++ b/Documentation/networking/e100.txt
@@ -181,17 +181,3 @@ For general information, go to the Intel support website at:
 If an issue is identified with the released source code on the supported
 kernel with a supported adapter, email the specific information related to the
 issue to e1000-devel@lists.sourceforge.net.
-
-
-License
-=======
-
-This software program is released under the terms of a license agreement
-between you ('Licensee') and Intel. Do not use or load this software or any
-associated materials (collectively, the 'Software') until you have carefully
-read the full terms and conditions of the file COPYING located in this software
-package. By loading or using the Software, you agree to the terms of this
-Agreement. If you do not agree with the terms of this Agreement, do not install
-or use the Software.
-
-* Other names and brands may be claimed as the property of others.
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [net 3/4] MAINTAINERS: Update Intel Wired LAN reviewers
  2015-12-03 21:57 [net 0/4][pull request] Intel Wired LAN Driver Updates 2015-12-03 Jeff Kirsher
  2015-12-03 21:57 ` [net 1/4] ixgbe: Reset interface after enabling SR-IOV Jeff Kirsher
  2015-12-03 21:57 ` [net 2/4] e100.txt: Cleanup license info in kernel doc Jeff Kirsher
@ 2015-12-03 21:57 ` Jeff Kirsher
  2015-12-03 21:57 ` [net 4/4] i40e/i40evf: avoid mutex re-init Jeff Kirsher
  2015-12-05 22:40 ` [net 0/4][pull request] Intel Wired LAN Driver Updates 2015-12-03 David Miller
  4 siblings, 0 replies; 6+ messages in thread
From: Jeff Kirsher @ 2015-12-03 21:57 UTC (permalink / raw)
  To: davem; +Cc: Jeff Kirsher, netdev, nhorman, sassmann, jogreene, Bruce Allan

Since Matthew has moved on to other pastures and no longer works
for Intel, remove him from the list of reviewers and add Bruce
Allan as his replacement.

CC: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 MAINTAINERS | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index e87b1be..24e7294 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -5574,7 +5574,7 @@ R:	Jesse Brandeburg <jesse.brandeburg@intel.com>
 R:	Shannon Nelson <shannon.nelson@intel.com>
 R:	Carolyn Wyborny <carolyn.wyborny@intel.com>
 R:	Don Skidmore <donald.c.skidmore@intel.com>
-R:	Matthew Vick <matthew.vick@intel.com>
+R:	Bruce Allan <bruce.w.allan@intel.com>
 R:	John Ronciak <john.ronciak@intel.com>
 R:	Mitch Williams <mitch.a.williams@intel.com>
 L:	intel-wired-lan@lists.osuosl.org
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [net 4/4] i40e/i40evf: avoid mutex re-init
  2015-12-03 21:57 [net 0/4][pull request] Intel Wired LAN Driver Updates 2015-12-03 Jeff Kirsher
                   ` (2 preceding siblings ...)
  2015-12-03 21:57 ` [net 3/4] MAINTAINERS: Update Intel Wired LAN reviewers Jeff Kirsher
@ 2015-12-03 21:57 ` Jeff Kirsher
  2015-12-05 22:40 ` [net 0/4][pull request] Intel Wired LAN Driver Updates 2015-12-03 David Miller
  4 siblings, 0 replies; 6+ messages in thread
From: Jeff Kirsher @ 2015-12-03 21:57 UTC (permalink / raw)
  To: davem; +Cc: Jesse Brandeburg, netdev, nhorman, sassmann, jogreene, Jeff Kirsher

From: Jesse Brandeburg <jesse.brandeburg@intel.com>

If the driver were to happen to have a mutex held while
the i40e_init_adminq call was called, the init_adminq might
inadvertently call mutex_init on a lock that was held
which is a violation of the calling semantics.

Fix this by avoiding adminq.c code allocating/freeing this memory, and
then do the same work only once in probe/remove.

Testing Hints (Required if no HSD): for VF, load i40evf in bare metal
and echo 32 > sriov_numvfs; echo 0 > sriov_numvfs in a loop.  Yes this
is a horrible thing to do.

Change-ID: Ida263c51b34e195252179e7e5e400d73a99be7a2
Reported-by: Stefan Assmann <sassmann@redhat.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_adminq.c   |  6 ------
 drivers/net/ethernet/intel/i40e/i40e_main.c     | 11 ++++++++++-
 drivers/net/ethernet/intel/i40evf/i40e_adminq.c |  6 ------
 drivers/net/ethernet/intel/i40evf/i40evf_main.c | 10 ++++++++++
 4 files changed, 20 insertions(+), 13 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq.c b/drivers/net/ethernet/intel/i40e/i40e_adminq.c
index 0ff8f01..1fd5ea8 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_adminq.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_adminq.c
@@ -567,10 +567,6 @@ i40e_status i40e_init_adminq(struct i40e_hw *hw)
 		goto init_adminq_exit;
 	}
 
-	/* initialize locks */
-	mutex_init(&hw->aq.asq_mutex);
-	mutex_init(&hw->aq.arq_mutex);
-
 	/* Set up register offsets */
 	i40e_adminq_init_regs(hw);
 
@@ -664,8 +660,6 @@ i40e_status i40e_shutdown_adminq(struct i40e_hw *hw)
 	i40e_shutdown_asq(hw);
 	i40e_shutdown_arq(hw);
 
-	/* destroy the locks */
-
 	if (hw->nvm_buff.va)
 		i40e_free_virt_mem(hw, &hw->nvm_buff);
 
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index b825f97..4a9873ec 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -10295,6 +10295,12 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	/* set up a default setting for link flow control */
 	pf->hw.fc.requested_mode = I40E_FC_NONE;
 
+	/* set up the locks for the AQ, do this only once in probe
+	 * and destroy them only once in remove
+	 */
+	mutex_init(&hw->aq.asq_mutex);
+	mutex_init(&hw->aq.arq_mutex);
+
 	err = i40e_init_adminq(hw);
 
 	/* provide nvm, fw, api versions */
@@ -10697,7 +10703,6 @@ static void i40e_remove(struct pci_dev *pdev)
 	set_bit(__I40E_DOWN, &pf->state);
 	del_timer_sync(&pf->service_timer);
 	cancel_work_sync(&pf->service_task);
-	i40e_fdir_teardown(pf);
 
 	if (pf->flags & I40E_FLAG_SRIOV_ENABLED) {
 		i40e_free_vfs(pf);
@@ -10740,6 +10745,10 @@ static void i40e_remove(struct pci_dev *pdev)
 			 "Failed to destroy the Admin Queue resources: %d\n",
 			 ret_code);
 
+	/* destroy the locks only once, here */
+	mutex_destroy(&hw->aq.arq_mutex);
+	mutex_destroy(&hw->aq.asq_mutex);
+
 	/* Clear all dynamic memory lists of rings, q_vectors, and VSIs */
 	i40e_clear_interrupt_scheme(pf);
 	for (i = 0; i < pf->num_alloc_vsi; i++) {
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_adminq.c b/drivers/net/ethernet/intel/i40evf/i40e_adminq.c
index fd123ca..3f65e39 100644
--- a/drivers/net/ethernet/intel/i40evf/i40e_adminq.c
+++ b/drivers/net/ethernet/intel/i40evf/i40e_adminq.c
@@ -551,10 +551,6 @@ i40e_status i40evf_init_adminq(struct i40e_hw *hw)
 		goto init_adminq_exit;
 	}
 
-	/* initialize locks */
-	mutex_init(&hw->aq.asq_mutex);
-	mutex_init(&hw->aq.arq_mutex);
-
 	/* Set up register offsets */
 	i40e_adminq_init_regs(hw);
 
@@ -596,8 +592,6 @@ i40e_status i40evf_shutdown_adminq(struct i40e_hw *hw)
 	i40e_shutdown_asq(hw);
 	i40e_shutdown_arq(hw);
 
-	/* destroy the locks */
-
 	if (hw->nvm_buff.va)
 		i40e_free_virt_mem(hw, &hw->nvm_buff);
 
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index d962164..99d2cff 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -2476,6 +2476,12 @@ static int i40evf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	hw->bus.device = PCI_SLOT(pdev->devfn);
 	hw->bus.func = PCI_FUNC(pdev->devfn);
 
+	/* set up the locks for the AQ, do this only once in probe
+	 * and destroy them only once in remove
+	 */
+	mutex_init(&hw->aq.asq_mutex);
+	mutex_init(&hw->aq.arq_mutex);
+
 	INIT_LIST_HEAD(&adapter->mac_filter_list);
 	INIT_LIST_HEAD(&adapter->vlan_filter_list);
 
@@ -2629,6 +2635,10 @@ static void i40evf_remove(struct pci_dev *pdev)
 	if (hw->aq.asq.count)
 		i40evf_shutdown_adminq(hw);
 
+	/* destroy the locks only once, here */
+	mutex_destroy(&hw->aq.arq_mutex);
+	mutex_destroy(&hw->aq.asq_mutex);
+
 	iounmap(hw->hw_addr);
 	pci_release_regions(pdev);
 
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [net 0/4][pull request] Intel Wired LAN Driver Updates 2015-12-03
  2015-12-03 21:57 [net 0/4][pull request] Intel Wired LAN Driver Updates 2015-12-03 Jeff Kirsher
                   ` (3 preceding siblings ...)
  2015-12-03 21:57 ` [net 4/4] i40e/i40evf: avoid mutex re-init Jeff Kirsher
@ 2015-12-05 22:40 ` David Miller
  4 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2015-12-05 22:40 UTC (permalink / raw)
  To: jeffrey.t.kirsher; +Cc: netdev, nhorman, sassmann, jogreene, john.ronciak

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Thu,  3 Dec 2015 13:57:50 -0800

> This series contains updates to ixgbe, i40e/i40evf, MAINTAINERS and
> e100.txt

Pulled, thanks Jeff.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-12-05 22:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-03 21:57 [net 0/4][pull request] Intel Wired LAN Driver Updates 2015-12-03 Jeff Kirsher
2015-12-03 21:57 ` [net 1/4] ixgbe: Reset interface after enabling SR-IOV Jeff Kirsher
2015-12-03 21:57 ` [net 2/4] e100.txt: Cleanup license info in kernel doc Jeff Kirsher
2015-12-03 21:57 ` [net 3/4] MAINTAINERS: Update Intel Wired LAN reviewers Jeff Kirsher
2015-12-03 21:57 ` [net 4/4] i40e/i40evf: avoid mutex re-init Jeff Kirsher
2015-12-05 22:40 ` [net 0/4][pull request] Intel Wired LAN Driver Updates 2015-12-03 David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.