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: <IA1PR11MB6241F331348234405D7E15798B022@IA1PR11MB6241.namprd11.prod.outlook.com>
Date: Mon, 23 Dec 2024 17:12:48 +0000
From: "Rinitha, SX" <sx.rinitha@...el.com>
To: "Nadezhdin, Anton" <anton.nadezhdin@...el.com>,
	"intel-wired-lan@...ts.osuosl.org" <intel-wired-lan@...ts.osuosl.org>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>, "Nguyen, Anthony L"
	<anthony.l.nguyen@...el.com>, "Kitszel, Przemyslaw"
	<przemyslaw.kitszel@...el.com>, "richardcochran@...il.com"
	<richardcochran@...il.com>, "Keller, Jacob E" <jacob.e.keller@...el.com>,
	"Olech, Milena" <milena.olech@...el.com>, "Nadezhdin, Anton"
	<anton.nadezhdin@...el.com>
Subject: RE: [Intel-wired-lan] [PATCH iwl-next v2 3/5] ice: add lock to
 protect low latency interface

> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@...osl.org> On Behalf Of Anton Nadezhdin
> Sent: 16 December 2024 20:24
> To: intel-wired-lan@...ts.osuosl.org
> Cc: netdev@...r.kernel.org; Nguyen, Anthony L <anthony.l.nguyen@...el.com>; Kitszel, Przemyslaw <przemyslaw.kitszel@...el.com>; richardcochran@...il.com; Keller, Jacob E <jacob.e.keller@...el.com>; Olech, Milena <milena.olech@...el.com>; Nadezhdin, Anton <anton.nadezhdin@...el.com>
> Subject: [Intel-wired-lan] [PATCH iwl-next v2 3/5] ice: add lock to protect low latency interface
>
> From: Jacob Keller <jacob.e.keller@...el.com>
>
> Newer firmware for the E810 devices support a 'low latency' interface to interact with the PHY without using the Admin Queue. This is interacted with via the REG_LL_PROXY_L and REG_LL_PROXY_H registers.
>
> Currently, this interface is only used for Tx timestamps. There are two different mechanisms, including one which uses an interrupt for firmware to signal completion. However, these two methods are mutually exclusive, so no synchronization between them was necessary.
>
> This low latency interface is being extended in future firmware to support also programming the PHY timers. Use of the interface for PHY timers will need synchronization to ensure there is no overlap with a Tx timestamp.
>
> The interrupt-based response complicates the locking somewhat. We can't use a simple spinlock. This would require being acquired in ice_ptp_req_tx_single_tstamp, and released in ice_ptp_complete_tx_single_tstamp. The ice_ptp_req_tx_single_tstamp function is called from the threaded IRQ, and the ice_ptp_complete_tx_single_stamp is called from the low latency IRQ, so we would need to acquire the lock with IRQs disabled.
>
> To handle this, we'll use a wait queue along with wait_event_interruptible_locked_irq in the update flows which don't use the interrupt.
>
> The interrupt flow will acquire the wait queue lock, set the ATQBAL_FLAGS_INTR_IN_PROGRESS, and then initiate the firmware low latency request, and unlock the wait queue lock.
>
> Upon receipt of the low latency interrupt, the lock will be acquired, the ATQBAL_FLAGS_INTR_IN_PROGRESS bit will be cleared, and the firmware response will be captured, and wake_up_locked() will be called on the wait queue.
>
> The other flows will use wait_event_interruptible_locked_irq() to wait until the ATQBAL_FLAGS_INTR_IN_PROGRESS is clear. This function checks the condition under lock, but does not hold the lock while waiting. On return, the lock is held, and a return of zero indicates we hold the lock and the in-progress flag is not set.
>
> This will ensure that threads which need to use the low latency interface will sleep until they can acquire the lock without any pending low latency interrupt flow interfering.
>
> Signed-off-by: Jacob Keller <jacob.e.keller@...el.com>
> Reviewed-by: Milena Olech <milena.olech@...el.com>
> Signed-off-by: Anton Nadezhdin <anton.nadezhdin@...el.com>
> ---
> drivers/net/ethernet/intel/ice/ice_ptp.c    | 42 +++++++++++++++++----
> drivers/net/ethernet/intel/ice/ice_ptp_hw.c | 18 +++++++++
> drivers/net/ethernet/intel/ice/ice_type.h   | 10 +++++
> 3 files changed, 62 insertions(+), 8 deletions(-)
>

Tested-by: Rinitha S <sx.rinitha@...el.com> (A Contingent worker at Intel)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ