From: Gowrishankar Muthukrishnan Date: Fri, 13 Apr 2018 05:06:31 +0000 (+0530) Subject: event/dpaa: fix integer overflow of max ports X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=100915c0a51121fdbbb3be04aa73823f54e20cda;p=dpdk.git event/dpaa: fix integer overflow of max ports 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 --- 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)