netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leon Romanovsky <leonro@nvidia.com>
To: Tony Nguyen <anthony.l.nguyen@intel.com>
Cc: <davem@davemloft.net>, <kuba@kernel.org>, <pabeni@redhat.com>,
	<edumazet@google.com>, Dave Ertman <david.m.ertman@intel.com>,
	<netdev@vger.kernel.org>,
	Michal Swiatkowski <michal.swiatkowski@linux.intel.com>,
	Gurucharan G <gurucharanx.g@intel.com>
Subject: Re: [PATCH net v3 1/2] ice: Prevent set_channel from changing queues while RDMA active
Date: Sun, 22 Jan 2023 14:37:09 +0200	[thread overview]
Message-ID: <Y80t9Q8699GV8ejm@unreal> (raw)
In-Reply-To: <20230120211231.431147-2-anthony.l.nguyen@intel.com>

On Fri, Jan 20, 2023 at 01:12:30PM -0800, Tony Nguyen wrote:
> From: Dave Ertman <david.m.ertman@intel.com>
> 
> The PF controls the set of queues that the RDMA auxiliary_driver requests
> resources from.  The set_channel command will alter that pool and trigger a
> reconfiguration of the VSI, which breaks RDMA functionality.
> 
> Prevent set_channel from executing when RDMA driver bound to auxiliary
> device.
> 
> Fixes: 348048e724a0 ("ice: Implement iidc operations")
> Co-developed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
> Signed-off-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
> Signed-off-by: Dave Ertman <david.m.ertman@intel.com>
> Tested-by: Gurucharan G <gurucharanx.g@intel.com> (A Contingent worker at Intel)
> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
> ---
>  drivers/net/ethernet/intel/ice/ice_ethtool.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/net/ethernet/intel/ice/ice_ethtool.c b/drivers/net/ethernet/intel/ice/ice_ethtool.c
> index 4191994d8f3a..16006eedfceb 100644
> --- a/drivers/net/ethernet/intel/ice/ice_ethtool.c
> +++ b/drivers/net/ethernet/intel/ice/ice_ethtool.c
> @@ -3705,6 +3705,14 @@ static int ice_set_channels(struct net_device *dev, struct ethtool_channels *ch)
>  		return -EINVAL;
>  	}
>  
> +	mutex_lock(&pf->adev_mutex);
> +	if (pf->adev && pf->adev->dev.driver) {

adev_mutex protects pf->adev, but not .driver, isn't it?

> +		netdev_err(dev, "Cannot change channels when RDMA is active\n");
> +		mutex_unlock(&pf->adev_mutex);
> +		return -EINVAL;
> +	}
> +	mutex_unlock(&pf->adev_mutex);
> +
>  	ice_vsi_recfg_qs(vsi, new_rx, new_tx);
>  
>  	if (!netif_is_rxfh_configured(dev))
> -- 
> 2.38.1
> 

  reply	other threads:[~2023-01-22 12:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-20 21:12 [PATCH net v3 0/2][pull request] Intel Wired LAN Driver Updates 2023-01-20 (ice) Tony Nguyen
2023-01-20 21:12 ` [PATCH net v3 1/2] ice: Prevent set_channel from changing queues while RDMA active Tony Nguyen
2023-01-22 12:37   ` Leon Romanovsky [this message]
2023-01-20 21:12 ` [PATCH net v3 2/2] ice: Fix broken link in ice NAPI doc Tony Nguyen

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=Y80t9Q8699GV8ejm@unreal \
    --to=leonro@nvidia.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=davem@davemloft.net \
    --cc=david.m.ertman@intel.com \
    --cc=edumazet@google.com \
    --cc=gurucharanx.g@intel.com \
    --cc=kuba@kernel.org \
    --cc=michal.swiatkowski@linux.intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@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;
as well as URLs for NNTP newsgroup(s).