From patchwork Fri Apr 13 05:06:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gowrishankar X-Patchwork-Id: 37985 X-Patchwork-Delegate: jerinj@marvell.com 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 1DEB31B72B; Fri, 13 Apr 2018 07:06:42 +0200 (CEST) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by dpdk.org (Postfix) with ESMTP id 419881B705 for ; Fri, 13 Apr 2018 07:06:40 +0200 (CEST) Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w3D56Fte041711 for ; Fri, 13 Apr 2018 01:06:39 -0400 Received: from e06smtp14.uk.ibm.com (e06smtp14.uk.ibm.com [195.75.94.110]) by mx0b-001b2d01.pphosted.com with ESMTP id 2hanbsscs0-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Fri, 13 Apr 2018 01:06:39 -0400 Received: from localhost by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 13 Apr 2018 06:06:37 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp14.uk.ibm.com (192.168.101.144) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 13 Apr 2018 06:06:34 +0100 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w3D56Xip262452; Fri, 13 Apr 2018 05:06:33 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D19FEA404D; Fri, 13 Apr 2018 05:58:48 +0100 (BST) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5EE01A4057; Fri, 13 Apr 2018 05:58:47 +0100 (BST) Received: from chozha.in.ibm.com (unknown [9.79.194.55]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 13 Apr 2018 05:58:47 +0100 (BST) From: Gowrishankar To: Sunil Kumar Kori , Shreyansh Jain Cc: Anatoly Burakov , dev@dpdk.org, Thomas Monjalon , Gowrishankar Muthukrishnan Date: Fri, 13 Apr 2018 10:36:31 +0530 X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 18041305-0044-0000-0000-00000546BFF0 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18041305-0045-0000-0000-00002886FD9D Message-Id: <1103cd020ba0357f46650c6de1807cbf35d2a83c.1523595512.git.gowrishankar.m@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-04-13_03:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1804130046 Subject: [dpdk-dev] [PATCH] event/dpaa: fix integer overflow on max_event_ports at compile time 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" From: Gowrishankar Muthukrishnan 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 Acked-by: Sunil Kumar Kori --- 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)