Page MenuHomeFreeBSD

nd6: Do not enter net_epoch under nd6_prelist_add
ClosedPublic

Authored by pouria on Mar 28 2026, 8:01 PM.
Tags
None
Referenced Files
F166337304: D56129.id.diff
Thu, Aug 13, 12:04 AM
Unknown Object (File)
Mon, Aug 10, 11:32 AM
Unknown Object (File)
Sun, Aug 9, 5:33 PM
Unknown Object (File)
Sat, Aug 8, 5:10 AM
Unknown Object (File)
Fri, Aug 7, 5:58 AM
Unknown Object (File)
Fri, Aug 7, 5:58 AM
Unknown Object (File)
Fri, Aug 7, 5:58 AM
Unknown Object (File)
Fri, Aug 7, 5:58 AM

Details

Summary

nd6_prefix_onlink will enter net_epoch when necessary.
Also, exit net_epoch earlier in nd6_prefix_onlink,
Because we acquired a reference to ifa, and we got our ifa
from the pr->ndpr_ifp, we don't need to stay under epoch.
While here, style it.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Mar 29 2026, 7:07 AM

The commit title needs to be fixed though, "Don NOT" -> "Do not"

pouria retitled this revision from ndp: Don NOT enter net_epoch under nd6_prelist_add to ndp: Do not enter net_epoch under nd6_prelist_add.Mar 29 2026, 11:00 AM
zlei added inline comments.
sys/netinet6/nd6_rtr.c
1441

This change looks good to me.

2145

I'd recommend against this.

A recursive NET_EPOCH_ENTER() has less performance impact vs a re-enter epoch.

CC @glebius for this change.

pouria retitled this revision from ndp: Do not enter net_epoch under nd6_prelist_add to nd6: Do not enter net_epoch under nd6_prelist_add.Apr 1 2026, 4:52 PM
pouria added inline comments.
sys/netinet6/nd6_rtr.c
2145

Will wait for @glebius response

sys/netinet6/nd6_rtr.c
2145

Will wait for @glebius response

kind ping @glebius

sys/netinet6/nd6_rtr.c
2145
glebius added inline comments.
sys/netinet6/nd6_rtr.c
2145

I don't understand Zhenlei's concern. We do not re-enter epoch, so there is nothing wrong with exiting earlier.