Page MenuHomeFreeBSD

ifcapnv: fix IFCAP2 usage
ClosedPublic

Authored by kib on Dec 23 2022, 5:35 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Dec 9, 9:58 PM
Unknown Object (File)
Nov 3 2024, 7:51 PM
Unknown Object (File)
Nov 3 2024, 4:13 PM
Unknown Object (File)
Oct 31 2024, 11:38 PM
Unknown Object (File)
Oct 1 2024, 7:15 PM
Unknown Object (File)
Sep 23 2024, 3:56 PM
Unknown Object (File)
Sep 19 2024, 8:42 PM
Unknown Object (File)
Sep 16 2024, 1:07 PM

Details

Summary
IFCAP2_XXX constants are integers, they do not need shift for the
definition.  But their usage as bitmask for if_capenable2 does require
shift.  Add convenience macro IFCAP2_BIT() for consumers.

Fix the only existing consumer, mlx5(4) RXTLS enable bits.

Reported by:    jhb
Coverity CID:   1501659
Sponsored by:   NVIDIA networking

Diff Detail

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

Event Timeline

kib requested review of this revision.Dec 23 2022, 5:35 PM

Sorry, I had intended to back out the IFCAP2_* changes, but clearly forgot this part.

This revision is now accepted and ready to land.Dec 23 2022, 6:09 PM
sys/net/if.h
258–261

Q: Can they start at 32 so it's easier to unify ifcaps and ifcaps2?

I'm going to export/import all ifcaps via netlink interface as a Netlink bitmask array and that would greatly help.

sys/net/if.h
258–261

IFCAP2 constants exist only for driver author's convenience, they do not provide ABI. There is no ioctl(2) op that exports them to userspace. Making the constants visible in other sneaky way is a step backward IMO.

Also remove invalid IFCAP2_RXTLS

This revision now requires review to proceed.Dec 23 2022, 10:56 PM
This revision is now accepted and ready to land.Jan 1 2023, 1:55 AM
This revision was automatically updated to reflect the committed changes.