From 100915c0a51121fdbbb3be04aa73823f54e20cda Mon Sep 17 00:00:00 2001 From: Gowrishankar Muthukrishnan Date: Fri, 13 Apr 2018 10:36:31 +0530 Subject: [PATCH] event/dpaa: fix integer overflow of max ports MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit dev_info->max_event_ports is uint8_t. dpaa_event_dev_info_get assigns DPAA_EVENT_MAX_EVENT_PORT (which is RTE_MAX_LCORE, upto 256 in ppc64le) into this variable, which breaks compile in ppc64le. drivers/event/dpaa/dpaa_eventdev.c: In function ‘dpaa_event_dev_info_get’: rte_config.h:23:23: error: large integer implicitly truncated to unsigned type [-Werror=overflow] #define RTE_MAX_LCORE 256 Fixes: 9caac5dd1e ("event/dpaa: introduce PMD") Cc: stable@dpdk.org Signed-off-by: Gowrishankar Muthukrishnan Acked-by: Sunil Kumar Kori --- drivers/event/dpaa/dpaa_eventdev.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/event/dpaa/dpaa_eventdev.h b/drivers/event/dpaa/dpaa_eventdev.h index 918fe35ce9..583e46ca4a 100644 --- a/drivers/event/dpaa/dpaa_eventdev.h +++ b/drivers/event/dpaa/dpaa_eventdev.h @@ -26,7 +26,7 @@ #define DPAA_EVENT_MAX_QUEUE_FLOWS 2048 #define DPAA_EVENT_MAX_QUEUE_PRIORITY_LEVELS 8 #define DPAA_EVENT_MAX_EVENT_PRIORITY_LEVELS 0 -#define DPAA_EVENT_MAX_EVENT_PORT RTE_MAX_LCORE +#define DPAA_EVENT_MAX_EVENT_PORT RTE_MIN(RTE_MAX_LCORE, INT8_MAX) #define DPAA_EVENT_MAX_PORT_DEQUEUE_DEPTH 8 #define DPAA_EVENT_PORT_DEQUEUE_TIMEOUT_NS 100UL #define DPAA_EVENT_PORT_DEQUEUE_TIMEOUT_INVALID ((uint64_t)-1) -- 2.20.1