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
Details
Details
- Reviewers
jhb • hselasky jhibbits - Commits
- rG01143ba1189b: ifcapnv: fix IFCAP2 usage
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Comment Actions
Sorry, I had intended to back out the IFCAP2_* changes, but clearly forgot this part.
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. |