[PATCH v2] net/netvsc: fix parsing of VLAN metadata

Long Li longli at microsoft.com
Fri Feb 9 02:13:57 CET 2024


> > +struct ndis_pkt_vlan_info {
> > +             union {
> > +                             struct {
> > +                                             uint32_t pri:3; /* User Priority */
> > +                                             uint32_t cfi:1; /* Canonical Format ID / DEI */
> > +                                             uint32_t vlanid:12; /* VLAN ID */
> > +                                             uint32_t reserved:16;
> > +                             };
> > +                             uint32_t value;
> > +             };
> > +};
> 
> Order of union elements is byte order sensitive, granted Hyper-V/Azure doesn't do
> big-endian.

Hyper-V/Azure uses the same endian for host and guest. They are all in little endian on X86 and ARM. If it uses big endian, this bug will not show up.

> 
> Most of this driver came from FreeBSD. Did you look there to make sure naming is
> the same. I.e would be good to be able to have same code in both places as much
> as possible.


More information about the dev mailing list