lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6da97f7e-2311-4658-b745-f8a29057b244@intel.com>
Date: Thu, 8 May 2025 11:34:08 +0200
From: Przemek Kitszel <przemyslaw.kitszel@...el.com>
To: Jagadeesh Yalapalli <jagadeesharm14@...il.com>, Tony Nguyen
	<anthony.l.nguyen@...el.com>
CC: Andrew Lunn <andrew+netdev@...n.ch>, "David S . Miller"
	<davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski
	<kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	<intel-wired-lan@...ts.osuosl.org>, <netdev@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>, Jagadeesh
	<jagadeesh.yalapalli@...fochips.com>
Subject: Re: [PATCH v1] e1000e: Replace schedule_work with delayed workqueue
 for watchdog.

On 5/8/25 08:14, Jagadeesh Yalapalli wrote:
> From: Jagadeesh <jagadeesh.yalapalli@...fochips.com>
> 
>      Replace direct schedule_work() usage with queue_delayed_work() to allow
>      better timing control for the watchdog task. This resolves potential
>      race conditions during interface reset operations.
> 
>      - Added watchdog_wq workqueue_struct and watchdog_dq delayed_work
>      - Updated e1000_watchdog() to use queue_delayed_work()
>      - Removed obsolete TODO comment about delayed workqueue
> 
>      Tested in Qemu :
>      / # for i in {1..1000}; do
>      >     echo 1 > /sys/class/net/eth0/device/reset
>      >     sleep 0.1
>      > done
>      [  726.357499] e1000e 0000:00:02.0: resetting
>      [  726.390737] e1000e 0000:00:02.0: reset done
> 
> Signed-off-by: Jagadeesh <jagadeesh.yalapalli@...fochips.com>

Thank you for your contribution.
Please use at least two parts for the author and signoff

> ---
>   drivers/net/ethernet/intel/e1000e/e1000.h  | 2 ++
>   drivers/net/ethernet/intel/e1000e/netdev.c | 3 +--
>   2 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/e1000e/e1000.h b/drivers/net/ethernet/intel/e1000e/e1000.h
> index ba9c19e6994c..1e7b365c4f31 100644
> --- a/drivers/net/ethernet/intel/e1000e/e1000.h
> +++ b/drivers/net/ethernet/intel/e1000e/e1000.h
> @@ -194,6 +194,8 @@ struct e1000_adapter {
>   	struct timer_list blink_timer;
>   
>   	struct work_struct reset_task;
> +	struct workqueue_struct *watchdog_wq;
> +	struct delayed_work watchdog_dq;
>   	struct work_struct watchdog_task;
>   
>   	const struct e1000_info *ei;
> diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
> index 8ebcb6a7d608..87a915d09f4e 100644
> --- a/drivers/net/ethernet/intel/e1000e/netdev.c
> +++ b/drivers/net/ethernet/intel/e1000e/netdev.c
> @@ -5178,9 +5178,8 @@ static void e1000_watchdog(struct timer_list *t)
>   	struct e1000_adapter *adapter = from_timer(adapter, t, watchdog_timer);
>   
>   	/* Do the rest outside of interrupt context */
> -	schedule_work(&adapter->watchdog_task);
> +	queue_delayed_work(adapter->watchdog_wq, &adapter->watchdog_dq, 0);

there is no much point in using queue_delayed_work() with the delay of 0

please also note that the last commit touching this function was
essentially just reverting the use of delayed work, see commit
d5ad7a6a7f3c ("e1000e: Revert "e1000e: Make watchdog use delayed work"")

would be best to understand what was wrong with the reverted commit

>   
> -	/* TODO: make this use queue_delayed_work() */
>   }
>   
>   static void e1000_watchdog_task(struct work_struct *work)


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ