lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 28 Apr 2022 18:10:49 +0000
From:   "Maloszewski, Michal" <michal.maloszewski@...el.com>
To:     Jakub Kicinski <kuba@...nel.org>,
        "Nguyen, Anthony L" <anthony.l.nguyen@...el.com>
CC:     "davem@...emloft.net" <davem@...emloft.net>,
        "pabeni@...hat.com" <pabeni@...hat.com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "sassmann@...hat.com" <sassmann@...hat.com>,
        Sylwester Dziedziuch <sylwesterx.dziedziuch@...el.com>,
        "Jankowski, Konrad0" <konrad0.jankowski@...el.com>
Subject: RE: [PATCH net 1/2] iavf: Fix error when changing ring parameters on
 ice PF

Hi,

>Can't we wait for the device to get into the right state?
>Throwing EAGAIN back to user space is not very friendly.

When we have state which is running, it does not mean that we have queues configured on PF.  
So in order to configure queues on PF, the IAVF_FLAG_QUEUES has to be disabled.      
I use here EAGAIN, because as long as we are not configured with queues, it does not make any sense to trigger command and we are not sure when the configuration of queues will end - so that is why EAGAIN is used.
 
>nit: why add this check in the middle of input validation (i.e. checking the ring params are supported)?

You are right here, I changed the order of 'if' statements.

Thanks,
Michał Małoszewski

-----Original Message-----
From: Jakub Kicinski <kuba@...nel.org> 
Sent: Saturday, April 23, 2022 12:48 AM
To: Nguyen, Anthony L <anthony.l.nguyen@...el.com>
Cc: davem@...emloft.net; pabeni@...hat.com; Maloszewski, Michal <michal.maloszewski@...el.com>; netdev@...r.kernel.org; sassmann@...hat.com; Sylwester Dziedziuch <sylwesterx.dziedziuch@...el.com>; Jankowski, Konrad0 <konrad0.jankowski@...el.com>
Subject: Re: [PATCH net 1/2] iavf: Fix error when changing ring parameters on ice PF

On Wed, 20 Apr 2022 10:26:23 -0700 Tony Nguyen wrote:
> From: Michal Maloszewski <michal.maloszewski@...el.com>
> 
> Reset is triggered when ring parameters are being changed through 
> ethtool and queues are reconfigured for VF's VSI. If ring is changed 
> again immediately, then the next reset could be executed before queues 
> could be properly reinitialized on VF's VSI. It caused ice PF to mess 
> up the VSI resource tree.
> 
> Add a check in iavf_set_ringparam for adapter and VF's queue state. If 
> VF is currently resetting or queues are disabled for the VF return 
> with EAGAIN error.

Can't we wait for the device to get into the right state?
Throwing EAGAIN back to user space is not very friendly.

> diff --git a/drivers/net/ethernet/intel/iavf/iavf_ethtool.c 
> b/drivers/net/ethernet/intel/iavf/iavf_ethtool.c
> index 3bb56714beb0..08efbc50fbe9 100644
> --- a/drivers/net/ethernet/intel/iavf/iavf_ethtool.c
> +++ b/drivers/net/ethernet/intel/iavf/iavf_ethtool.c
> @@ -631,6 +631,11 @@ static int iavf_set_ringparam(struct net_device *netdev,
>  	if ((ring->rx_mini_pending) || (ring->rx_jumbo_pending))
>  		return -EINVAL;
>  
> +	if (adapter->state == __IAVF_RESETTING ||
> +	    (adapter->state == __IAVF_RUNNING &&
> +	     (adapter->flags & IAVF_FLAG_QUEUES_DISABLED)))
> +		return -EAGAIN;

nit: why add this check in the middle of input validation (i.e. checking the ring params are supported)?

>  	if (ring->tx_pending > IAVF_MAX_TXD ||
>  	    ring->tx_pending < IAVF_MIN_TXD ||
>  	    ring->rx_pending > IAVF_MAX_RXD ||

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ