netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Nguyen, Anthony L" <anthony.l.nguyen@intel.com>
To: "kuba@kernel.org" <kuba@kernel.org>
Cc: "jkc@redhat.com" <jkc@redhat.com>,
	"Szlosek, Marek" <marek.szlosek@intel.com>,
	"Yang, Lihong" <lihong.yang@intel.com>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"Venkataramanan, Anirudh" <anirudh.venkataramanan@intel.com>
Subject: Re: [PATCH net 1/1] ixgbe: Add locking to prevent panic when setting sriov_numvfs to zero
Date: Mon, 16 Aug 2021 17:52:43 +0000	[thread overview]
Message-ID: <31f33e9ced63115b66ede5ff1e385105be076f15.camel@intel.com> (raw)
In-Reply-To: <20210813172033.2c5c9101@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>

On Fri, 2021-08-13 at 17:20 -0700, Jakub Kicinski wrote:
> On Thu, 12 Aug 2021 10:18:56 -0700 Tony Nguyen wrote:
> > diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
> > b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
> > index 214a38de3f41..0a1a8756f1fd 100644
> > --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
> > +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
> > @@ -206,8 +206,12 @@ int ixgbe_disable_sriov(struct ixgbe_adapter
> > *adapter)
> >  	unsigned int num_vfs = adapter->num_vfs, vf;
> >  	int rss;
> >  
> > +	while (test_and_set_bit(__IXGBE_DISABLING_VFS, &adapter-
> > >state))
> > +		usleep_range(1000, 2000);
> > +
> >  	/* set num VFs to 0 to prevent access to vfinfo */
> >  	adapter->num_vfs = 0;
> > +	clear_bit(__IXGBE_DISABLING_VFS, &adapter->state);
> >  
> >  	/* put the reference to all of the vf devices */
> >  	for (vf = 0; vf < num_vfs; ++vf) {
> > @@ -1307,6 +1311,9 @@ void ixgbe_msg_task(struct ixgbe_adapter
> > *adapter)
> >  	struct ixgbe_hw *hw = &adapter->hw;
> >  	u32 vf;
> >  
> > +	if (test_and_set_bit(__IXGBE_DISABLING_VFS, &adapter->state))
> > +		return;
> > +
> >  	for (vf = 0; vf < adapter->num_vfs; vf++) {
> >  		/* process any reset requests */
> >  		if (!ixgbe_check_for_rst(hw, vf))
> > @@ -1320,6 +1327,7 @@ void ixgbe_msg_task(struct ixgbe_adapter
> > *adapter)
> >  		if (!ixgbe_check_for_ack(hw, vf))
> >  			ixgbe_rcv_ack_from_vf(adapter, vf);
> >  	}
> > +	clear_bit(__IXGBE_DISABLING_VFS, &adapter->state);
> 
> Like I've already said two or three times. No flag based locking.

Ken,

Did you want to make this change or did you want Intel to do it?

Thanks,
Tony



  reply	other threads:[~2021-08-16 17:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-12 17:18 [PATCH net 1/1] ixgbe: Add locking to prevent panic when setting sriov_numvfs to zero Tony Nguyen
2021-08-14  0:20 ` Jakub Kicinski
2021-08-16 17:52   ` Nguyen, Anthony L [this message]
2021-08-17 10:23     ` Ken Cox
  -- strict thread matches above, loose matches on Subject: below --
2022-06-28 16:53 Tony Nguyen
2022-06-28 17:27 ` Jakub Kicinski
2022-06-30 10:08   ` Piotr Skajewski
2022-06-30 15:11     ` Jakub Kicinski
2022-07-01  8:31       ` Piotr Skajewski

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=31f33e9ced63115b66ede5ff1e385105be076f15.camel@intel.com \
    --to=anthony.l.nguyen@intel.com \
    --cc=anirudh.venkataramanan@intel.com \
    --cc=davem@davemloft.net \
    --cc=jkc@redhat.com \
    --cc=kuba@kernel.org \
    --cc=lihong.yang@intel.com \
    --cc=marek.szlosek@intel.com \
    --cc=netdev@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).