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] [day] [month] [year] [list]
Date:	Wed, 21 Aug 2013 10:10:53 +0300
From:	Amir Vadai <amirv.mellanox@...il.com>
To:	Joe Perches <joe@...ches.com>
CC:	Amir Vadai <amirv@...lanox.com>,
	"David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
	Eugenia Emantayev <eugenia@...lanox.com>
Subject: Re: [PATCH net-next V1 1/4] net/mlx4_en: Disable global flow control
 when PFC enabled

On 20/08/2013 19:58, Joe Perches wrote:
> On Tue, 2013-08-20 at 18:42 +0300, Amir Vadai wrote:
>> Fix a bug when FC and PFC are enabled/disabled at the same time.
>> According to ConnectX-3 Programmer Manual these two features are mutial
>> exclusive.  So make sure when enabling PFC to turn off global FC and
>> vise versa.  Otherwise it hurts the performance.
> []
>> diff --git a/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c b/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c
>> index 9d4a1ea..fcef764 100644
>> --- a/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c
>> +++ b/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c
>> @@ -169,7 +169,8 @@ static int mlx4_en_dcbnl_ieee_setpfc(struct net_device *dev,
>>  			pfc->mbc,
>>  			pfc->delay);
>>  
>> -	priv->prof->rx_pause = priv->prof->tx_pause = !!pfc->pfc_en;
>> +	priv->prof->rx_pause = !pfc->pfc_en;
>> +	priv->prof->tx_pause = !pfc->pfc_en;
>>  	priv->prof->rx_ppp = priv->prof->tx_ppp = pfc->pfc_en;
> 
> Just do the minimal change.
> 
> Otherwise, because you're using separate sets for the
> pause vars I think you should change the line below as
> well so a single style is used.
> 
> Maybe I'd just go ahead and use a temporary for prof too.
> ---
>  drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c | 15 +++++++++------
>  1 file changed, 9 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c b/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c
> index 9d4a1ea..45894c6 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c
> @@ -161,6 +161,7 @@ static int mlx4_en_dcbnl_ieee_setpfc(struct net_device *dev,
>  {
>  	struct mlx4_en_priv *priv = netdev_priv(dev);
>  	struct mlx4_en_dev *mdev = priv->mdev;
> +	struct mlx4_en_port_profile *prof = priv->prof;
>  	int err;
>  
>  	en_dbg(DRV, priv, "cap: 0x%x en: 0x%x mbc: 0x%x delay: %d\n",
> @@ -169,15 +170,17 @@ static int mlx4_en_dcbnl_ieee_setpfc(struct net_device *dev,
>  			pfc->mbc,
>  			pfc->delay);
>  
> -	priv->prof->rx_pause = priv->prof->tx_pause = !!pfc->pfc_en;
> -	priv->prof->rx_ppp = priv->prof->tx_ppp = pfc->pfc_en;
> +	prof->rx_pause = !pfc->pfc_en;
> +	prof->tx_pause = !pfc->pfc_en;
> +	prof->rx_ppp = pfc->pfc_en;
> +	prof->tx_ppp = pfc->pfc_en;
>  
>  	err = mlx4_SET_PORT_general(mdev->dev, priv->port,
>  				    priv->rx_skb_size + ETH_FCS_LEN,
> -				    priv->prof->tx_pause,
> -				    priv->prof->tx_ppp,
> -				    priv->prof->rx_pause,
> -				    priv->prof->rx_ppp);
> +				    prof->tx_pause,
> +				    prof->tx_ppp,
> +				    prof->rx_pause,
> +				    prof->rx_ppp);
>  	if (err)
>  		en_err(priv, "Failed setting pause params\n");
>  
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

Did as you suggested.

Thanks,
Amir
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ