Page MenuHomeFreeBSD

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

Authored by zlei on Fri, Jan 17, 10:04 AM.

Details

Reviewers
np
kib
bryanv
Group Reviewers
network
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