Page MenuHomeFreeBSD

if_vxlan(4): Stop invoking vxlan_stop event handler when the interface was not configured
ClosedPublic

Authored by zlei on Fri, Jan 17, 10:04 AM.
Tags
None
Referenced Files
F109102909: D48494.id149663.diff
Fri, Jan 31, 7:57 PM
Unknown Object (File)
Fri, Jan 31, 6:05 AM
Unknown Object (File)
Tue, Jan 28, 11:15 AM
Unknown Object (File)
Tue, Jan 28, 7:46 AM
Unknown Object (File)
Tue, Jan 28, 6:29 AM
Unknown Object (File)
Mon, Jan 27, 5:36 PM
Unknown Object (File)
Mon, Jan 27, 12:46 PM
Unknown Object (File)
Thu, Jan 23, 8:58 PM

Details

Summary

It is harmless but pointless to invoke vxlan_stop event handler when the interface was not previously configured. This change will also prevent an assert panic from t4_vxlan_stop_handler().

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

zlei requested review of this revision.Fri, Jan 17, 10:04 AM
zlei retitled this revision from if_vxlan(4): Invoke vxlan_stop event handlers only when the interface was configured to if_vxlan(4): Stop invoking vxlan_stop event handler when the interface was not configured.
zlei edited the summary of this revision. (Show Details)

Since eventhandlers are called outside the vxlan_sx protection, it is not even guaranteed that the stop event comes after the start, or that events are properly interleaved. In other words, drivers must be prepared for the situation like 'stop without start' or 'two stops after one start'.

sys/net/if_vxlan.c
1824
zlei marked an inline comment as done.Sat, Jan 18, 2:34 PM
In D48494#1106769, @kib wrote:

Since eventhandlers are called outside the vxlan_sx protection, it is not even guaranteed that the stop event comes after the start, or that events are properly interleaved. In other words, drivers must be prepared for the situation like 'stop without start' or 'two stops after one start'.

Emm, I read the code carefully, both vxlan_start and vxlan_event handlers are called within protection of vxlan_sx. So drivers will get proper event order. Am I missing something important ?

In D48494#1106769, @kib wrote:

Since eventhandlers are called outside the vxlan_sx protection, it is not even guaranteed that the stop event comes after the start, or that events are properly interleaved. In other words, drivers must be prepared for the situation like 'stop without start' or 'two stops after one start'.

Emm, I read the code carefully, both vxlan_start and vxlan_event handlers are called within protection of vxlan_sx. So drivers will get proper event order. Am I missing something important ?

Oh, I did not noticed the global sx (vxlan_sx).

This revision is now accepted and ready to land.Sun, Jan 19, 2:15 AM