Re: [PATCH v4 net-next] net: mana: Add a driver for Microsoft Azure Network Adapter (MANA)

From: Leon Romanovsky
Date: Mon Apr 12 2021 - 05:11:50 EST


On Mon, Apr 12, 2021 at 08:35:32AM +0000, Dexuan Cui wrote:
> > From: Leon Romanovsky <leon@xxxxxxxxxx>
> > Sent: Monday, April 12, 2021 12:46 AM
> > To: Dexuan Cui <decui@xxxxxxxxxxxxx>
> > > ...
> > > +#define ANA_MAJOR_VERSION 0
> > > +#define ANA_MINOR_VERSION 1
> > > +#define ANA_MICRO_VERSION 1
> >
> > Please don't introduce drier versions.
>
> This is not the usual "driver version", though it's called "drv version" :-)
> As you can see, the driver does not use the macro MODULE_VERSION().
>
> Here the "drv version" actually means the version of the VF-to-PF protocol,
> with which the Azure Network Adapter ethernet NIC driver (i.e. the VF driver)
> talks to the PF driver. The protocol version determines the formats of the
> messages that are sent from the VF driver to the PF driver, e.g. query the
> MAC address, create Send/Receive queues, configure RSS, etc.
>
> Currently the protocol versin is 0.1.1 You may ask why it's called
> "drv version" rather than "protocol version" -- it's because the PF driver
> calls it that way, so I think here the VF driver may as well use the same
> name. BTW, the "drv ver" info is passed to the PF driver in the below
> function:

Ohh, yes, the "driver version" is not the ideal name for that.

I already looked on it in previous patch, came to the conclusion about
the protocol and forgot :(.

>
> static int mana_query_client_cfg(struct ana_context *ac, u32 drv_major_ver,
> u32 drv_minor_ver, u32 drv_micro_ver,
> u16 *max_num_vports)
> {
> struct gdma_context *gc = ac->gdma_dev->gdma_context;
> struct ana_query_client_cfg_resp resp = {};
> struct ana_query_client_cfg_req req = {};
> struct device *dev = gc->dev;
> int err = 0;
>
> mana_gd_init_req_hdr(&req.hdr, ANA_QUERY_CLIENT_CONFIG,
> sizeof(req), sizeof(resp));
> req.drv_major_ver = drv_major_ver;
> req.drv_minor_ver = drv_minor_ver;
> req.drv_micro_ver = drv_micro_ver;
>
> err = mana_send_request(ac, &req, sizeof(req), &resp, sizeof(resp));
>
> Thanks,
> Dexuan
>