[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <797c3c53-ce1b-9f60-e253-cda615788f4a@iogearbox.net>
Date: Tue, 24 May 2022 17:32:57 +0200
From: Daniel Borkmann <daniel@...earbox.net>
To: Paolo Abeni <pabeni@...hat.com>, Yuwei Wang <wangyuweihx@...il.com>
Cc: davem@...emloft.net, Jakub Kicinski <kuba@...nel.org>,
Eric Dumazet <edumazet@...gle.com>, roopa@...dia.com,
dsahern@...nel.org, 秦迪 <qindi@...ff.weibo.com>,
netdev@...r.kernel.org
Subject: Re: [PATCH net-next v2] net, neigh: introduce interval_probe_time for
periodic probe
On 5/24/22 12:41 PM, Paolo Abeni wrote:
> On Tue, 2022-05-24 at 17:38 +0800, Yuwei Wang wrote:
>> On Tue, 24 May 2022 at 16:38, Paolo Abeni <pabeni@...hat.com> wrote:
>>>
>>> On Sun, 2022-05-22 at 03:17 +0000, Yuwei Wang wrote:
>>>
>>>> diff --git a/include/net/netevent.h b/include/net/netevent.h
>>>> index 4107016c3bb4..121df77d653e 100644
>>>> --- a/include/net/netevent.h
>>>> +++ b/include/net/netevent.h
>>>> @@ -26,6 +26,7 @@ enum netevent_notif_type {
>>>> NETEVENT_NEIGH_UPDATE = 1, /* arg is struct neighbour ptr */
>>>> NETEVENT_REDIRECT, /* arg is struct netevent_redirect ptr */
>>>> NETEVENT_DELAY_PROBE_TIME_UPDATE, /* arg is struct neigh_parms ptr */
>>>> + NETEVENT_INTERVAL_PROBE_TIME_UPDATE, /* arg is struct neigh_parms ptr */
>>>
>>> Are you sure we need to notify the drivers about this parameter change?
>>> The host will periodically resolve the neighbours, and that should work
>>> regardless of the NIC offload. I think we don't need additional
>>> notifications.
>>>
>>
>> `mlxsw_sp_router_netevent_event` in
>> drivers/net/ethernet/mellanox/mlx5/core/en/rep/neigh.c and
>> `mlx5e_rep_netevent_event` in
>> drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c still
>> use `NETEVENT_DELAY_PROBE_TIME_UPDATE` to receive the update event of
>> `DELAY_PROBE_TIME` as the probe interval.
>>
>> I think we are supposed to replace `NETEVENT_DELAY_PROBE_TIME_UPDATE` with
>> `NETEVENT_INTERVAL_PROBE_TIME_UPDATE` after this patch is merged.
>
> AFAICS the event notification is to let neigh_timer_handler() cope
> properly with NIC offloading the data plane.
>
> In such scenario packets (forwarded by the NIC) don't reach the host,
> and neigh->confirmed can be untouched for a long time fooling
> neigh_timer_handler() into a timeout.
>
> The event notification allows the NIC to perform the correct actions to
> avoid such timeout.
>
> In case of MANAGED neighbour, the host is periodically sending probe
> request, and both req/replies should not be offloaded. AFAICS no action
> is expected from the NIC to cope with INTERVAL_PROBE_TIME changes.
Right, maybe we could just split this into two: 1) prevent misconfig (see
below), and 2) make the timeout configurable as what Yuwei has. Wdyt?
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 47b6c1f0fdbb..54625287ee5b 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -1579,7 +1579,7 @@ static void neigh_managed_work(struct work_struct *work)
list_for_each_entry(neigh, &tbl->managed_list, managed_list)
neigh_event_send_probe(neigh, NULL, false);
queue_delayed_work(system_power_efficient_wq, &tbl->managed_work,
- NEIGH_VAR(&tbl->parms, DELAY_PROBE_TIME));
+ max(NEIGH_VAR(&tbl->parms, DELAY_PROBE_TIME), HZ));
write_unlock_bh(&tbl->lock);
}
Thanks,
Daniel
Powered by blists - more mailing lists