Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

neigh: Send a notification when DELAY_PROBE_TIME changes

When the data plane is offloaded the traffic doesn't go through the
networking stack. Therefore, after first resolving a neighbour the NUD
state machine will transition it from REACHABLE to STALE until it's
finally deleted by the garbage collector.

To prevent such situations the offloading driver should notify the NUD
state machine on any neighbours that were recently used. The driver's
polling interval should be set so that the NUD state machine can
function as if the traffic wasn't offloaded.

Currently, there are no in-tree drivers that can report confirmation for
a neighbour, but only 'used' indication. Therefore, the polling interval
should be set according to DELAY_FIRST_PROBE_TIME, as a neighbour will
transition from REACHABLE state to DELAY (instead of STALE) if "a packet
was sent within the last DELAY_FIRST_PROBE_TIME seconds" (RFC 4861).

Send a netevent whenever the DELAY_FIRST_PROBE_TIME changes - either via
netlink or sysctl - so that offloading drivers can correctly set their
polling interval.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Ido Schimmel and committed by
David S. Miller
2a4501ae 7cf2c205

+3
+1
include/net/netevent.h
··· 24 24 enum netevent_notif_type { 25 25 NETEVENT_NEIGH_UPDATE = 1, /* arg is struct neighbour ptr */ 26 26 NETEVENT_REDIRECT, /* arg is struct netevent_redirect ptr */ 27 + NETEVENT_DELAY_PROBE_TIME_UPDATE, /* arg is struct neigh_parms ptr */ 27 28 }; 28 29 29 30 int register_netevent_notifier(struct notifier_block *nb);
+2
net/core/neighbour.c
··· 2047 2047 case NDTPA_DELAY_PROBE_TIME: 2048 2048 NEIGH_VAR_SET(p, DELAY_PROBE_TIME, 2049 2049 nla_get_msecs(tbp[i])); 2050 + call_netevent_notifiers(NETEVENT_DELAY_PROBE_TIME_UPDATE, p); 2050 2051 break; 2051 2052 case NDTPA_RETRANS_TIME: 2052 2053 NEIGH_VAR_SET(p, RETRANS_TIME, ··· 2931 2930 return; 2932 2931 2933 2932 set_bit(index, p->data_state); 2933 + call_netevent_notifiers(NETEVENT_DELAY_PROBE_TIME_UPDATE, p); 2934 2934 if (!dev) /* NULL dev means this is default value */ 2935 2935 neigh_copy_dflt_parms(net, p, index); 2936 2936 }