lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160922124906.GC1830@nanopsycho.orion>
Date:   Thu, 22 Sep 2016 14:49:06 +0200
From:   Jiri Pirko <jiri@...nulli.us>
To:     Ido Schimmel <idosch@...sch.org>
Cc:     netdev@...r.kernel.org, davem@...emloft.net, idosch@...lanox.com,
        eladr@...lanox.com, yotamg@...lanox.com, nogahf@...lanox.com,
        ogerlitz@...lanox.com, roopa@...ulusnetworks.com,
        nikolay@...ulusnetworks.com, linville@...driver.com,
        andy@...yhouse.net, f.fainelli@...il.com, dsa@...ulusnetworks.com,
        jhs@...atatu.com, vivien.didelot@...oirfairelinux.com,
        andrew@...n.ch, ivecera@...hat.com, kaber@...sh.net,
        john@...ozen.org
Subject: Re: [patch net-next 5/6] switchdev: remove FIB offload infrastructure

Thu, Sep 22, 2016 at 09:25:19AM CEST, idosch@...sch.org wrote:
>On Wed, Sep 21, 2016 at 01:53:13PM +0200, Jiri Pirko wrote:
>> From: Jiri Pirko <jiri@...lanox.com>
>> 
>> Since this is now taken care of by FIB notifier, remove the code, with
>> all unused dependencies.
>> 
>> Signed-off-by: Jiri Pirko <jiri@...lanox.com>
>
>[...]
>
>> -static struct net_device *switchdev_get_dev_by_nhs(struct fib_info *fi)
>> -{
>> -	struct switchdev_attr attr = {
>> -		.id = SWITCHDEV_ATTR_ID_PORT_PARENT_ID,
>> -	};
>> -	struct switchdev_attr prev_attr;
>> -	struct net_device *dev = NULL;
>> -	int nhsel;
>> -
>> -	ASSERT_RTNL();
>> -
>> -	/* For this route, all nexthop devs must be on the same switch. */
>> -
>> -	for (nhsel = 0; nhsel < fi->fib_nhs; nhsel++) {
>> -		const struct fib_nh *nh = &fi->fib_nh[nhsel];
>> -
>> -		if (!nh->nh_dev)
>> -			return NULL;
>> -
>> -		dev = switchdev_get_lowest_dev(nh->nh_dev);
>> -		if (!dev)
>> -			return NULL;
>> -
>> -		attr.orig_dev = dev;
>> -		if (switchdev_port_attr_get(dev, &attr))
>> -			return NULL;
>> -
>> -		if (nhsel > 0 &&
>> -		    !netdev_phys_item_id_same(&prev_attr.u.ppid, &attr.u.ppid))
>> -				return NULL;
>> -
>> -		prev_attr = attr;
>> -	}
>> -
>> -	return dev;
>> -}
>
>[...]
>
>> -int switchdev_fib_ipv4_add(u32 dst, int dst_len, struct fib_info *fi,
>> -			   u8 tos, u8 type, u32 nlflags, u32 tb_id)
>> -{
>> -	struct switchdev_obj_ipv4_fib ipv4_fib = {
>> -		.obj.id = SWITCHDEV_OBJ_ID_IPV4_FIB,
>> -		.dst = dst,
>> -		.dst_len = dst_len,
>> -		.fi = fi,
>> -		.tos = tos,
>> -		.type = type,
>> -		.nlflags = nlflags,
>> -		.tb_id = tb_id,
>> -	};
>> -	struct net_device *dev;
>> -	int err = 0;
>> -
>> -	/* Don't offload route if using custom ip rules or if
>> -	 * IPv4 FIB offloading has been disabled completely.
>> -	 */
>> -
>> -#ifdef CONFIG_IP_MULTIPLE_TABLES
>> -	if (fi->fib_net->ipv4.fib_has_custom_rules)
>> -		return 0;
>> -#endif
>> -
>> -	if (fi->fib_net->ipv4.fib_offload_disabled)
>> -		return 0;
>> -
>> -	dev = switchdev_get_dev_by_nhs(fi);
>
>Since this is now removed I believe we should perform this check inside
>the drivers. For mlxsw we can simply iterate over the nexthops and make
>sure each has a RIF.

rocker does not support multiple nexthops. For mlxsw, we can you what
you suggest. Will add it.


>
>> -	if (!dev)
>> -		return 0;
>> -
>> -	ipv4_fib.obj.orig_dev = dev;
>> -	err = switchdev_port_obj_add(dev, &ipv4_fib.obj);
>> -	if (!err)
>> -		fib_info_offload_inc(fi);
>> -
>> -	return err == -EOPNOTSUPP ? 0 : err;
>> -}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ