ice_for_each_vf(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… ice_for_each_vf(9) πŸ’…

okay bestie, welcome to the Kernel API Manual, section 9 β€” this one's a macro-flavored little loop-de-loop and it's honestly iconic once you get it. sit down, grab a strawberry πŸ“, let's go.


✨ NAME ✨

ice_for_each_vf β€” loop your way through every single VF entry, one at a time, no skips, no cap 🫢


🌸 SYNOPSIS 🌸

ice_for_each_vf (pf , bkt , vf );

πŸŽ€ ARGUMENTS πŸŽ€

  • pf β€” pointer to the PF private structure, aka the main character of this whole operation πŸ‘‘
  • bkt β€” the bucket index used for the iteration, your little loop gremlin
  • vf β€” pointer to the VF entry that's currently being processed in the loop, so like, the one you're on right now πŸ’«

πŸ¦‹ DESCRIPTION πŸ¦‹

so the bkt variable? it's an unsigned integer iterator that you use to traverse the VF entries. and here's the part everyone messes up: it is *not* guaranteed to be the VF's vf_id. not even a little bit. do not assume it is. like, don't even think about it πŸ™ˆ. if you actually need the id number, go get it with vf->vf_id, periodt.

also, the caller is expected to be holding the table_lock mutex for the entire loop β€” the whole time, no dropping it halfway, no "brb". and use this iterator if your loop is long or if it might sleep 😴 (yes, that's the whole vibe check on when to pick this one).


πŸ”₯ SEE ALSO πŸ”₯


and that's the teaaaaa πŸ’– this little page lives over in ./drivers/net/ethernet/intel/ice (that's the source/version, ngl it's giving very specific), stamped October 2026 β€” so yeah, future energy 🌈⭐ mwah, go loop responsibly bestie πŸ’œ

πŸ“¦ where this page comes from