All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: Ido Schimmel <idosch@idosch.org>, netdev@vger.kernel.org
Cc: davem@davemloft.net, kuba@kernel.org, yoshfuji@linux-ipv6.org,
	jiri@nvidia.com, amcohen@nvidia.com, roopa@nvidia.com,
	bpoirier@nvidia.com, sharpd@nvidia.com, mlxsw@nvidia.com,
	Ido Schimmel <idosch@nvidia.com>
Subject: Re: [PATCH net-next v2 01/10] netdevsim: fib: Convert the current occupancy to an atomic variable
Date: Mon, 1 Feb 2021 18:49:17 -0700	[thread overview]
Message-ID: <3a86a371-b4d5-325a-1557-ea7a8c25ff23@gmail.com> (raw)
In-Reply-To: <20210201194757.3463461-2-idosch@idosch.org>

On 2/1/21 12:47 PM, Ido Schimmel wrote:
> From: Amit Cohen <amcohen@nvidia.com>
> 
> When route is added/deleted, the appropriate counter is increased/decreased
> to maintain number of routes.
> 
> User can limit the number of routes and then according to the appropriate
> counter, adding more routes than the limitation is forbidden.
> 
> Currently, there is one lock which protects hashtable, list and accounting.
> 
> Handling the counters will be performed from both atomic context and
> non-atomic context, while the hashtable and the list will be used only from
> non-atomic context and therefore will be protected by a separate lock.
> 
> Protect accounting by using an atomic variable, so lock is not needed.
> 
> v2:
> * Use atomic64_sub() in nsim_nexthop_account()'s error path
> 
> Signed-off-by: Amit Cohen <amcohen@nvidia.com>
> Signed-off-by: Ido Schimmel <idosch@nvidia.com>
> ---
>  drivers/net/netdevsim/fib.c | 55 ++++++++++++++++++-------------------
>  1 file changed, 27 insertions(+), 28 deletions(-)
> 

Reviewed-by: David Ahern <dsahern@kernel.org>



  reply	other threads:[~2021-02-02  1:50 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-01 19:47 [PATCH net-next v2 00/10] Add notifications when route hardware flags change Ido Schimmel
2021-02-01 19:47 ` [PATCH net-next v2 01/10] netdevsim: fib: Convert the current occupancy to an atomic variable Ido Schimmel
2021-02-02  1:49   ` David Ahern [this message]
2021-02-01 19:47 ` [PATCH net-next v2 02/10] netdevsim: fib: Perform the route programming in a non-atomic context Ido Schimmel
2021-02-01 19:47 ` [PATCH net-next v2 03/10] net: ipv4: Pass fib_rt_info as const to fib_dump_info() Ido Schimmel
2021-02-01 19:47 ` [PATCH net-next v2 04/10] net: ipv4: Publish fib_nlmsg_size() Ido Schimmel
2021-02-01 19:47 ` [PATCH net-next v2 05/10] net: ipv4: Emit notification when fib hardware flags are changed Ido Schimmel
2021-02-01 19:47 ` [PATCH net-next v2 06/10] net: Pass 'net' struct as first argument to fib6_info_hw_flags_set() Ido Schimmel
2021-02-01 19:47 ` [PATCH net-next v2 07/10] net: Do not call fib6_info_hw_flags_set() when IPv6 is disabled Ido Schimmel
2021-02-01 19:47 ` [PATCH net-next v2 08/10] net: ipv6: Emit notification when fib hardware flags are changed Ido Schimmel
2021-02-01 19:47 ` [PATCH net-next v2 09/10] selftests: Extend fib tests to run with and without flags notifications Ido Schimmel
2021-02-01 19:47 ` [PATCH net-next v2 10/10] selftests: netdevsim: Add fib_notifications test Ido Schimmel
2021-02-03  2:00 ` [PATCH net-next v2 00/10] Add notifications when route hardware flags change patchwork-bot+netdevbpf

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=3a86a371-b4d5-325a-1557-ea7a8c25ff23@gmail.com \
    --to=dsahern@gmail.com \
    --cc=amcohen@nvidia.com \
    --cc=bpoirier@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=idosch@idosch.org \
    --cc=idosch@nvidia.com \
    --cc=jiri@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=mlxsw@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=roopa@nvidia.com \
    --cc=sharpd@nvidia.com \
    --cc=yoshfuji@linux-ipv6.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.