• Michal Witwicki's avatar
    crypto: qat - allow disabling SR-IOV VFs · ca88a2bd
    Michal Witwicki authored
    The QAT driver allows enabling SR-IOV VFs but does not allow them to be
    disabled through a write to sysfs.
    Disabling SR-IOV VFs can be only achieved by bringing down and up a
    device using the attribute /sys/bus/pci/devices/<BDF>/qat/state.
    
    The documentation for the sysfs attribute `sriov_numvfs` specifies
    that "a userspace application wanting to disable the VFs would write a
    zero to this file".
    
    Add support for disabling SR-IOV VFs by writing '0' to the
    'sriov_numvfs' attribute in sysfs.
    
    Enabling or disabling SR-IOV always requires adf_dev_down() to be
    called. This action subsequently leads to the deletion of the
    ADF_KERNEL_SEC configuration section. The keys ADF_NUM_CY and ADF_NUM_DC
    within that section must be set to '0', otherwise, the driver will
    register into the Linux Crypto Framework. Because of this, the
    configuration in the ADF_KERNEL_SEC section must be added before every
    sriov_enable.
    Signed-off-by: default avatarMichal Witwicki <michal.witwicki@intel.com>
    Reviewed-by: default avatarGiovanni Cabiddu <giovanni.cabiddu@intel.com>
    Reviewed-by: default avatarPrzemek Kitszel <przemyslaw.kitszel@intel.com>
    Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
    ca88a2bd
adf_sriov.c 7.81 KB