All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH net-next 1/3] net: mscc: ocelot: support matching on EtherType
Date: Wed, 22 Apr 2020 21:43:58 -0300	[thread overview]
Message-ID: <20200423004358.GA2469@localhost.localdomain> (raw)
In-Reply-To: <CA+h21hpDkc02Hd5JFbD_r3sAtFAOBStQN2dAT+n0aq5SxgKwvw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1630 bytes --]

On Thu, Apr 23, 2020 at 01:50:41AM +0300, Vladimir Oltean wrote:
> On Thu, 23 Apr 2020 at 01:36, kbuild test robot <lkp@intel.com> 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/kbuild-all(a)lists.01.org
> 
> -Vladimir
> 

WARNING: multiple messages have this Message-ID (diff)
From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
To: Vladimir Oltean <olteanv@gmail.com>
Cc: kbuild test robot <lkp@intel.com>,
	"David S. Miller" <davem@davemloft.net>,
	netdev <netdev@vger.kernel.org>,
	kbuild-all@lists.01.org, Ido Schimmel <idosch@idosch.org>,
	"Allan W. Nielsen" <allan.nielsen@microchip.com>,
	Horatiu Vultur <horatiu.vultur@microchip.com>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Antoine Tenart <antoine.tenart@bootlin.com>,
	Andrew Lunn <andrew@lunn.ch>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Vivien Didelot <vivien.didelot@gmail.com>,
	Joergen Andreasen <joergen.andreasen@microchip.com>
Subject: Re: [PATCH net-next 1/3] net: mscc: ocelot: support matching on EtherType
Date: Wed, 22 Apr 2020 21:43:58 -0300	[thread overview]
Message-ID: <20200423004358.GA2469@localhost.localdomain> (raw)
In-Reply-To: <CA+h21hpDkc02Hd5JFbD_r3sAtFAOBStQN2dAT+n0aq5SxgKwvw@mail.gmail.com>

On Thu, Apr 23, 2020 at 01:50:41AM +0300, Vladimir Oltean wrote:
> On Thu, 23 Apr 2020 at 01:36, kbuild test robot <lkp@intel.com> 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/kbuild-all@lists.01.org
> 
> -Vladimir
> 

  reply	other threads:[~2020-04-23  0:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-20 16:27 [PATCH net-next 0/3] Ocelot MAC_ETYPE tc-flower key improvements Vladimir Oltean
2020-04-20 16:27 ` [PATCH net-next 1/3] net: mscc: ocelot: support matching on EtherType Vladimir Oltean
2020-04-22 22:35   ` kbuild test robot
2020-04-22 22:35     ` kbuild test robot
2020-04-22 22:50     ` Vladimir Oltean
2020-04-23  0:43       ` Marcelo Ricardo Leitner [this message]
2020-04-23  0:43         ` Marcelo Ricardo Leitner
2020-04-20 16:27 ` [PATCH net-next 2/3] net: mscc: ocelot: refine the ocelot_ace_is_problematic_mac_etype function Vladimir Oltean
2020-04-23  2:23   ` kbuild test robot
2020-04-23  2:23     ` kbuild test robot
2020-04-20 16:27 ` [PATCH net-next 3/3] net: mscc: ocelot: lift protocol restriction for flow_match_eth_addrs keys Vladimir Oltean
2020-04-22 18:41 ` [PATCH net-next 0/3] Ocelot MAC_ETYPE tc-flower key improvements David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200423004358.GA2469@localhost.localdomain \
    --to=marcelo.leitner@gmail.com \
    --cc=kbuild-all@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.