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
F171572161: D56129.id174453.diff
Fri, Sep 11, 8:15 PM
Unknown Object (File)
Wed, Sep 9, 4:11 AM
Unknown Object (File)
Tue, Sep 8, 4:44 PM
Unknown Object (File)
Mon, Sep 7, 2:05 AM
Unknown Object (File)
Sat, Sep 5, 5:29 PM
Unknown Object (File)
Sat, Sep 5, 9:06 AM
Unknown Object (File)
Sat, Sep 5, 1:52 AM
Unknown Object (File)
Sat, Sep 5, 1:34 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 Skipped
Unit
Tests Skipped
Build Status
Buildable 71777
Build 68660: arc lint + arc unit

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
1420

This change looks good to me.

2168

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
2168

Will wait for @glebius response

sys/netinet6/nd6_rtr.c
2168

Will wait for @glebius response

kind ping @glebius

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

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