Page MenuHomeFreeBSD

net80211: refactor sequence number assignment code
ClosedPublic

Authored by adrian on Apr 10 2025, 8:31 PM.
Referenced Files
Unknown Object (File)
Mon, Jul 7, 3:33 AM
Unknown Object (File)
Sun, Jul 6, 2:51 AM
Unknown Object (File)
Sat, Jul 5, 8:54 AM
Unknown Object (File)
Wed, Jul 2, 1:24 AM
Unknown Object (File)
Tue, Jul 1, 7:22 PM
Unknown Object (File)
Tue, Jul 1, 11:49 AM
Unknown Object (File)
Mon, Jun 30, 9:34 PM
Unknown Object (File)
Sun, Jun 29, 8:14 PM

Details

Summary

Refactor out the sequence number assignment code for normal frames
and beacons.

Document the behaviour around fragments and packet lists.

Right now this should be a no-op; there's some verification code
in here to make sure that the TID selected by the existing code
matches the TID populated in the passed in mbuf/frame.

Locally tested:

  • rtwn(4), STA mode

Diff Detail

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

Event Timeline

I need to understand this code and the callers. That'll take time. Hopefully I'll find an hour next week.

sys/net80211/ieee80211_output.c
4217

Do you not want uint8_t arg_tid and a bool XXX to use as indicator; changing signedness and size of tid is a pain to deal with usually.

4221

uint8_t you can fold it down together with uint8_t tid, type;

4239

tid=%u

adrian added inline comments.
sys/net80211/ieee80211_output.c
4217

I don't think so just yet? It's only used as a comparison and printing here, the value of arg_tid isn't used as the actual TID.

bz requested changes to this revision.May 12 2025, 9:45 AM
bz added inline comments.
sys/net80211/ieee80211_output.c
1911

Unrelated. You can just commit the doc update ahead and merge it out.

1932

Unrelated. You can just commit the doc update ahead and merge it out.

4204

).

4236

No need for a block

4243

indent not according to style.9

4243

Hos is this going to work given type is already assigned with the TYPE_MASK above? The SUBTYPE case will always be 0

4244

I'd put the block on the outer if not the inner. The inner is a single-line if/else while the outer one is multi-line

sys/net80211/ieee80211_proto.h
126

Both seem to only be used in void context. Do we need the return type or should we return an int error instead (and then the ic_printf with the tid mismatch can just fail?

This revision now requires changes to proceed.May 12 2025, 9:45 AM
sys/net80211/ieee80211_proto.h
126

i haven't decided yet whether we want to have callers eventually call seqno_assign and use the returned seqno, or call seqno_assign and check the mbuf.

sys/net80211/ieee80211_output.c
4243

oh nice catch! lemme fix that!

comment fixes; address a bug that bz caught, thanks!

Scrolling through again this looks good. Thanks a lot for all the follow-up changes (incl. the extra one folding the ic_printf arguments into one line :) ).

This revision is now accepted and ready to land.May 15 2025, 9:48 PM