All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH v2 net-next 4/6] net: dsa: tag_rtl8_4: add realtek 8 byte protocol 4 tag
Date: Thu, 14 Oct 2021 08:46:46 +0800	[thread overview]
Message-ID: <202110140822.K85RW1Q3-lkp@intel.com> (raw)
In-Reply-To: <20211013145040.886956-5-alvin@pqrs.dk>

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

Hi "Alvin,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on net-next/master]

url:    https://github.com/0day-ci/linux/commits/Alvin-ipraga/net-dsa-add-support-for-RTL8365MB-VC/20211013-225955
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git d1f24712a86abd04d82cf4b00fb4ab8ff2d23c8a
config: powerpc-randconfig-r023-20211013 (attached as .config)
compiler: powerpc-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/e17d422e49ba2acbf43ae144fcce940cc06152a0
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Alvin-ipraga/net-dsa-add-support-for-RTL8365MB-VC/20211013-225955
        git checkout e17d422e49ba2acbf43ae144fcce940cc06152a0
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=powerpc 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   In file included from include/linux/byteorder/big_endian.h:5,
                    from arch/powerpc/include/uapi/asm/byteorder.h:14,
                    from include/asm-generic/bitops/le.h:7,
                    from arch/powerpc/include/asm/bitops.h:265,
                    from include/linux/bitops.h:33,
                    from include/linux/kernel.h:12,
                    from include/linux/skbuff.h:13,
                    from include/linux/if_ether.h:19,
                    from include/linux/etherdevice.h:20,
                    from net/dsa/tag_rtl8_4.c:64:
   net/dsa/tag_rtl8_4.c: In function 'rtl8_4_tag_xmit':
>> net/dsa/tag_rtl8_4.c:108:24: error: implicit declaration of function 'FIELD_PREP' [-Werror=implicit-function-declaration]
     108 |         tag[1] = htons(FIELD_PREP(RTL8_4_PROTOCOL, RTL8_4_PROTOCOL_RTL8365MB));
         |                        ^~~~~~~~~~
   include/uapi/linux/byteorder/big_endian.h:41:51: note: in definition of macro '__cpu_to_be16'
      41 | #define __cpu_to_be16(x) ((__force __be16)(__u16)(x))
         |                                                   ^
   include/linux/byteorder/generic.h:141:18: note: in expansion of macro '___htons'
     141 | #define htons(x) ___htons(x)
         |                  ^~~~~~~~
   net/dsa/tag_rtl8_4.c:108:18: note: in expansion of macro 'htons'
     108 |         tag[1] = htons(FIELD_PREP(RTL8_4_PROTOCOL, RTL8_4_PROTOCOL_RTL8365MB));
         |                  ^~~~~
   net/dsa/tag_rtl8_4.c: In function 'rtl8_4_tag_rcv':
>> net/dsa/tag_rtl8_4.c:142:17: error: implicit declaration of function 'FIELD_GET'; did you mean 'FOLL_GET'? [-Werror=implicit-function-declaration]
     142 |         proto = FIELD_GET(RTL8_4_PROTOCOL, ntohs(tag[1]));
         |                 ^~~~~~~~~
         |                 FOLL_GET
   cc1: some warnings being treated as errors


vim +/FIELD_PREP +108 net/dsa/tag_rtl8_4.c

  > 64	#include <linux/etherdevice.h>
    65	
    66	#include "dsa_priv.h"
    67	
    68	/* Protocols supported:
    69	 *
    70	 * 0x04 = RTL8365MB DSA protocol
    71	 */
    72	
    73	#define RTL8_4_TAG_LEN			8
    74	
    75	#define RTL8_4_PROTOCOL			GENMASK(15, 8)
    76	#define   RTL8_4_PROTOCOL_RTL8365MB	0x04
    77	#define RTL8_4_REASON			GENMASK(7, 0)
    78	#define   RTL8_4_REASON_FORWARD		0
    79	#define   RTL8_4_REASON_TRAP		80
    80	
    81	#define RTL8_4_LEARN_DIS		BIT(5)
    82	
    83	#define RTL8_4_TX			GENMASK(3, 0)
    84	#define RTL8_4_RX			GENMASK(10, 0)
    85	
    86	static struct sk_buff *rtl8_4_tag_xmit(struct sk_buff *skb,
    87					       struct net_device *dev)
    88	{
    89		struct dsa_port *dp = dsa_slave_to_port(dev);
    90		__be16 *tag;
    91	
    92		/* Pad out so the (stripped) packet is at least 64 bytes long
    93		 * (including FCS), otherwise the switch will drop the packet.
    94		 * Then we need an additional 8 bytes for the Realtek tag.
    95		 */
    96		if (unlikely(__skb_put_padto(skb, ETH_ZLEN + RTL8_4_TAG_LEN, false)))
    97			return NULL;
    98	
    99		skb_push(skb, RTL8_4_TAG_LEN);
   100	
   101		dsa_alloc_etype_header(skb, RTL8_4_TAG_LEN);
   102		tag = dsa_etype_header_pos_tx(skb);
   103	
   104		/* Set Realtek EtherType */
   105		tag[0] = htons(ETH_P_REALTEK);
   106	
   107		/* Set Protocol; zero REASON */
 > 108		tag[1] = htons(FIELD_PREP(RTL8_4_PROTOCOL, RTL8_4_PROTOCOL_RTL8365MB));
   109	
   110		/* Zero FID_EN, FID, PRI_EN, PRI, KEEP; set LEARN_DIS */
   111		tag[2] = htons(FIELD_PREP(RTL8_4_LEARN_DIS, 1));
   112	
   113		/* Zero ALLOW; set RX (CPU->switch) forwarding port mask */
   114		tag[3] = htons(FIELD_PREP(RTL8_4_RX, BIT(dp->index)));
   115	
   116		return skb;
   117	}
   118	
   119	static struct sk_buff *rtl8_4_tag_rcv(struct sk_buff *skb,
   120					      struct net_device *dev)
   121	{
   122		__be16 *tag;
   123		u16 etype;
   124		u8 reason;
   125		u8 proto;
   126		u8 port;
   127	
   128		if (unlikely(!pskb_may_pull(skb, RTL8_4_TAG_LEN)))
   129			return NULL;
   130	
   131		tag = dsa_etype_header_pos_rx(skb);
   132	
   133		/* Parse Realtek EtherType */
   134		etype = ntohs(tag[0]);
   135		if (unlikely(etype != ETH_P_REALTEK)) {
   136			dev_warn_ratelimited(&dev->dev,
   137					     "non-realtek ethertype 0x%04x\n", etype);
   138			return NULL;
   139		}
   140	
   141		/* Parse Protocol */
 > 142		proto = FIELD_GET(RTL8_4_PROTOCOL, ntohs(tag[1]));
   143		if (unlikely(proto != RTL8_4_PROTOCOL_RTL8365MB)) {
   144			dev_warn_ratelimited(&dev->dev,
   145					     "unknown realtek protocol 0x%02x\n",
   146					     proto);
   147			return NULL;
   148		}
   149	
   150		/* Parse REASON */
   151		reason = FIELD_GET(RTL8_4_REASON, ntohs(tag[1]));
   152	
   153		/* Parse TX (switch->CPU) */
   154		port = FIELD_GET(RTL8_4_TX, ntohs(tag[3]));
   155		skb->dev = dsa_master_find_slave(dev, 0, port);
   156		if (!skb->dev) {
   157			dev_warn_ratelimited(&dev->dev,
   158					     "could not find slave for port %d\n",
   159					     port);
   160			return NULL;
   161		}
   162	
   163		/* Remove tag and recalculate checksum */
   164		skb_pull_rcsum(skb, RTL8_4_TAG_LEN);
   165	
   166		dsa_strip_etype_header(skb, RTL8_4_TAG_LEN);
   167	
   168		if (reason != RTL8_4_REASON_TRAP)
   169			dsa_default_offload_fwd_mark(skb);
   170	
   171		return skb;
   172	}
   173	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 40872 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: "Alvin Šipraga" <alvin@pqrs.dk>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	"Andrew Lunn" <andrew@lunn.ch>,
	"Vivien Didelot" <vivien.didelot@gmail.com>,
	"Florian Fainelli" <f.fainelli@gmail.com>,
	"Vladimir Oltean" <olteanv@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Heiner Kallweit" <hkallweit1@gmail.com>
Cc: kbuild-all@lists.01.org, netdev@vger.kernel.org
Subject: Re: [PATCH v2 net-next 4/6] net: dsa: tag_rtl8_4: add realtek 8 byte protocol 4 tag
Date: Thu, 14 Oct 2021 08:46:46 +0800	[thread overview]
Message-ID: <202110140822.K85RW1Q3-lkp@intel.com> (raw)
In-Reply-To: <20211013145040.886956-5-alvin@pqrs.dk>

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

Hi "Alvin,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on net-next/master]

url:    https://github.com/0day-ci/linux/commits/Alvin-ipraga/net-dsa-add-support-for-RTL8365MB-VC/20211013-225955
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git d1f24712a86abd04d82cf4b00fb4ab8ff2d23c8a
config: powerpc-randconfig-r023-20211013 (attached as .config)
compiler: powerpc-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/e17d422e49ba2acbf43ae144fcce940cc06152a0
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Alvin-ipraga/net-dsa-add-support-for-RTL8365MB-VC/20211013-225955
        git checkout e17d422e49ba2acbf43ae144fcce940cc06152a0
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=powerpc 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   In file included from include/linux/byteorder/big_endian.h:5,
                    from arch/powerpc/include/uapi/asm/byteorder.h:14,
                    from include/asm-generic/bitops/le.h:7,
                    from arch/powerpc/include/asm/bitops.h:265,
                    from include/linux/bitops.h:33,
                    from include/linux/kernel.h:12,
                    from include/linux/skbuff.h:13,
                    from include/linux/if_ether.h:19,
                    from include/linux/etherdevice.h:20,
                    from net/dsa/tag_rtl8_4.c:64:
   net/dsa/tag_rtl8_4.c: In function 'rtl8_4_tag_xmit':
>> net/dsa/tag_rtl8_4.c:108:24: error: implicit declaration of function 'FIELD_PREP' [-Werror=implicit-function-declaration]
     108 |         tag[1] = htons(FIELD_PREP(RTL8_4_PROTOCOL, RTL8_4_PROTOCOL_RTL8365MB));
         |                        ^~~~~~~~~~
   include/uapi/linux/byteorder/big_endian.h:41:51: note: in definition of macro '__cpu_to_be16'
      41 | #define __cpu_to_be16(x) ((__force __be16)(__u16)(x))
         |                                                   ^
   include/linux/byteorder/generic.h:141:18: note: in expansion of macro '___htons'
     141 | #define htons(x) ___htons(x)
         |                  ^~~~~~~~
   net/dsa/tag_rtl8_4.c:108:18: note: in expansion of macro 'htons'
     108 |         tag[1] = htons(FIELD_PREP(RTL8_4_PROTOCOL, RTL8_4_PROTOCOL_RTL8365MB));
         |                  ^~~~~
   net/dsa/tag_rtl8_4.c: In function 'rtl8_4_tag_rcv':
>> net/dsa/tag_rtl8_4.c:142:17: error: implicit declaration of function 'FIELD_GET'; did you mean 'FOLL_GET'? [-Werror=implicit-function-declaration]
     142 |         proto = FIELD_GET(RTL8_4_PROTOCOL, ntohs(tag[1]));
         |                 ^~~~~~~~~
         |                 FOLL_GET
   cc1: some warnings being treated as errors


vim +/FIELD_PREP +108 net/dsa/tag_rtl8_4.c

  > 64	#include <linux/etherdevice.h>
    65	
    66	#include "dsa_priv.h"
    67	
    68	/* Protocols supported:
    69	 *
    70	 * 0x04 = RTL8365MB DSA protocol
    71	 */
    72	
    73	#define RTL8_4_TAG_LEN			8
    74	
    75	#define RTL8_4_PROTOCOL			GENMASK(15, 8)
    76	#define   RTL8_4_PROTOCOL_RTL8365MB	0x04
    77	#define RTL8_4_REASON			GENMASK(7, 0)
    78	#define   RTL8_4_REASON_FORWARD		0
    79	#define   RTL8_4_REASON_TRAP		80
    80	
    81	#define RTL8_4_LEARN_DIS		BIT(5)
    82	
    83	#define RTL8_4_TX			GENMASK(3, 0)
    84	#define RTL8_4_RX			GENMASK(10, 0)
    85	
    86	static struct sk_buff *rtl8_4_tag_xmit(struct sk_buff *skb,
    87					       struct net_device *dev)
    88	{
    89		struct dsa_port *dp = dsa_slave_to_port(dev);
    90		__be16 *tag;
    91	
    92		/* Pad out so the (stripped) packet is at least 64 bytes long
    93		 * (including FCS), otherwise the switch will drop the packet.
    94		 * Then we need an additional 8 bytes for the Realtek tag.
    95		 */
    96		if (unlikely(__skb_put_padto(skb, ETH_ZLEN + RTL8_4_TAG_LEN, false)))
    97			return NULL;
    98	
    99		skb_push(skb, RTL8_4_TAG_LEN);
   100	
   101		dsa_alloc_etype_header(skb, RTL8_4_TAG_LEN);
   102		tag = dsa_etype_header_pos_tx(skb);
   103	
   104		/* Set Realtek EtherType */
   105		tag[0] = htons(ETH_P_REALTEK);
   106	
   107		/* Set Protocol; zero REASON */
 > 108		tag[1] = htons(FIELD_PREP(RTL8_4_PROTOCOL, RTL8_4_PROTOCOL_RTL8365MB));
   109	
   110		/* Zero FID_EN, FID, PRI_EN, PRI, KEEP; set LEARN_DIS */
   111		tag[2] = htons(FIELD_PREP(RTL8_4_LEARN_DIS, 1));
   112	
   113		/* Zero ALLOW; set RX (CPU->switch) forwarding port mask */
   114		tag[3] = htons(FIELD_PREP(RTL8_4_RX, BIT(dp->index)));
   115	
   116		return skb;
   117	}
   118	
   119	static struct sk_buff *rtl8_4_tag_rcv(struct sk_buff *skb,
   120					      struct net_device *dev)
   121	{
   122		__be16 *tag;
   123		u16 etype;
   124		u8 reason;
   125		u8 proto;
   126		u8 port;
   127	
   128		if (unlikely(!pskb_may_pull(skb, RTL8_4_TAG_LEN)))
   129			return NULL;
   130	
   131		tag = dsa_etype_header_pos_rx(skb);
   132	
   133		/* Parse Realtek EtherType */
   134		etype = ntohs(tag[0]);
   135		if (unlikely(etype != ETH_P_REALTEK)) {
   136			dev_warn_ratelimited(&dev->dev,
   137					     "non-realtek ethertype 0x%04x\n", etype);
   138			return NULL;
   139		}
   140	
   141		/* Parse Protocol */
 > 142		proto = FIELD_GET(RTL8_4_PROTOCOL, ntohs(tag[1]));
   143		if (unlikely(proto != RTL8_4_PROTOCOL_RTL8365MB)) {
   144			dev_warn_ratelimited(&dev->dev,
   145					     "unknown realtek protocol 0x%02x\n",
   146					     proto);
   147			return NULL;
   148		}
   149	
   150		/* Parse REASON */
   151		reason = FIELD_GET(RTL8_4_REASON, ntohs(tag[1]));
   152	
   153		/* Parse TX (switch->CPU) */
   154		port = FIELD_GET(RTL8_4_TX, ntohs(tag[3]));
   155		skb->dev = dsa_master_find_slave(dev, 0, port);
   156		if (!skb->dev) {
   157			dev_warn_ratelimited(&dev->dev,
   158					     "could not find slave for port %d\n",
   159					     port);
   160			return NULL;
   161		}
   162	
   163		/* Remove tag and recalculate checksum */
   164		skb_pull_rcsum(skb, RTL8_4_TAG_LEN);
   165	
   166		dsa_strip_etype_header(skb, RTL8_4_TAG_LEN);
   167	
   168		if (reason != RTL8_4_REASON_TRAP)
   169			dsa_default_offload_fwd_mark(skb);
   170	
   171		return skb;
   172	}
   173	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 40872 bytes --]

  parent reply	other threads:[~2021-10-14  0:46 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-13 14:50 [PATCH v2 net-next 0/6] net: dsa: add support for RTL8365MB-VC Alvin Šipraga
2021-10-13 14:50 ` [PATCH v2 net-next 1/6] ether: add EtherType for proprietary Realtek protocols Alvin Šipraga
2021-10-14  2:17   ` Florian Fainelli
2021-10-13 14:50 ` [PATCH v2 net-next 2/6] net: dsa: move NET_DSA_TAG_RTL4_A to right place in Kconfig/Makefile Alvin Šipraga
2021-10-14  2:17   ` Florian Fainelli
2021-10-13 14:50 ` [PATCH v2 net-next 3/6] dt-bindings: net: dsa: realtek-smi: document new compatible rtl8365mb Alvin Šipraga
2021-10-13 14:50 ` [PATCH v2 net-next 4/6] net: dsa: tag_rtl8_4: add realtek 8 byte protocol 4 tag Alvin Šipraga
2021-10-14  0:38   ` kernel test robot
2021-10-14  0:38     ` kernel test robot
2021-10-14  0:46   ` kernel test robot [this message]
2021-10-14  0:46     ` kernel test robot
2021-10-14  2:19   ` Florian Fainelli
2021-10-13 14:50 ` [PATCH v2 net-next 5/6] net: dsa: realtek-smi: add rtl8365mb subdriver for RTL8365MB-VC Alvin Šipraga
2021-10-14  2:25   ` Florian Fainelli
2021-10-13 14:50 ` [PATCH v2 net-next 6/6] net: phy: realtek: add support for RTL8365MB-VC internal PHYs Alvin Šipraga

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=202110140822.K85RW1Q3-lkp@intel.com \
    --to=lkp@intel.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.