ice_for_each_vf(9)
π 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 gremlinvfβ 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 π₯
- Kernel file
./drivers/net/ethernet/intel/ice/ice_vf_lib.h ice_for_each_vf_rcu(9)
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
- 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