ice_set_key(9)
π ice_set_key β Kernel API Manual, but make it make sense
okay so bestie, we're in the kernel today, and the function we're stanning is ice_set_key. Manual name is ice_set_key(9) β it lives in the 9th section of the kernel API manual, so you already know it's driver-dev territory. Let's go. π«Ά
β¨ NAME β¨
ice_set_key β generate a variable sized key with multiples of 16-bits
That's the whole pitch. You're building a key, it can be any size you want, and it wants its sizes in multiples of 16 bits. Iconic little constraint, honestly. π
πΈ SYNOPSIS πΈ
int ice_set_key (u8 *key , u16 size , u8 *val , u8 *upd , u8 *dc , u8
*nm , u16 off , u16 len );
Return type is int, and the signature is a whole friend group of parameters. Keep reading, I gotchu. π
π ARGUMENTS π
keyβ pointer to where the key will be stored. This is the destination, bestie β the finished key's home address. πsizeβ the size of the complete key in bytes (must be even). Don't try to be quirky with an odd number, it's not that kind of party.valβ array of 8-bit values that makes up the value portion of the key. The actual content, the main character energy. β¨updβ array of 8-bit masks that determine what key portion to update. Basically the "which bits are we touching" list.dcβ array of 8-bit masks that make up the don't care mask. Bits here are the ones we said "not my problem" to. πnmβ array of 8-bit masks that make up the never match mask. The friend group that's never getting let in. π«offβ the offset of the first byte in the key to update. Where the action starts.lenβ the number of bytes in the key update. How far the action goes. π
π¦ DESCRIPTION π¦
So the way that this works is: ice_set_key generates a key from a value, a don't care mask and a never match mask. Three ingredients, one key. It's giving recipe, lowkey. π
And here's the cute part β upd, dc, and nm are optional parameters. You can pass NULL for any of them and the function just fills in the defaults for you, no arguments, no notes:
upd == NULLβ upd mask is all 1's (update all bits)dc == NULLβ dc mask is all 0's (no don't care bits)nm == NULLβ nm mask is all 0's (no never match bits)
Literally so forgiving. Not me being obsessed with a null check. π
ngl, size still has to be even β that rule does not bend for anybody. Periodt.
π₯ SEE ALSO π₯
okay bestie you asked for the related-pages section and it is unhinged in size, I'm warning you now. First up, the source itself:
- Kernel file
./drivers/net/ethernet/intel/ice/ice_flex_pipe.c
and then the entire extended universe of (9) functions, all of them, no skips, no summarising, let's get into it:
ice_sect_id(9)ice_hw_ptype_ena(9)ice_gen_key_word(9)ice_bits_max_set(9)ice_acquire_change_lock(9)ice_release_change_lock(9)ice_get_open_tunnel_port(9)ice_upd_dvm_boost_entry(9)ice_set_dvm_boost_entries(9)ice_tunnel_idx_to_entry(9)ice_create_tunnel(9)ice_destroy_tunnel(9)ice_find_prot_off(9)ice_ptg_find_ptype(9)ice_ptg_alloc_val(9)ice_ptg_remove_ptype(9)ice_ptg_add_mv_ptype(9)ice_match_prop_lst(9)ice_vsig_find_vsi(9)ice_vsig_alloc_val(9)ice_vsig_alloc(9)ice_find_dup_props_vsig(9)ice_vsig_free(9)ice_vsig_remove_vsi(9)ice_vsig_add_mv_vsi(9)ice_prof_has_mask_idx(9)ice_prof_has_mask(9)ice_find_prof_id_with_mask(9)ice_prof_id_rsrc_type(9)ice_tcam_ent_rsrc_type(9)ice_alloc_tcam_ent(9)ice_free_tcam_ent(9)ice_alloc_prof_id(9)ice_free_prof_id(9)ice_prof_inc_ref(9)ice_write_prof_mask_reg(9)ice_write_prof_mask_enable_res(9)ice_init_prof_masks(9)ice_init_all_prof_masks(9)ice_alloc_prof_mask(9)ice_free_prof_mask(9)ice_free_prof_masks(9)ice_shutdown_prof_masks(9)ice_shutdown_all_prof_masks(9)ice_update_prof_masking(9)ice_write_es(9)ice_prof_dec_ref(9)ice_init_sw_xlt1_db(9)ice_init_sw_xlt2_db(9)ice_init_sw_db(9)ice_fill_tbl(9)ice_fill_blk_tbls(9)ice_free_prof_map(9)ice_free_flow_profs(9)ice_free_vsig_tbl(9)ice_free_hw_tbls(9)ice_init_flow_profs(9)ice_clear_hw_tbls(9)ice_init_hw_tbls(9)ice_prof_gen_key(9)ice_tcam_write_entry(9)ice_vsig_get_ref(9)ice_has_prof_vsig(9)ice_prof_bld_es(9)ice_prof_bld_tcam(9)ice_prof_bld_xlt1(9)ice_prof_bld_xlt2(9)ice_upd_prof_hw(9)ice_update_fd_mask(9)ice_update_fd_swap(9)ice_get_ptype_attrib_info(9)ice_add_prof_attrib(9)ice_disable_fd_swap(9)ice_search_prof_id(9)ice_vsig_prof_id_count(9)ice_rel_tcam_idx(9)ice_rem_prof_id(9)ice_rem_vsig(9)ice_rem_prof_id_vsig(9)ice_rem_flow_all(9)ice_rem_prof(9)ice_get_prof(9)ice_get_profs_vsig(9)ice_add_prof_to_lst(9)ice_move_vsi(9)ice_set_tcam_flags(9)ice_rem_chg_tcam_ent(9)ice_prof_tcam_ena_dis(9)ice_ptg_attr_in_use(9)ice_adj_prof_priorities(9)ice_add_prof_id_vsig(9)ice_create_prof_id_vsig(9)ice_create_vsig_from_lst(9)ice_find_prof_vsig(9)ice_add_prof_id_flow(9)ice_flow_assoc_fdir_prof(9)ice_rem_prof_from_list(9)ice_rem_prof_id_flow(9)
yeah. all of that. iykyk. π
β the sign-off β
This little page comes from ./drivers/net/ethernet/intel/ice and it's dated October 2026 β so when you're flipping through the manual, that's the version stamp you're looking at. Slay, go build your keys, and remember: even sizes only. bye 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