From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Alan Brady <alan.brady@intel.com>,
netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com,
jogreene@redhat.com, Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next 14/15] i40e: fix client notify of VF reset
Date: Mon, 2 Oct 2017 12:48:51 -0700 [thread overview]
Message-ID: <20171002194852.71970-15-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <20171002194852.71970-1-jeffrey.t.kirsher@intel.com>
From: Alan Brady <alan.brady@intel.com>
Currently there is a bug in which the PF driver fails to inform clients
of a VF reset which then causes clients to leak resources. The bug
exists because we were incorrectly checking the I40E_VF_STATE_PRE_ENABLE
bit.
When a VF is first init we go through a reset to initialize variables
and allocate resources but we don't want to inform clients of this first
reset since the client isn't fully enabled yet so we set a state bit
signifying we're in a "pre-enabled" client state. During the first
reset we should be clearing the bit, allowing all following resets to
notify the client of the reset when the bit is not set. This patch
fixes the issue by negating the 'test_and_clear_bit' check to accurately
reflect the behavior we want.
Signed-off-by: Alan Brady <alan.brady@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
index 989a65d60ac9..04568137e029 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
@@ -1050,8 +1050,8 @@ static void i40e_cleanup_reset_vf(struct i40e_vf *vf)
set_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states);
clear_bit(I40E_VF_STATE_DISABLED, &vf->vf_states);
/* Do not notify the client during VF init */
- if (test_and_clear_bit(I40E_VF_STATE_PRE_ENABLE,
- &vf->vf_states))
+ if (!test_and_clear_bit(I40E_VF_STATE_PRE_ENABLE,
+ &vf->vf_states))
i40e_notify_client_of_vf_reset(pf, abs_vf_id);
vf->num_vlan = 0;
}
--
2.14.2
next prev parent reply other threads:[~2017-10-02 19:49 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-02 19:48 [net-next 00/15][pull request] 40GbE Intel Wired LAN Driver Updates 2017-10-02 Jeff Kirsher
2017-10-02 19:48 ` [net-next 01/15] i40e: limit lan queue count in large CPU count machine Jeff Kirsher
2017-10-02 19:48 ` [net-next 02/15] i40e: remove logically dead code Jeff Kirsher
2017-10-02 19:48 ` [net-next 03/15] i40e: Fix a potential NULL pointer dereference Jeff Kirsher
2017-10-02 19:48 ` [net-next 04/15] i40e: Fix reporting of supported link modes Jeff Kirsher
2017-10-02 19:48 ` [net-next 05/15] i40e: Add support for 'ethtool -m' Jeff Kirsher
2017-10-02 19:48 ` [net-next 06/15] i40e: use admin queue for setting LEDs behavior Jeff Kirsher
2017-10-02 19:48 ` [net-next 07/15] i40e: don't hold spinlock while resetting VF Jeff Kirsher
2017-10-02 19:48 ` [net-next 08/15] i40e: drop i40e_pf *pf from i40e_vc_disable_vf() Jeff Kirsher
2017-10-02 19:48 ` [net-next 09/15] i40e: make use of i40e_vc_disable_vf Jeff Kirsher
2017-10-02 19:48 ` [net-next 10/15] i40e: ensure reset occurs when disabling VF Jeff Kirsher
2017-10-02 19:48 ` [net-next 11/15] i40evf: Enable VF to request an alternate queue allocation Jeff Kirsher
2017-10-02 20:50 ` Yuval Mintz
2017-10-02 21:35 ` Brady, Alan
2017-10-02 19:48 ` [net-next 12/15] i40e: make i40evf_map_rings_to_vectors void Jeff Kirsher
2017-10-02 19:48 ` [net-next 13/15] i40e: fix handling of vf_states variable Jeff Kirsher
2017-10-02 19:48 ` Jeff Kirsher [this message]
2017-10-02 19:48 ` [net-next 15/15] i40e: Stop dropping 802.1ad tags - eth proto 0x88a8 Jeff Kirsher
2017-10-02 22:17 ` [net-next 00/15][pull request] 40GbE Intel Wired LAN Driver Updates 2017-10-02 David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171002194852.71970-15-jeffrey.t.kirsher@intel.com \
--to=jeffrey.t.kirsher@intel.com \
--cc=alan.brady@intel.com \
--cc=davem@davemloft.net \
--cc=jogreene@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=nhorman@redhat.com \
--cc=sassmann@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox