public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli•us>
To: Ido Schimmel <idosch@idosch•org>
Cc: netdev@vger•kernel.org, davem@davemloft•net, idosch@mellanox•com,
	eladr@mellanox•com, yotamg@mellanox•com, nogahf@mellanox•com,
	ogerlitz@mellanox•com, roopa@cumulusnetworks•com,
	nikolay@cumulusnetworks•com, linville@tuxdriver•com,
	andy@greyhouse•net, f.fainelli@gmail•com,
	dsa@cumulusnetworks•com, jhs@mojatatu•com,
	vivien.didelot@savoirfairelinux•com, andrew@lunn•ch,
	ivecera@redhat•com, kaber@trash•net, john@phrozen•org
Subject: Re: [patch net-next 5/6] switchdev: remove FIB offload infrastructure
Date: Thu, 22 Sep 2016 14:49:06 +0200	[thread overview]
Message-ID: <20160922124906.GC1830@nanopsycho.orion> (raw)
In-Reply-To: <20160922072519.GB13287@splinter>

Thu, Sep 22, 2016 at 09:25:19AM CEST, idosch@idosch•org wrote:
>On Wed, Sep 21, 2016 at 01:53:13PM +0200, Jiri Pirko wrote:
>> From: Jiri Pirko <jiri@mellanox•com>
>> 
>> Since this is now taken care of by FIB notifier, remove the code, with
>> all unused dependencies.
>> 
>> Signed-off-by: Jiri Pirko <jiri@mellanox•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;
>> -}

  reply	other threads:[~2016-09-22 12:49 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-21 11:53 [patch net-next 0/6] fib offload: switch to notifier Jiri Pirko
2016-09-21 11:53 ` [patch net-next 1/6] fib: introduce FIB notification infrastructure Jiri Pirko
2016-09-22  5:13   ` Ido Schimmel
2016-09-22  9:43     ` Jiri Pirko
2016-09-21 11:53 ` [patch net-next 2/6] fib: introduce FIB info offload flag helpers Jiri Pirko
2016-09-22  5:14   ` Ido Schimmel
2016-09-21 11:53 ` [patch net-next 3/6] mlxsw: spectrum_router: Use FIB notifications instead of switchdev calls Jiri Pirko
2016-09-22  6:51   ` Ido Schimmel
2016-09-22  9:47     ` Jiri Pirko
2016-09-22 14:58   ` David Ahern
2016-09-22 15:05     ` Jiri Pirko
2016-09-22 15:12       ` David Ahern
2016-09-21 11:53 ` [patch net-next 4/6] rocker: use " Jiri Pirko
2016-09-21 11:53 ` [patch net-next 5/6] switchdev: remove FIB offload infrastructure Jiri Pirko
2016-09-22  7:25   ` Ido Schimmel
2016-09-22 12:49     ` Jiri Pirko [this message]
2016-09-21 11:53 ` [patch net-next 6/6] doc: update switchdev L3 section Jiri Pirko
2016-09-22  7:31   ` Ido Schimmel

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=20160922124906.GC1830@nanopsycho.orion \
    --to=jiri@resnulli$(echo .)us \
    --cc=andrew@lunn$(echo .)ch \
    --cc=andy@greyhouse$(echo .)net \
    --cc=davem@davemloft$(echo .)net \
    --cc=dsa@cumulusnetworks$(echo .)com \
    --cc=eladr@mellanox$(echo .)com \
    --cc=f.fainelli@gmail$(echo .)com \
    --cc=idosch@idosch$(echo .)org \
    --cc=idosch@mellanox$(echo .)com \
    --cc=ivecera@redhat$(echo .)com \
    --cc=jhs@mojatatu$(echo .)com \
    --cc=john@phrozen$(echo .)org \
    --cc=kaber@trash$(echo .)net \
    --cc=linville@tuxdriver$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=nikolay@cumulusnetworks$(echo .)com \
    --cc=nogahf@mellanox$(echo .)com \
    --cc=ogerlitz@mellanox$(echo .)com \
    --cc=roopa@cumulusnetworks$(echo .)com \
    --cc=vivien.didelot@savoirfairelinux$(echo .)com \
    --cc=yotamg@mellanox$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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