@@ -625,6 +625,9 @@ static int nfp_nsp_init(struct pci_dev *pdev, struct nfp_pf *pf)
return err;
}
+ pf->multi_pf.en = pdev->multifunction;
+ dev_info(&pdev->dev, "%s-PF detected\n", pf->multi_pf.en ? "Multi" : "Single");
+
err = nfp_nsp_wait(nsp);
if (err < 0)
goto exit_close_nsp;
@@ -84,6 +84,8 @@ struct nfp_dumpspec {
* @port_refresh_work: Work entry for taking netdevs out
* @shared_bufs: Array of shared buffer structures if FW has any SBs
* @num_shared_bufs: Number of elements in @shared_bufs
+ * @multi_pf: Used in multi-PF setup
+ * @multi_pf.en: True if it's a NIC with multiple PFs
*
* Fields which may change after proble are protected by devlink instance lock.
*/
@@ -141,6 +143,10 @@ struct nfp_pf {
struct nfp_shared_buf *shared_bufs;
unsigned int num_shared_bufs;
+
+ struct {
+ bool en;
+ } multi_pf;
};
extern struct pci_driver nfp_netvf_pci_driver;
@@ -59,7 +59,13 @@
#define NFP_CAP_CMD_DMA_SG 0x28
#define NSP_MAGIC 0xab10
-#define NSP_MAJOR 0
+/* ABI major version is bumped separately without resetting minor
+ * version when the change in NSP is not compatible to old driver.
+ */
+#define NSP_MAJOR 1
+/* ABI minor version is bumped when new feature is introduced
+ * while old driver can still work without this new feature.
+ */
#define NSP_MINOR 8
#define NSP_CODE_MAJOR GENMASK(15, 12)
@@ -248,14 +254,14 @@ static int nfp_nsp_check(struct nfp_nsp *state)
state->ver.major = FIELD_GET(NSP_STATUS_MAJOR, reg);
state->ver.minor = FIELD_GET(NSP_STATUS_MINOR, reg);
- if (state->ver.major != NSP_MAJOR) {
+ if (state->ver.major > NSP_MAJOR) {
nfp_err(cpp, "Unsupported ABI %hu.%hu\n",
state->ver.major, state->ver.minor);
return -EINVAL;
}
if (state->ver.minor < NSP_MINOR) {
- nfp_err(cpp, "ABI too old to support NIC operation (%u.%hu < %u.%u), please update the management FW on the flash\n",
- NSP_MAJOR, state->ver.minor, NSP_MAJOR, NSP_MINOR);
+ nfp_err(cpp, "ABI too old to support NIC operation (x.%u < x.%u), please update the management FW on the flash\n",
+ state->ver.minor, NSP_MINOR);
return -EINVAL;
}