From: kbuild test robot <lkp@intel.com>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: kbuild-all@lists.01.org, netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nf-next] netfilter: nf_tables_offload: pass extack to nft_flow_cls_offload_setup()
Date: Mon, 4 Nov 2019 20:27:11 +0800 [thread overview]
Message-ID: <201911042000.sDYuFIQa%lkp@intel.com> (raw)
In-Reply-To: <20191102142805.25340-1-pablo@netfilter.org>
Hi Pablo,
I love your patch! Perhaps something to improve:
[auto build test WARNING on nf-next/master]
url: https://github.com/0day-ci/linux/commits/Pablo-Neira-Ayuso/netfilter-nf_tables_offload-pass-extack-to-nft_flow_cls_offload_setup/20191103-115127
base: https://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next.git master
reproduce:
# apt-get install sparse
# sparse version: v0.6.1-6-g57f8611-dirty
make ARCH=x86_64 allmodconfig
make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
sparse warnings: (new ones prefixed by >>)
net/netfilter/nf_tables_offload.c:165:24: sparse: sparse: incorrect type in initializer (different base types) @@ expected restricted __be16 [usertype] proto @@ got e] proto @@
net/netfilter/nf_tables_offload.c:165:24: sparse: expected restricted __be16 [usertype] proto
net/netfilter/nf_tables_offload.c:165:24: sparse: got int
>> net/netfilter/nf_tables_offload.c:218:17: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected void *s @@ got struct netlink_exvoid *s @@
>> net/netfilter/nf_tables_offload.c:218:17: sparse: expected void *s
>> net/netfilter/nf_tables_offload.c:218:17: sparse: got struct netlink_ext_ack extack
vim +218 net/netfilter/nf_tables_offload.c
157
158 static void nft_flow_cls_offload_setup(struct flow_cls_offload *cls_flow,
159 const struct nft_base_chain *basechain,
160 const struct nft_rule *rule,
161 const struct nft_flow_rule *flow,
162 struct netlink_ext_ack *extack,
163 enum flow_cls_command command)
164 {
> 165 __be16 proto = ETH_P_ALL;
166
167 memset(cls_flow, 0, sizeof(*cls_flow));
168
169 if (flow)
170 proto = flow->proto;
171
172 nft_flow_offload_common_init(&cls_flow->common, proto,
173 basechain->ops.priority, extack);
174 cls_flow->command = command;
175 cls_flow->cookie = (unsigned long) rule;
176 if (flow)
177 cls_flow->rule = flow->rule;
178 }
179
180 static int nft_flow_offload_rule(struct nft_chain *chain,
181 struct nft_rule *rule,
182 struct nft_flow_rule *flow,
183 enum flow_cls_command command)
184 {
185 struct netlink_ext_ack extack = {};
186 struct flow_cls_offload cls_flow;
187 struct nft_base_chain *basechain;
188
189 if (!nft_is_base_chain(chain))
190 return -EOPNOTSUPP;
191
192 basechain = nft_base_chain(chain);
193 nft_flow_cls_offload_setup(&cls_flow, basechain, rule, flow, &extack,
194 command);
195
196 return nft_setup_cb_call(TC_SETUP_CLSFLOWER, &cls_flow,
197 &basechain->flow_block.cb_list);
198 }
199
200 static int nft_flow_offload_bind(struct flow_block_offload *bo,
201 struct nft_base_chain *basechain)
202 {
203 list_splice(&bo->cb_list, &basechain->flow_block.cb_list);
204 return 0;
205 }
206
207 static int nft_flow_offload_unbind(struct flow_block_offload *bo,
208 struct nft_base_chain *basechain)
209 {
210 struct flow_block_cb *block_cb, *next;
211 struct flow_cls_offload cls_flow;
212 struct netlink_ext_ack extack;
213 struct nft_chain *chain;
214 struct nft_rule *rule;
215
216 chain = &basechain->chain;
217 list_for_each_entry(rule, &chain->rules, list) {
> 218 memset(extack, 0, sizeof(extack));
219 nft_flow_cls_offload_setup(&cls_flow, basechain, rule, NULL,
220 &extack, FLOW_CLS_DESTROY);
221 nft_setup_cb_call(TC_SETUP_CLSFLOWER, &cls_flow, &bo->cb_list);
222 }
223
224 list_for_each_entry_safe(block_cb, next, &bo->cb_list, list) {
225 list_del(&block_cb->list);
226 flow_block_cb_free(block_cb);
227 }
228
229 return 0;
230 }
231
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
prev parent reply other threads:[~2019-11-04 12:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-02 14:28 [PATCH nf-next] netfilter: nf_tables_offload: pass extack to nft_flow_cls_offload_setup() Pablo Neira Ayuso
2019-11-03 4:58 ` kbuild test robot
2019-11-03 4:58 ` kbuild test robot
2019-11-04 12:27 ` kbuild test robot [this message]
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=201911042000.sDYuFIQa%lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild-all@lists.01.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).