HomeFreeBSD

lagg: Make the none protocol a first-class citizen

Description

lagg: Make the none protocol a first-class citizen

All the other protocols have corresponding start and input routines,
which are used in the fast path. Currently the none protocol is
treated specially. In the fast path it is checked to indicate whether
a working protocol is configured. There are two issues raised by this
design:

  1. In production, other protocols are commonly used, but not the

none protocol. It smells like an overkill to always check it in the
fast path. It is unfair to other commonly used protocols.

  1. PR 289017 reveals that there's a small window between checking the

protocol and calling lagg_proto_start(). lagg_proto_start() is possible
to see the none protocol and do NULL deferencing.

Fix them by making the none protocol a first-class citizen so that it
has start and input routines just the same as other protocols. Then we
can stop checking it in the fast path, since lagg_proto_start() and
lagg_proto_input() will never fail to work.

The error ENETDOWN is chosen for the start routine. Obviously no active
ports are available, and the packets will go nowhere. It is also a
better error than ENXIO, since indeed the interface is configured and
has a TX algorithm (the none protocol).

PR: 289017
Diagnosed by: Qiu-ji Chen <chenqiuji666@gmail.com>
Tested by: Gui-Dong Han <hanguidong02@gmail.com>
Reviewed by: glebius
MFC after: 5 days
Differential Revision: https://reviews.freebsd.org/D55123

Details

Provenance
zleiAuthored on Feb 6 2026, 3:37 AM
Reviewer
glebius
Differential Revision
D55123: lagg: Makes the none protocol a first-class citizen
Parents
rG40134060f658: diff: Bump version number
Branches
Unknown
Tags
Unknown