[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202110140806.7Eiz5jr5-lkp@intel.com>
Date: Thu, 14 Oct 2021 08:38:37 +0800
From: kernel test robot <lkp@...el.com>
To: Alvin Šipraga <alvin@...s.dk>,
Linus Walleij <linus.walleij@...aro.org>,
Andrew Lunn <andrew@...n.ch>,
Vivien Didelot <vivien.didelot@...il.com>,
Florian Fainelli <f.fainelli@...il.com>,
Vladimir Oltean <olteanv@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Rob Herring <robh+dt@...nel.org>,
Heiner Kallweit <hkallweit1@...il.com>
Cc: llvm@...ts.linux.dev, kbuild-all@...ts.01.org,
netdev@...r.kernel.org
Subject: Re: [PATCH v2 net-next 4/6] net: dsa: tag_rtl8_4: add realtek 8 byte
protocol 4 tag
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: x86_64-randconfig-r034-20211013 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project b6a8c695542b2987eb9a203d5663a0740cb4725f)
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=clang make.cross W=1 ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>
All errors (new ones prefixed by >>):
>> net/dsa/tag_rtl8_4.c:108:17: error: implicit declaration of function 'FIELD_PREP' [-Werror,-Wimplicit-function-declaration]
tag[1] = htons(FIELD_PREP(RTL8_4_PROTOCOL, RTL8_4_PROTOCOL_RTL8365MB));
^
>> net/dsa/tag_rtl8_4.c:142:10: error: implicit declaration of function 'FIELD_GET' [-Werror,-Wimplicit-function-declaration]
proto = FIELD_GET(RTL8_4_PROTOCOL, ntohs(tag[1]));
^
2 errors generated.
vim +/FIELD_PREP +108 net/dsa/tag_rtl8_4.c
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
Download attachment ".config.gz" of type "application/gzip" (39874 bytes)
Powered by blists - more mailing lists