Content-Type: multipart/mixed; boundary="===============7164010353699657039==" MIME-Version: 1.0 From: kbuild test robot To: kbuild-all@lists.01.org Subject: Re: [PATCH nf-next] netfilter: nf_tables_offload: pass extack to nft_flow_cls_offload_setup() Date: Mon, 04 Nov 2019 20:27:11 +0800 Message-ID: <201911042000.sDYuFIQa%lkp@intel.com> In-Reply-To: <20191102142805.25340-1-pablo@netfilter.org> List-Id: --===============7164010353699657039== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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/netfilte= r-nf_tables_offload-pass-extack-to-nft_flow_cls_offload_setup/20191103-1151= 27 base: https://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next.git m= aster reproduce: # apt-get install sparse # sparse version: v0.6.1-6-g57f8611-dirty make ARCH=3Dx86_64 allmodconfig make C=3D1 CF=3D'-fdiagnostic-prefix -D__CHECK_ENDIAN__' If you fix the issue, kindly add following tag Reported-by: kbuild test robot 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 [us= ertype] 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 stru= ct 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 =3D ETH_P_ALL; 166 = 167 memset(cls_flow, 0, sizeof(*cls_flow)); 168 = 169 if (flow) 170 proto =3D flow->proto; 171 = 172 nft_flow_offload_common_init(&cls_flow->common, proto, 173 basechain->ops.priority, extack); 174 cls_flow->command =3D command; 175 cls_flow->cookie =3D (unsigned long) rule; 176 if (flow) 177 cls_flow->rule =3D 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 =3D {}; 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 =3D nft_base_chain(chain); 193 nft_flow_cls_offload_setup(&cls_flow, basechain, rule, flow, &extac= k, 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 =3D &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 Cent= er https://lists.01.org/pipermail/kbuild-all Intel Corporati= on --===============7164010353699657039==--