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]
Date:   Wed, 19 Jul 2017 10:14:54 -0600
From:   David Ahern <dsahern@...il.com>
To:     Jiri Pirko <jiri@...nulli.us>, netdev@...r.kernel.org
Cc:     davem@...emloft.net, idosch@...lanox.com, mlxsw@...lanox.com,
        roopa@...ulusnetworks.com, nikolay@...ulusnetworks.com,
        kafai@...com, hannes@...essinduktion.org, yoshfuji@...ux-ipv6.org,
        edumazet@...gle.com, yanhaishuang@...s.chinamobile.com
Subject: Re: [patch net-next 14/17] mlxsw: spectrum_router: Add support for
 IPv6 routes addition / deletion

On 7/19/17 1:02 AM, Jiri Pirko wrote:
> @@ -2094,6 +2106,40 @@ mlxsw_sp_fib_entry_should_offload(const struct mlxsw_sp_fib_entry *fib_entry)
>  	}
>  }
>  
> +static void
> +mlxsw_sp_fib6_entry_offload_set(struct mlxsw_sp_fib_entry *fib_entry)
> +{
> +	struct mlxsw_sp_fib6_entry *fib6_entry;
> +	struct mlxsw_sp_rt6 *mlxsw_sp_rt6;
> +
> +	fib6_entry = container_of(fib_entry, struct mlxsw_sp_fib6_entry,
> +				  common);
> +	list_for_each_entry(mlxsw_sp_rt6, &fib6_entry->rt6_list, list) {
> +		struct rt6_info *rt = mlxsw_sp_rt6->rt;
> +
> +		write_lock_bh(&rt->rt6i_table->tb6_lock);
> +		rt->rt6i_flags |= RTF_OFFLOAD;
> +		write_unlock_bh(&rt->rt6i_table->tb6_lock);

Seems wrong. A device driver should not be taking FIB table locks.


> +	}
> +}
> +
> +static void
> +mlxsw_sp_fib6_entry_offload_unset(struct mlxsw_sp_fib_entry *fib_entry)
> +{
> +	struct mlxsw_sp_fib6_entry *fib6_entry;
> +	struct mlxsw_sp_rt6 *mlxsw_sp_rt6;
> +
> +	fib6_entry = container_of(fib_entry, struct mlxsw_sp_fib6_entry,
> +				  common);
> +	list_for_each_entry(mlxsw_sp_rt6, &fib6_entry->rt6_list, list) {
> +		struct rt6_info *rt = mlxsw_sp_rt6->rt;
> +
> +		write_lock_bh(&rt->rt6i_table->tb6_lock);
> +		rt->rt6i_flags &= ~RTF_OFFLOAD;
> +		write_unlock_bh(&rt->rt6i_table->tb6_lock);

same here.




> +static int mlxsw_sp_nexthop6_init(struct mlxsw_sp *mlxsw_sp,
> +				  struct mlxsw_sp_nexthop_group *nh_grp,
> +				  struct mlxsw_sp_nexthop *nh,
> +				  const struct rt6_info *rt)
> +{
> +	struct net_device *dev = rt->dst.dev;
> +	struct mlxsw_sp_rif *rif;
> +	int err;
> +
> +	nh->nh_grp = nh_grp;
> +	memcpy(&nh->gw_addr, &rt->rt6i_gateway, sizeof(nh->gw_addr));
> +
> +	if (!dev)
> +		return 0;
> +
> +	rif = mlxsw_sp_rif_find_by_dev(mlxsw_sp, dev);
> +	if (!rif)
> +		return 0;

rif == 0 means the dst device is not related to a port owned by this
driver?


A lot to process so I am sure I missed the answer to these:

1. How do you handle host routes for local addresses? IPv6 inserts the
host and anycast routes with the device set to 'lo' (or VRF device)
instead of the device with the address. I have a patch to change this,
but needs more testing

2. How are routes with devices unrelated to ports owned by this driver
handled?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ