DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] event/dpaa: fix integer overflow on max_event_ports at compile time
@ 2018-04-13  5:06 Gowrishankar
  2018-04-13  6:51 ` Sunil Kumar Kori
  0 siblings, 1 reply; 3+ messages in thread
From: Gowrishankar @ 2018-04-13  5:06 UTC (permalink / raw)
  To: Sunil Kumar Kori, Shreyansh Jain
  Cc: Anatoly Burakov, dev, Thomas Monjalon, Gowrishankar Muthukrishnan

From: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>

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.

Fixes: 9caac5dd1e ("event/dpaa: introduce PMD")

Signed-off-by: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>

--

dpdk/drivers/event/dpaa/dpaa_eventdev.c: In function ‘dpaa_event_dev_info_get’:
dpdk/ppc_64-power8-linuxapp-gcc/include/rte_config.h:23:23: error: large integer implicitly truncated to unsigned type [-Werror=overflow]
 #define RTE_MAX_LCORE 256
                       ^
dpdk/drivers/event/dpaa/dpaa_eventdev.h:29:36: note: in expansion of macro ‘RTE_MAX_LCORE’
 #define DPAA_EVENT_MAX_EVENT_PORT  RTE_MAX_LCORE
                                    ^~~~~~~~~~~~~
dpdk/drivers/event/dpaa/dpaa_eventdev.c:197:3: note: in expansion of macro ‘DPAA_EVENT_MAX_EVENT_PORT’
   DPAA_EVENT_MAX_EVENT_PORT;
   ^~~~~~~~~~~~~~~~~~~~~~~~~

 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 918fe35..583e46c 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)
-- 
1.9.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] event/dpaa: fix integer overflow on max_event_ports at compile time
  2018-04-13  5:06 [dpdk-dev] [PATCH] event/dpaa: fix integer overflow on max_event_ports at compile time Gowrishankar
@ 2018-04-13  6:51 ` Sunil Kumar Kori
  2018-04-16 14:45   ` Thomas Monjalon
  0 siblings, 1 reply; 3+ messages in thread
From: Sunil Kumar Kori @ 2018-04-13  6:51 UTC (permalink / raw)
  To: Gowrishankar, Shreyansh Jain; +Cc: Anatoly Burakov, dev, Thomas Monjalon

> -----Original Message-----
> From: Gowrishankar [mailto:gowrishankar.m@linux.vnet.ibm.com]
> Sent: Friday, April 13, 2018 10:37 AM
> To: Sunil Kumar Kori <sunil.kori@nxp.com>; Shreyansh Jain
> <shreyansh.jain@nxp.com>
> Cc: Anatoly Burakov <anatoly.burakov@intel.com>; dev@dpdk.org; Thomas
> Monjalon <thomas@monjalon.net>; Gowrishankar Muthukrishnan
> <gowrishankar.m@linux.vnet.ibm.com>
> Subject: [PATCH] event/dpaa: fix integer overflow on max_event_ports at
> compile time
> 
> From: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
> 
> 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.
> 
> Fixes: 9caac5dd1e ("event/dpaa: introduce PMD")
> 
> Signed-off-by: Gowrishankar Muthukrishnan
> <gowrishankar.m@linux.vnet.ibm.com>
> 

Acked-by: Sunil Kumar Kori <sunil.kori@nxp.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] event/dpaa: fix integer overflow on max_event_ports at compile time
  2018-04-13  6:51 ` Sunil Kumar Kori
@ 2018-04-16 14:45   ` Thomas Monjalon
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2018-04-16 14:45 UTC (permalink / raw)
  To: Gowrishankar; +Cc: dev, Sunil Kumar Kori, Shreyansh Jain, Anatoly Burakov

> > From: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
> > 
> > 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.
> > 
> > Fixes: 9caac5dd1e ("event/dpaa: introduce PMD")

Cc: stable@dpdk.org
 
> > Signed-off-by: Gowrishankar Muthukrishnan
> > <gowrishankar.m@linux.vnet.ibm.com>
> > 
> 
> Acked-by: Sunil Kumar Kori <sunil.kori@nxp.com>

Applied, thanks

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-04-16 14:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-13  5:06 [dpdk-dev] [PATCH] event/dpaa: fix integer overflow on max_event_ports at compile time Gowrishankar
2018-04-13  6:51 ` Sunil Kumar Kori
2018-04-16 14:45   ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).