All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 0/2][pull request] Intel Wired LAN Driver Updates 2021-10-25
@ 2021-10-25 20:56 Tony Nguyen
  2021-10-25 20:56 ` [PATCH net 1/2] ice: Respond to a NETDEV_UNREGISTER event for LAG Tony Nguyen
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Tony Nguyen @ 2021-10-25 20:56 UTC (permalink / raw)
  To: davem, kuba; +Cc: Tony Nguyen, netdev

This series contains updates to ice driver only.

Dave adds event handler for LAG NETDEV_UNREGISTER to unlink device from
link aggregate.

Yongxin Liu adds a check for PTP support during release which would
cause a call trace on non-PTP supported devices.

The following are changes since commit f7a1e76d0f608961cc2fc681f867a834f2746bce:
  net-sysfs: initialize uid and gid before calling net_ns_get_ownership
and are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue 100GbE

Dave Ertman (1):
  ice: Respond to a NETDEV_UNREGISTER event for LAG

Yongxin Liu (1):
  ice: check whether PTP is initialized in ice_ptp_release()

 drivers/net/ethernet/intel/ice/ice_lag.c | 18 ++++--------------
 drivers/net/ethernet/intel/ice/ice_ptp.c |  3 +++
 2 files changed, 7 insertions(+), 14 deletions(-)

-- 
2.31.1


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

* [PATCH net 1/2] ice: Respond to a NETDEV_UNREGISTER event for LAG
  2021-10-25 20:56 [PATCH net 0/2][pull request] Intel Wired LAN Driver Updates 2021-10-25 Tony Nguyen
@ 2021-10-25 20:56 ` Tony Nguyen
  2021-10-25 20:56 ` [PATCH net 2/2] ice: check whether PTP is initialized in ice_ptp_release() Tony Nguyen
  2021-10-26 12:30 ` [PATCH net 0/2][pull request] Intel Wired LAN Driver Updates 2021-10-25 patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Tony Nguyen @ 2021-10-25 20:56 UTC (permalink / raw)
  To: davem, kuba; +Cc: Dave Ertman, netdev, anthony.l.nguyen, Tony Brelinski

From: Dave Ertman <david.m.ertman@intel.com>

When the PF is a member of a link aggregate, and the driver
is removed, the process will hang unless we respond to the
NETDEV_UNREGISTER event that is sent to the event_handler
for LAG.

Add a case statement for the ice_lag_event_handler to unlink
the PF from the link aggregate.

Also remove code that was incorrectly applying a dev_hold to
peer_netdevs that were associated with the ice driver.

Fixes: df006dd4b1dc ("ice: Add initial support framework for LAG")
Signed-off-by: Dave Ertman <david.m.ertman@intel.com>
Tested-by: Tony Brelinski <tony.brelinski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_lag.c | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_lag.c b/drivers/net/ethernet/intel/ice/ice_lag.c
index 37c18c66b5c7..e375ac849aec 100644
--- a/drivers/net/ethernet/intel/ice/ice_lag.c
+++ b/drivers/net/ethernet/intel/ice/ice_lag.c
@@ -100,9 +100,9 @@ static void ice_display_lag_info(struct ice_lag *lag)
  */
 static void ice_lag_info_event(struct ice_lag *lag, void *ptr)
 {
-	struct net_device *event_netdev, *netdev_tmp;
 	struct netdev_notifier_bonding_info *info;
 	struct netdev_bonding_info *bonding_info;
+	struct net_device *event_netdev;
 	const char *lag_netdev_name;
 
 	event_netdev = netdev_notifier_info_to_dev(ptr);
@@ -123,19 +123,6 @@ static void ice_lag_info_event(struct ice_lag *lag, void *ptr)
 		goto lag_out;
 	}
 
-	rcu_read_lock();
-	for_each_netdev_in_bond_rcu(lag->upper_netdev, netdev_tmp) {
-		if (!netif_is_ice(netdev_tmp))
-			continue;
-
-		if (netdev_tmp && netdev_tmp != lag->netdev &&
-		    lag->peer_netdev != netdev_tmp) {
-			dev_hold(netdev_tmp);
-			lag->peer_netdev = netdev_tmp;
-		}
-	}
-	rcu_read_unlock();
-
 	if (bonding_info->slave.state)
 		ice_lag_set_backup(lag);
 	else
@@ -319,6 +306,9 @@ ice_lag_event_handler(struct notifier_block *notif_blk, unsigned long event,
 	case NETDEV_BONDING_INFO:
 		ice_lag_info_event(lag, ptr);
 		break;
+	case NETDEV_UNREGISTER:
+		ice_lag_unlink(lag, ptr);
+		break;
 	default:
 		break;
 	}
-- 
2.31.1


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

* [PATCH net 2/2] ice: check whether PTP is initialized in ice_ptp_release()
  2021-10-25 20:56 [PATCH net 0/2][pull request] Intel Wired LAN Driver Updates 2021-10-25 Tony Nguyen
  2021-10-25 20:56 ` [PATCH net 1/2] ice: Respond to a NETDEV_UNREGISTER event for LAG Tony Nguyen
@ 2021-10-25 20:56 ` Tony Nguyen
  2021-10-26 12:30 ` [PATCH net 0/2][pull request] Intel Wired LAN Driver Updates 2021-10-25 patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Tony Nguyen @ 2021-10-25 20:56 UTC (permalink / raw)
  To: davem, kuba
  Cc: Yongxin Liu, netdev, anthony.l.nguyen, Jacob Keller, Gurucharan G

From: Yongxin Liu <yongxin.liu@windriver.com>

PTP is currently only supported on E810 devices, it is checked
in ice_ptp_init(). However, there is no check in ice_ptp_release().
For other E800 series devices, ice_ptp_release() will be wrongly executed.

Fix the following calltrace.

  INFO: trying to register non-static key.
  The code is fine but needs lockdep annotation, or maybe
  you didn't initialize this object before use?
  turning off the locking correctness validator.
  Workqueue: ice ice_service_task [ice]
  Call Trace:
   dump_stack_lvl+0x5b/0x82
   dump_stack+0x10/0x12
   register_lock_class+0x495/0x4a0
   ? find_held_lock+0x3c/0xb0
   __lock_acquire+0x71/0x1830
   lock_acquire+0x1e6/0x330
   ? ice_ptp_release+0x3c/0x1e0 [ice]
   ? _raw_spin_lock+0x19/0x70
   ? ice_ptp_release+0x3c/0x1e0 [ice]
   _raw_spin_lock+0x38/0x70
   ? ice_ptp_release+0x3c/0x1e0 [ice]
   ice_ptp_release+0x3c/0x1e0 [ice]
   ice_prepare_for_reset+0xcb/0xe0 [ice]
   ice_do_reset+0x38/0x110 [ice]
   ice_service_task+0x138/0xf10 [ice]
   ? __this_cpu_preempt_check+0x13/0x20
   process_one_work+0x26a/0x650
   worker_thread+0x3f/0x3b0
   ? __kthread_parkme+0x51/0xb0
   ? process_one_work+0x650/0x650
   kthread+0x161/0x190
   ? set_kthread_struct+0x40/0x40
   ret_from_fork+0x1f/0x30

Fixes: 4dd0d5c33c3e ("ice: add lock around Tx timestamp tracker flush")
Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Gurucharan G <gurucharanx.g@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_ptp.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c b/drivers/net/ethernet/intel/ice/ice_ptp.c
index 80380aed8882..d1ef3d48a4b0 100644
--- a/drivers/net/ethernet/intel/ice/ice_ptp.c
+++ b/drivers/net/ethernet/intel/ice/ice_ptp.c
@@ -1571,6 +1571,9 @@ void ice_ptp_init(struct ice_pf *pf)
  */
 void ice_ptp_release(struct ice_pf *pf)
 {
+	if (!test_bit(ICE_FLAG_PTP, pf->flags))
+		return;
+
 	/* Disable timestamping for both Tx and Rx */
 	ice_ptp_cfg_timestamp(pf, false);
 
-- 
2.31.1


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

* Re: [PATCH net 0/2][pull request] Intel Wired LAN Driver Updates 2021-10-25
  2021-10-25 20:56 [PATCH net 0/2][pull request] Intel Wired LAN Driver Updates 2021-10-25 Tony Nguyen
  2021-10-25 20:56 ` [PATCH net 1/2] ice: Respond to a NETDEV_UNREGISTER event for LAG Tony Nguyen
  2021-10-25 20:56 ` [PATCH net 2/2] ice: check whether PTP is initialized in ice_ptp_release() Tony Nguyen
@ 2021-10-26 12:30 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-10-26 12:30 UTC (permalink / raw)
  To: Tony Nguyen; +Cc: davem, kuba, netdev

Hello:

This series was applied to netdev/net.git (master)
by Tony Nguyen <anthony.l.nguyen@intel.com>:

On Mon, 25 Oct 2021 13:56:20 -0700 you wrote:
> This series contains updates to ice driver only.
> 
> Dave adds event handler for LAG NETDEV_UNREGISTER to unlink device from
> link aggregate.
> 
> Yongxin Liu adds a check for PTP support during release which would
> cause a call trace on non-PTP supported devices.
> 
> [...]

Here is the summary with links:
  - [net,1/2] ice: Respond to a NETDEV_UNREGISTER event for LAG
    https://git.kernel.org/netdev/net/c/6a8b357278f5
  - [net,2/2] ice: check whether PTP is initialized in ice_ptp_release()
    https://git.kernel.org/netdev/net/c/fd1b5beb177a

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] 4+ messages in thread

end of thread, other threads:[~2021-10-26 12:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-25 20:56 [PATCH net 0/2][pull request] Intel Wired LAN Driver Updates 2021-10-25 Tony Nguyen
2021-10-25 20:56 ` [PATCH net 1/2] ice: Respond to a NETDEV_UNREGISTER event for LAG Tony Nguyen
2021-10-25 20:56 ` [PATCH net 2/2] ice: check whether PTP is initialized in ice_ptp_release() Tony Nguyen
2021-10-26 12:30 ` [PATCH net 0/2][pull request] Intel Wired LAN Driver Updates 2021-10-25 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.