Subject: Re: [PATCH net-next 1/3] net: mscc: ocelot: support matching on EtherType

From: Marcelo Ricardo Leitner <[email-masked]>
Date: Wed, 22 Apr 2020 21:43:58 -0300

On Thu, Apr 23, 2020 at 01:50:41AM +0300, Vladimir Oltean wrote:
> On Thu, 23 Apr 2020 at 01:36, kbuild test robot <[email-masked]> wrote:
> >
> > Hi Vladimir,
> >
> 
> [...]
> 
> >
> > sparse warnings: (new ones prefixed by >>)
> >
> > >> drivers/net/ethernet/mscc/ocelot_flower.c:184:54: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned short [usertype] @@    got resunsigned short [usertype] @@
> 
> What's a resunsigned short?

Dunno, but seems "restricted unsigned short", considering the below.

> 
> > >> drivers/net/ethernet/mscc/ocelot_flower.c:184:54: sparse:    expected unsigned short [usertype]
> > >> drivers/net/ethernet/mscc/ocelot_flower.c:184:54: sparse:    got restricted __be16 [usertype]
> >
> 
> [...]
> 
> >    179          if (match_protocol && proto != ETH_P_ALL) {
> >    180                  /* TODO: support SNAP, LLC etc */
> >    181                  if (proto < ETH_P_802_3_MIN)
> >    182                          return -EOPNOTSUPP;
> >    183                  ace->type = OCELOT_ACE_TYPE_ETYPE;
> >  > 184                  *(u16 *)ace->frame.etype.etype.value = htons(proto);
> 
> What's wrong with this? Doesn't it like the left hand side or the
> right hand side?

It's assigning a big-endian value (network endian) to a host-endian
variable (u16 cast).

> 
> >    185                  *(u16 *)ace->frame.etype.etype.mask = 0xffff;
> >    186          }
> 
> >
> > ---
> > 0-DAY CI Kernel Test Service, Intel Corporation
> > https://lists.01.org/hyperkitty/list/[email-masked]
> 
> -Vladimir
>