From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 9996CA04DD;
	Wed, 18 Nov 2020 18:01:17 +0100 (CET)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id B5827C8F8;
	Wed, 18 Nov 2020 18:00:31 +0100 (CET)
Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])
 by dpdk.org (Postfix) with ESMTP id 66F4558C4
 for <dev@dpdk.org>; Wed, 18 Nov 2020 18:00:25 +0100 (CET)
Received: from Internal Mail-Server by MTLPINE1 (envelope-from
 michaelba@nvidia.com) with SMTP; 18 Nov 2020 19:00:19 +0200
Received: from nvidia.com (pegasus07.mtr.labs.mlnx [10.210.16.112])
 by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 0AIH0Iwb005874;
 Wed, 18 Nov 2020 19:00:19 +0200
From: Michael Baum <michaelba@nvidia.com>
To: dev@dpdk.org
Cc: Matan Azrad <matan@nvidia.com>, Raslan Darawsheh <rasland@nvidia.com>,
 Viacheslav Ovsiienko <viacheslavo@nvidia.com>, stable@dpdk.org
Date: Wed, 18 Nov 2020 17:00:10 +0000
Message-Id: <1605718811-18652-6-git-send-email-michaelba@nvidia.com>
X-Mailer: git-send-email 1.8.3.1
In-Reply-To: <1605718811-18652-1-git-send-email-michaelba@nvidia.com>
References: <1605718811-18652-1-git-send-email-michaelba@nvidia.com>
Subject: [dpdk-dev] [PATCH 6/7] regex/mlx5: improve constants type in QP
	buffers creation
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

The constant representing the size of the metadata is defined as a
regular number (32-bit signed), even though all of its uses request an
unsigned int variable.
Similarly the constant representing the maximal output is also defined
as a regular number, even though all of its uses request an unsigned int
variable.

Change the type of the above constants to unsigned.

Fixes: 5f41b66d12cd ("regex/mlx5: setup fast path")
Cc: stable@dpdk.org

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
---
 drivers/regex/mlx5/mlx5_regex_fastpath.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/regex/mlx5/mlx5_regex_fastpath.c b/drivers/regex/mlx5/mlx5_regex_fastpath.c
index 2549547..32ba19f 100644
--- a/drivers/regex/mlx5/mlx5_regex_fastpath.c
+++ b/drivers/regex/mlx5/mlx5_regex_fastpath.c
@@ -3,6 +3,8 @@
  */
 
 #include <unistd.h>
+#include <strings.h>
+#include <stdint.h>
 #include <sys/mman.h>
 
 #include <rte_malloc.h>
@@ -17,15 +19,14 @@
 #include <mlx5_glue.h>
 #include <mlx5_common.h>
 #include <mlx5_prm.h>
-#include <strings.h>
 
 #include "mlx5_regex_utils.h"
 #include "mlx5_rxp.h"
 #include "mlx5_regex.h"
 
 #define MLX5_REGEX_MAX_WQE_INDEX 0xffff
-#define MLX5_REGEX_METADATA_SIZE 64
-#define MLX5_REGEX_MAX_OUTPUT (1 << 11)
+#define MLX5_REGEX_METADATA_SIZE UINT32_C(64)
+#define MLX5_REGEX_MAX_OUTPUT (UINT32_C(1) << 11)
 #define MLX5_REGEX_WQE_CTRL_OFFSET 12
 #define MLX5_REGEX_WQE_METADATA_OFFSET 16
 #define MLX5_REGEX_WQE_GATHER_OFFSET 32
-- 
1.8.3.1