[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <d0dc3c1c-7567-4506-8d21-3e983f7742e6@lunn.ch>
Date: Mon, 17 Nov 2025 14:58:32 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Jiawen Wu <jiawenwu@...stnetic.com>
Cc: 'Vadim Fedorenko' <vadim.fedorenko@...ux.dev>, netdev@...r.kernel.org,
'Andrew Lunn' <andrew+netdev@...n.ch>,
"'David S. Miller'" <davem@...emloft.net>,
'Eric Dumazet' <edumazet@...gle.com>,
'Jakub Kicinski' <kuba@...nel.org>,
'Paolo Abeni' <pabeni@...hat.com>,
'Russell King' <linux@...linux.org.uk>,
'Simon Horman' <horms@...nel.org>,
'Jacob Keller' <jacob.e.keller@...el.com>,
'Mengyuan Lou' <mengyuanlou@...-swift.com>
Subject: Re: [PATCH net-next 5/5] net: txgbe: support getting module EEPROM
by page
On Mon, Nov 17, 2025 at 02:14:29PM +0800, Jiawen Wu wrote:
> On Fri, Nov 14, 2025 6:19 AM, Andrew Lunn wrote:
> > > For 1-byte data, wx_host_interface_command() can be used to set 'return_data'
> > > to true, then page->data = buffer->data. For other cases, I think it would be more
> > > convenient to read directly from the mailbox registers.
> >
> > For 1-byte data, you need to careful where it is used. All the sensor
> > values are u16 and you need to read a u16 otherwise you are not
> > guaranteed to get consistent upper/lower bytes.
> >
> > So i would not recommend 1 byte read, unless you have an SFP module
> > which is known to be broken, and only supports 1 byte reads.
>
> Thanks for the reminder.
>
> But when I use 'ethtool -m', .get_module_eeprom_by_page() is always
> invoked multiple times, with 'page->length = 1' in the first time.
What is important is that the sensors are read using multi-byte
transfers. I expect ethtool does that correctly. You can also have
your firmware do multi-byte reads by default, with word alignment, and
then just return the byte it asked for. I believe historically user
space would always ask for a 1/2 page and then just extract what it
wanted. Getting sections smaller than a 1/2 page is new.
Andrew
Powered by blists - more mailing lists