netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: Ido Schimmel <idosch@mellanox.com>, netdev@vger.kernel.org
Cc: davem@davemloft.net, jiri@mellanox.com, mlxsw@mellanox.com
Subject: Re: [PATCH net-next v2 2/2] mlxsw: spectrum_router: Return an error for routes added after abort
Date: Wed, 2 May 2018 09:28:10 -0600	[thread overview]
Message-ID: <32c82844-73a8-77f8-f47c-eef167e53cd8@gmail.com> (raw)
In-Reply-To: <20180502071735.32352-3-idosch@mellanox.com>

On 5/2/18 1:17 AM, Ido Schimmel wrote:
> We currently do not perform accounting in the driver and thus can't
> reject routes before resources are exceeded.
> 
> However, in order to make users aware of the fact that routes are no
> longer offloaded we can return an error for routes configured after the
> abort mechanism was triggered.
> 
> Signed-off-by: Ido Schimmel <idosch@mellanox.com>
> ---
>  drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
> index added380e344..8028d221aece 100644
> --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
> +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
> @@ -5928,6 +5928,13 @@ static int mlxsw_sp_router_fib_event(struct notifier_block *nb,
>  						     router->mlxsw_sp);
>  		if (!err || info->extack)
>  			return notifier_from_errno(err);
> +		break;
> +	case FIB_EVENT_ENTRY_ADD:
> +		if (router->aborted) {
> +			NL_SET_ERR_MSG_MOD(info->extack, "FIB offload was aborted. Not configuring route");
> +			return notifier_from_errno(-EINVAL);
> +		}
> +		break;
>  	}
>  
>  	fib_work = kzalloc(sizeof(*fib_work), GFP_ATOMIC);
> 

Reasonable next step.

Acked-by: David Ahern <dsahern@gmail.com>

  reply	other threads:[~2018-05-02 15:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-02  7:17 [PATCH net-next v2 0/2] mlxsw: Reject unsupported FIB configurations Ido Schimmel
2018-05-02  7:17 ` [PATCH net-next v2 1/2] mlxsw: spectrum_router: Return an error for non-default FIB rules Ido Schimmel
2018-05-02 15:26   ` David Ahern
2018-05-02  7:17 ` [PATCH net-next v2 2/2] mlxsw: spectrum_router: Return an error for routes added after abort Ido Schimmel
2018-05-02 15:28   ` David Ahern [this message]
2018-05-02 17:17 ` [PATCH net-next v2 0/2] mlxsw: Reject unsupported FIB configurations David Miller

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=32c82844-73a8-77f8-f47c-eef167e53cd8@gmail.com \
    --to=dsahern@gmail.com \
    --cc=davem@davemloft.net \
    --cc=idosch@mellanox.com \
    --cc=jiri@mellanox.com \
    --cc=mlxsw@mellanox.com \
    --cc=netdev@vger.kernel.org \
    /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).