netdev_napi_by_id_lock(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ netdev_napi_by_id_lock(9) ✨

Kernel API Manual, bestie edition β€” okay so this page is all about finding a device by NAPI ID and locking it. πŸ’…

🌸 NAME 🌸

netdev_napi_by_id_lock β€” find a device by NAPI ID and lock it. 🫢

✨ SYNOPSIS ✨

struct napi_struct * netdev_napi_by_id_lock (struct net *net , unsigned
int napi_id );

πŸŽ€ ARGUMENTS πŸŽ€

  • net β€” the applicable net namespace. (yes, the namespace context you’re working in)
  • napi_id β€” ID of a NAPI of a target device.

πŸ’– DESCRIPTION πŸ’–

Okay so the move is: find a NAPI instance with napi_id, then lock its device. The device must be in NETREG_REGISTERED state for the lookup to succeed β€” that’s the vibe check it has to pass. And when you’re done, netdev_unlock must be called to release it. No ghosting the lock, bestie. 😭

πŸ”₯ RETURN πŸ”₯

A pointer to the NAPI, with its device and the lock held. If it’s not found, you get NULL. That’s the whole return situation. ✨

πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file: ./net/core/dev.c.

And the whole see-also group chat:


Source/version: ./net/core Β· Date: October 2026. Bye bestie, go unlock responsibly πŸ’…βœ¨

πŸ“¦ where this page comes from