From: Gowrishankar <gowrishankar.m@linux.vnet.ibm.com>
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: [dpdk-dev] [PATCH] event/dpaa: fix integer overflow on max_event_ports at compile time
Date: Fri, 13 Apr 2018 10:36:31 +0530 [thread overview]
Message-ID: <1103cd020ba0357f46650c6de1807cbf35d2a83c.1523595512.git.gowrishankar.m@linux.vnet.ibm.com> (raw)
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
next reply other threads:[~2018-04-13 5:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-13 5:06 Gowrishankar [this message]
2018-04-13 6:51 ` Sunil Kumar Kori
2018-04-16 14:45 ` Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1103cd020ba0357f46650c6de1807cbf35d2a83c.1523595512.git.gowrishankar.m@linux.vnet.ibm.com \
--to=gowrishankar.m@linux.vnet.ibm.com \
--cc=anatoly.burakov@intel.com \
--cc=dev@dpdk.org \
--cc=shreyansh.jain@nxp.com \
--cc=sunil.kori@nxp.com \
--cc=thomas@monjalon.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).