Messages in this thread | | | Date | Fri, 12 Mar 2021 20:59:41 +0100 | From | Andrew Lunn <> | Subject | Re: [PATCH v2] eeprom/optoe: driver to read/write SFP/QSFP/CMIS EEPROMS |
| |
> This interface is implemented in python scripts provided by the switch > platform > vendor. Those scripts encode the mapping of CPLD i2c muxes to i2c buses to > port numbers, specific to each switch. > > At the bottom of that python stack, all EEPROM access goes through > open/seek/read/close access to the optoe managed file in > /sys/bus/i2c/devices/{num}-0050/eeprom.
And this python stack is all open source? So you should be able to throw away parts of the bottom end and replace it with a different KAPI, and nobody will notice? In fact, this is probably how it was designed. Anybody working with out of tree code knows what gets merged later is going to be different because of review comments. And KAPI code is even more likely to be different. So nobody really expected optoe to get merged as is.
> You're not going to like this, but ethtool -e and ethtool -m both > return ' Ethernet0 Cannot get EEPROM data: Operation not supported', > for every port managed by the big switch silicon.
You are still missing what i said. The existing IOCTL interface needs a network interface name. But there is no reason why you cannot extend the new netlink KAPI to take an alternative identifier, sfp42. That maps directly to the SFP device, without using an interface name. Your pile of python can directly use the netlink API, the ethtool command does not need to make use of this form of identifier, and you don't need to "screen scrape" ethtool.
It seems very unlikely optoe is going to get merged. The network maintainers are against it, due to KAPI issues. I'm trying to point out a path you can take to get code merged. But it is up to you if you decided to follow it.
Andrew
| |