Netdev List
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Magnus Lindholm <linmag7@gmail.com>
Cc: pavan.chebbi@broadcom.com, andrew+netdev@lunn.ch,
	edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
	netdev@vger.kernel.org, sparclinux@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next] tg3: normalize inherited M3000 register byte order
Date: Sun, 11 Oct 2026 15:33:37 +0200	[thread overview]
Message-ID: <c8bc138e-2d62-4ee8-9020-5f1091efe015@lunn.ch> (raw)
In-Reply-To: <CA+=Fv5TU1rOUimi8f+e0R4_48ki+X3qzD_+1QPyviTnJz-irvA@mail.gmail.com>

On Fri, Oct 09, 2026 at 02:52:57PM +0200, Magnus Lindholm wrote:
> Hi Andrew,
> 
> On Fri, Oct 9, 2026 at 2:09 PM Andrew Lunn <andrew@lunn.ch> wrote:
> >
> > > > Is there a legitimate reason you would want the bytes are swapped?
> >
> > You missed answering this. I'm guessing, but does the hardware offer
> > this to make big endian machines more efficient?
> >
> > Please could you look at the driver and think about what would happen
> > on a big endian machine. Is the change still correct?
> >
> >         Andrew
> 
> You're right, my earlier reply missed the underlying question.
> 
> That is a plausible reason for providing the hardware swap mode:
> it can accommodate big-endian accesses without software byte
> swapping. I haven't verified Broadcom's design rationale.
> 
> However, Linux tg3 already initializes misc_host_ctrl with WORD_SWAP set
> and BYTE_SWAP clear on both little- and big-endian builds, before
> this helper runs.
> 
> The helper restores that existing setting. Its swab32() compensates
> for the device's inherited register state, not CPU endianness.
> Subsequent accesses use the normal driver path, and the separate
> __BIG_ENDIAN handling for DMA remains unchanged.
> 
> That is why I believe the correction is appropriate on either
> endianness. The runtime tests were on the M3000 running big-endian
> SPARC64.

Please expand the commit message to show you have thought about this.

       Andrew

  reply	other threads:[~2026-10-11 13:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-08 22:04 [PATCH net-next] tg3: normalize inherited M3000 register byte order Magnus Lindholm
2026-10-09  1:13 ` Andrew Lunn
2026-10-09  6:28   ` Magnus Lindholm
2026-10-09 12:09     ` Andrew Lunn
2026-10-09 12:52       ` Magnus Lindholm
2026-10-11 13:33         ` Andrew Lunn [this message]
2026-10-11 19:17           ` Magnus Lindholm

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=c8bc138e-2d62-4ee8-9020-5f1091efe015@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=andrew+netdev@lunn.ch \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linmag7@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pavan.chebbi@broadcom.com \
    --cc=sparclinux@vger.kernel.org \
    /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