Re: [PATCH 1/3] net:ipv6:Add ndisc_bond_send_na to support sending na by slave directly

From: kernel test robot
Date: Fri Mar 11 2022 - 09:45:20 EST


Hi Sun,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on 2a9eef868a997ec575c2e6ae885e91313f635d59]

url: https://github.com/0day-ci/linux/commits/Sun-Shouxin/net-bonding-Add-support-for-IPV6-RLB-to-balance-alb-mode/20220311-110221
base: 2a9eef868a997ec575c2e6ae885e91313f635d59
config: mips-bmips_be_defconfig (https://download.01.org/0day-ci/archive/20220311/202203112242.Gjf5MZjs-lkp@xxxxxxxxx/config)
compiler: mips-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/9bd4966a283f758f100bd97d09967edc92903c76
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Sun-Shouxin/net-bonding-Add-support-for-IPV6-RLB-to-balance-alb-mode/20220311-110221
git checkout 9bd4966a283f758f100bd97d09967edc92903c76
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=mips SHELL=/bin/bash net/ipv6/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

net/ipv6/ndisc.c: In function 'ndisc_bond_send_na':
>> net/ipv6/ndisc.c:587:13: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
587 | int ret;
| ^~~


vim +/ret +587 net/ipv6/ndisc.c

574
575 void ndisc_bond_send_na(struct net_device *dev, const struct in6_addr *daddr,
576 const struct in6_addr *solicited_addr,
577 bool router, bool solicited, bool override,
578 bool inc_opt, unsigned short vlan_id,
579 const void *mac_dst, const void *mac_src)
580 {
581 struct sk_buff *skb;
582 const struct in6_addr *src_addr;
583 struct nd_msg *msg;
584 struct net *net = dev_net(dev);
585 struct sock *sk = net->ipv6.ndisc_sk;
586 int optlen = 0;
> 587 int ret;
588
589 src_addr = solicited_addr;
590 if (!dev->addr_len)
591 inc_opt = false;
592 if (inc_opt)
593 optlen += ndisc_opt_addr_space(dev,
594 NDISC_NEIGHBOUR_ADVERTISEMENT);
595
596 skb = ndisc_alloc_skb(dev, sizeof(*msg) + optlen);
597 if (!skb)
598 return;
599
600 msg = skb_put(skb, sizeof(*msg));
601 *msg = (struct nd_msg) {
602 .icmph = {
603 .icmp6_type = NDISC_NEIGHBOUR_ADVERTISEMENT,
604 .icmp6_router = router,
605 .icmp6_solicited = solicited,
606 .icmp6_override = override,
607 },
608 .target = *solicited_addr,
609 };
610
611 if (inc_opt)
612 ndisc_fill_addr_option(skb, ND_OPT_TARGET_LL_ADDR,
613 dev->dev_addr,
614 NDISC_NEIGHBOUR_ADVERTISEMENT);
615
616 if (vlan_id)
617 __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q),
618 vlan_id);
619
620 msg->icmph.icmp6_cksum = csum_ipv6_magic(src_addr, daddr, skb->len,
621 IPPROTO_ICMPV6,
622 csum_partial(&msg->icmph,
623 skb->len, 0));
624
625 ip6_nd_hdr(skb, src_addr, daddr, inet6_sk(sk)->hop_limit, skb->len);
626
627 skb->protocol = htons(ETH_P_IPV6);
628 skb->dev = dev;
629 if (dev_hard_header(skb, dev, ETH_P_IPV6, mac_dst, mac_src, skb->len) < 0)
630 return;
631
632 ret = dev_queue_xmit(skb);
633 }
634 EXPORT_SYMBOL(ndisc_bond_send_na);
635

---
0-DAY CI Kernel Test Service
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx