ice_aq_get_sw_cfg(9)
π
ice_aq_get_sw_cfg β get switch configuration π
okay so bestie, welcome to the ice_aq_get_sw_cfg(9) page from the Kernel API Manual β¨ this is the one that goes and asks the firmware "hey girl, what's the switch config?" and it's genuinely so fetch. let's get into it π«Ά
β¨ SYNOPSIS β¨
int ice_aq_get_sw_cfg (struct ice_hw *hw , struct
ice_aqc_get_sw_cfg_resp_elem *buf , u16 buf_size , u16 *req_desc , u16
*num_elems , struct ice_sq_cd *cd );
like, it returns an int, and it takes a whole little friend group of parameters. no cap π
πΈ ARGUMENTS πΈ
hwβ pointer to the hardware structure. the main character of the whole situation tbh πbufβ pointer to the result buffer. this is where the tea gets stored πbuf_sizeβ length of the buffer available for response. i.e. how much room you're giving it to spill πreq_descβ pointer to requested descriptor. plot twist: this one is in AND out, more on that below πnum_elemsβ pointer to number of elements. strictly an output situation, keep reading βcdβ pointer to command details structure orNULL. you can literally just passNULL, it's fine π
π¦ DESCRIPTION π¦
Get switch configuration (0x0200) to be placed in buf. π
This admin command returns information such as initial VSI/port number and switch ID it belongs to. like, it literally tells you which VSI/port number it started as and which switch ID it's part of β iconic info gathering behavior β¨
π NOTE π
*req_desc is both an input/output parameter. yes bestie, it's giving dual-threat. π
The caller of this function first calls this function with *request_desc set to 0. so like, start at zero, fresh start, new me energy π
If the response from f/w has *req_desc set to 0, all the switch configuration information has been returned. congrats, you ate, you're done π₯
if non-zero (meaning not all the information was returned), the caller should call this function again with *req_desc set to the previous value returned by f/w to get the next block of switch configuration information. so it's a lil pagination era β same value back in, next block out, keep going till you hit that 0 π§
*num_elems is output only parameter. Periodt. π«Ά
This reflects the number of elements in response buffer. The caller of this function to use *num_elems while parsing the response buffer. so yeah, when you're looping through buf, *num_elems is your bestie telling you how many elements are actually in there β
fr fr do not sleep on *req_desc β forgetting to loop on a non-zero return means you're leaving half the switch config on read and that is not the vibe π
π SEE ALSO π
Kernel file ./drivers/net/ethernet/intel/ice/ice_switch.c β that's the source file, iykyk π
and now the extended friend group, literally the whole ice_switch.c squad:
ice_init_def_sw_recp(9)ice_aq_add_vsi(9)ice_aq_free_vsi(9)ice_aq_update_vsi(9)ice_is_vsi_valid(9)ice_get_hw_vsi_num(9)ice_get_vsi_ctx(9)ice_save_vsi_ctx(9)ice_clear_vsi_q_ctx(9)ice_clear_vsi_ctx(9)ice_clear_all_vsi_ctx(9)ice_add_vsi(9)ice_free_vsi(9)ice_update_vsi(9)ice_cfg_rdma_fltr(9)ice_aq_alloc_free_vsi_list(9)ice_aq_sw_rules(9)ice_aq_add_recipe(9)ice_aq_get_recipe(9)ice_update_recipe_lkup_idx(9)ice_aq_map_recipe_to_profile(9)ice_aq_get_recipe_to_profile(9)ice_init_chk_recipe_reuse_support(9)ice_alloc_recipe(9)ice_free_recipe_res(9)ice_release_recipe_res(9)ice_get_recp_to_prof_map(9)ice_get_recp_frm_fw(9)ice_fill_sw_info(9)ice_fill_eth_hdr(9)ice_fill_sw_rule(9)ice_add_marker_act(9)ice_create_vsi_list_map(9)ice_update_vsi_list_rule(9)ice_create_vsi_list_rule(9)ice_create_pkt_fwd_rule(9)ice_update_pkt_fwd_rule(9)ice_update_sw_rule_bridge_mode(9)ice_add_update_vsi_list(9)ice_find_rule_entry(9)ice_find_vsi_list_entry(9)ice_add_rule_internal(9)ice_remove_vsi_list_rule(9)ice_rem_update_vsi_list(9)ice_remove_rule_internal(9)ice_vlan_fltr_exist(9)ice_add_mac(9)ice_add_vlan_internal(9)ice_add_vlan(9)ice_add_eth_mac(9)ice_remove_eth_mac(9)ice_rem_sw_rule_info(9)ice_rem_adv_rule_info(9)ice_cfg_dflt_vsi(9)ice_vsi_uses_fltr(9)ice_check_if_dflt_vsi(9)ice_remove_mac(9)ice_remove_vlan(9)ice_add_entry_to_vsi_fltr_list(9)ice_add_to_vsi_fltr_list(9)ice_determine_promisc_mask(9)ice_remove_promisc(9)ice_clear_vsi_promisc(9)ice_set_vsi_promisc(9)ice_set_vlan_vsi_promisc(9)ice_remove_vsi_lkup_fltr(9)ice_remove_vsi_fltr(9)ice_alloc_res_cntr(9)ice_free_res_cntr(9)ice_share_res(9)ice_find_recp(9)ice_change_proto_id_to_dvm(9)ice_prot_type_to_id(9)ice_fill_valid_words(9)ice_fill_fv_word_index(9)ice_find_free_recp_res_idx(9)ice_calc_recp_cnt(9)ice_add_sw_recipe(9)ice_subscribe_recipe(9)ice_subscribable_recp_shared(9)ice_add_adv_recipe(9)ice_dummy_packet_add_vlan(9)ice_find_dummy_packet(9)ice_fill_adv_dummy_packet(9)ice_fill_adv_packet_tun(9)ice_fill_adv_packet_vlan(9)ice_find_adv_rule_entry(9)ice_adv_add_update_vsi_list(9)ice_add_adv_rule(9)ice_replay_vsi_fltr(9)ice_adv_rem_update_vsi_list(9)ice_rem_adv_rule(9)ice_rem_adv_rule_by_id(9)ice_replay_vsi_adv_rule(9)ice_replay_vsi_all_fltr(9)ice_rm_all_sw_replay_rule_info(9)
that's the whole page bestie, every single reference accounted for, no crumbs left behind π
mwah π β this one comes to you from the ./drivers/net/ethernet/intel/ice corner of the kernel, dated October 2026, and yes she's still serving ice_aq_get_sw_cfg(9) realness. slay πΈ
π¦ 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