lpfc_sriov_nr_virtfn_store(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– lpfc_sriov_nr_virtfn_store(9) πŸ’–

okay so this is from the Kernel API Manual, and it's literally the page for the function that enables your adapter for sr-iov virtual functions. bestie, if you're here you're probably messing with virtual functions and you need the whole vibe check on what this thing actually does. no cap, every detail is staying. πŸŽ€

🌸 NAME 🌸

lpfc_sriov_nr_virtfn_store β€” Enable the adapter for sr-iov virtual functions.

✨ SYNOPSIS ✨

ssize_t lpfc_sriov_nr_virtfn_store (struct device *dev , struct
       device_attribute *attr , const char *buf , size_t count );

the whole signature, untouched, because we do not edit code in this house πŸ’…

πŸŽ€ ARGUMENTS πŸŽ€

  • dev β€” class device that is converted into a Scsi_host. that's the glow-up.
  • attr β€” device attribute, not used. it's giving background character energy.
  • buf β€” containing the string the number of vfs to be enabled. so like, the actual number goes in here as a string. πŸ“
  • count β€” unused variable. not me forgetting about count, but the page says unused so periodt.

πŸ’… DESCRIPTION πŸ’…

okay so when this api is called either through user sysfs, the driver shall try to enable or disable SR-IOV virtual functions according to the following. this is the main character section, so pay attention:

  • If zero virtual function has been enabled to the physical function, the driver shall invoke the pci enable virtual function api trying to enable the virtual functions. If the nr_vfn provided is greater than the maximum supported, the maximum virtual function number will be used for invoking the api; otherwise, the nr_vfn provided shall be used for invoking the api. If the api call returned success, the actual number of virtual functions enabled will be set to the driver cfg_sriov_nr_virtfn; otherwise, -EINVAL shall be returned and driver cfg_sriov_nr_virtfn remains zero. slay if success, sad girl hours if not. 😭
  • If none-zero virtual functions have already been enabled to the physical function, as reflected by the driver's cfg_sriov_nr_virtfn, -EINVAL will be returned and the driver does nothing. it literally said not today.
  • If the nr_vfn provided is zero and none-zero virtual functions have been enabled, as indicated by the driver's cfg_sriov_nr_virtfn, the disabling virtual function api shall be invoked to disable all the virtual functions and driver's cfg_sriov_nr_virtfn shall be set to zero. Otherwise, if zero virtual function has been enabled, do nothing. so if there's nothing to disable, we're not doing a whole production. πŸ’€

🌈 RETURN 🌈

  • length of the buf on success if val is in range the intended mode is supported.
  • -EINVAL if val out of range or intended mode is not supported.

that's the tea, bestie: success means you get the length of buf, and out-of-range or unsupported mode means -EINVAL. ✨

πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./drivers/scsi/lpfc/lpfc_attr.c β€” and honestly the whole friend group is here, iykyk:

mwah πŸ’‹ that's the whole page, bestie. source/version: ./drivers/scsi/lpfc; date: October 2026; manual: lpfc_sriov_nr_virtfn_store(9). go forth and handle your virtual functions with main character energy 🫢✨

πŸ“¦ where this page comes from