From: kbuild test robot <lkp@intel.com>
To: liujian56@huawei.com
Cc: kbuild-all@01.org, davem@davemloft.net, j.vosburgh@gmail.com,
vfalico@gmail.com, andy@greyhouse.net, netdev@vger.kernel.org,
weiyongjun1@huawei.com, liujian56@huawei.com
Subject: Re: [PATCH] net: bond: skip vlan header when do layer 3+4 hash policy
Date: Sun, 1 Apr 2018 07:59:44 +0800 [thread overview]
Message-ID: <201804010732.nz5xInrS%fengguang.wu@intel.com> (raw)
In-Reply-To: <1522487670-15796-1-git-send-email-liujian56@huawei.com>
Hi liujian,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on net-next/master]
[also build test WARNING on v4.16-rc7 next-20180329]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/liujian56-huawei-com/net-bond-skip-vlan-header-when-do-layer-3-4-hash-policy/20180401-045327
reproduce:
# apt-get install sparse
make ARCH=x86_64 allmodconfig
make C=1 CF=-D__CHECK_ENDIAN__
sparse warnings: (new ones prefixed by >>)
drivers/net/bonding/bond_main.c:2343:26: sparse: restricted __be16 degrades to integer
drivers/net/bonding/bond_main.c:2349:20: sparse: restricted __be16 degrades to integer
drivers/net/bonding/bond_main.c:2396:40: sparse: incorrect type in assignment (different base types) @@ expected restricted __be16 [usertype] vlan_proto @@ got e] vlan_proto @@
drivers/net/bonding/bond_main.c:2396:40: expected restricted __be16 [usertype] vlan_proto
drivers/net/bonding/bond_main.c:2396:40: got int
>> drivers/net/bonding/bond_main.c:3217:18: sparse: incorrect type in assignment (different base types) @@ expected int [signed] skbproto @@ got restricted __be1int [signed] skbproto @@
drivers/net/bonding/bond_main.c:3217:18: expected int [signed] skbproto
drivers/net/bonding/bond_main.c:3217:18: got restricted __be16 [usertype] protocol
>> drivers/net/bonding/bond_main.c:3219:26: sparse: incorrect type in assignment (different base types) @@ expected int [signed] skbproto @@ got restint [signed] skbproto @@
drivers/net/bonding/bond_main.c:3219:26: expected int [signed] skbproto
drivers/net/bonding/bond_main.c:3219:26: got restricted __be16
drivers/net/bonding/bond_main.c:3221:25: sparse: restricted __be16 degrades to integer
drivers/net/bonding/bond_main.c:3229:32: sparse: restricted __be16 degrades to integer
drivers/net/bonding/bond_main.c:3199:60: sparse: restricted __be16 degrades to integer
drivers/net/bonding/bond_main.c:3199:60: sparse: restricted __be16 degrades to integer
vim +3217 drivers/net/bonding/bond_main.c
3202
3203 /* Extract the appropriate headers based on bond's xmit policy */
3204 static bool bond_flow_dissect(struct bonding *bond, struct sk_buff *skb,
3205 struct flow_keys *fk)
3206 {
3207 const struct ipv6hdr *iph6;
3208 const struct iphdr *iph;
3209 int noff, proto = -1, skbproto;
3210
3211 if (bond->params.xmit_policy > BOND_XMIT_POLICY_LAYER23)
3212 return skb_flow_dissect_flow_keys(skb, fk, 0);
3213
3214 fk->ports.ports = 0;
3215 noff = skb_network_offset(skb);
3216
> 3217 skbproto = skb->protocol;
3218 if (bond->params.xmit_policy == BOND_XMIT_POLICY_LAYER34)
> 3219 skbproto = vlan_get_protocol(skb);
3220
3221 if (skbproto == htons(ETH_P_IP)) {
3222 if (unlikely(!pskb_may_pull(skb, noff + sizeof(*iph))))
3223 return false;
3224 iph = ip_hdr(skb);
3225 iph_to_flow_copy_v4addrs(fk, iph);
3226 noff += iph->ihl << 2;
3227 if (!ip_is_fragment(iph))
3228 proto = iph->protocol;
3229 } else if (skbproto == htons(ETH_P_IPV6)) {
3230 if (unlikely(!pskb_may_pull(skb, noff + sizeof(*iph6))))
3231 return false;
3232 iph6 = ipv6_hdr(skb);
3233 iph_to_flow_copy_v6addrs(fk, iph6);
3234 noff += sizeof(*iph6);
3235 proto = iph6->nexthdr;
3236 } else {
3237 return false;
3238 }
3239 if (bond->params.xmit_policy == BOND_XMIT_POLICY_LAYER34 && proto >= 0)
3240 fk->ports.ports = skb_flow_get_ports(skb, noff, proto);
3241
3242 return true;
3243 }
3244
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
prev parent reply other threads:[~2018-04-01 0:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-31 9:14 [PATCH] net: bond: skip vlan header when do layer 3+4 hash policy liujian56
2018-03-31 9:22 ` Nikolay Aleksandrov
2018-04-02 10:53 ` liujian (CE)
2018-03-31 23:59 ` 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=201804010732.nz5xInrS%fengguang.wu@intel.com \
--to=lkp@intel.com \
--cc=andy@greyhouse.net \
--cc=davem@davemloft.net \
--cc=j.vosburgh@gmail.com \
--cc=kbuild-all@01.org \
--cc=liujian56@huawei.com \
--cc=netdev@vger.kernel.org \
--cc=vfalico@gmail.com \
--cc=weiyongjun1@huawei.com \
/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