ice_add_adv_rule(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… ice_add_adv_rule(9) β€” Kernel API Manual 🧚

okay so this is page ice_add_adv_rule(9) from the Kernel API Manual, and bestie, we're about to learn how to make an advanced switch rule. it's giving low-level driver energy and i'm obsessed. let's go 🫢


✨ NAME ✨

ice_add_adv_rule β€” the helper function that creates an advanced switch rule. literally its whole job πŸ’–


🌸 SYNOPSIS 🌸

int ice_add_adv_rule (struct ice_hw *hw , struct ice_adv_lkup_elem
*lkups , u16 lkups_cnt , struct ice_adv_rule_info *rinfo , struct
ice_rule_query_data *added_entry );

like look at that signature. five arguments. no cap, she's thorough πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • hw β€” pointer to the hardware structure. yeah. the hardware. the main character πŸ–₯️
  • lkups β€” info on the words that need to be looked up. and here's the slay: all the words together make one recipe. one recipe, bestie. that's the vibe check πŸ”₯
  • lkups_cnt β€” the num of entries in the lkups array. keep it accurate or perish πŸ’€
  • rinfo β€” everything else about the rule that needs to be programmed. the ~extra~ info, yk? 🌈
  • added_entry β€” this one returns stuff: recipe_id, rule_id, and vsi_handle. so she gives back. 🎁
πŸ’€ real talk though: added_entry should be ignored in case of error. do not look at her if things went bad, she's not okay and neither are you. respect the boundary.

πŸ’œ DESCRIPTION πŸ’œ

so what does this function actually do? she programs rules. but hear me: this function can program only 1 rule at a time. one. single. rule. no bundle deals, no buy-one-get-one. periodt πŸ‘‘

the lkups argument is what describes all the words that form the "lookup" portion of the recipe. and here's the cute part β€” these words can span multiple protocols. yeah, multiple. she's flexible like that 🌸

callers to this function need to pass in:

  • a list of protocol headers with lookup information along, and
  • a mask that determines which words are valid from the given protocol header

and then rinfo describes the other information related to this rule, such as forwarding IDs, the priority of this rule, etc. etc. basically the whole personality of the rule goes in rinfo πŸ’–


πŸ¦‹ SEE ALSO πŸ¦‹

first up, the kernel file herself:

  • ./drivers/net/ethernet/intel/ice/ice_switch.c

and now, the extended friend group. buckle up bestie, this is a long guest list 😭:

like i said. huge friend group. every single one of them is invited to the function and you will be reading all of them 🫢


🌟 cute sign-off 🌟

this little beauty comes to you from ./drivers/net/ethernet/intel/ice, dated October 2026, and she's page ice_add_adv_rule(9) of the Kernel API Manual. mwah πŸ’‹ go program exactly one (1) rule, bestie. not two. πŸ’–βœ¨

πŸ“¦ where this page comes from