[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CADEbmW327YjOjkbb5p8KmyL=sXJbD-MaVBS5XT1uHCSg2ZNBLw@mail.gmail.com>
Date: Thu, 20 Jun 2024 08:14:07 +0200
From: Michal Schmidt <mschmidt@...hat.com>
To: Sergey Temerkhanov <sergey.temerkhanov@...el.com>
Cc: intel-wired-lan@...ts.osuosl.org, netdev@...r.kernel.org,
Przemek Kitszel <przemyslaw.kitszel@...el.com>
Subject: Re: [RFC PATCH iwl-next v1 3/4] ice: Use ice_adapter for PTP shared
data instead of auxdev
On Tue, Jun 18, 2024 at 3:59 PM Sergey Temerkhanov
<sergey.temerkhanov@...el.com> 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>
[...]
> /**
> * 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
> */
> struct ice_adapter {
> /* For access to the GLTSYN_TIME register */
> spinlock_t ptp_gltsyn_time_lock;
> -
> refcount_t refcount;
> +
> + struct ice_pf *ctrl_pf;
> + struct ice_port_list ports;
> };
A minor nitpick about grouping of the members in this structure:
"refcount" is special. It tracks the lifetime of the ice_adapter
structure itself and it is accessed only from ice_adapter.c. The other
members are the useful payload. So I would suggest keeping "refcount"
as either the last or the first struct member.
Michal
Powered by blists - more mailing lists