Skip to content

Commit

Permalink
nfp: drop support for old firmware ABIs
Browse files Browse the repository at this point in the history
Be more strict about FW versions.  Drop support for old
transitional revisions which were never used in production.
Dropping support for FW ABI version 0.0.0.0 is particularly
useful because 0 could just be uninitialized memory.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Dinan Gunawardena <dinan.gunawardena@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jakub Kicinski authored and David S. Miller committed Sep 9, 2016
1 parent 312fada commit 313b345
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/net/ethernet/netronome/nfp/nfp_netvf_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,17 +133,15 @@ static int nfp_netvf_pci_probe(struct pci_dev *pdev,
}

nfp_net_get_fw_version(&fw_ver, ctrl_bar);
if (fw_ver.class != NFP_NET_CFG_VERSION_CLASS_GENERIC) {
if (fw_ver.resv || fw_ver.class != NFP_NET_CFG_VERSION_CLASS_GENERIC) {
dev_err(&pdev->dev, "Unknown Firmware ABI %d.%d.%d.%d\n",
fw_ver.resv, fw_ver.class, fw_ver.major, fw_ver.minor);
err = -EINVAL;
goto err_ctrl_unmap;
}

/* Determine stride */
if (nfp_net_fw_ver_eq(&fw_ver, 0, 0, 0, 0) ||
nfp_net_fw_ver_eq(&fw_ver, 0, 0, 0, 1) ||
nfp_net_fw_ver_eq(&fw_ver, 0, 0, 0x12, 0x48)) {
if (nfp_net_fw_ver_eq(&fw_ver, 0, 0, 0, 1)) {
stride = 2;
tx_bar_no = NFP_NET_Q0_BAR;
rx_bar_no = NFP_NET_Q1_BAR;
Expand Down

0 comments on commit 313b345

Please sign in to comment.