DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Nikhil Rao <nikhil.rao@intel.com>,
	Jerin Jacob <jerin.jacob@caviumnetworks.com>
Cc: dev@dpdk.org, Ferruh Yigit <ferruh.yigit@intel.com>, stable@dpdk.org
Subject: [dpdk-dev] [PATCH] eventdev: fix build related to port id storage size
Date: Thu, 10 May 2018 01:45:45 +0100	[thread overview]
Message-ID: <20180510004546.88230-1-ferruh.yigit@intel.com> (raw)

When CONFIG_RTE_MAX_ETHPORTS more than 255 getting following build
error with gcc, gcc (GCC) 7.3.1

.../lib/librte_eventdev/rte_event_eth_rx_adapter.c:
   In function ‘eth_poll_wrr_calc’:
.../build/include/rte_ethdev.h:1328:23:
   error: comparison is always true due to limited range of data type
          [-Werror=type-limits]
       (unsigned int)p < (unsigned int)RTE_MAX_ETHPORTS; \
                       ^
.../build/include/rte_ethdev.h:1345:2:
   note: in expansion of macro ‘RTE_ETH_FOREACH_DEV_OWNED_BY’
  RTE_ETH_FOREACH_DEV_OWNED_BY(p, RTE_ETH_DEV_NO_OWNER)
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
.../lib/librte_eventdev/rte_event_eth_rx_adapter.c:220:3:
   note: in expansion of macro ‘RTE_ETH_FOREACH_DEV’
   RTE_ETH_FOREACH_DEV(d) {
   ^~~~~~~~~~~~~~~~~~~

Same for
rte_event_eth_rx_adapter.c:220:3 & rte_event_eth_rx_adapter.c:921:2

The storage type of the variable used in RTE_ETH_FOREACH_DEV is uint8_t
which is causing the build error.

port_id storage type is increased to uint16_t, fixing storage type fixes
the build error.

Fixes: 9c38b704d280 ("eventdev: add eth Rx adapter implementation")
Cc: stable@dpdk.org
Cc: nikhil.rao@intel.com

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
Patch rebased on next-eventdev.

Cc: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Cc: Nikhil Rao <nikhil.rao@intel.com>

There are a few uint8_t storage type on suspicious variable names like
uint8_t eth_dev_id, not sure if this is ethdev port_id. It can be good
to double check storage size.
---
 lib/librte_eventdev/rte_event_eth_rx_adapter.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/librte_eventdev/rte_event_eth_rx_adapter.c b/lib/librte_eventdev/rte_event_eth_rx_adapter.c
index 4c0c02530..9016bb950 100644
--- a/lib/librte_eventdev/rte_event_eth_rx_adapter.c
+++ b/lib/librte_eventdev/rte_event_eth_rx_adapter.c
@@ -190,7 +190,7 @@ wrr_next(struct rte_event_eth_rx_adapter *rx_adapter,
 static int
 eth_poll_wrr_calc(struct rte_event_eth_rx_adapter *rx_adapter)
 {
-	uint8_t d;
+	uint16_t d;
 	uint16_t q;
 	unsigned int i;
 
@@ -859,7 +859,7 @@ rte_event_eth_rx_adapter_create_ext(uint8_t id, uint8_t dev_id,
 	struct rte_event_eth_rx_adapter *rx_adapter;
 	int ret;
 	int socket_id;
-	uint8_t i;
+	uint16_t i;
 	char mem_name[ETH_RX_ADAPTER_SERVICE_NAME_LEN];
 	const uint8_t default_rss_key[] = {
 		0x6d, 0x5a, 0x56, 0xda, 0x25, 0x5b, 0x0e, 0xc2,
-- 
2.14.3

             reply	other threads:[~2018-05-10  0:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-10  0:45 Ferruh Yigit [this message]
2018-05-10 19:54 ` Ferruh Yigit

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=20180510004546.88230-1-ferruh.yigit@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=dev@dpdk.org \
    --cc=jerin.jacob@caviumnetworks.com \
    --cc=nikhil.rao@intel.com \
    --cc=stable@dpdk.org \
    /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).