From patchwork Thu May 10 00:45:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ferruh Yigit X-Patchwork-Id: 39658 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8833A1B7B4; Thu, 10 May 2018 02:46:00 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 65A8F1B73C; Thu, 10 May 2018 02:45:58 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 May 2018 17:45:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,383,1520924400"; d="scan'208";a="57368936" Received: from silpixa00399777.ir.intel.com (HELO silpixa00399777.ger.corp.intel.com) ([10.237.222.236]) by orsmga002.jf.intel.com with ESMTP; 09 May 2018 17:45:55 -0700 From: Ferruh Yigit To: Nikhil Rao , Jerin Jacob Cc: dev@dpdk.org, Ferruh Yigit , stable@dpdk.org Date: Thu, 10 May 2018 01:45:45 +0100 Message-Id: <20180510004546.88230-1-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.14.3 MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH] eventdev: fix build related to port id storage size X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- Patch rebased on next-eventdev. Cc: Jerin Jacob Cc: Nikhil Rao 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,