Re: [RFC PATCH net-next v2 09/17] ethtool: implement GET_DRVINFO message

From: Michal Kubecek
Date: Mon Jul 30 2018 - 10:37:21 EST


On Mon, Jul 30, 2018 at 03:21:07PM +0200, Jiri Pirko wrote:
> Mon, Jul 30, 2018 at 02:53:27PM CEST, mkubecek@xxxxxxx wrote:
>
> [...]
>
> >+/* GET_DRVINFO / SET_DRVINFO */
> >+
> >+enum {
> >+ ETHA_DRVINFO_UNSPEC,
> >+ ETHA_DRVINFO_DEV, /* nest - ETHA_DEV_* */
> >+ ETHA_DRVINFO_DRIVER, /* string */
> >+ ETHA_DRVINFO_VERSION, /* string */
> >+ ETHA_DRVINFO_FWVERSION, /* string */
> >+ ETHA_DRVINFO_BUSINFO, /* string */
> >+ ETHA_DRVINFO_EROM_VER, /* string */
> >+ ETHA_DRVINFO_N_PRIV_FLAGS, /* u32 */
> >+ ETHA_DRVINFO_N_STATS, /* u32 */
> >+ ETHA_DRVINFO_TESTINFO_LEN, /* u32 */
> >+ ETHA_DRVINFO_EEDUMP_LEN, /* u32 */
> >+ ETHA_DRVINFO_REGDUMP_LEN, /* u32 */
>
> This is a nice example of why 1:1 ioctl->netlink conversion would be
> a big mistake.
>
> I understand that for ioclt, getting lengths of various things is
> important. Userspace can prepare buffer for next ioctl which would
> actually do dump transfer. However in netlink, this is totally pointless
> as the dump goes into userspace in multiple netlink messages.

Right, I already mentioned this in the ToDo part of cover letter. It
makes indeed little sense to put this information here - and even less
to put only dome of the counts and lengths.

Michal Kubecek