ethnl_update_bitset32(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 to true if 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, bitmap is 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 😭
  • 0 on success ✨

πŸ¦‹ SEE ALSO πŸ¦‹

the kernel file ./net/ethtool/bitset.c and its whole friend group:


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