ethnl_put_bitset32(9)
π ethnl_put_bitset32 β like, the kernel API manual, bestie π
okay so this is a page from the Kernel API Manual (section 9, the kernel devs' own little corner) and it's about ethnl_put_bitset32, which puts a bitset nest into a message. yes that's a real sentence. no I will not calm down. π
β¨ NAME β¨
ethnl_put_bitset32 β put a bitset nest into a message π«Ά
πΈ SYNOPSIS πΈ
int ethnl_put_bitset32 (struct sk_buff *skb , int attrtype , const u32
*val , const u32 *mask , unsigned int nbits , ethnl_string_array_t names
, bool compact );
like literally just look at it. that's the whole function signature. iconic behaviour honestly β¨
π¦ ARGUMENTS π¦
skbβ the skb that's carrying your message πattrtypeβ the attribute type for the bitset nestvalβ the value bitmap (u32 based, bestie, u32 based)maskβ the mask bitmap (u32 based, and it's optional β no pressure π )nbitsβ the bit length of the bitsetnamesβ an array of bit names (optional, again, we're chill)compactβ use the compact format for the output π
π DESCRIPTION π
so what this does is compose a nested attribute that represents a bitset. that's the whole vibe.
here's the tea though, and this part matters so listen:
- if
maskis null β‘οΈ a simple bitmap (bit list) gets created - if
maskis provided β‘οΈ you're representing a value/mask pair
and the bit names? they're only used in verbose mode, and only when they're actually provided by the caller. so like, don't stress if you didn't bring names to the function β it's giving "optional for a reason" β¨
π₯ RETURN π₯
0on success π- a negative error value on error π
π SEE ALSO π
Kernel file ./net/ethtool/bitset.c (yes, the actual file, go read it iykwim) and these absolute legends:
ethnl_bitmap32_clear(9)ethnl_bitmap32_not_zero(9)ethnl_bitmap32_update(9)ethnl_bitset32_size(9)ethnl_bitset_is_compact(9)ethnl_name_to_idx(9)ethnl_bitmap32_equal(9)ethnl_update_bitset32(9)ethnl_parse_bitset(9)
ngl the manpage also credits ./net/ethtool as the source and slaps October 2026 on it as the date, so likeβ¦ mark your calendars bestie ποΈπ
anyway that's the whole page, you ate it, go forth and nest those bitsets π πΈπ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms