From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8F301426D6; Sat, 7 Oct 2023 04:34:30 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BA93C40A7D; Sat, 7 Oct 2023 04:34:08 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2108.outbound.protection.outlook.com [40.107.93.108]) by mails.dpdk.org (Postfix) with ESMTP id 0AAA340A6C for ; Sat, 7 Oct 2023 04:34:06 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NlgZ1MZ2SAR46GmdegP82T7+FB13zYcDjt0rh3ue1RMO8cRYmQ3ktI62TxhGO9CTlb/uc6Jbk/NUEwGTOqh8M5Ddr6AX24eFPbtlJE5KmhPD2AVAZr5+6rAawjHz5ioNH5xlSupKTZ9vDVNRCKCb2k8q+hQC9XEML0nAnK5OqllYQj7NaLQ/9wYR/P8ZBQ6MmZJZvQFg78NSQnQgJlJMfFTNAfp/nRwwcDETKbeSQgW3OWafMVlAZdobZ4BpIcqhIt0buA2i/B4bqboJSqYEwaIltqX+vs9DbNr+rIGnnA0MIAl5hfJf280rZANuU5gmcm4cpqQAE4sGPL48LI/AJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=gDCg0FTEyvmnctj4XSM0Ma8YfuByetGBc+HvHTIzZlg=; b=gaDp1cx6/GnYk6Zdn7wp66403pdHdd2/uogTLynTZAoU82kXwfO+SuNr9TWZLAWGGC9vhMSJfvb6aGH04h9XksbLfr3+pO9xiES24LLUg/hrT5kl9DB8UODe6ShdUWrnLlfpj1AX/ZwDvjI2g2Ia8QOxUUpPZzvAWvuF9VdgPw/U4uJn7U5f4f5gHcSVtCHJKhhcSen2MLcKWDUOOMxjnI4hSK1NdtfBogQxvDcYiQyX3Xa/NtdB0dkb5gW6jJooSoAwJMUeRG4ltAbOJWHTF3zhC2X/+cdFjrW/4NqAgQUB4BUznz/qH4R5PAe1k2n41Hmr/+vu3cKLKeenryWKbQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gDCg0FTEyvmnctj4XSM0Ma8YfuByetGBc+HvHTIzZlg=; b=P0COn/1E6pIcBYuXsDq3E4KOR3UHV94XYFYvR6DUz2CZRDJx98EnerNYw028ncKoJ+Fy9HlUS7faX9Ryl3SrBHsMKg4C6YSYWxZlx5bfdQTJ2+OQrrlqN0cAtOJgIUlsX0VlL9GsBJIi8y5oSR8GeYXFZXQPsmh/WyFBD/WK2q4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) by SA0PR13MB3936.namprd13.prod.outlook.com (2603:10b6:806:97::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.38; Sat, 7 Oct 2023 02:34:04 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::28c0:63e2:ecd1:9314]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::28c0:63e2:ecd1:9314%4]) with mapi id 15.20.6813.027; Sat, 7 Oct 2023 02:34:04 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Chaoyong He , Long Wu , Peng Zhang Subject: [PATCH 03/11] net/nfp: unify the type of integer variable Date: Sat, 7 Oct 2023 10:33:31 +0800 Message-Id: <20231007023339.1546659-4-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20231007023339.1546659-1-chaoyong.he@corigine.com> References: <20231007023339.1546659-1-chaoyong.he@corigine.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SJ0PR03CA0212.namprd03.prod.outlook.com (2603:10b6:a03:39f::7) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|SA0PR13MB3936:EE_ X-MS-Office365-Filtering-Correlation-Id: 5195df8b-0d1f-4731-c509-08dbc6dddf2f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: EWK3cx0Q2HfuHk0HpDAMOV7yb47RHdqi1vXSKo/sOmcyZ2hMH+Qdk3i84n4O1plAe9uN5Gcj7Kt0AjgrOI3g7rD/zBFFTuml64FQeQcsd+JEl5NZPEQFTX9gu+olT9RmvM1PAL6P5zo5t8s3wLFBLTtZO7cCMqFniA2TPhgg3ABZ4iU27UWht+IFNUeX+u+dOC8DxVOi7vug2K9tM9IEWNQyCLxbSuOCR2uFV14xF8g08cRMbQCnaaNKaCKxbYEYtLT2leEU3Mps4DgEPGR2crGTqoM/kuTQQNrNeblvzibgXtFoFzMYFxSJuE6WW0B/bWB9jpfDejgLKpFM3cr374TvuU77qavxdE09gFMGBGP+jo/xw3HhLdFsYMe+RYY0Ts3lF0JDdaL6QI5WnqnQIV1hDGvG8EsMkUoD/JLv3KEkNTtJN5u+tTIEpAJdkE15gbXoOhgVsKJ/qdGHEKBx/CXtpPoGnxA4yPtBV/MZ89P1n79QmdKkkZDSeg1PiovqP19x8Q+ThXQfCAWqG3ewQ9QQf2U4DoJzkopFpYCjB+mH8FKHmpg+9KL/x3Dop8nJyTcShJcfXz47oI5jMsesnQQTlxScVXB6ExtqMz1vs5OxWZQ57DswugurigMP9yaU15CwM3tYmv+WLJuYB13RAIxPA6ACoET9ThgdEVUmY+o= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR13MB5545.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(366004)(376002)(346002)(396003)(39830400003)(136003)(230922051799003)(186009)(1800799009)(64100799003)(451199024)(6666004)(6506007)(52116002)(6512007)(478600001)(6486002)(26005)(107886003)(1076003)(6916009)(316002)(30864003)(41300700001)(2906002)(44832011)(66476007)(8936002)(5660300002)(4326008)(54906003)(66556008)(66946007)(36756003)(8676002)(86362001)(38350700002)(38100700002)(2616005)(83380400001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?Xb5x8FrWVhVoXDfEbgMwjsu/w8qXFLMPo7yEZec9A4c2HWV2FpeT5To33ivM?= =?us-ascii?Q?Tb53Qjkq7fM+hTlL+EgjFnyGsvkw4zQXuRpkE9W9CDPYCSBF4Jrfvgg4Fm1+?= =?us-ascii?Q?qL5QTZdGobzH4BNFuxsdW17/y1s7cSFzbg8zoKUh7anCpsAQzGlaBzVdW4cE?= =?us-ascii?Q?69EZFQpp0IcjA8PlylQ52OTiDyuWTdBxW51rn6AqCp7N+Or7WHPZrf4+7/8f?= =?us-ascii?Q?Ox7q8Thr5Rxv+trYb4jEIzDPw45OwZluwmd6MvKHg3uQhKYZWB/V9ikJ6y6S?= =?us-ascii?Q?Pyu46hMtsbyTZIvZHr7cS7Azh3rK5H2W6axwZK7XqD5XyY7N0EL9dtry9x5o?= =?us-ascii?Q?NuD34KfwdoYK+LZJsaaDZ++c46lVnsyrP01aJPpGzQpncSTHHBKNmLbuuaoc?= =?us-ascii?Q?ZB/Bqv2mk/FQI4KUxy2l4y9GDW9BqJsd9R294Z8fBa9dS1ALi+8ZfashLumv?= =?us-ascii?Q?fJqaWHWVTf4KsGSSkKGWoq1tSbxMiWmL0/e70M4rOT6aYBOVBEzwz8DjP2Ts?= =?us-ascii?Q?1fx1sZ5Y6Mh4Dm0vgmL0CNF8obdBI8RVRyF1h+5SFPwJd9n1LMzVI96fzoQb?= =?us-ascii?Q?pNuRtp1I1wYgikJ4IejnAuGaseBuQfSNjS+rMO8JJAEUBD5OSoE41fbPnjbF?= =?us-ascii?Q?J7rr0xMyvCCKF+jHP7Jd1JfJww7po9hCs7v3VPspgPnuvcrBYroyFlU9IxYt?= =?us-ascii?Q?wEIUFyDyyFJO7Dlo6NonZjHiGXySPDa/6nCxOUXMPwq0AIXtB4bqVqt2Wbge?= =?us-ascii?Q?TxESwC87b43hL0IHGRnxgY3gd70twK63FgHN2i6MuUkS8XU8EhCwsoqkQVkI?= =?us-ascii?Q?J/nZcRMDISm1cvr5rzgLlLf0wAzYd0chesZFhG/YGjJUVaxkcCmahJrth8zF?= =?us-ascii?Q?n1/ZWguF+gQUofZewe7lmIJG4N2rHgDuG9n9MPFyUCwC3OPDGpPAZFv73sF5?= =?us-ascii?Q?1t55CfFIkd817t+LDUt93N+2slBcMHg5iEstqQMg9p2RcBf8WZO2rduPfZRX?= =?us-ascii?Q?+kXnFBfzhpKID3lRp3d/ow4MWO3xv+3gzW6v7oETXu7Y+A4Jzr3CegLuWMn2?= =?us-ascii?Q?m+ra4VuWnnCl2w39P48Y8hEaI77CQkNmD/GT6A/8fxNrGW3yRsiAUJgY+7Iq?= =?us-ascii?Q?HFEa4V7gNSFDVIhhsproiGXjRvyViaxNDWntxbj/HTIFNsnfL7DL4QjsnfBe?= =?us-ascii?Q?zkQ3FwISIQ3+cdEpBriomY6Zzef4Z7BV29ei8rX9VinWZ7lwCqwPXKH9pJR+?= =?us-ascii?Q?nUoEVCB7WUQZRYMr0JvLZfsnUWCKMj1lqJuiTmYz/0TaVbMJ9DWWaQ4CzfA3?= =?us-ascii?Q?W9BFCtbU64zkp6asAgGysBBws/eVo8sFi/GlKBdju0scKXZuvNUw2E6Ylln5?= =?us-ascii?Q?IH4YDzHL1fHJKR0iJF4XmxLFsAjs6WpVIlleAN9rU80ZjJIl+C2ns0zhagsB?= =?us-ascii?Q?l8CIoAudfkGLMVGFZwmDf9FAY7Z+ZQODBFu6Y5Ih41bFvlcMF+YTwJV2t9L8?= =?us-ascii?Q?ofwGgkAGxGHJK7sIBLQa5POf++tmQallYLBr5qZS1pDjeu43xaPQp7mV32ZV?= =?us-ascii?Q?87FKvfnXfcG/5TFn/Hvb6jAGDcjGS1eyrXClPsTsKa5QH88945OGhPCc+JDf?= =?us-ascii?Q?dA=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5195df8b-0d1f-4731-c509-08dbc6dddf2f X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Oct 2023 02:34:04.0617 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: QkrFKAhrWyL8xc13KeXfRyC8q1WONN56w50ghV522lOMKLJqhdrAqyUjXO4LY/uZNPjBRsa27Ahw8j5i7qN4YA7cJQE0ViJyfDGPgAT8FyY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR13MB3936 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Unify the type of integer variable to the DPDK prefer style. Signed-off-by: Chaoyong He Reviewed-by: Long Wu Reviewed-by: Peng Zhang --- drivers/net/nfp/flower/nfp_flower.c | 2 +- drivers/net/nfp/flower/nfp_flower_cmsg.c | 16 +++++----- drivers/net/nfp/nfd3/nfp_nfd3_dp.c | 6 ++-- drivers/net/nfp/nfp_common.c | 37 +++++++++++++----------- drivers/net/nfp/nfp_common.h | 16 +++++----- drivers/net/nfp/nfp_ethdev.c | 24 +++++++-------- drivers/net/nfp/nfp_ethdev_vf.c | 2 +- drivers/net/nfp/nfp_flow.c | 4 +-- drivers/net/nfp/nfp_rxtx.c | 12 ++++---- drivers/net/nfp/nfp_rxtx.h | 2 +- 10 files changed, 62 insertions(+), 59 deletions(-) diff --git a/drivers/net/nfp/flower/nfp_flower.c b/drivers/net/nfp/flower/nfp_flower.c index 59717fa6b1..bd961043b2 100644 --- a/drivers/net/nfp/flower/nfp_flower.c +++ b/drivers/net/nfp/flower/nfp_flower.c @@ -26,7 +26,7 @@ nfp_pf_repr_enable_queues(struct rte_eth_dev *dev) { struct nfp_net_hw *hw; uint64_t enabled_queues = 0; - int i; + uint16_t i; struct nfp_flower_representor *repr; repr = dev->data->dev_private; diff --git a/drivers/net/nfp/flower/nfp_flower_cmsg.c b/drivers/net/nfp/flower/nfp_flower_cmsg.c index 6b9532f5b6..5d6912b079 100644 --- a/drivers/net/nfp/flower/nfp_flower_cmsg.c +++ b/drivers/net/nfp/flower/nfp_flower_cmsg.c @@ -64,10 +64,10 @@ nfp_flower_cmsg_mac_repr_init(struct rte_mbuf *mbuf, static void nfp_flower_cmsg_mac_repr_fill(struct rte_mbuf *m, - unsigned int idx, - unsigned int nbi, - unsigned int nbi_port, - unsigned int phys_port) + uint8_t idx, + uint32_t nbi, + uint32_t nbi_port, + uint32_t phys_port) { struct nfp_flower_cmsg_mac_repr *msg; @@ -81,11 +81,11 @@ nfp_flower_cmsg_mac_repr_fill(struct rte_mbuf *m, int nfp_flower_cmsg_mac_repr(struct nfp_app_fw_flower *app_fw_flower) { - int i; + uint8_t i; uint16_t cnt; - unsigned int nbi; - unsigned int nbi_port; - unsigned int phys_port; + uint32_t nbi; + uint32_t nbi_port; + uint32_t phys_port; struct rte_mbuf *mbuf; struct nfp_eth_table *nfp_eth_table; diff --git a/drivers/net/nfp/nfd3/nfp_nfd3_dp.c b/drivers/net/nfp/nfd3/nfp_nfd3_dp.c index 64928254d8..5a84629ed7 100644 --- a/drivers/net/nfp/nfd3/nfp_nfd3_dp.c +++ b/drivers/net/nfp/nfd3/nfp_nfd3_dp.c @@ -227,9 +227,9 @@ nfp_net_nfd3_xmit_pkts_common(void *tx_queue, uint16_t nb_pkts, bool repr_flag) { - int i; - int pkt_size; - int dma_size; + uint16_t i; + uint32_t pkt_size; + uint16_t dma_size; uint8_t offset; uint64_t dma_addr; uint16_t free_descs; diff --git a/drivers/net/nfp/nfp_common.c b/drivers/net/nfp/nfp_common.c index 9719a9212b..cb2c2afbd7 100644 --- a/drivers/net/nfp/nfp_common.c +++ b/drivers/net/nfp/nfp_common.c @@ -199,7 +199,7 @@ static int __nfp_net_reconfig(struct nfp_net_hw *hw, uint32_t update) { - int cnt; + uint32_t cnt; uint32_t new; struct timespec wait; @@ -229,7 +229,7 @@ __nfp_net_reconfig(struct nfp_net_hw *hw, } if (cnt >= NFP_NET_POLL_TIMEOUT) { PMD_INIT_LOG(ERR, "Reconfig timeout for 0x%08x after" - " %dms", update, cnt); + " %ums", update, cnt); return -EIO; } nanosleep(&wait, 0); /* waiting for a 1ms */ @@ -466,7 +466,7 @@ nfp_net_enable_queues(struct rte_eth_dev *dev) { struct nfp_net_hw *hw; uint64_t enabled_queues = 0; - int i; + uint16_t i; hw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private); @@ -575,7 +575,7 @@ nfp_configure_rx_interrupt(struct rte_eth_dev *dev, struct rte_intr_handle *intr_handle) { struct nfp_net_hw *hw; - int i; + uint16_t i; if (rte_intr_vec_list_alloc(intr_handle, "intr_vec", dev->data->nb_rx_queues) != 0) { @@ -832,7 +832,7 @@ int nfp_net_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) { - int i; + uint16_t i; struct nfp_net_hw *hw; struct rte_eth_stats nfp_dev_stats; @@ -923,7 +923,7 @@ nfp_net_stats_get(struct rte_eth_dev *dev, int nfp_net_stats_reset(struct rte_eth_dev *dev) { - int i; + uint16_t i; struct nfp_net_hw *hw; hw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private); @@ -1398,7 +1398,7 @@ nfp_rx_queue_intr_enable(struct rte_eth_dev *dev, { struct rte_pci_device *pci_dev; struct nfp_net_hw *hw; - int base = 0; + uint16_t base = 0; hw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private); pci_dev = RTE_ETH_DEV_TO_PCI(dev); @@ -1419,7 +1419,7 @@ nfp_rx_queue_intr_disable(struct rte_eth_dev *dev, { struct rte_pci_device *pci_dev; struct nfp_net_hw *hw; - int base = 0; + uint16_t base = 0; hw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private); pci_dev = RTE_ETH_DEV_TO_PCI(dev); @@ -1619,9 +1619,10 @@ nfp_net_rss_reta_write(struct rte_eth_dev *dev, struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t reta_size) { - uint32_t reta, mask; - int i, j; - int idx, shift; + uint8_t mask; + uint32_t reta; + uint16_t i, j; + uint16_t idx, shift; struct nfp_net_hw *hw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private); @@ -1695,8 +1696,9 @@ nfp_net_reta_query(struct rte_eth_dev *dev, struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t reta_size) { - uint8_t i, j, mask; - int idx, shift; + uint16_t i, j; + uint8_t mask; + uint16_t idx, shift; uint32_t reta; struct nfp_net_hw *hw; @@ -1720,7 +1722,7 @@ nfp_net_reta_query(struct rte_eth_dev *dev, /* Handling 4 RSS entries per loop */ idx = i / RTE_ETH_RETA_GROUP_SIZE; shift = i % RTE_ETH_RETA_GROUP_SIZE; - mask = (uint8_t)((reta_conf[idx].mask >> shift) & 0xF); + mask = (reta_conf[idx].mask >> shift) & 0xF; if (mask == 0) continue; @@ -1744,7 +1746,7 @@ nfp_net_rss_hash_write(struct rte_eth_dev *dev, uint64_t rss_hf; uint32_t cfg_rss_ctrl = 0; uint8_t key; - int i; + uint8_t i; hw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private); @@ -1835,7 +1837,7 @@ nfp_net_rss_hash_conf_get(struct rte_eth_dev *dev, uint64_t rss_hf; uint32_t cfg_rss_ctrl; uint8_t key; - int i; + uint8_t i; struct nfp_net_hw *hw; hw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private); @@ -1893,7 +1895,8 @@ nfp_net_rss_config_default(struct rte_eth_dev *dev) struct rte_eth_rss_reta_entry64 nfp_reta_conf[2]; uint16_t rx_queues = dev->data->nb_rx_queues; uint16_t queue; - int i, j, ret; + uint8_t i, j; + int ret; PMD_DRV_LOG(INFO, "setting default RSS conf for %u queues", rx_queues); diff --git a/drivers/net/nfp/nfp_common.h b/drivers/net/nfp/nfp_common.h index e4fd394868..71153ea25b 100644 --- a/drivers/net/nfp/nfp_common.h +++ b/drivers/net/nfp/nfp_common.h @@ -245,14 +245,14 @@ nn_writeq(uint64_t val, */ static inline uint8_t nn_cfg_readb(struct nfp_net_hw *hw, - int off) + uint32_t off) { return nn_readb(hw->ctrl_bar + off); } static inline void nn_cfg_writeb(struct nfp_net_hw *hw, - int off, + uint32_t off, uint8_t val) { nn_writeb(val, hw->ctrl_bar + off); @@ -260,14 +260,14 @@ nn_cfg_writeb(struct nfp_net_hw *hw, static inline uint16_t nn_cfg_readw(struct nfp_net_hw *hw, - int off) + uint32_t off) { return rte_le_to_cpu_16(nn_readw(hw->ctrl_bar + off)); } static inline void nn_cfg_writew(struct nfp_net_hw *hw, - int off, + uint32_t off, uint16_t val) { nn_writew(rte_cpu_to_le_16(val), hw->ctrl_bar + off); @@ -275,14 +275,14 @@ nn_cfg_writew(struct nfp_net_hw *hw, static inline uint32_t nn_cfg_readl(struct nfp_net_hw *hw, - int off) + uint32_t off) { return rte_le_to_cpu_32(nn_readl(hw->ctrl_bar + off)); } static inline void nn_cfg_writel(struct nfp_net_hw *hw, - int off, + uint32_t off, uint32_t val) { nn_writel(rte_cpu_to_le_32(val), hw->ctrl_bar + off); @@ -290,14 +290,14 @@ nn_cfg_writel(struct nfp_net_hw *hw, static inline uint64_t nn_cfg_readq(struct nfp_net_hw *hw, - int off) + uint32_t off) { return rte_le_to_cpu_64(nn_readq(hw->ctrl_bar + off)); } static inline void nn_cfg_writeq(struct nfp_net_hw *hw, - int off, + uint32_t off, uint64_t val) { nn_writeq(rte_cpu_to_le_64(val), hw->ctrl_bar + off); diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c index 65473d87e8..140d20dcf7 100644 --- a/drivers/net/nfp/nfp_ethdev.c +++ b/drivers/net/nfp/nfp_ethdev.c @@ -23,7 +23,7 @@ static int nfp_net_pf_read_mac(struct nfp_app_fw_nic *app_fw_nic, - int port) + uint16_t port) { struct nfp_eth_table *nfp_eth_table; struct nfp_net_hw *hw = NULL; @@ -255,7 +255,7 @@ nfp_net_close(struct rte_eth_dev *dev) struct rte_pci_device *pci_dev; struct nfp_pf_dev *pf_dev; struct nfp_app_fw_nic *app_fw_nic; - int i; + uint8_t i; if (rte_eal_process_type() != RTE_PROC_PRIMARY) return 0; @@ -487,7 +487,7 @@ nfp_net_init(struct rte_eth_dev *eth_dev) struct rte_ether_addr *tmp_ether_addr; uint64_t rx_base; uint64_t tx_base; - int port = 0; + uint16_t port = 0; int err; PMD_INIT_FUNC_TRACE(); @@ -501,7 +501,7 @@ nfp_net_init(struct rte_eth_dev *eth_dev) app_fw_nic = NFP_PRIV_TO_APP_FW_NIC(pf_dev->app_fw_priv); port = ((struct nfp_net_hw *)eth_dev->data->dev_private)->idx; - if (port < 0 || port > 7) { + if (port > 7) { PMD_DRV_LOG(ERR, "Port value is wrong"); return -ENODEV; } @@ -761,10 +761,10 @@ static int nfp_init_app_fw_nic(struct nfp_pf_dev *pf_dev, const struct nfp_dev_info *dev_info) { - int i; + uint8_t i; int ret; int err = 0; - int total_vnics; + uint32_t total_vnics; struct nfp_net_hw *hw; unsigned int numa_node; struct rte_eth_dev *eth_dev; @@ -785,7 +785,7 @@ nfp_init_app_fw_nic(struct nfp_pf_dev *pf_dev, /* Read the number of vNIC's created for the PF */ total_vnics = nfp_rtsym_read_le(pf_dev->sym_tbl, "nfd_cfg_pf0_num_ports", &err); - if (err != 0 || total_vnics <= 0 || total_vnics > 8) { + if (err != 0 || total_vnics == 0 || total_vnics > 8) { PMD_INIT_LOG(ERR, "nfd_cfg_pf0_num_ports symbol with wrong value"); ret = -ENODEV; goto app_cleanup; @@ -795,7 +795,7 @@ nfp_init_app_fw_nic(struct nfp_pf_dev *pf_dev, * For coreNIC the number of vNICs exposed should be the same as the * number of physical ports */ - if (total_vnics != (int)nfp_eth_table->count) { + if (total_vnics != nfp_eth_table->count) { PMD_INIT_LOG(ERR, "Total physical ports do not match number of vNICs"); ret = -ENODEV; goto app_cleanup; @@ -1053,15 +1053,15 @@ nfp_secondary_init_app_fw_nic(struct rte_pci_device *pci_dev, struct nfp_rtsym_table *sym_tbl, struct nfp_cpp *cpp) { - int i; + uint32_t i; int err = 0; int ret = 0; - int total_vnics; + uint32_t total_vnics; struct nfp_net_hw *hw; /* Read the number of vNIC's created for the PF */ total_vnics = nfp_rtsym_read_le(sym_tbl, "nfd_cfg_pf0_num_ports", &err); - if (err != 0 || total_vnics <= 0 || total_vnics > 8) { + if (err != 0 || total_vnics == 0 || total_vnics > 8) { PMD_INIT_LOG(ERR, "nfd_cfg_pf0_num_ports symbol with wrong value"); return -ENODEV; } @@ -1069,7 +1069,7 @@ nfp_secondary_init_app_fw_nic(struct rte_pci_device *pci_dev, for (i = 0; i < total_vnics; i++) { struct rte_eth_dev *eth_dev; char port_name[RTE_ETH_NAME_MAX_LEN]; - snprintf(port_name, sizeof(port_name), "%s_port%d", + snprintf(port_name, sizeof(port_name), "%s_port%u", pci_dev->device.name, i); PMD_INIT_LOG(DEBUG, "Secondary attaching to port %s", port_name); diff --git a/drivers/net/nfp/nfp_ethdev_vf.c b/drivers/net/nfp/nfp_ethdev_vf.c index ac6a10685d..892300a909 100644 --- a/drivers/net/nfp/nfp_ethdev_vf.c +++ b/drivers/net/nfp/nfp_ethdev_vf.c @@ -260,7 +260,7 @@ nfp_netvf_init(struct rte_eth_dev *eth_dev) uint64_t tx_bar_off = 0, rx_bar_off = 0; uint32_t start_q; - int port = 0; + uint16_t port = 0; int err; const struct nfp_dev_info *dev_info; diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c index 156b9599db..a254d839ff 100644 --- a/drivers/net/nfp/nfp_flow.c +++ b/drivers/net/nfp/nfp_flow.c @@ -2001,7 +2001,7 @@ nfp_flow_compile_item_proc(struct nfp_flower_representor *repr, char **mbuf_off_mask, bool is_outer_layer) { - int i; + uint32_t i; int ret = 0; bool continue_flag = true; const struct rte_flow_item *item; @@ -2235,7 +2235,7 @@ nfp_flow_action_set_ipv6(char *act_data, const struct rte_flow_action *action, bool ip_src_flag) { - int i; + uint32_t i; rte_be32_t tmp; size_t act_size; struct nfp_fl_act_set_ipv6_addr *set_ip; diff --git a/drivers/net/nfp/nfp_rxtx.c b/drivers/net/nfp/nfp_rxtx.c index 7885166753..8cbb9b74a2 100644 --- a/drivers/net/nfp/nfp_rxtx.c +++ b/drivers/net/nfp/nfp_rxtx.c @@ -190,7 +190,7 @@ nfp_net_rx_fill_freelist(struct nfp_net_rxq *rxq) { struct nfp_net_dp_buf *rxe = rxq->rxbufs; uint64_t dma_addr; - unsigned int i; + uint16_t i; PMD_RX_LOG(DEBUG, "Fill Rx Freelist for %u descriptors", rxq->rx_count); @@ -229,7 +229,7 @@ nfp_net_rx_fill_freelist(struct nfp_net_rxq *rxq) int nfp_net_rx_freelist_setup(struct rte_eth_dev *dev) { - int i; + uint16_t i; for (i = 0; i < dev->data->nb_rx_queues; i++) { if (nfp_net_rx_fill_freelist(dev->data->rx_queues[i]) != 0) @@ -840,7 +840,7 @@ nfp_net_recv_pkts(void *rx_queue, static void nfp_net_rx_queue_release_mbufs(struct nfp_net_rxq *rxq) { - unsigned int i; + uint16_t i; if (rxq->rxbufs == NULL) return; @@ -992,11 +992,11 @@ nfp_net_rx_queue_setup(struct rte_eth_dev *dev, * @txq: TX queue to work with * Returns number of descriptors freed */ -int +uint32_t nfp_net_tx_free_bufs(struct nfp_net_txq *txq) { uint32_t qcp_rd_p; - int todo; + uint32_t todo; PMD_TX_LOG(DEBUG, "queue %hu. Check for descriptor with a complete" " status", txq->qidx); @@ -1032,7 +1032,7 @@ nfp_net_tx_free_bufs(struct nfp_net_txq *txq) static void nfp_net_tx_queue_release_mbufs(struct nfp_net_txq *txq) { - unsigned int i; + uint32_t i; if (txq->txbufs == NULL) return; diff --git a/drivers/net/nfp/nfp_rxtx.h b/drivers/net/nfp/nfp_rxtx.h index 9a30ebd89e..98ef6c3d93 100644 --- a/drivers/net/nfp/nfp_rxtx.h +++ b/drivers/net/nfp/nfp_rxtx.h @@ -253,7 +253,7 @@ int nfp_net_tx_queue_setup(struct rte_eth_dev *dev, uint16_t nb_desc, unsigned int socket_id, const struct rte_eth_txconf *tx_conf); -int nfp_net_tx_free_bufs(struct nfp_net_txq *txq); +uint32_t nfp_net_tx_free_bufs(struct nfp_net_txq *txq); void nfp_net_set_meta_vlan(struct nfp_net_meta_raw *meta_data, struct rte_mbuf *pkt, uint8_t layer); -- 2.39.1