Skip to content

Commit ee1693e

Browse files
mawilli1Jeff Kirsher
authored andcommitted
i40evf: support virtual channel API version 1.1
Store off the PF's API version, then use it to determine whether or not to send it our capabilities. Change the version checking to allow for PF drivers with lower API versions than our current version, so we can still talk to PF drivers over the 1.0 API. Change-ID: I8edc55d1229c7decf0ed3f285a63032694007c2e Signed-off-by: Mitch Williams <[email protected]> Tested-by: Jim young <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent e6d038d commit ee1693e

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

drivers/net/ethernet/intel/i40evf/i40evf_main.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2113,6 +2113,12 @@ static void i40evf_init_task(struct work_struct *work)
21132113
if (err) {
21142114
if (err == I40E_ERR_ADMIN_QUEUE_NO_WORK)
21152115
err = i40evf_send_api_ver(adapter);
2116+
else
2117+
dev_err(&pdev->dev, "Unsupported PF API version %d.%d, expected %d.%d\n",
2118+
adapter->pf_version.major,
2119+
adapter->pf_version.minor,
2120+
I40E_VIRTCHNL_VERSION_MAJOR,
2121+
I40E_VIRTCHNL_VERSION_MINOR);
21162122
goto err;
21172123
}
21182124
err = i40evf_send_vf_config_msg(adapter);

drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,11 @@ int i40evf_verify_api_ver(struct i40evf_adapter *adapter)
125125
}
126126

127127
pf_vvi = (struct i40e_virtchnl_version_info *)event.msg_buf;
128-
if ((pf_vvi->major != I40E_VIRTCHNL_VERSION_MAJOR) ||
129-
(pf_vvi->minor != I40E_VIRTCHNL_VERSION_MINOR))
128+
adapter->pf_version = *pf_vvi;
129+
130+
if ((pf_vvi->major > I40E_VIRTCHNL_VERSION_MAJOR) ||
131+
((pf_vvi->major == I40E_VIRTCHNL_VERSION_MAJOR) &&
132+
(pf_vvi->minor > I40E_VIRTCHNL_VERSION_MINOR)))
130133
err = -EIO;
131134

132135
out_alloc:

0 commit comments

Comments
 (0)