public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: "Olech, Milena" <milena.olech@intel.com>,
	 Willem de Bruijn <willemdebruijn.kernel@gmail.com>,
	 "intel-wired-lan@lists.osuosl.org"
	<intel-wired-lan@lists.osuosl.org>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	 "Nguyen, Anthony L" <anthony.l.nguyen@intel.com>,
	 "Kitszel, Przemyslaw" <przemyslaw.kitszel@intel.com>,
	 "Lobakin, Aleksander" <aleksander.lobakin@intel.com>
Subject: RE: [Intel-wired-lan] [PATCH iwl-net 04/10] idpf: negotiate PTP capabilies and get PTP clock
Date: Mon, 18 Nov 2024 10:21:50 -0500	[thread overview]
Message-ID: <673b5b8ec78aa_1d050f29498@willemb.c.googlers.com.notmuch> (raw)
In-Reply-To: <PH7PR11MB5885163CE356FF37F047D1E18E272@PH7PR11MB5885.namprd11.prod.outlook.com>

Olech, Milena wrote:
> On 11/14/2024 9:20 PM, Willem de Bruijn wrote:
> 
> > Milena Olech wrote:
> > > PTP capabilities are negotiated using virtchnl command. Add get
> > > capabilities function, direct access to read the PTP clock time and
> > > direct access to read the cross timestamp - system time and PTP clock
> > > time. Set initial PTP capabilities exposed to the stack.
> > >
> > > Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com>
> > > Signed-off-by: Milena Olech <milena.olech@intel.com>
> >
> > Tested-by: Willem de Bruijn <willemb@google.com>
> >
> > >  /**
> > >   * struct idpf_ptp - PTP parameters
> > >   * @info: structure defining PTP hardware capabilities
> > >   * @clock: pointer to registered PTP clock device
> > >   * @adapter: back pointer to the adapter
> > > + * @cmd: HW specific command masks
> > > + * @dev_clk_regs: the set of registers to access the device clock
> > > + * @caps: PTP capabilities negotiated with the Control Plane
> > > + * @get_dev_clk_time_access: access type for getting the device clock time
> > > + * @get_cross_tstamp_access: access type for the cross timestamping
> > >   */
> > >  struct idpf_ptp {
> > >  	struct ptp_clock_info info;
> > >  	struct ptp_clock *clock;
> > >  	struct idpf_adapter *adapter;
> > > +	struct idpf_ptp_cmd cmd;
> > > +	struct idpf_ptp_dev_clk_regs dev_clk_regs;
> > > +	u32 caps;
> > > +	enum idpf_ptp_access get_dev_clk_time_access:16;
> > > +	enum idpf_ptp_access get_cross_tstamp_access:16;
> >
> > why are these 16 bit fields, when they are only ternary options?
> 
> Willem, I was trying to avoid holes in the struct and this is the best
> shape I was able to obtain. I'll try to reorder it in v2 and limit the
> 16 bit.

Does it work to reserve the number of bits needed for these enums
and add an explicit padding field for the remainder? Say

    u32 get_dev_clk_time_access:2;
    u32 get_cross_tstamp_access:2;
    u32 reserved:28;

No need to use the explicit enum type with fixed size allocation.
Though using that and/or leaving any padding implicit is fine too.

  reply	other threads:[~2024-11-18 15:21 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-13 15:46 [PATCH iwl-net 00/10] initial PTP support Milena Olech
2024-11-13 15:46 ` [PATCH iwl-net 01/10] idpf: " Milena Olech
2024-11-14 11:01   ` Vadim Fedorenko
2024-11-14 17:27   ` Willem de Bruijn
2024-11-15 12:38   ` Simon Horman
2024-11-15 13:43   ` [Intel-wired-lan] " Paul Menzel
2024-11-15 16:07     ` Olech, Milena
2024-11-13 15:46 ` [PATCH iwl-net 02/10] virtchnl: add PTP virtchnl definitions Milena Olech
2024-11-14 17:28   ` Willem de Bruijn
2024-11-18 12:57     ` [Intel-wired-lan] " Olech, Milena
2024-11-15 12:42   ` Simon Horman
2024-11-13 15:46 ` [PATCH iwl-net 03/10] idpf: move virtchnl structures to the header file Milena Olech
2024-11-14 20:02   ` Willem de Bruijn
2024-11-13 15:46 ` [PATCH iwl-net 04/10] idpf: negotiate PTP capabilies and get PTP clock Milena Olech
2024-11-14 12:17   ` Vadim Fedorenko
2024-11-14 20:57     ` Willem de Bruijn
2024-11-15 16:34       ` [Intel-wired-lan] " Olech, Milena
2024-11-14 20:20   ` Willem de Bruijn
2024-11-18 14:36     ` [Intel-wired-lan] " Olech, Milena
2024-11-18 15:21       ` Willem de Bruijn [this message]
2024-11-14 23:26   ` Willem de Bruijn
2024-11-15 12:51   ` Simon Horman
2024-11-13 15:46 ` [PATCH iwl-net 05/10] idpf: add mailbox access to read PTP clock time Milena Olech
2024-11-14 20:22   ` Willem de Bruijn
2024-11-13 15:46 ` [PATCH iwl-net 06/10] idpf: add PTP clock configuration Milena Olech
2024-11-14 20:27   ` Willem de Bruijn
2024-11-13 15:46 ` [PATCH iwl-net 07/10] idpf: add Tx timestamp capabilities negotiation Milena Olech
2024-11-14 20:49   ` Willem de Bruijn
2024-11-15 12:45     ` Simon Horman
2024-11-15 13:45   ` Simon Horman
2024-11-13 15:46 ` [PATCH iwl-net 08/10] idpf: add Tx timestamp flows Milena Olech
2024-11-14 12:52   ` Vadim Fedorenko
2024-11-18 15:07     ` Olech, Milena
2024-11-18 17:24       ` Vadim Fedorenko
2024-11-14 23:20   ` Willem de Bruijn
2024-11-18 15:18     ` [Intel-wired-lan] " Olech, Milena
2024-11-18 15:52       ` Willem de Bruijn
2024-11-13 15:46 ` [PATCH iwl-net 09/10] idpf: add support for Rx timestamping Milena Olech
2024-11-14 20:53   ` Willem de Bruijn
2024-11-18 15:31     ` Olech, Milena
2024-11-18 15:53       ` Willem de Bruijn
2024-11-13 15:46 ` [PATCH iwl-net 10/10] idpf: change the method for mailbox workqueue allocation Milena Olech

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=673b5b8ec78aa_1d050f29498@willemb.c.googlers.com.notmuch \
    --to=willemdebruijn.kernel@gmail.com \
    --cc=aleksander.lobakin@intel.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=milena.olech@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=przemyslaw.kitszel@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox