From: David Ahern <dsahern@gmail.com>
To: Ido Schimmel <idosch@idosch.org>, netdev@vger.kernel.org
Cc: davem@davemloft.net, kuba@kernel.org, amcohen@nvidia.com,
roopa@nvidia.com, sharpd@nvidia.com, bpoirier@nvidia.com,
mlxsw@nvidia.com, Ido Schimmel <idosch@nvidia.com>
Subject: Re: [PATCH net-next 02/10] netdevsim: fib: Perform the route programming in a non-atomic context
Date: Tue, 26 Jan 2021 21:36:12 -0700 [thread overview]
Message-ID: <505125ef-522b-4beb-270f-25b6614f88ed@gmail.com> (raw)
In-Reply-To: <20210126132311.3061388-3-idosch@idosch.org>
On 1/26/21 6:23 AM, Ido Schimmel wrote:
> From: Amit Cohen <amcohen@nvidia.com>
>
> Currently, netdevsim implements dummy FIB offload and marks notified
> routes with RTM_F_TRAP flag. netdevsim does not defer route notifications
> to a work queue because it does not need to program any hardware.
>
> Given that netdevsim's purpose is to both give an example implementation
> and allow developers to test their code, align netdevsim to a "real"
> hardware device driver like mlxsw and have it also perform the route
> "programming" in a non-atomic context.
>
> It will be used to test route flags notifications which will be added in
> the next patches.
>
> The following changes are needed when route handling is performed in WQ:
> - Handle the accounting in the main context, to be able to return an
> error for adding route when all the routes are used.
> For FIB_EVENT_ENTRY_REPLACE increase the counter before scheduling
> the delayed work, and in case that this event replaces an existing route,
> decrease the counter as part of the delayed work.
>
> - For IPv6, cannot use fen6_info->rt->fib6_siblings list because it
> might be changed during handling the delayed work.
> Save an array with the nexthops as part of fib6_event struct, and take
> a reference for each nexthop to prevent them from being freed while
> event is queued.
>
> - Change GFP_ATOMIC allocations to GFP_KERNEL.
>
> - Use single work item that is handling a list of ordered routes.
> Handling routes must be processed in the order they were submitted to
> avoid logical errors that could lead to unexpected failures.
>
> Signed-off-by: Amit Cohen <amcohen@nvidia.com>
> Signed-off-by: Ido Schimmel <idosch@nvidia.com>
> ---
> drivers/net/netdevsim/fib.c | 467 +++++++++++++++++++++++++-----------
> 1 file changed, 327 insertions(+), 140 deletions(-)
>
Acked-by: David Ahern <dsahern@kernel.org>
next prev parent reply other threads:[~2021-01-27 5:20 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-26 13:23 [PATCH net-next 00/10] Add notifications when route hardware flags change Ido Schimmel
2021-01-26 13:23 ` [PATCH net-next 01/10] netdevsim: fib: Convert the current occupancy to an atomic variable Ido Schimmel
2021-01-27 4:33 ` David Ahern
2021-01-27 10:51 ` Amit Cohen
2021-01-28 3:42 ` David Ahern
2021-01-26 13:23 ` [PATCH net-next 02/10] netdevsim: fib: Perform the route programming in a non-atomic context Ido Schimmel
2021-01-27 4:36 ` David Ahern [this message]
2021-01-26 13:23 ` [PATCH net-next 03/10] net: ipv4: Pass fib_rt_info as const to fib_dump_info() Ido Schimmel
2021-01-27 4:38 ` David Ahern
2021-01-26 13:23 ` [PATCH net-next 04/10] net: ipv4: Publish fib_nlmsg_size() Ido Schimmel
2021-01-27 4:41 ` David Ahern
2021-01-26 13:23 ` [PATCH net-next 05/10] net: ipv4: Emit notification when fib hardware flags are changed Ido Schimmel
2021-01-27 5:02 ` David Ahern
2021-01-27 11:46 ` Amit Cohen
2021-01-28 3:34 ` David Ahern
2021-01-29 3:04 ` Jakub Kicinski
2021-01-29 3:33 ` David Ahern
2021-01-29 4:15 ` Jakub Kicinski
2021-01-30 15:36 ` Ido Schimmel
2021-01-30 15:11 ` Ido Schimmel
2021-01-26 13:23 ` [PATCH net-next 06/10] net: Pass 'net' struct as first argument to fib6_info_hw_flags_set() Ido Schimmel
2021-01-27 5:08 ` David Ahern
2021-01-26 13:23 ` [PATCH net-next 07/10] net: Do not call fib6_info_hw_flags_set() when IPv6 is disabled Ido Schimmel
2021-01-26 13:23 ` [PATCH net-next 08/10] net: ipv6: Emit notification when fib hardware flags are changed Ido Schimmel
2021-01-27 5:14 ` David Ahern
2021-01-28 3:36 ` David Ahern
2021-01-26 13:23 ` [PATCH net-next 09/10] selftests: Extend fib tests to run with and without flags notifications Ido Schimmel
2021-01-26 13:23 ` [PATCH net-next 10/10] selftests: netdevsim: Add fib_notifications test Ido Schimmel
2021-01-28 3:41 ` David Ahern
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=505125ef-522b-4beb-270f-25b6614f88ed@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=kuba@kernel.org \
--cc=mlxsw@nvidia.com \
--cc=netdev@vger.kernel.org \
--cc=roopa@nvidia.com \
--cc=sharpd@nvidia.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).