[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7a2082c1-b6a5-cba2-00aa-329a813b8343@gmail.com>
Date: Tue, 14 Jan 2020 08:43:06 -0700
From: David Ahern <dsahern@...il.com>
To: Ido Schimmel <idosch@...sch.org>, netdev@...r.kernel.org
Cc: davem@...emloft.net, kuba@...nel.org, jiri@...lanox.com,
roopa@...ulusnetworks.com, mlxsw@...lanox.com,
Ido Schimmel <idosch@...lanox.com>
Subject: Re: [PATCH net-next v2 03/10] ipv4: Add "offload" and "trap"
indications to routes
On 1/14/20 4:23 AM, Ido Schimmel wrote:
> From: Ido Schimmel <idosch@...lanox.com>
>
> When performing L3 offload, routes and nexthops are usually programmed
> into two different tables in the underlying device. Therefore, the fact
> that a nexthop resides in hardware does not necessarily mean that all
> the associated routes also reside in hardware and vice-versa.
>
> While the kernel can signal to user space the presence of a nexthop in
> hardware (via 'RTNH_F_OFFLOAD'), it does not have a corresponding flag
> for routes. In addition, the fact that a route resides in hardware does
> not necessarily mean that the traffic is offloaded. For example,
> unreachable routes (i.e., 'RTN_UNREACHABLE') are programmed to trap
> packets to the CPU so that the kernel will be able to generate the
> appropriate ICMP error packet.
>
> This patch adds an "offload" and "trap" indications to IPv4 routes, so
> that users will have better visibility into the offload process.
>
> 'struct fib_alias' is extended with two new fields that indicate if the
> route resides in hardware or not and if it is offloading traffic from
> the kernel or trapping packets to it. Note that the new fields are added
> in the 6 bytes hole and therefore the struct still fits in a single
> cache line [1].
>
> Capable drivers are expected to invoke fib_alias_hw_flags_set() with the
> route's key in order to set the flags.
>
> The indications are dumped to user space via a new flags (i.e.,
> 'RTM_F_OFFLOAD' and 'RTM_F_TRAP') in the 'rtm_flags' field in the
> ancillary header.
>
...
> Signed-off-by: Ido Schimmel <idosch@...lanox.com>
> ---
> include/net/ip_fib.h | 4 +++
> include/uapi/linux/rtnetlink.h | 2 ++
> net/ipv4/fib_lookup.h | 3 ++
> net/ipv4/fib_semantics.c | 7 +++++
> net/ipv4/fib_trie.c | 52 ++++++++++++++++++++++++++++++++++
> net/ipv4/route.c | 19 +++++++++++++
> 6 files changed, 87 insertions(+)
>
Reviewed-by: David Ahern <dsahern@...il.com>
Powered by blists - more mailing lists