Re: [PATCH nf-next] netfilter: nf_tables_offload: pass extack to nft_flow_cls_offload_setup()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>


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



[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux