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]
Message-ID: <20190812145023.GA22363@kroah.com>
Date:   Mon, 12 Aug 2019 16:50:23 +0200
From:   Greg KH <gregkh@...uxfoundation.org>
To:     Oded Gabbay <oded.gabbay@...il.com>
Cc:     linux-kernel@...r.kernel.org, Dotan Barak <dbarak@...ana.ai>
Subject: Re: [PATCH] habanalabs: explicitly set the queue-id enumerated
 numbers

On Mon, Aug 12, 2019 at 10:41:44AM +0300, Oded Gabbay wrote:
> From: Dotan Barak <dbarak@...ana.ai>
> 
> When looking at kernel log messages and when debugging user applications,
> we only see the queue id. This patch explicitly set the queue id in the
> queue enumeration which will be helpful for finding the queue name when we
> have its id.
> 
> Signed-off-by: Dotan Barak <dbarak@...ana.ai>
> Reviewed-by: Oded Gabbay <oded.gabbay@...il.com>
> Signed-off-by: Oded Gabbay <oded.gabbay@...il.com>
> ---
>  include/uapi/misc/habanalabs.h | 28 ++++++++++++++--------------
>  1 file changed, 14 insertions(+), 14 deletions(-)
> 
> diff --git a/include/uapi/misc/habanalabs.h b/include/uapi/misc/habanalabs.h
> index a5a1d0e7ec82..6cf50177cd21 100644
> --- a/include/uapi/misc/habanalabs.h
> +++ b/include/uapi/misc/habanalabs.h
> @@ -28,20 +28,20 @@
>  
>  enum goya_queue_id {
>  	GOYA_QUEUE_ID_DMA_0 = 0,
> -	GOYA_QUEUE_ID_DMA_1,
> -	GOYA_QUEUE_ID_DMA_2,
> -	GOYA_QUEUE_ID_DMA_3,
> -	GOYA_QUEUE_ID_DMA_4,
> -	GOYA_QUEUE_ID_CPU_PQ,
> -	GOYA_QUEUE_ID_MME,	/* Internal queues start here */
> -	GOYA_QUEUE_ID_TPC0,
> -	GOYA_QUEUE_ID_TPC1,
> -	GOYA_QUEUE_ID_TPC2,
> -	GOYA_QUEUE_ID_TPC3,
> -	GOYA_QUEUE_ID_TPC4,
> -	GOYA_QUEUE_ID_TPC5,
> -	GOYA_QUEUE_ID_TPC6,
> -	GOYA_QUEUE_ID_TPC7,
> +	GOYA_QUEUE_ID_DMA_1 = 1,
> +	GOYA_QUEUE_ID_DMA_2 = 2,
> +	GOYA_QUEUE_ID_DMA_3 = 3,
> +	GOYA_QUEUE_ID_DMA_4 = 4,
> +	GOYA_QUEUE_ID_CPU_PQ = 5,
> +	GOYA_QUEUE_ID_MME = 6,	/* Internal queues start here */
> +	GOYA_QUEUE_ID_TPC0 = 7,
> +	GOYA_QUEUE_ID_TPC1 = 8,
> +	GOYA_QUEUE_ID_TPC2 = 9,
> +	GOYA_QUEUE_ID_TPC3 = 10,
> +	GOYA_QUEUE_ID_TPC4 = 11,
> +	GOYA_QUEUE_ID_TPC5 = 12,
> +	GOYA_QUEUE_ID_TPC6 = 13,
> +	GOYA_QUEUE_ID_TPC7 = 14,
>  	GOYA_QUEUE_ID_SIZE
>  };

This is good anyway, uapi enums should ALWAYS be explicitly set,
otherwise you could have problems with different compilers setting the
values to different numbers.

Reviewed-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ