/* Max number of collect buffers supported */
extern uint sif_cb_max;
+/* Number of VFs to request firmware to configure, 0 = use driver defaults */
+extern int sif_vf_max;
+
/* Initialized in init */
extern struct kmem_cache *compl_cache;
#include "sif_defs.h"
#include <linux/bitmap.h>
#include <linux/seq_file.h>
+#include <xen/xen.h>
#define CSR_ONLINE_MASK 0x8000
lcqe.rsp = &lrsp;
lcqe.need_complete = false;
+ if (!sdev->is_vf) {
+ /* PF only: If sif_vf_max is >= 0, enable that number of VFs.
+ * If vf_max == -1: enable Exadata mode as follows:
+ * if Xen PV domain automatically enable all VFs,
+ * otherwise enable no VFs - only physical function.
+ * If vf_max == -2: Default to NVRAM settings from firmware
+ * = bw comp mode.
+ */
+ if (sif_vf_max >= 0)
+ lconfig.num_ufs = min_t(int, pci_sriov_get_totalvfs(sdev->pdev),sif_vf_max) + 1;
+ else if (sif_vf_max == -2)
+ lconfig.num_ufs = 0; /* Use firmware defaults */
+ else if (xen_pv_domain())
+ lconfig.num_ufs = pci_sriov_get_totalvfs(sdev->pdev) + 1;
+ else
+ lconfig.num_ufs = 1;
+ }
+
lconfig.hwapi_major_ver = PSIF_MAJOR_VERSION;
lconfig.hwapi_minor_ver = PSIF_MINOR_VERSION;
lconfig.epsapi_major_ver = EPSC_MAJOR_VERSION;
module_param_named(cb_max, sif_cb_max, uint, S_IRUGO);
MODULE_PARM_DESC(cb_max, "Upper limit on no. of CBs of each type to reserve for the kernel");
+int sif_vf_max = -1;
+module_param_named(vf_max, sif_vf_max, int, S_IRUGO);
+MODULE_PARM_DESC(vf_max, "Number of VFs to request firmware to configure, -1 = use driver defaults");
+
uint sif_fmr_cache_flush_threshold = 512;
module_param_named(fmr_cache_flush_threshold, sif_fmr_cache_flush_threshold, uint, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC(fmr_cache_flush_threshold, "PF limit for when to use fast-path full MMU flush for FMR unmap");