netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@idosch.org>
To: Jiri Pirko <jiri@resnulli.us>
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 3/6] mlxsw: spectrum_router: Use FIB notifications instead of switchdev calls
Date: Thu, 22 Sep 2016 09:51:02 +0300	[thread overview]
Message-ID: <20160922065102.GA13287@splinter> (raw)
In-Reply-To: <1474458794-5512-4-git-send-email-jiri@resnulli.us>

On Wed, Sep 21, 2016 at 01:53:11PM +0200, Jiri Pirko wrote:
> From: Jiri Pirko <jiri@mellanox.com>
> 
> Until now, in order to offload a FIB entry to HW we use switchdev op.
> However that has limits. Mainly in case we need to make the HW aware of
> all route prefixes configured in kernel. HW needs to know those in order
> to properly trap appropriate packets and pass the to kernel to do
> the forwarding. Abort mechanism is now handled within the mlxsw driver.

FWIW, I think it's smart to move abort into the driver instead of
flushing all the routes from the namespace as before.

> 
> Signed-off-by: Jiri Pirko <jiri@mellanox.com>

[...]

> +static void mlxsw_sp_router_fib4_abort(struct mlxsw_sp *mlxsw_sp)
> +{
> +	char ralue_pl[MLXSW_REG_RALUE_LEN];
> +	struct mlxsw_resources *resources;
> +	struct mlxsw_sp_fib_entry *fib_entry;
> +	struct mlxsw_sp_fib_entry *tmp;
> +	struct mlxsw_sp_vr *vr;
> +	int i;
> +	int err;
> +
> +	resources = mlxsw_core_resources_get(mlxsw_sp->core);
> +	for (i = 0; i < resources->max_virtual_routers; i++) {
> +		vr = &mlxsw_sp->router.vrs[i];
> +		if (!vr->used)
> +			continue;
> +
> +		list_for_each_entry_safe(fib_entry, tmp,
> +					 &vr->fib->entry_list, list) {
> +			fib_info_offload_dec(fib_entry->fi);
> +			mlxsw_sp_fib_entry_del(mlxsw_sp, fib_entry);
> +			mlxsw_sp_fib_entry_remove(fib_entry->vr->fib,
> +						  fib_entry);
> +			mlxsw_sp_fib_entry_put_all(mlxsw_sp, fib_entry);

If we now do the routing in slow path, then maybe it makes sense to also
flush all the neighbour entries and prevent new neighbours from being
programmed into the device?

> +		}
> +	}
> +	mlxsw_sp->router.aborted = true;
> +
> +	mlxsw_reg_ralue_pack4(ralue_pl, MLXSW_SP_L3_PROTO_IPV4,
> +			      MLXSW_REG_RALUE_OP_WRITE_WRITE, 0, 0, 0);

I'm not sure about that, but the loop above removed all the tables from
the device and now you are using table 0 again. Will this work w/o
binding some tree to it (0?)?

> +	mlxsw_reg_ralue_act_ip2me_pack(ralue_pl);
> +	err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ralue), ralue_pl);
> +	if (err)
> +		dev_warn(mlxsw_sp->bus_info->dev, "Failed to set abort trap.\n");
> +}

Thanks

  reply	other threads:[~2016-09-22  6:51 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 [this message]
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
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=20160922065102.GA13287@splinter \
    --to=idosch@idosch.org \
    --cc=andrew@lunn.ch \
    --cc=andy@greyhouse.net \
    --cc=davem@davemloft.net \
    --cc=dsa@cumulusnetworks.com \
    --cc=eladr@mellanox.com \
    --cc=f.fainelli@gmail.com \
    --cc=idosch@mellanox.com \
    --cc=ivecera@redhat.com \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=john@phrozen.org \
    --cc=kaber@trash.net \
    --cc=linville@tuxdriver.com \
    --cc=netdev@vger.kernel.org \
    --cc=nikolay@cumulusnetworks.com \
    --cc=nogahf@mellanox.com \
    --cc=ogerlitz@mellanox.com \
    --cc=roopa@cumulusnetworks.com \
    --cc=vivien.didelot@savoirfairelinux.com \
    --cc=yotamg@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).