Page MenuHomeFreeBSD

iwx: enable seqno offload
ClosedPublic

Authored by adrian on Jun 5 2025, 3:51 AM.
Referenced Files
Unknown Object (File)
Mon, Oct 6, 12:09 AM
Unknown Object (File)
Fri, Oct 3, 5:35 PM
Unknown Object (File)
Wed, Oct 1, 6:34 PM
Unknown Object (File)
Tue, Sep 30, 6:34 AM
Unknown Object (File)
Fri, Sep 19, 10:50 AM
Unknown Object (File)
Wed, Sep 17, 2:01 PM
Unknown Object (File)
Sep 16 2025, 11:21 PM
Unknown Object (File)
Sep 14 2025, 4:21 PM
Subscribers

Details

Reviewers
thj
bz
Group Reviewers
wireless
Commits
rG5bf3c5586b5e: iwx: enable seqno offload
Summary

Enable sequence number offload.

This should both enable the sequence number offloading and disable
the net80211 TX lock from being acquired/released/checked.

Diff Detail

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

Event Timeline

adrian requested review of this revision.Jun 5 2025, 3:51 AM
adrian added a reviewer: wireless.
adrian added a project: wireless.
adrian added a reviewer: thj.
bz requested changes to this revision.Jun 5 2025, 8:03 AM
bz added a subscriber: bz.
bz added inline comments.
sys/dev/iwx/if_iwx.c
5678

This is entirely done in firmware.

This revision now requires changes to proceed.Jun 5 2025, 8:03 AM
sys/dev/iwx/if_iwx.c
5678

This is entirely done in firmware.

aha let me go and try that too then. If it works then I'll delete it and leave the comment there that seqno offload is done at that point.

Address bz's comment - yup, this works with seqno offload and
with it just not populated in the driver encap path. Neat!

As far as I can tell this is nop, but good ground work for future stuff.

The commit message needs to be updated before commit!

I don't mind the other comments.

sys/dev/iwx/if_iwx.c
5692

What does obsd-style mean here? I wonder if/how things can work at all beyond 11abg if tkip is not done in hw?

This revision is now accepted and ready to land.Aug 19 2025, 7:36 PM
This revision was automatically updated to reflect the committed changes.
sys/dev/iwx/if_iwx.c
5692

In theory it SHOULD be calling ic_encap() for /all/ encrypted frames, but here it's just increasing wk_keytsc and not doing ic_encap().
The openbsd crypto path doesn't have all of our offload flags/support.

I believe the code is doing:

  • hardware encryption for CCMP (ie, by setting the keys in firmware);
  • setting IWX_TX_FLAGS_ENCRYPT_DIS for anything but CCMP; and
  • iwx_key_set() manually rejects setting encryption keys for non-CCMP, falling back to software encryption.

This could completely be tidied up to use freebsd's crypto stuff 100% and support all the combinations of stuff!

sys/dev/iwx/if_iwx.c
5692

Yeah, there's a lot of work to do for iwx if you really wanted.

The above simply means if you try to do anything HT or AC with anything but CCMP it'll not work.

And not everything goes through ic_encap(); LinuxKPI does neither, but it has it's own (linked) copy of a key and only neeeds the keyix for that if we do offloading.

5019         if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) {
5020
5021 #ifdef LKPI_80211_HW_CRYPTO
5022                 if (lkpi_hwcrypto) {
5023                         k = ieee80211_crypto_get_txkey(ni, m);
5024                         if (k != NULL && lsta->kc[k->wk_keyix] != NULL)
5025                                 keyix = k->wk_keyix;
5026                 }
5027 #endif
5028 
5029                 /* Encrypt the frame if need be. */
5030                 if (keyix == IEEE80211_KEYIX_NONE) {
5031                         /* Retrieve key for TX && do software encryption. */
5032                         k = ieee80211_crypto_encap(ni, m);
5033                         if (k == NULL) {
5034                                 ieee80211_free_node(ni);
5035                                 m_freem(m);
5036                                 return;
5037                         }
5038                 }
5039         }