ice_aq_get_sw_cfg(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 or NULL. you can literally just pass NULL, 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:


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