From fda572c53e2d4ab56a0836c6c4e1348962db7a3a Mon Sep 17 00:00:00 2001 From: Jim Somerville Date: Fri, 13 Apr 2018 14:53:38 -0400 Subject: [PATCH] i40e ndo_get_vf_config poll for out of vf reset It can take up to 200 mS for a vf to come out of reset. Poll for it being ready rather than just abandoning the request. Change-Id: I76a93029e155fada3ef8f652a562552031c06a41 Signed-off-by: Jim Somerville --- intel-i40e/centos/i40e-kmod.spec | 1 + ...t_vf_config-poll-for-out-of-vf-reset.patch | 47 +++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 intel-i40e/files/ndo_get_vf_config-poll-for-out-of-vf-reset.patch diff --git a/intel-i40e/centos/i40e-kmod.spec b/intel-i40e/centos/i40e-kmod.spec index 4aec808..c76c066 100644 --- a/intel-i40e/centos/i40e-kmod.spec +++ b/intel-i40e/centos/i40e-kmod.spec @@ -25,6 +25,7 @@ Source11: modules-load.conf Patch01: i40e-Enable-getting-link-status-from-VF.patch Patch02: i40e-add-more-debug-info-for-VFs-still-in-reset.patch +Patch03: ndo_get_vf_config-poll-for-out-of-vf-reset.patch %define kversion %(rpm -q kernel%{?bt_ext}-devel | sort --version-sort | tail -1 | sed 's/kernel%{?bt_ext}-devel-//') diff --git a/intel-i40e/files/ndo_get_vf_config-poll-for-out-of-vf-reset.patch b/intel-i40e/files/ndo_get_vf_config-poll-for-out-of-vf-reset.patch new file mode 100644 index 0000000..c759825 --- /dev/null +++ b/intel-i40e/files/ndo_get_vf_config-poll-for-out-of-vf-reset.patch @@ -0,0 +1,47 @@ +From 3147c6198571464749af94f0fbf6986a932ed8c7 Mon Sep 17 00:00:00 2001 +Message-Id: <3147c6198571464749af94f0fbf6986a932ed8c7.1522697994.git.Jim.Somerville@windriver.com> +From: Jim Somerville +Date: Mon, 2 Apr 2018 15:35:12 -0400 +Subject: [PATCH 1/1] ndo_get_vf_config poll for out of vf reset + +Same solution as 028daf80117376b22909becd9720daaefdfceff4 from the +net-next tree as supplied by Intel, but we apply it to +ndo_get_vf_config instead. + +Signed-off-by: Jim Somerville +--- + src/i40e_virtchnl_pf.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/src/i40e_virtchnl_pf.c b/src/i40e_virtchnl_pf.c +index 83f6f88..6f749b6 100644 +--- a/src/i40e_virtchnl_pf.c ++++ b/src/i40e_virtchnl_pf.c +@@ -3358,6 +3358,7 @@ int i40e_ndo_get_vf_config(struct net_device *netdev, + struct i40e_pf *pf = vsi->back; + struct i40e_vf *vf; + int ret = 0; ++ u8 i; + + /* validate the request */ + if (vf_id >= pf->num_alloc_vfs) { +@@ -3369,6 +3370,16 @@ int i40e_ndo_get_vf_config(struct net_device *netdev, + vf = &(pf->vf[vf_id]); + /* first vsi is always the LAN vsi */ + vsi = pf->vsi[vf->lan_vsi_idx]; ++ ++ /* When the VF is resetting wait until it is done. ++ * It can take up to 200 milliseconds, ++ * but wait for up to 300 milliseconds to be safe. ++ */ ++ for (i = 0; i < 15; i++) { ++ if (test_bit(I40E_VF_STATE_INIT, &vf->vf_states)) ++ break; ++ msleep(20); ++ } + if (!test_bit(I40E_VF_STATE_INIT, &vf->vf_states)) { + dev_err(&pf->pdev->dev, "%s: VF %d still in reset. Try again.\n", + __func__, vf_id); +-- +1.8.3.1 +