[PATCH 12/12] net: Get rid of SWITCHDEV_ATTR_ID_PORT_PARENT_ID

kbuild test robot lkp at intel.com
Tue Feb 5 11:17:10 UTC 2019


Hi Florian,

I love your patch! Yet something to improve:

[auto build test ERROR on net/master]
[also build test ERROR on next-20190205]
[cannot apply to v5.0-rc4]
[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/Florian-Fainelli/net-Introduce-ndo_get_port_parent_id/20190205-163356
config: nds32-allmodconfig (attached as .config)
compiler: nds32le-linux-gcc (GCC) 6.4.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=6.4.0 make.cross ARCH=nds32 

All errors (new ones prefixed by >>):

   net/ipv4/ipmr.c: In function 'vif_add':
>> net/ipv4/ipmr.c:920:2: error: 'attr' undeclared (first use in this function)
     attr.orig_dev = dev;
     ^~~~
   net/ipv4/ipmr.c:920:2: note: each undeclared identifier is reported only once for each function it appears in

vim +/attr +920 net/ipv4/ipmr.c

^1da177e4 Linus Torvalds      2005-04-16  835  
0c12295a7 Patrick McHardy     2010-04-13  836  static int vif_add(struct net *net, struct mr_table *mrt,
0c12295a7 Patrick McHardy     2010-04-13  837  		   struct vifctl *vifc, int mrtsock)
^1da177e4 Linus Torvalds      2005-04-16  838  {
ca3b84139 Florian Fainelli    2019-02-04  839  	struct netdev_phys_item_id ppid = { };
f95ad5036 Florian Fainelli    2019-02-04  840  	const struct net_device_ops *ops;
^1da177e4 Linus Torvalds      2005-04-16  841  	int vifi = vifc->vifc_vifi;
0c12295a7 Patrick McHardy     2010-04-13  842  	struct vif_device *v = &mrt->vif_table[vifi];
^1da177e4 Linus Torvalds      2005-04-16  843  	struct net_device *dev;
^1da177e4 Linus Torvalds      2005-04-16  844  	struct in_device *in_dev;
d607032db Wang Chen           2008-07-14  845  	int err;
^1da177e4 Linus Torvalds      2005-04-16  846  
^1da177e4 Linus Torvalds      2005-04-16  847  	/* Is vif busy ? */
0c12295a7 Patrick McHardy     2010-04-13  848  	if (VIF_EXISTS(mrt, vifi))
^1da177e4 Linus Torvalds      2005-04-16  849  		return -EADDRINUSE;
^1da177e4 Linus Torvalds      2005-04-16  850  
^1da177e4 Linus Torvalds      2005-04-16  851  	switch (vifc->vifc_flags) {
^1da177e4 Linus Torvalds      2005-04-16  852  	case VIFF_REGISTER:
1973a4ea6 Nikolay Aleksandrov 2015-11-26  853  		if (!ipmr_pimsm_enabled())
c316c629f Nikolay Aleksandrov 2015-11-21  854  			return -EINVAL;
c316c629f Nikolay Aleksandrov 2015-11-21  855  		/* Special Purpose VIF in PIM
^1da177e4 Linus Torvalds      2005-04-16  856  		 * All the packets will be sent to the daemon
^1da177e4 Linus Torvalds      2005-04-16  857  		 */
0c12295a7 Patrick McHardy     2010-04-13  858  		if (mrt->mroute_reg_vif_num >= 0)
^1da177e4 Linus Torvalds      2005-04-16  859  			return -EADDRINUSE;
f0ad0860d Patrick McHardy     2010-04-13  860  		dev = ipmr_reg_vif(net, mrt);
^1da177e4 Linus Torvalds      2005-04-16  861  		if (!dev)
^1da177e4 Linus Torvalds      2005-04-16  862  			return -ENOBUFS;
d607032db Wang Chen           2008-07-14  863  		err = dev_set_allmulti(dev, 1);
d607032db Wang Chen           2008-07-14  864  		if (err) {
d607032db Wang Chen           2008-07-14  865  			unregister_netdevice(dev);
7dc00c82c Wang Chen           2008-07-14  866  			dev_put(dev);
d607032db Wang Chen           2008-07-14  867  			return err;
d607032db Wang Chen           2008-07-14  868  		}
^1da177e4 Linus Torvalds      2005-04-16  869  		break;
^1da177e4 Linus Torvalds      2005-04-16  870  	case VIFF_TUNNEL:
4feb88e5c Benjamin Thery      2009-01-22  871  		dev = ipmr_new_tunnel(net, vifc);
^1da177e4 Linus Torvalds      2005-04-16  872  		if (!dev)
^1da177e4 Linus Torvalds      2005-04-16  873  			return -ENOBUFS;
d607032db Wang Chen           2008-07-14  874  		err = dev_set_allmulti(dev, 1);
d607032db Wang Chen           2008-07-14  875  		if (err) {
d607032db Wang Chen           2008-07-14  876  			ipmr_del_tunnel(dev, vifc);
7dc00c82c Wang Chen           2008-07-14  877  			dev_put(dev);
d607032db Wang Chen           2008-07-14  878  			return err;
d607032db Wang Chen           2008-07-14  879  		}
^1da177e4 Linus Torvalds      2005-04-16  880  		break;
ee5e81f00 Ilia K              2009-09-16  881  	case VIFF_USE_IFINDEX:
^1da177e4 Linus Torvalds      2005-04-16  882  	case 0:
ee5e81f00 Ilia K              2009-09-16  883  		if (vifc->vifc_flags == VIFF_USE_IFINDEX) {
ee5e81f00 Ilia K              2009-09-16  884  			dev = dev_get_by_index(net, vifc->vifc_lcl_ifindex);
51456b291 Ian Morris          2015-04-03  885  			if (dev && !__in_dev_get_rtnl(dev)) {
ee5e81f00 Ilia K              2009-09-16  886  				dev_put(dev);
ee5e81f00 Ilia K              2009-09-16  887  				return -EADDRNOTAVAIL;
ee5e81f00 Ilia K              2009-09-16  888  			}
a8cb16dd9 Eric Dumazet        2010-10-01  889  		} else {
4feb88e5c Benjamin Thery      2009-01-22  890  			dev = ip_dev_find(net, vifc->vifc_lcl_addr.s_addr);
a8cb16dd9 Eric Dumazet        2010-10-01  891  		}
^1da177e4 Linus Torvalds      2005-04-16  892  		if (!dev)
^1da177e4 Linus Torvalds      2005-04-16  893  			return -EADDRNOTAVAIL;
d607032db Wang Chen           2008-07-14  894  		err = dev_set_allmulti(dev, 1);
7dc00c82c Wang Chen           2008-07-14  895  		if (err) {
7dc00c82c Wang Chen           2008-07-14  896  			dev_put(dev);
d607032db Wang Chen           2008-07-14  897  			return err;
7dc00c82c Wang Chen           2008-07-14  898  		}
^1da177e4 Linus Torvalds      2005-04-16  899  		break;
^1da177e4 Linus Torvalds      2005-04-16  900  	default:
^1da177e4 Linus Torvalds      2005-04-16  901  		return -EINVAL;
^1da177e4 Linus Torvalds      2005-04-16  902  	}
^1da177e4 Linus Torvalds      2005-04-16  903  
a8cb16dd9 Eric Dumazet        2010-10-01  904  	in_dev = __in_dev_get_rtnl(dev);
a8cb16dd9 Eric Dumazet        2010-10-01  905  	if (!in_dev) {
d0490cfdf Dan Carpenter       2009-11-11  906  		dev_put(dev);
^1da177e4 Linus Torvalds      2005-04-16  907  		return -EADDRNOTAVAIL;
d0490cfdf Dan Carpenter       2009-11-11  908  	}
42f811b8b Herbert Xu          2007-06-04  909  	IPV4_DEVCONF(in_dev->cnf, MC_FORWARDING)++;
3b0228656 David Ahern         2017-03-28  910  	inet_netconf_notify_devconf(net, RTM_NEWNETCONF, NETCONFA_MC_FORWARDING,
3b0228656 David Ahern         2017-03-28  911  				    dev->ifindex, &in_dev->cnf);
^1da177e4 Linus Torvalds      2005-04-16  912  	ip_rt_multicast_event(in_dev);
^1da177e4 Linus Torvalds      2005-04-16  913  
a8cb16dd9 Eric Dumazet        2010-10-01  914  	/* Fill in the VIF structures */
6853f21f7 Yuval Mintz         2018-02-28  915  	vif_device_init(v, dev, vifc->vifc_rate_limit,
6853f21f7 Yuval Mintz         2018-02-28  916  			vifc->vifc_threshold,
6853f21f7 Yuval Mintz         2018-02-28  917  			vifc->vifc_flags | (!mrtsock ? VIFF_STATIC : 0),
6853f21f7 Yuval Mintz         2018-02-28  918  			(VIFF_TUNNEL | VIFF_REGISTER));
a8cb16dd9 Eric Dumazet        2010-10-01  919  
5d8b3e69f Yotam Gigi          2017-10-03 @920  	attr.orig_dev = dev;
f95ad5036 Florian Fainelli    2019-02-04  921  	ops = dev->netdev_ops;
f95ad5036 Florian Fainelli    2019-02-04  922  	if (ops->ndo_get_port_parent_id &&
ca3b84139 Florian Fainelli    2019-02-04  923  	    !ops->ndo_get_port_parent_id(dev, &ppid)) {
ca3b84139 Florian Fainelli    2019-02-04  924  		memcpy(v->dev_parent_id.id, ppid.id, ppid.id_len);
ca3b84139 Florian Fainelli    2019-02-04  925  		v->dev_parent_id.id_len = ppid.id_len;
5d8b3e69f Yotam Gigi          2017-10-03  926  	} else {
5d8b3e69f Yotam Gigi          2017-10-03  927  		v->dev_parent_id.id_len = 0;
5d8b3e69f Yotam Gigi          2017-10-03  928  	}
6853f21f7 Yuval Mintz         2018-02-28  929  
^1da177e4 Linus Torvalds      2005-04-16  930  	v->local = vifc->vifc_lcl_addr.s_addr;
^1da177e4 Linus Torvalds      2005-04-16  931  	v->remote = vifc->vifc_rmt_addr.s_addr;
^1da177e4 Linus Torvalds      2005-04-16  932  
^1da177e4 Linus Torvalds      2005-04-16  933  	/* And finish update writing critical data */
^1da177e4 Linus Torvalds      2005-04-16  934  	write_lock_bh(&mrt_lock);
^1da177e4 Linus Torvalds      2005-04-16  935  	v->dev = dev;
^1da177e4 Linus Torvalds      2005-04-16  936  	if (v->flags & VIFF_REGISTER)
0c12295a7 Patrick McHardy     2010-04-13  937  		mrt->mroute_reg_vif_num = vifi;
0c12295a7 Patrick McHardy     2010-04-13  938  	if (vifi+1 > mrt->maxvif)
0c12295a7 Patrick McHardy     2010-04-13  939  		mrt->maxvif = vifi+1;
^1da177e4 Linus Torvalds      2005-04-16  940  	write_unlock_bh(&mrt_lock);
b362053a7 Yotam Gigi          2017-09-27  941  	call_ipmr_vif_entry_notifiers(net, FIB_EVENT_VIF_ADD, v, vifi, mrt->id);
^1da177e4 Linus Torvalds      2005-04-16  942  	return 0;
^1da177e4 Linus Torvalds      2005-04-16  943  }
^1da177e4 Linus Torvalds      2005-04-16  944  

:::::: The code at line 920 was first introduced by commit
:::::: 5d8b3e69fc5e5ccafc9db1251bb7c78a8622fddd ipv4: ipmr: Add the parent ID field to VIF struct

:::::: TO: Yotam Gigi <yotamg at mellanox.com>
:::::: CC: David S. Miller <davem at davemloft.net>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 49796 bytes
Desc: not available
URL: <http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/attachments/20190205/b9eb5872/attachment-0001.bin>


More information about the devel mailing list