ethnl_update_bitset32(9)
π ethnl_update_bitset32 β from the Kernel API Manual, bestie
okay so picture this: you're deep in the kernel, you've got a bitset nest just sitting there, and you need it applied to a u32-based bitmap. that's literally this function. it's ethnl_update_bitset32, and yes it's giving "glue code that carries the whole operation on its back" energy. no cap.
β¨ SYNOPSIS β¨
int ethnl_update_bitset32 (u32 *bitmap , unsigned int nbits , const
struct nlattr *attr , ethnl_string_array_t names , struct
netlink_ext_ack *extack , bool *mod );
π ARGUMENTS π
bitmapβ the bitmap you're updating. this is the main character. she gets written to.nbitsβ how big the updated bitmap is, counted in bits. know your size bestie π«Άattrβ the nest attribute to parse and then apply. this is the homework.namesβ an array of bit names; may be null for the compact format. optional queen behavior πextackβ the extack, for error reporting. so when things go wrong (and they might π) the messages have somewhere cute to go.modβ set this totrueif the bitmap is modified, and leave it exactly as it is if it's not. don't be touching it otherwise, fr fr.
πΈ DESCRIPTION πΈ
Apply that bitset nested attribute to a bitmap. simple enough, right?
here's the tea though β it branches based on vibes:
- if the attribute represents a bit list,
bitmapis set to its contents. done. slay. - otherwise, the bits in mask are set to values from value.
and a very important heads-up π: bitmaps in the attribute may be longer than nbits, but the message must not request modifying any bits past nbits. like, it's allowed to be extra, but it is not allowed to reach past the line. that's not a vibe, that's a rule. also lowkey the word "netsted" showed up in the original and honestly we respect the typo, it stays iconic in spirit.
π₯ RETURN π₯
- a negative error code on failure π
0on success β¨
π¦ SEE ALSO π¦
the kernel file ./net/ethtool/bitset.c and its whole friend group:
ethnl_bitmap32_clear(9)ethnl_bitmap32_not_zero(9)ethnl_bitmap32_update(9)ethnl_bitset32_size(9)ethnl_put_bitset32(9)ethnl_bitset_is_compact(9)ethnl_name_to_idx(9)ethnl_bitmap32_equal(9)ethnl_parse_bitset(9)
okay that's the whole guide bestie, go forth and update those bitsets responsibly π this page came straight out of ./net/ethtool, dated October 2026 β and that's the whole manual page, no notes, periodt πβ
π¦ 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