* [PATCH net 0/3][pull request] Intel Wired LAN Driver Updates 2021-04-14
@ 2021-04-14 16:20 Tony Nguyen
2021-04-14 16:20 ` [PATCH net 1/3] ixgbe: Fix NULL pointer dereference in ethtool loopback test Tony Nguyen
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Tony Nguyen @ 2021-04-14 16:20 UTC (permalink / raw)
To: davem, kuba; +Cc: Tony Nguyen, netdev, sassmann
This series contains updates to ixgbe and ice drivers.
Alex Duyck fixes a NULL pointer dereference for ixgbe.
Yongxin Liu fixes an unbalanced enable/disable which was causing a call
trace with suspend for ixgbe.
Colin King fixes a potential infinite loop for ice.
The following are changes since commit 2afeec08ab5c86ae21952151f726bfe184f6b23d:
xen-netback: Check for hotplug-status existence before watching
and are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue 10GbE
Alexander Duyck (1):
ixgbe: Fix NULL pointer dereference in ethtool loopback test
Colin Ian King (1):
ice: Fix potential infinite loop when using u8 loop counter
Yongxin Liu (1):
ixgbe: fix unbalanced device enable/disable in suspend/resume
drivers/net/ethernet/intel/ice/ice_dcb.c | 4 ++--
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 14 +++++++++++++-
2 files changed, 15 insertions(+), 3 deletions(-)
--
2.26.2
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH net 1/3] ixgbe: Fix NULL pointer dereference in ethtool loopback test
2021-04-14 16:20 [PATCH net 0/3][pull request] Intel Wired LAN Driver Updates 2021-04-14 Tony Nguyen
@ 2021-04-14 16:20 ` Tony Nguyen
2021-04-14 16:20 ` [PATCH net 2/3] ixgbe: fix unbalanced device enable/disable in suspend/resume Tony Nguyen
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Tony Nguyen @ 2021-04-14 16:20 UTC (permalink / raw)
To: davem, kuba
Cc: Alexander Duyck, netdev, sassmann, anthony.l.nguyen,
Björn Töpel, Dave Switzer
From: Alexander Duyck <alexanderduyck@fb.com>
The ixgbe driver currently generates a NULL pointer dereference when
performing the ethtool loopback test. This is due to the fact that there
isn't a q_vector associated with the test ring when it is setup as
interrupts are not normally added to the test rings.
To address this I have added code that will check for a q_vector before
returning a napi_id value. If a q_vector is not present it will return a
value of 0.
Fixes: b02e5a0ebb17 ("xsk: Propagate napi_id to XDP socket Rx path")
Signed-off-by: Alexander Duyck <alexanderduyck@fb.com>
Acked-by: Björn Töpel <bjorn.topel@intel.com>
Tested-by: Dave Switzer <david.switzer@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 03d9aad516d4..45d2c8f37c01 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -6536,6 +6536,13 @@ static int ixgbe_setup_all_tx_resources(struct ixgbe_adapter *adapter)
return err;
}
+static int ixgbe_rx_napi_id(struct ixgbe_ring *rx_ring)
+{
+ struct ixgbe_q_vector *q_vector = rx_ring->q_vector;
+
+ return q_vector ? q_vector->napi.napi_id : 0;
+}
+
/**
* ixgbe_setup_rx_resources - allocate Rx resources (Descriptors)
* @adapter: pointer to ixgbe_adapter
@@ -6583,7 +6590,7 @@ int ixgbe_setup_rx_resources(struct ixgbe_adapter *adapter,
/* XDP RX-queue info */
if (xdp_rxq_info_reg(&rx_ring->xdp_rxq, adapter->netdev,
- rx_ring->queue_index, rx_ring->q_vector->napi.napi_id) < 0)
+ rx_ring->queue_index, ixgbe_rx_napi_id(rx_ring)) < 0)
goto err;
rx_ring->xdp_prog = adapter->xdp_prog;
--
2.26.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH net 2/3] ixgbe: fix unbalanced device enable/disable in suspend/resume
2021-04-14 16:20 [PATCH net 0/3][pull request] Intel Wired LAN Driver Updates 2021-04-14 Tony Nguyen
2021-04-14 16:20 ` [PATCH net 1/3] ixgbe: Fix NULL pointer dereference in ethtool loopback test Tony Nguyen
@ 2021-04-14 16:20 ` Tony Nguyen
2021-04-14 16:20 ` [PATCH net 3/3] ice: Fix potential infinite loop when using u8 loop counter Tony Nguyen
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Tony Nguyen @ 2021-04-14 16:20 UTC (permalink / raw)
To: davem, kuba; +Cc: Yongxin Liu, netdev, sassmann, anthony.l.nguyen, Dave Switzer
From: Yongxin Liu <yongxin.liu@windriver.com>
pci_disable_device() called in __ixgbe_shutdown() decreases
dev->enable_cnt by 1. pci_enable_device_mem() which increases
dev->enable_cnt by 1, was removed from ixgbe_resume() in commit
6f82b2558735 ("ixgbe: use generic power management"). This caused
unbalanced increase/decrease. So add pci_enable_device_mem() back.
Fix the following call trace.
ixgbe 0000:17:00.1: disabling already-disabled device
Call Trace:
__ixgbe_shutdown+0x10a/0x1e0 [ixgbe]
ixgbe_suspend+0x32/0x70 [ixgbe]
pci_pm_suspend+0x87/0x160
? pci_pm_freeze+0xd0/0xd0
dpm_run_callback+0x42/0x170
__device_suspend+0x114/0x460
async_suspend+0x1f/0xa0
async_run_entry_fn+0x3c/0xf0
process_one_work+0x1dd/0x410
worker_thread+0x34/0x3f0
? cancel_delayed_work+0x90/0x90
kthread+0x14c/0x170
? kthread_park+0x90/0x90
ret_from_fork+0x1f/0x30
Fixes: 6f82b2558735 ("ixgbe: use generic power management")
Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com>
Tested-by: Dave Switzer <david.switzer@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 45d2c8f37c01..cffb95f8f632 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -6899,6 +6899,11 @@ static int __maybe_unused ixgbe_resume(struct device *dev_d)
adapter->hw.hw_addr = adapter->io_addr;
+ err = pci_enable_device_mem(pdev);
+ if (err) {
+ e_dev_err("Cannot enable PCI device from suspend\n");
+ return err;
+ }
smp_mb__before_atomic();
clear_bit(__IXGBE_DISABLED, &adapter->state);
pci_set_master(pdev);
--
2.26.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH net 3/3] ice: Fix potential infinite loop when using u8 loop counter
2021-04-14 16:20 [PATCH net 0/3][pull request] Intel Wired LAN Driver Updates 2021-04-14 Tony Nguyen
2021-04-14 16:20 ` [PATCH net 1/3] ixgbe: Fix NULL pointer dereference in ethtool loopback test Tony Nguyen
2021-04-14 16:20 ` [PATCH net 2/3] ixgbe: fix unbalanced device enable/disable in suspend/resume Tony Nguyen
@ 2021-04-14 16:20 ` Tony Nguyen
2021-04-14 23:28 ` [PATCH net 0/3][pull request] Intel Wired LAN Driver Updates 2021-04-14 Jakub Kicinski
2021-04-15 21:40 ` patchwork-bot+netdevbpf
4 siblings, 0 replies; 6+ messages in thread
From: Tony Nguyen @ 2021-04-14 16:20 UTC (permalink / raw)
To: davem, kuba
Cc: Colin Ian King, netdev, sassmann, anthony.l.nguyen, Tony Brelinski
From: Colin Ian King <colin.king@canonical.com>
A for-loop is using a u8 loop counter that is being compared to
a u32 cmp_dcbcfg->numapp to check for the end of the loop. If
cmp_dcbcfg->numapp is larger than 255 then the counter j will wrap
around to zero and hence an infinite loop occurs. Fix this by making
counter j the same type as cmp_dcbcfg->numapp.
Addresses-Coverity: ("Infinite loop")
Fixes: aeac8ce864d9 ("ice: Recognize 860 as iSCSI port in CEE mode")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Tested-by: Tony Brelinski <tonyx.brelinski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/ice/ice_dcb.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/ice/ice_dcb.c b/drivers/net/ethernet/intel/ice/ice_dcb.c
index 211ac6f907ad..28e834a128c0 100644
--- a/drivers/net/ethernet/intel/ice/ice_dcb.c
+++ b/drivers/net/ethernet/intel/ice/ice_dcb.c
@@ -747,8 +747,8 @@ ice_cee_to_dcb_cfg(struct ice_aqc_get_cee_dcb_cfg_resp *cee_cfg,
struct ice_port_info *pi)
{
u32 status, tlv_status = le32_to_cpu(cee_cfg->tlv_status);
- u32 ice_aqc_cee_status_mask, ice_aqc_cee_status_shift;
- u8 i, j, err, sync, oper, app_index, ice_app_sel_type;
+ u32 ice_aqc_cee_status_mask, ice_aqc_cee_status_shift, j;
+ u8 i, err, sync, oper, app_index, ice_app_sel_type;
u16 app_prio = le16_to_cpu(cee_cfg->oper_app_prio);
u16 ice_aqc_cee_app_mask, ice_aqc_cee_app_shift;
struct ice_dcbx_cfg *cmp_dcbcfg, *dcbcfg;
--
2.26.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH net 0/3][pull request] Intel Wired LAN Driver Updates 2021-04-14
2021-04-14 16:20 [PATCH net 0/3][pull request] Intel Wired LAN Driver Updates 2021-04-14 Tony Nguyen
` (2 preceding siblings ...)
2021-04-14 16:20 ` [PATCH net 3/3] ice: Fix potential infinite loop when using u8 loop counter Tony Nguyen
@ 2021-04-14 23:28 ` Jakub Kicinski
2021-04-15 21:40 ` patchwork-bot+netdevbpf
4 siblings, 0 replies; 6+ messages in thread
From: Jakub Kicinski @ 2021-04-14 23:28 UTC (permalink / raw)
To: Tony Nguyen; +Cc: davem, netdev, sassmann
On Wed, 14 Apr 2021 09:20:29 -0700 Tony Nguyen wrote:
> This series contains updates to ixgbe and ice drivers.
>
> Alex Duyck fixes a NULL pointer dereference for ixgbe.
>
> Yongxin Liu fixes an unbalanced enable/disable which was causing a call
> trace with suspend for ixgbe.
>
> Colin King fixes a potential infinite loop for ice.
Acked-by: Jakub Kicinski <kuba@kernel.org>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net 0/3][pull request] Intel Wired LAN Driver Updates 2021-04-14
2021-04-14 16:20 [PATCH net 0/3][pull request] Intel Wired LAN Driver Updates 2021-04-14 Tony Nguyen
` (3 preceding siblings ...)
2021-04-14 23:28 ` [PATCH net 0/3][pull request] Intel Wired LAN Driver Updates 2021-04-14 Jakub Kicinski
@ 2021-04-15 21:40 ` patchwork-bot+netdevbpf
4 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-04-15 21:40 UTC (permalink / raw)
To: Tony Nguyen; +Cc: davem, kuba, netdev, sassmann
Hello:
This series was applied to netdev/net.git (refs/heads/master):
On Wed, 14 Apr 2021 09:20:29 -0700 you wrote:
> This series contains updates to ixgbe and ice drivers.
>
> Alex Duyck fixes a NULL pointer dereference for ixgbe.
>
> Yongxin Liu fixes an unbalanced enable/disable which was causing a call
> trace with suspend for ixgbe.
>
> [...]
Here is the summary with links:
- [net,1/3] ixgbe: Fix NULL pointer dereference in ethtool loopback test
https://git.kernel.org/netdev/net/c/31166efb1cee
- [net,2/3] ixgbe: fix unbalanced device enable/disable in suspend/resume
https://git.kernel.org/netdev/net/c/debb9df31158
- [net,3/3] ice: Fix potential infinite loop when using u8 loop counter
https://git.kernel.org/netdev/net/c/ef963ae427aa
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-04-15 21:40 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-14 16:20 [PATCH net 0/3][pull request] Intel Wired LAN Driver Updates 2021-04-14 Tony Nguyen
2021-04-14 16:20 ` [PATCH net 1/3] ixgbe: Fix NULL pointer dereference in ethtool loopback test Tony Nguyen
2021-04-14 16:20 ` [PATCH net 2/3] ixgbe: fix unbalanced device enable/disable in suspend/resume Tony Nguyen
2021-04-14 16:20 ` [PATCH net 3/3] ice: Fix potential infinite loop when using u8 loop counter Tony Nguyen
2021-04-14 23:28 ` [PATCH net 0/3][pull request] Intel Wired LAN Driver Updates 2021-04-14 Jakub Kicinski
2021-04-15 21:40 ` patchwork-bot+netdevbpf
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.