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]
Message-ID: <6e0c7231-9fbb-e7ac-61e4-ba4e774a7692@cogentembedded.com>
Date:   Thu, 20 Feb 2020 12:55:37 +0300
From:   Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
To:     Jeff Kirsher <jeffrey.t.kirsher@...el.com>, davem@...emloft.net
Cc:     Avinash Dayanand <avinash.dayanand@...el.com>,
        netdev@...r.kernel.org, nhorman@...hat.com, sassmann@...hat.com,
        Scott Register <scottx.register@...el.com>,
        Andrew Bowers <andrewx.bowers@...el.com>
Subject: Re: [net-next 06/13] ice: Report correct DCB mode

On 20.02.2020 1:06, Jeff Kirsher wrote:

> From: Avinash Dayanand <avinash.dayanand@...el.com>
> 
> Add code to detect if DCB is in IEEE or CEE mode. Without this the code
> will always report as IEEE mode which is incorrect and confuses the
> user.
> 
> Signed-off-by: Avinash Dayanand <avinash.dayanand@...el.com>
> Signed-off-by: Scott Register <scottx.register@...el.com>
> Tested-by: Andrew Bowers <andrewx.bowers@...el.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@...el.com>
> ---
>   drivers/net/ethernet/intel/ice/ice_dcb_lib.c | 27 +++++++++++++++++---
>   1 file changed, 24 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/ice/ice_dcb_lib.c b/drivers/net/ethernet/intel/ice/ice_dcb_lib.c
> index 1c118e7bab88..16656b6c3d09 100644
> --- a/drivers/net/ethernet/intel/ice/ice_dcb_lib.c
> +++ b/drivers/net/ethernet/intel/ice/ice_dcb_lib.c
> @@ -62,6 +62,26 @@ u8 ice_dcb_get_ena_tc(struct ice_dcbx_cfg *dcbcfg)
>   	return ena_tc;
>   }
>   
> +/**
> + * ice_dcb_get_mode - gets the DCB mode
> + * @port_info: pointer to port info structure
> + * @host: if set it's HOST if not it's MANAGED
> + */
> +static u8 ice_dcb_get_mode(struct ice_port_info *port_info, bool host)
> +{
> +	u8 mode;
> +
> +	if (host)
> +		mode = DCB_CAP_DCBX_HOST;
> +	else
> +		mode = DCB_CAP_DCBX_LLD_MANAGED;
> +
> +	if (port_info->local_dcbx_cfg.dcbx_mode & ICE_DCBX_MODE_CEE)
> +		return (mode | DCB_CAP_DCBX_VER_CEE);
> +	else
> +		return (mode | DCB_CAP_DCBX_VER_IEEE);

    () not really needed here and above.

[...]

MBR, Sergei

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ