Content-Type: multipart/mixed; boundary="===============8677209750768342907==" MIME-Version: 1.0 From: kbuild test robot To: kbuild-all@lists.01.org Subject: Re: [PATCH nf-next 2/5] netfilter: nft_tunnel: support NFT_TUNNEL_IPV4_SRC/DST match Date: Sun, 27 Oct 2019 18:32:43 +0800 Message-ID: <201910271840.MV2CnqwN%lkp@intel.com> In-Reply-To: <1571913336-13431-3-git-send-email-wenxu@ucloud.cn> List-Id: --===============8677209750768342907== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Hi, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on nf-next/master] url: https://github.com/0day-ci/linux/commits/wenxu-ucloud-cn/netfilter-= nft_tunnel-support-tunnel-match-expr-offload/20191027-152013 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-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/nft_tunnel.c:71:31: sparse: sparse: incorrect type in assi= gnment (different base types) @@ expected unsigned int [usertype] @@ = got restrunsigned int [usertype] @@ >> net/netfilter/nft_tunnel.c:71:31: sparse: expected unsigned int [user= type] >> net/netfilter/nft_tunnel.c:71:31: sparse: got restricted __be32 [user= type] src net/netfilter/nft_tunnel.c:81:31: sparse: sparse: incorrect type in assi= gnment (different base types) @@ expected unsigned int [usertype] @@ = got restrunsigned int [usertype] @@ net/netfilter/nft_tunnel.c:81:31: sparse: expected unsigned int [user= type] >> net/netfilter/nft_tunnel.c:81:31: sparse: got restricted __be32 [user= type] dst net/netfilter/nft_tunnel.c:531:54: sparse: sparse: cast from restricted = __be16 net/netfilter/nft_tunnel.c:531:54: sparse: sparse: incorrect type in arg= ument 1 (different base types) @@ expected unsigned short [usertype] val= @@ got resunsigned short [usertype] val @@ net/netfilter/nft_tunnel.c:531:54: sparse: expected unsigned short [u= sertype] val net/netfilter/nft_tunnel.c:531:54: sparse: got restricted __be16 [use= rtype] tp_src net/netfilter/nft_tunnel.c:531:54: sparse: sparse: cast from restricted = __be16 net/netfilter/nft_tunnel.c:531:54: sparse: sparse: cast from restricted = __be16 net/netfilter/nft_tunnel.c:532:54: sparse: sparse: cast from restricted = __be16 net/netfilter/nft_tunnel.c:532:54: sparse: sparse: incorrect type in arg= ument 1 (different base types) @@ expected unsigned short [usertype] val= @@ got resunsigned short [usertype] val @@ net/netfilter/nft_tunnel.c:532:54: sparse: expected unsigned short [u= sertype] val net/netfilter/nft_tunnel.c:532:54: sparse: got restricted __be16 [use= rtype] tp_dst net/netfilter/nft_tunnel.c:532:54: sparse: sparse: cast from restricted = __be16 net/netfilter/nft_tunnel.c:532:54: sparse: sparse: cast from restricted = __be16 vim +71 net/netfilter/nft_tunnel.c 33 = 34 static void nft_tunnel_get_eval(const struct nft_expr *expr, 35 struct nft_regs *regs, 36 const struct nft_pktinfo *pkt) 37 { 38 const struct nft_tunnel *priv =3D nft_expr_priv(expr); 39 u32 *dest =3D ®s->data[priv->dreg]; 40 struct ip_tunnel_info *tun_info; 41 = 42 tun_info =3D skb_tunnel_info(pkt->skb); 43 = 44 switch (priv->key) { 45 case NFT_TUNNEL_PATH: 46 if (!tun_info) { 47 nft_reg_store8(dest, false); 48 return; 49 } 50 if (nft_tunnel_mode_validate(priv->mode, tun_info->mode)) 51 nft_reg_store8(dest, true); 52 else 53 nft_reg_store8(dest, false); 54 break; 55 case NFT_TUNNEL_ID: 56 if (!tun_info) { 57 regs->verdict.code =3D NFT_BREAK; 58 return; 59 } 60 if (nft_tunnel_mode_validate(priv->mode, tun_info->mode)) 61 *dest =3D ntohl(tunnel_id_to_key32(tun_info->key.tun_id)); 62 else 63 regs->verdict.code =3D NFT_BREAK; 64 break; 65 case NFT_TUNNEL_IPV4_SRC: 66 if (!tun_info) { 67 regs->verdict.code =3D NFT_BREAK; 68 return; 69 } 70 if (nft_tunnel_mode_validate(priv->mode, tun_info->mode)) > 71 *dest =3D tun_info->key.u.ipv4.src; 72 else 73 regs->verdict.code =3D NFT_BREAK; 74 break; 75 case NFT_TUNNEL_IPV4_DST: 76 if (!tun_info) { 77 regs->verdict.code =3D NFT_BREAK; 78 return; 79 } 80 if (nft_tunnel_mode_validate(priv->mode, tun_info->mode)) > 81 *dest =3D tun_info->key.u.ipv4.dst; 82 else 83 regs->verdict.code =3D NFT_BREAK; 84 break; 85 default: 86 WARN_ON(1); 87 regs->verdict.code =3D NFT_BREAK; 88 } 89 } 90 = --- 0-DAY kernel test infrastructure Open Source Technology Cent= er https://lists.01.org/pipermail/kbuild-all Intel Corporati= on --===============8677209750768342907==--