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] [day] [month] [year] [list]
Message-ID: <ead9d3f5-5424-46d6-88c3-e670562f9c99@intel.com>
Date: Mon, 1 Jul 2024 10:18:21 +0200
From: Przemek Kitszel <przemyslaw.kitszel@...el.com>
To: Sergey Temerkhanov <sergey.temerkhanov@...el.com>
CC: <netdev@...r.kernel.org>, <intel-wired-lan@...ts.osuosl.org>, "Michal
 Schmidt" <mschmidt@...hat.com>, Tony Nguyen <anthony.l.nguyen@...el.com>
Subject: Re: [PATCH iwl-next v2 3/4] ice: Use ice_adapter for PTP shared data
 instead of auxdev

On 6/26/24 14:54, Sergey Temerkhanov wrote:
> Use struct ice_adapter to hold shared PTP data and control PTP
> related actions instead of auxbus. This allows significant code
> simplification and faster access to the container fields used in
> the PTP support code.
> 
> Move the PTP port list to the ice_adapter container to simplify
> the code and avoid race conditions which could occur due to the
> synchronous nature of the initialization/access and
> certain memory saving can be achieved by moving PTP data into
> the ice_adapter itself.
> 
> Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@...el.com>
> Signed-off-by: Sergey Temerkhanov <sergey.temerkhanov@...el.com>
> ---
>   drivers/net/ethernet/intel/ice/ice_adapter.c |   6 ++
>   drivers/net/ethernet/intel/ice/ice_adapter.h |  18 +++-
>   drivers/net/ethernet/intel/ice/ice_ptp.c     | 101 ++++++++++++-------
>   drivers/net/ethernet/intel/ice/ice_ptp.h     |   3 +
>   drivers/net/ethernet/intel/ice/ice_ptp_hw.h  |   5 +
>   5 files changed, 95 insertions(+), 38 deletions(-)
> 

[...]

>   /**
>    * struct ice_adapter - PCI adapter resources shared across PFs
>    * @ptp_gltsyn_time_lock: Spinlock protecting access to the GLTSYN_TIME
>    *                        register of the PTP clock.
>    * @refcount: Reference count. struct ice_pf objects hold the references.
>    * @ctrl_pf: Control PF of the adapter
> + * @ports: Ports list
>    */
>   struct ice_adapter {
>   	/* For access to the GLTSYN_TIME register */
>   	spinlock_t ptp_gltsyn_time_lock;
> -
>   	refcount_t refcount;

Michal has pointed out that @refcount is special in that it protecting
whole struct ice_adapter, so should be kept as the last (but as you see
it's problematic) or as the first :)

>   
>   	struct ice_pf *ctrl_pf;
> +	struct ice_port_list ports;
>   };
>   

[...]

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ