| Message ID | 20260311060533.52598-4-amorenoz@redhat.com |
|---|---|
| State | New |
| Headers | show |
| Series | netdev-linux: Use event-driven netlink notifications. | expand |
| Context | Check | Description |
|---|---|---|
| ovsrobot/apply-robot | success | apply and check: success |
| ovsrobot/github-robot-_Build_and_Test | success | github build: passed |
On Wed, Mar 11, 2026 at 2:06 AM Adrian Moreno via dev < ovs-dev@openvswitch.org> wrote: > If the netlink socket overflows, we report an empty change to let all > notifiers know some events are lost and therefore they can no longer > trust their known state. This acts as a kind of reset. > > Draining the socket makes sense here so that partial events are not > sent afterwards. > > Signed-off-by: Adrian Moreno <amorenoz@redhat.com> > --- > This looks reasonable to me! Acked-by: Mike Pattrick <mkp@redhat.com>
diff --git a/lib/netlink-notifier.c b/lib/netlink-notifier.c index 7ea5a4181..ea4742a90 100644 --- a/lib/netlink-notifier.c +++ b/lib/netlink-notifier.c @@ -200,6 +200,7 @@ nln_run(struct nln *nln) return; } else { if (error == ENOBUFS) { + nl_sock_drain(nln->notify_sock); /* The socket buffer might be full, there could be too many * notifications, so it makes sense to call nln_report() */ nln_report(nln, NULL, 0);
If the netlink socket overflows, we report an empty change to let all notifiers know some events are lost and therefore they can no longer trust their known state. This acts as a kind of reset. Draining the socket makes sense here so that partial events are not sent afterwards. Signed-off-by: Adrian Moreno <amorenoz@redhat.com> --- lib/netlink-notifier.c | 1 + 1 file changed, 1 insertion(+)