* [net 0/4][pull request] Intel Wired LAN Driver Updates 2016-10-27
@ 2016-10-27 21:27 Jeff Kirsher
2016-10-27 21:27 ` [net 1/4] ixgbe: fix panic when using macvlan with l2-fwd-offload enabled Jeff Kirsher
` (4 more replies)
0 siblings, 5 replies; 7+ messages in thread
From: Jeff Kirsher @ 2016-10-27 21:27 UTC (permalink / raw)
To: davem; +Cc: Jeff Kirsher, netdev, nhorman, sassmann, jogreene, guru.anbalagane
This series contains fixes to ixgbe and i40e.
Emil fixes a NULL pointer dereference when a macvlan interface is brought
up while the PF is still down.
David root caused the original panic that was fixed by commit id
(a036244c068612 "i40e: Fix kernel panic on enable/disable LLDP") and the
fix was not quite correct, so removed the get_default_tc() and replaced
it with a #define since there is only one TC supported as a default.
Guilherme Piccoli fixes an issue where if we modprobe the driver module
without enough MSI-X interrupts, then unload the module and reload it
again, the kernel would crash. So if we fail to allocate enough MSI-X
interrupts, we should disable them since they were previously enabled.
Huaibin Wang found that the order of the arguments for
ndo_dflt_bridge_getlink() were in the correct order, so fix the order.
The following are changes since commit d5d32e4b76687f4df9ad3ba8d3702b7347f51fa6:
net: ipv6: Do not consider link state for nexthop validation
and are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-queue 40GbE
David Ertman (1):
i40e: Fix configure TCs after initial DCB disable
Emil Tantilov (1):
ixgbe: fix panic when using macvlan with l2-fwd-offload enabled
Guilherme G Piccoli (1):
i40e: disable MSI-X interrupts if we cannot reserve enough vectors
Huaibin Wang (1):
i40e: fix call of ndo_dflt_bridge_getlink()
drivers/net/ethernet/intel/i40e/i40e.h | 1 +
drivers/net/ethernet/intel/i40e/i40e_main.c | 34 +++++----------------------
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 12 ++++++----
3 files changed, 15 insertions(+), 32 deletions(-)
--
2.7.4
^ permalink raw reply [flat|nested] 7+ messages in thread
* [net 1/4] ixgbe: fix panic when using macvlan with l2-fwd-offload enabled
2016-10-27 21:27 [net 0/4][pull request] Intel Wired LAN Driver Updates 2016-10-27 Jeff Kirsher
@ 2016-10-27 21:27 ` Jeff Kirsher
2016-10-27 21:27 ` [net 2/4] i40e: Fix configure TCs after initial DCB disable Jeff Kirsher
` (3 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Jeff Kirsher @ 2016-10-27 21:27 UTC (permalink / raw)
To: davem
Cc: Emil Tantilov, netdev, nhorman, sassmann, jogreene,
guru.anbalagane, Jeff Kirsher
From: Emil Tantilov <emil.s.tantilov@intel.com>
Fix NULL pointer dereference in the case where a macvlan interface is
brought up while the PF is still down:
BUG: unable to handle kernel NULL pointer dereference at 0000000000000010
IP: [<ffffffffa0170fb2>] ixgbe_alloc_rx_buffers+0x42/0x1a0 [ixgbe]
Call Trace:
[<ffffffffa017336b>] ixgbe_configure_rx_ring+0x2eb/0x3d0 [ixgbe]
[<ffffffffa0173811>] ixgbe_fwd_ring_up+0xd1/0x380 [ixgbe]
[<ffffffffa0179709>] ixgbe_fwd_add+0x149/0x230 [ixgbe]
[<ffffffffa0113480>] macvlan_open+0x260/0x2b0 [macvlan]
Reported-by: Matthew Garrett <mjg59@coreos.com>
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index a244d9a..bd93d82 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -9135,10 +9135,14 @@ static void *ixgbe_fwd_add(struct net_device *pdev, struct net_device *vdev)
goto fwd_add_err;
fwd_adapter->pool = pool;
fwd_adapter->real_adapter = adapter;
- err = ixgbe_fwd_ring_up(vdev, fwd_adapter);
- if (err)
- goto fwd_add_err;
- netif_tx_start_all_queues(vdev);
+
+ if (netif_running(pdev)) {
+ err = ixgbe_fwd_ring_up(vdev, fwd_adapter);
+ if (err)
+ goto fwd_add_err;
+ netif_tx_start_all_queues(vdev);
+ }
+
return fwd_adapter;
fwd_add_err:
/* unwind counter and free adapter struct */
--
2.7.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [net 2/4] i40e: Fix configure TCs after initial DCB disable
2016-10-27 21:27 [net 0/4][pull request] Intel Wired LAN Driver Updates 2016-10-27 Jeff Kirsher
2016-10-27 21:27 ` [net 1/4] ixgbe: fix panic when using macvlan with l2-fwd-offload enabled Jeff Kirsher
@ 2016-10-27 21:27 ` Jeff Kirsher
2016-10-27 21:27 ` [net 3/4] i40e: disable MSI-X interrupts if we cannot reserve enough vectors Jeff Kirsher
` (2 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Jeff Kirsher @ 2016-10-27 21:27 UTC (permalink / raw)
To: davem
Cc: David Ertman, netdev, nhorman, sassmann, jogreene,
guru.anbalagane, Jeff Kirsher
From: David Ertman <david.m.ertman@intel.com>
in commit a036244c068612a43fa8c0f33a0eb4daa4d8dba0 a fix
was put into place to avoid a kernel panic when a non-
supported traffic class configuration was put into place
and then lldp was enabled/disabled on the link partner
switch. This fix caused it to be necessary to
unload/reload the driver to reenable DCB once a supported
TC config was in place.
The root cause of the original panic was that the function
i40e_pf_get_default_tc was allowing for a default TC other
than TC 0, and only TC 0 is supported as a default.
This patch removes the get_default_tc function and replaces
it with a #define since there is only one TC supported as
a default.
Change-Id: I448371974e946386d0a7718d73668b450b7c72ef
Signed-off-by: Dave Ertman <david.m.ertman@intel.com>
Tested-by: Ronald Bynoe <ronald.j.bynoe@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e.h | 1 +
drivers/net/ethernet/intel/i40e/i40e_main.c | 31 ++++-------------------------
2 files changed, 5 insertions(+), 27 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h
index 2030d7c..6d61e44 100644
--- a/drivers/net/ethernet/intel/i40e/i40e.h
+++ b/drivers/net/ethernet/intel/i40e/i40e.h
@@ -92,6 +92,7 @@
#define I40E_AQ_LEN 256
#define I40E_AQ_WORK_LIMIT 66 /* max number of VFs + a little */
#define I40E_MAX_USER_PRIORITY 8
+#define I40E_DEFAULT_TRAFFIC_CLASS BIT(0)
#define I40E_DEFAULT_MSG_ENABLE 4
#define I40E_QUEUE_WAIT_RETRY_LIMIT 10
#define I40E_INT_NAME_STR_LEN (IFNAMSIZ + 16)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index ac1faee..050d005 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -4641,29 +4641,6 @@ static u8 i40e_pf_get_num_tc(struct i40e_pf *pf)
}
/**
- * i40e_pf_get_default_tc - Get bitmap for first enabled TC
- * @pf: PF being queried
- *
- * Return a bitmap for first enabled traffic class for this PF.
- **/
-static u8 i40e_pf_get_default_tc(struct i40e_pf *pf)
-{
- u8 enabled_tc = pf->hw.func_caps.enabled_tcmap;
- u8 i = 0;
-
- if (!enabled_tc)
- return 0x1; /* TC0 */
-
- /* Find the first enabled TC */
- for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) {
- if (enabled_tc & BIT(i))
- break;
- }
-
- return BIT(i);
-}
-
-/**
* i40e_pf_get_pf_tc_map - Get bitmap for enabled traffic classes
* @pf: PF being queried
*
@@ -4673,7 +4650,7 @@ static u8 i40e_pf_get_tc_map(struct i40e_pf *pf)
{
/* If DCB is not enabled for this PF then just return default TC */
if (!(pf->flags & I40E_FLAG_DCB_ENABLED))
- return i40e_pf_get_default_tc(pf);
+ return I40E_DEFAULT_TRAFFIC_CLASS;
/* SFP mode we want PF to be enabled for all TCs */
if (!(pf->flags & I40E_FLAG_MFP_ENABLED))
@@ -4683,7 +4660,7 @@ static u8 i40e_pf_get_tc_map(struct i40e_pf *pf)
if (pf->hw.func_caps.iscsi)
return i40e_get_iscsi_tc_map(pf);
else
- return i40e_pf_get_default_tc(pf);
+ return I40E_DEFAULT_TRAFFIC_CLASS;
}
/**
@@ -5029,7 +5006,7 @@ static void i40e_dcb_reconfigure(struct i40e_pf *pf)
if (v == pf->lan_vsi)
tc_map = i40e_pf_get_tc_map(pf);
else
- tc_map = i40e_pf_get_default_tc(pf);
+ tc_map = I40E_DEFAULT_TRAFFIC_CLASS;
#ifdef I40E_FCOE
if (pf->vsi[v]->type == I40E_VSI_FCOE)
tc_map = i40e_get_fcoe_tc_map(pf);
@@ -5717,7 +5694,7 @@ static int i40e_handle_lldp_event(struct i40e_pf *pf,
u8 type;
/* Not DCB capable or capability disabled */
- if (!(pf->flags & I40E_FLAG_DCB_ENABLED))
+ if (!(pf->flags & I40E_FLAG_DCB_CAPABLE))
return ret;
/* Ignore if event is not for Nearest Bridge */
--
2.7.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [net 3/4] i40e: disable MSI-X interrupts if we cannot reserve enough vectors
2016-10-27 21:27 [net 0/4][pull request] Intel Wired LAN Driver Updates 2016-10-27 Jeff Kirsher
2016-10-27 21:27 ` [net 1/4] ixgbe: fix panic when using macvlan with l2-fwd-offload enabled Jeff Kirsher
2016-10-27 21:27 ` [net 2/4] i40e: Fix configure TCs after initial DCB disable Jeff Kirsher
@ 2016-10-27 21:27 ` Jeff Kirsher
2016-10-27 21:27 ` [net 4/4] i40e: fix call of ndo_dflt_bridge_getlink() Jeff Kirsher
2016-10-29 21:14 ` [net 0/4][pull request] Intel Wired LAN Driver Updates 2016-10-27 David Miller
4 siblings, 0 replies; 7+ messages in thread
From: Jeff Kirsher @ 2016-10-27 21:27 UTC (permalink / raw)
To: davem
Cc: Guilherme G Piccoli, netdev, nhorman, sassmann, jogreene,
guru.anbalagane, Jeff Kirsher
From: Guilherme G Piccoli <gpiccoli@linux.vnet.ibm.com>
If we fail on allocating enough MSI-X interrupts, we should disable
them since they were previously enabled in this point of code.
Not disabling them can lead to WARN_ON() being triggered and subsequent
failure in enabling MSI as a fallback; the below message was shown without
this patch while we played with interrupt allocation in i40e driver:
[ 21.461346] sysfs: cannot create duplicate filename '/devices/pci0007:00/0007:00:00.0/0007:01:00.3/msi_irqs'
[ 21.461459] ------------[ cut here ]------------
[ 21.461514] WARNING: CPU: 64 PID: 1155 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x88/0xc0
Also, we noticed that without this patch, if we modprobe the module without
enough MSI-X interrupts (triggering the above warning), unload the module
and re-load it again, we got a crash on the system.
Signed-off-by: Guilherme G Piccoli <gpiccoli@linux.vnet.ibm.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_main.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 050d005..6abc130 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -7684,6 +7684,7 @@ static int i40e_init_msix(struct i40e_pf *pf)
pf->flags &= ~I40E_FLAG_MSIX_ENABLED;
kfree(pf->msix_entries);
pf->msix_entries = NULL;
+ pci_disable_msix(pf->pdev);
return -ENODEV;
} else if (v_actual == I40E_MIN_MSIX) {
--
2.7.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [net 4/4] i40e: fix call of ndo_dflt_bridge_getlink()
2016-10-27 21:27 [net 0/4][pull request] Intel Wired LAN Driver Updates 2016-10-27 Jeff Kirsher
` (2 preceding siblings ...)
2016-10-27 21:27 ` [net 3/4] i40e: disable MSI-X interrupts if we cannot reserve enough vectors Jeff Kirsher
@ 2016-10-27 21:27 ` Jeff Kirsher
2016-10-27 22:13 ` Greg
2016-10-29 21:14 ` [net 0/4][pull request] Intel Wired LAN Driver Updates 2016-10-27 David Miller
4 siblings, 1 reply; 7+ messages in thread
From: Jeff Kirsher @ 2016-10-27 21:27 UTC (permalink / raw)
To: davem
Cc: Huaibin Wang, netdev, nhorman, sassmann, jogreene,
guru.anbalagane, Carolyn Wyborny, Nicolas Dichtel, Jeff Kirsher
From: Huaibin Wang <huaibin.wang@6wind.com>
Order of arguments is wrong.
The wrong code has been introduced by commit 7d4f8d871ab1, but is compiled
only since commit 9df70b66418e.
Note that this may break netlink dumps.
Fixes: 9df70b66418e ("i40e: Remove incorrect #ifdef's")
Fixes: 7d4f8d871ab1 ("switchdev; add VLAN support for port's bridge_getlink")
CC: Carolyn Wyborny <carolyn.wyborny@intel.com>
Signed-off-by: Huaibin Wang <huaibin.wang@6wind.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.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_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 6abc130..31c97e3 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -9034,7 +9034,7 @@ static int i40e_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
return 0;
return ndo_dflt_bridge_getlink(skb, pid, seq, dev, veb->bridge_mode,
- nlflags, 0, 0, filter_mask, NULL);
+ 0, 0, nlflags, filter_mask, NULL);
}
/* Hardware supports L4 tunnel length of 128B (=2^7) which includes
--
2.7.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [net 4/4] i40e: fix call of ndo_dflt_bridge_getlink()
2016-10-27 21:27 ` [net 4/4] i40e: fix call of ndo_dflt_bridge_getlink() Jeff Kirsher
@ 2016-10-27 22:13 ` Greg
0 siblings, 0 replies; 7+ messages in thread
From: Greg @ 2016-10-27 22:13 UTC (permalink / raw)
To: Jeff Kirsher
Cc: davem, Huaibin Wang, netdev, nhorman, sassmann, jogreene,
guru.anbalagane, Carolyn Wyborny, Nicolas Dichtel
On Thu, 2016-10-27 at 14:27 -0700, Jeff Kirsher wrote:
> From: Huaibin Wang <huaibin.wang@6wind.com>
>
> Order of arguments is wrong.
> The wrong code has been introduced by commit 7d4f8d871ab1, but is compiled
> only since commit 9df70b66418e.
>
> Note that this may break netlink dumps.
>
> Fixes: 9df70b66418e ("i40e: Remove incorrect #ifdef's")
> Fixes: 7d4f8d871ab1 ("switchdev; add VLAN support for port's bridge_getlink")
> CC: Carolyn Wyborny <carolyn.wyborny@intel.com>
> Signed-off-by: Huaibin Wang <huaibin.wang@6wind.com>
> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.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_main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
> index 6abc130..31c97e3 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_main.c
> +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
> @@ -9034,7 +9034,7 @@ static int i40e_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
> return 0;
>
> return ndo_dflt_bridge_getlink(skb, pid, seq, dev, veb->bridge_mode,
> - nlflags, 0, 0, filter_mask, NULL);
> + 0, 0, nlflags, filter_mask, NULL);
Yikes! And NDO function with 10 parameters? No wonder they get mixed
up.
- Greg
> }
>
> /* Hardware supports L4 tunnel length of 128B (=2^7) which includes
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [net 0/4][pull request] Intel Wired LAN Driver Updates 2016-10-27
2016-10-27 21:27 [net 0/4][pull request] Intel Wired LAN Driver Updates 2016-10-27 Jeff Kirsher
` (3 preceding siblings ...)
2016-10-27 21:27 ` [net 4/4] i40e: fix call of ndo_dflt_bridge_getlink() Jeff Kirsher
@ 2016-10-29 21:14 ` David Miller
4 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2016-10-29 21:14 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, nhorman, sassmann, jogreene, guru.anbalagane
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Thu, 27 Oct 2016 14:27:53 -0700
> This series contains fixes to ixgbe and i40e.
Pulled, thanks Jeff.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2016-10-29 21:14 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-27 21:27 [net 0/4][pull request] Intel Wired LAN Driver Updates 2016-10-27 Jeff Kirsher
2016-10-27 21:27 ` [net 1/4] ixgbe: fix panic when using macvlan with l2-fwd-offload enabled Jeff Kirsher
2016-10-27 21:27 ` [net 2/4] i40e: Fix configure TCs after initial DCB disable Jeff Kirsher
2016-10-27 21:27 ` [net 3/4] i40e: disable MSI-X interrupts if we cannot reserve enough vectors Jeff Kirsher
2016-10-27 21:27 ` [net 4/4] i40e: fix call of ndo_dflt_bridge_getlink() Jeff Kirsher
2016-10-27 22:13 ` Greg
2016-10-29 21:14 ` [net 0/4][pull request] Intel Wired LAN Driver Updates 2016-10-27 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.