netdev_work_cancel(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ NAME ✨

netdev_work_cancel β€” cancel selected work for a netdev 🧚

okay so quick vibe check first: this whole page lives in the Kernel API Manual bestie, that's the manual we're in, and it's literally all about calling off some of a netdev's pending work. that's it, that's the girl. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

unsigned long netdev_work_cancel (struct net_device *dev , unsigned long
mask );

🌸 ARGUMENTS 🌸

  • dev β€” a net_device. the device in question. the main character, honestly. πŸ‘‘
  • mask β€” the events to cancel. like, which ones you're calling off. πŸŽ€

πŸ’– DESCRIPTION πŸ’–

so what this does is clear mask from the device's work pending mask. that's the whole move. ✨

and here's the slay part: if there's no work left pending, the device gets dequeued and its ndo_work won't be called. no cap. it's giving "you're done here." πŸ’€

ngl, the locking situation is a whole mood: no expectations on locking, but also no guarantees provided. so if the caller wants to touch dev afterwards (like, say, call the work that just got canceled 😭) they have to make sure dev doesn't get freed. that's on you, bestie. protect her. 🫢

⭐ RETURN ⭐

it returns the subset of mask that was actually pending β€” so the caller can run those events inline. convenient much? πŸ”₯


🌈 SEE ALSO 🌈

  • Kernel file ./net/core/netdev_work.c β€” go read it, iykyk πŸ¦‹

and that's the page!! πŸ’œ huge thanks to the source fam over in ./net/core, this edition is dated October 2026, and the manual page is literally called netdev_work_cancel(9) in case you forgot five seconds after reading the title πŸŽ€βœ¨

πŸ“¦ where this page comes from