* [net 1/4] fm10k: Check the host state when bringing the interface up
2014-10-16 9:36 [net 0/4][pull request] Intel Wired LAN Driver Updates 2014-10-16 Jeff Kirsher
@ 2014-10-16 9:36 ` Jeff Kirsher
2014-10-16 9:36 ` [net 2/4] fm10k: Unlock mailbox on VLAN addition failures Jeff Kirsher
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Jeff Kirsher @ 2014-10-16 9:36 UTC (permalink / raw)
To: davem; +Cc: Matthew Vick, netdev, nhorman, sassmann, jogreene, Jeff Kirsher
From: Matthew Vick <matthew.vick@intel.com>
Set the flag to fetch the host state before kicking off the service task
that reads the host state when bringing the interface back up.
Signed-off-by: Matthew Vick <matthew.vick@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/fm10k/fm10k_pci.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
index e02036c..a0cb74a 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
@@ -1489,6 +1489,7 @@ void fm10k_up(struct fm10k_intfc *interface)
netif_tx_start_all_queues(interface->netdev);
/* kick off the service timer */
+ hw->mac.get_host_state = 1;
mod_timer(&interface->service_timer, jiffies);
}
--
1.9.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [net 2/4] fm10k: Unlock mailbox on VLAN addition failures
2014-10-16 9:36 [net 0/4][pull request] Intel Wired LAN Driver Updates 2014-10-16 Jeff Kirsher
2014-10-16 9:36 ` [net 1/4] fm10k: Check the host state when bringing the interface up Jeff Kirsher
@ 2014-10-16 9:36 ` Jeff Kirsher
2014-10-16 9:36 ` [net 3/4] fm10k: Add CONFIG_FM10K_VXLAN configuration option Jeff Kirsher
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Jeff Kirsher @ 2014-10-16 9:36 UTC (permalink / raw)
To: davem; +Cc: Matthew Vick, netdev, nhorman, sassmann, jogreene, Jeff Kirsher
From: Matthew Vick <matthew.vick@intel.com>
After grabbing the mailbox lock and detecting an error, the lock must be
released before the error code can be returned.
Signed-off-by: Matthew Vick <matthew.vick@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/fm10k/fm10k_netdev.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c b/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c
index bf44a8f..b57ea1c 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c
@@ -785,14 +785,14 @@ static int fm10k_update_vid(struct net_device *netdev, u16 vid, bool set)
if (!(netdev->flags & IFF_PROMISC)) {
err = hw->mac.ops.update_vlan(hw, vid, 0, set);
if (err)
- return err;
+ goto err_out;
}
/* update our base MAC address */
err = hw->mac.ops.update_uc_addr(hw, interface->glort, hw->mac.addr,
vid, set, 0);
if (err)
- return err;
+ goto err_out;
/* set vid prior to syncing/unsyncing the VLAN */
interface->vid = vid + (set ? VLAN_N_VID : 0);
@@ -801,9 +801,10 @@ static int fm10k_update_vid(struct net_device *netdev, u16 vid, bool set)
__dev_uc_unsync(netdev, fm10k_uc_vlan_unsync);
__dev_mc_unsync(netdev, fm10k_mc_vlan_unsync);
+err_out:
fm10k_mbx_unlock(interface);
- return 0;
+ return err;
}
static int fm10k_vlan_rx_add_vid(struct net_device *netdev,
--
1.9.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [net 3/4] fm10k: Add CONFIG_FM10K_VXLAN configuration option
2014-10-16 9:36 [net 0/4][pull request] Intel Wired LAN Driver Updates 2014-10-16 Jeff Kirsher
2014-10-16 9:36 ` [net 1/4] fm10k: Check the host state when bringing the interface up Jeff Kirsher
2014-10-16 9:36 ` [net 2/4] fm10k: Unlock mailbox on VLAN addition failures Jeff Kirsher
@ 2014-10-16 9:36 ` Jeff Kirsher
2014-10-16 9:36 ` [net 4/4] ixgbe: check for vfs outside of sriov_num_vfs before dereference Jeff Kirsher
2014-10-16 18:43 ` [net 0/4][pull request] Intel Wired LAN Driver Updates 2014-10-16 David Miller
4 siblings, 0 replies; 6+ messages in thread
From: Jeff Kirsher @ 2014-10-16 9:36 UTC (permalink / raw)
To: davem; +Cc: Andy Zhou, netdev, nhorman, sassmann, jogreene, Jeff Kirsher
From: Andy Zhou <azhou@nicira.com>
Compiling with CONFIG_FM10K=y and VXLAN=m resulting in linking error:
drivers/built-in.o: In function `fm10k_open':
(.text+0x1f9d7a): undefined reference to `vxlan_get_rx_port'
make: *** [vmlinux] Error 1
The fix follows the same strategy as I40E.
Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/Kconfig | 11 +++++++++++
drivers/net/ethernet/intel/fm10k/fm10k_netdev.c | 6 +++---
2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/intel/Kconfig b/drivers/net/ethernet/intel/Kconfig
index 6919adb..5b8300a 100644
--- a/drivers/net/ethernet/intel/Kconfig
+++ b/drivers/net/ethernet/intel/Kconfig
@@ -320,4 +320,15 @@ config FM10K
To compile this driver as a module, choose M here. The module
will be called fm10k. MSI-X interrupt support is required
+config FM10K_VXLAN
+ bool "Virtual eXtensible Local Area Network Support"
+ default n
+ depends on FM10K && VXLAN && !(FM10K=y && VXLAN=m)
+ ---help---
+ This allows one to create VXLAN virtual interfaces that provide
+ Layer 2 Networks over Layer 3 Networks. VXLAN is often used
+ to tunnel virtual network infrastructure in virtualized environments.
+ Say Y here if you want to use Virtual eXtensible Local Area Network
+ (VXLAN) in the driver.
+
endif # NET_VENDOR_INTEL
diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c b/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c
index b57ea1c..8811364 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c
@@ -20,9 +20,9 @@
#include "fm10k.h"
#include <linux/vmalloc.h>
-#if IS_ENABLED(CONFIG_VXLAN)
+#if IS_ENABLED(CONFIG_FM10K_VXLAN)
#include <net/vxlan.h>
-#endif /* CONFIG_VXLAN */
+#endif /* CONFIG_FM10K_VXLAN */
/**
* fm10k_setup_tx_resources - allocate Tx resources (Descriptors)
@@ -556,7 +556,7 @@ int fm10k_open(struct net_device *netdev)
if (err)
goto err_set_queues;
-#if IS_ENABLED(CONFIG_VXLAN)
+#if IS_ENABLED(CONFIG_FM10K_VXLAN)
/* update VXLAN port configuration */
vxlan_get_rx_port(netdev);
--
1.9.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [net 4/4] ixgbe: check for vfs outside of sriov_num_vfs before dereference
2014-10-16 9:36 [net 0/4][pull request] Intel Wired LAN Driver Updates 2014-10-16 Jeff Kirsher
` (2 preceding siblings ...)
2014-10-16 9:36 ` [net 3/4] fm10k: Add CONFIG_FM10K_VXLAN configuration option Jeff Kirsher
@ 2014-10-16 9:36 ` Jeff Kirsher
2014-10-16 18:43 ` [net 0/4][pull request] Intel Wired LAN Driver Updates 2014-10-16 David Miller
4 siblings, 0 replies; 6+ messages in thread
From: Jeff Kirsher @ 2014-10-16 9:36 UTC (permalink / raw)
To: davem; +Cc: Emil Tantilov, netdev, nhorman, sassmann, jogreene, Jeff Kirsher
From: Emil Tantilov <emil.s.tantilov@intel.com>
The check for vfinfo is not sufficient because it does not protect
against specifying vf that is outside of sriov_num_vfs range.
All of the ndo functions have a check for it except for
ixgbevf_ndo_set_spoofcheck().
The following patch is all we need to protect against this panic:
ip link set p96p1 vf 0 spoofchk off
BUG: unable to handle kernel NULL pointer dereference at 0000000000000052
IP: [<ffffffffa044a1c1>]
ixgbe_ndo_set_vf_spoofchk+0x51/0x150 [ixgbe]
Reported-by: Thierry Herbelot <thierry.herbelot@6wind.com>
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Acked-by: Thierry Herbelot <thierry.herbelot@6wind.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
index 706fc69..97c85b8 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
@@ -1261,6 +1261,9 @@ int ixgbe_ndo_set_vf_spoofchk(struct net_device *netdev, int vf, bool setting)
struct ixgbe_hw *hw = &adapter->hw;
u32 regval;
+ if (vf >= adapter->num_vfs)
+ return -EINVAL;
+
adapter->vfinfo[vf].spoofchk_enabled = setting;
regval = IXGBE_READ_REG(hw, IXGBE_PFVFSPOOF(vf_target_reg));
--
1.9.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [net 0/4][pull request] Intel Wired LAN Driver Updates 2014-10-16
2014-10-16 9:36 [net 0/4][pull request] Intel Wired LAN Driver Updates 2014-10-16 Jeff Kirsher
` (3 preceding siblings ...)
2014-10-16 9:36 ` [net 4/4] ixgbe: check for vfs outside of sriov_num_vfs before dereference Jeff Kirsher
@ 2014-10-16 18:43 ` David Miller
4 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2014-10-16 18:43 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, nhorman, sassmann, jogreene
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Thu, 16 Oct 2014 02:36:23 -0700
> This series contains updates to fm10k and ixgbe.
>
> Matthew provides two fixes for fm10k, first sets the flag to fetch the
> host state before kicking off the service task that reads the host
> state when bringing the interface up. The second makes sure that we
> release the mailbox lock after detecting an error and before we return
> the error code.
>
> Andy Zhou provides a compile fix for fm10k, when the driver is compiled
> into the kernel and the VXLAN driver is compiled as a module.
>
> Emil provides a fix for ixgbe to prevent against a panic by trying
> to dereference a NULL pointer in ixgbe_ndo_set_vf_spoofchk().
Series applied, thanks Jeff.
^ permalink raw reply [flat|nested] 6+ messages in thread