RE: [EXTERNAL] Re: [PATCH net-next] net: mana: Add support for Multi Vports on Bare metal

From: Haiyang Zhang
Date: Fri May 16 2025 - 17:46:12 EST




> -----Original Message-----
> From: ALOK TIWARI <alok.a.tiwari@xxxxxxxxxx>
> Sent: Friday, May 16, 2025 4:57 PM
> To: Haiyang Zhang <haiyangz@xxxxxxxxxxxxx>; linux-hyperv@xxxxxxxxxxxxxxx;
> netdev@xxxxxxxxxxxxxxx
> Cc: Dexuan Cui <decui@xxxxxxxxxxxxx>; stephen@xxxxxxxxxxxxxxxxxx; KY
> Srinivasan <kys@xxxxxxxxxxxxx>; Paul Rosswurm <paulros@xxxxxxxxxxxxx>;
> olaf@xxxxxxxxx; vkuznets@xxxxxxxxxx; davem@xxxxxxxxxxxxx;
> wei.liu@xxxxxxxxxx; edumazet@xxxxxxxxxx; kuba@xxxxxxxxxx;
> pabeni@xxxxxxxxxx; leon@xxxxxxxxxx; Long Li <longli@xxxxxxxxxxxxx>;
> ssengar@xxxxxxxxxxxxxxxxxxx; linux-rdma@xxxxxxxxxxxxxxx;
> daniel@xxxxxxxxxxxxx; john.fastabend@xxxxxxxxx; bpf@xxxxxxxxxxxxxxx;
> ast@xxxxxxxxxx; hawk@xxxxxxxxxx; tglx@xxxxxxxxxxxxx;
> shradhagupta@xxxxxxxxxxxxxxxxxxx; andrew+netdev@xxxxxxx; Konstantin
> Taranov <kotaranov@xxxxxxxxxxxxx>; horms@xxxxxxxxxx; linux-
> kernel@xxxxxxxxxxxxxxx
> Subject: [EXTERNAL] Re: [PATCH net-next] net: mana: Add support for Multi
> Vports on Bare metal
>
>
>
> On 17-05-2025 01:21, Haiyang Zhang wrote:
> > To support Multi Vports on Bare metal, increase the device config
> response
> > version. And, skip the register HW vport, and register filter steps,
> when
> > the Bare metal hostmode is set.
> >
> > Signed-off-by: Haiyang Zhang <haiyangz@xxxxxxxxxxxxx>
> > ---
> > drivers/net/ethernet/microsoft/mana/mana_en.c | 22 +++++++++++++------
> > include/net/mana/mana.h | 4 +++-
> > 2 files changed, 18 insertions(+), 8 deletions(-)
> >
> > diff --git a/drivers/net/ethernet/microsoft/mana/mana_en.c
> b/drivers/net/ethernet/microsoft/mana/mana_en.c
> > index 2bac6be8f6a0..0273696d254b 100644
> > --- a/drivers/net/ethernet/microsoft/mana/mana_en.c
> > +++ b/drivers/net/ethernet/microsoft/mana/mana_en.c
> > @@ -921,7 +921,7 @@ static void mana_pf_deregister_filter(struct
> mana_port_context *apc)
> >
> [snip]
> > + u8 bm_hostmode = 0;
> > u16 num_ports = 0;
> > int err;
> > int i;
> > @@ -3026,10 +3032,12 @@ int mana_probe(struct gdma_dev *gd, bool
> resuming)
> > }
> >
> > err = mana_query_device_cfg(ac, MANA_MAJOR_VERSION,
> MANA_MINOR_VERSION,
> > - MANA_MICRO_VERSION, &num_ports);
> > + MANA_MICRO_VERSION, &num_ports, &bm_hostmode);
> > if (err)
> > goto out;
> >
> > + ac->bm_hostmode = bm_hostmode;
> > +
> > if (!resuming) {
> > ac->num_ports = num_ports;
> > } else {
> > diff --git a/include/net/mana/mana.h b/include/net/mana/mana.h
> > index 0f78065de8fe..b352d2a7118e 100644
> > --- a/include/net/mana/mana.h
> > +++ b/include/net/mana/mana.h
> > @@ -408,6 +408,7 @@ struct mana_context {
> > struct gdma_dev *gdma_dev;
> >
> > u16 num_ports;
> > + u8 bm_hostmode; /* Bare Metal Host Mode Enabled */
>
> what about maintaining natural alignment, +u8 reserved0 ?

This is not structure going across the "wire". Compiler will
add holes when necessary. So we don't normally add "reserved"
for alignment in these structs, right?

> /* +response v3: Bare Metal Host Mode Enabled */ for consistency.
> Even though this comment is optional here.

I will just remove this optional comment.

Thanks,
- Haiyang