Netdev List
 help / color / mirror / Atom feed
From: Daniel Golle <daniel@makrotopia.org>
To: Jakub Kicinski <kuba@kernel.org>
Cc: John Crispin <john@phrozen.org>, Andrew Lunn <andrew@lunn.ch>,
	Vladimir Oltean <olteanv@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	Russell King <linux@armlinux.org.uk>,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH net-next v4 4/4] net: dsa: mxl862xx: add support for SerDes ports
Date: Wed, 3 Jun 2026 00:11:58 +0100	[thread overview]
Message-ID: <ah9jPhiHSSqYjScK@makrotopia.org> (raw)
In-Reply-To: <20260602142209.740b18d7@kernel.org>

On Tue, Jun 02, 2026 at 02:22:09PM -0700, Jakub Kicinski wrote:
> On Fri, 29 May 2026 06:40:17 +0100 Daniel Golle wrote:
> > +struct mxl862xx_xpcs_pcs_cfg {
> > +#ifdef __LITTLE_ENDIAN_BITFIELD
> > +	u8 port_id:2;
> > +	u8 interface:6; /* enum mxl862xx_xpcs_if_mode */
> > +	u8 neg_mode:2; /* enum mxl862xx_xpcs_neg_mode */
> > +	u8 permit_pause:1;
> > +	u8 usx_lane_mode:2; /* enum mxl862xx_xpcs_usx_lane_mode */
> > +	u8 role:1; /* enum mxl862xx_xpcs_role */
> > +	u8 usx_subport:2;
> > +#elif defined(__BIG_ENDIAN_BITFIELD)
> > +	u8 interface:6; /* enum mxl862xx_xpcs_if_mode */
> > +	u8 port_id:2;
> > +	u8 usx_subport:2;
> > +	u8 role:1; /* enum mxl862xx_xpcs_role */
> > +	u8 usx_lane_mode:2; /* enum mxl862xx_xpcs_usx_lane_mode */
> > +	u8 permit_pause:1;
> > +	u8 neg_mode:2; /* enum mxl862xx_xpcs_neg_mode */
> > +#else
> > +#error "Unknown bitfield endianness"
> > +#endif
> 
> With the bitfields and MACROS for read/write this patch give off vendor
> BSP more than upstream code :( Doesn't look like the driver used
> bitfileds before, please use FIELD_GET / FIELD_PUT

It wasn't necessary before because the older and more mature parts of
the API have a different hand-writing and used only (sometimes quite
arbitrary) 8-bit, 16-bit and 32-bit types. Now this more recently
designed part of the API breaks that rule.
Anyway, a single __le16 it is then in this case, and I'll use
FIELD_PUT/FIELD_GET.


      reply	other threads:[~2026-06-02 23:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-29  5:39 [PATCH net-next v4 0/4] net: dsa: mxl862xx: SerDes ports Daniel Golle
2026-05-29  5:39 ` [PATCH net-next v4 1/4] net: dsa: mxl862xx: store firmware version for feature gating Daniel Golle
2026-05-29  5:40 ` [PATCH net-next v4 2/4] net: dsa: mxl862xx: move phylink stubs to mxl862xx-phylink.c Daniel Golle
2026-05-29  5:40 ` [PATCH net-next v4 3/4] net: dsa: mxl862xx: move API macros to mxl862xx-host.h Daniel Golle
2026-05-29  5:40 ` [PATCH net-next v4 4/4] net: dsa: mxl862xx: add support for SerDes ports Daniel Golle
2026-06-02 21:22   ` Jakub Kicinski
2026-06-02 23:11     ` Daniel Golle [this message]

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=ah9jPhiHSSqYjScK@makrotopia.org \
    --to=daniel@makrotopia.org \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=john@phrozen.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.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