]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
nexthop: Emit a notification when a nexthop is added
authorIdo Schimmel <idosch@nvidia.com>
Wed, 4 Nov 2020 13:30:29 +0000 (15:30 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 Oct 2025 11:35:46 +0000 (13:35 +0200)
commitafd05e5028fee25922daef00bdd178e5aabb23ce
tree0ea8814969807ca99acbe2ec85736f3f388e1108
parentbdcad48c96ddbb7f3e7842ae7ca3e23715888346
nexthop: Emit a notification when a nexthop is added

[ Upstream commit 732d167bf5f53a8c1e8c53cf7dbffe2a13f63752 ]

Emit a notification in the nexthop notification chain when a new nexthop
is added (not replaced). The nexthop can either be a new group or a
single nexthop.

The notification is sent after the nexthop is inserted into the
red-black tree, as listeners might need to callback into the nexthop
code with the nexthop ID in order to mark the nexthop as offloaded.

A 'REPLACE' notification is emitted instead of 'ADD' as the distinction
between the two is not important for in-kernel listeners. In case the
listener is not familiar with the encoded nexthop ID, it can simply
treat it as a new one. This is also consistent with the route offload
API.

Changes since RFC:
* Reword commit message

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Stable-dep-of: 390b3a300d78 ("nexthop: Forbid FDB status change while nexthop is in a group")
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/net/nexthop.h
net/ipv4/nexthop.c