[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAD4GDZwOzLQd+FYd0AHr5AUcANWkf731Jgu6aeyix8EjRGXRag@mail.gmail.com>
Date: Thu, 7 Nov 2024 17:16:28 +0000
From: Donald Hunter <donald.hunter@...il.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: Xiao Liang <shaw.leon@...il.com>, netdev@...r.kernel.org,
linux-kselftest@...r.kernel.org, Kuniyuki Iwashima <kuniyu@...zon.com>,
"David S. Miller" <davem@...emloft.net>, David Ahern <dsahern@...nel.org>,
Eric Dumazet <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>,
Ido Schimmel <idosch@...dia.com>, Andrew Lunn <andrew+netdev@...n.ch>,
Simon Horman <horms@...nel.org>, Shuah Khan <shuah@...nel.org>, Jiri Pirko <jiri@...nulli.us>,
Hangbin Liu <liuhangbin@...il.com>
Subject: Re: [PATCH net-next v2 7/8] tools/net/ynl: Add retry limit for async notification
On Thu, 7 Nov 2024 at 16:04, Jakub Kicinski <kuba@...nel.org> wrote:
>
> On Thu, 7 Nov 2024 21:30:02 +0800 Xiao Liang wrote:
> > Since commit 1bf70e6c3a53 ("tools/net/ynl: improve async notification
> > handling"), check_ntf() would block indefinitely if there's no messages.
> > In some cases we want to set a limit on waiting time. This patch adds
> > max_reties parameter check_ntf(), and makes it stop when no message is
> > recievied in that number of consecutive retries.
>
> Looking at 1bf70e6c3a53 again I wonder if we should revert it, sort of,
> and add its logic back as a new function called poll_nft?
>
> The thing is C YNL has check_ntf too - ynl_ntf_check() and it has the
> old semantics. Would be nice for similarly named functions to behave
> the same across languages.
>
> WDYT Donald? Sorry for not thinking about this earlier.
Yes, that makes sense. I didn't realise the C lib had an equivalent.
Adding a poll_ntf() that calls check_ntf() internally will actually be
a bit cleaner overall.
It's then a question of whether we need the repeat logic in poll_ntf()
because it's always possible to use check_ntf() in your own repeat
logic. Either way, I'd prefer not to call the parameter "max_retries"
because semantically I don't think we are retrying - it is a count of
how many times to repeat the poll. Thoughts? Should it be a "duration"
parameter?
> Xiao, feel free to submit this separately from the series.
Powered by blists - more mailing lists