From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50062.outbound.protection.outlook.com [40.107.5.62]) by dpdk.org (Postfix) with ESMTP id 1FDD02C6A for ; Sun, 6 May 2018 08:06:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=92c50VFdLe3K3EBP+QXeQfLc5uMwn8NFnq/NsPX4TRM=; b=yDpUQ+8oAtkK/8aI8B4XI9MKVmeo+s3kWMTdzP0O39vjBb94/dpbMsSAgptprhd0jc20kcCd5lfrx7VtH5juThldeKgO421U0LhIkLsNHSrCMF6ovtWOnoSM2KUbCbfXdX1hSFTKLU0qsSjHGCcjEdbw1bsqvmesjOki7iaSIpI= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; Received: from mellanox.com (141.226.120.58) by AM6PR05MB4422.eurprd05.prod.outlook.com (2603:10a6:209:43::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.735.16; Sun, 6 May 2018 06:06:45 +0000 From: Shahaf Shuler To: bluca@debian.org Cc: stable@dpdk.org, nelio.laranjeiro@6wind.com, yskoh@mellanox.com, adrien.mazarguil@6wind.com Date: Sun, 6 May 2018 09:05:43 +0300 Message-Id: X-Mailer: git-send-email 2.12.0 MIME-Version: 1.0 In-Reply-To: References: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Originating-IP: [141.226.120.58] X-ClientProxiedBy: LO2P265CA0008.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:62::20) To AM6PR05MB4422.eurprd05.prod.outlook.com (2603:10a6:209:43::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:AM6PR05MB4422; X-Microsoft-Exchange-Diagnostics: 1; AM6PR05MB4422; 3:tpI1kXhik1FPZG2e/zV+XYR1vTw8xwJETSf+s2bcGao6SFNAhnvR/fSHF/PnstG1zfLGzvOoWnnFnNPmE32CqC7HcnH93Ze0NYSMvaoRC+oVrM7SZfXP6cYyOm2Ay0MkOtdEnZP+o4lyvTkJx46osmlWEqANHHgbfxHZ8wRJM2qA69jS1SYUwXrzYAK4PIVC630zYvuPT6HF9jkzOLgeOxBfmGW9dc/Sb6X2ImIy6Tz3NtAVHqdqHVzp2t6qYw/+; 25:Td4H3rkyMLYTPbYTV4hMfihb+qmKh3Eqibx/XXeoENSdggJFfLTZ9AIrmi7FiBVsZY2QTuDUrXbXZbQAEm1WVmknYVlOUEjizIz+OWhFvBaaCAjcenU9BVNy2FlcmsahfSq0c2tjpFjAh4SVRkwTfX+W+YzJhLr83VcmZpalyVxgZm6qnPtCaS0IZNbx9Qok3iu6Xr8A5OcGgDScxc6sEsL5eyyiqm2NKFhypImFPJJxvPuSAwZUbVW+C5TwUiiy3+Akl+aRBwwxWY0FHUbDn3boe0iVxILRErcspvJtTgSAtYs3sDJl+7BV6YeOVqsuSazUgdWcMsBA8y+x1VETdQ==; 31:Pb/LPEIXHyYavxIh2BKl2fF35CkLPS7Dhg1D5l/Qe4ohSTS9T41JJNzRUP3xAJirVAXRFryQwajHXe5EJpS3rrhWdVA9ePF50KbbyshMMakaYRJ2/5d2HtKXY3dvGh/Qo7Z6M4JD+vb74DAVz1xE/pU8NxylukJBVT6O23lO6l1ITySP+wxbf1xhR+emhWI+VFPlt4i15gwO6gZqM7kRAo9UHwOyX9Ygq+OFHJYg3nE= X-MS-TrafficTypeDiagnostic: AM6PR05MB4422: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; AM6PR05MB4422; 20:exd+TQFfcr3jJdzQJ7MBwGBnVj9HRUDEV8IozMe7TgIefmntf/IOy57IZtImj4/Qn1AscecqlUSLBuE/nr/QZpum5rLM5qE37XJJZikN79sbGXHMIjR54kwoDtGVyVu2/lqoSBgL1BA2NaxfVjTchoRlz6vu3NmiF9ve/bFgasZu3PVhZo8FKbAWYKP3fTt9KBd8aQOlN5keLt8UIPFeQx460st02JvjGgXEBAFZF9s6Rxxo4lONKE9H4rbMVdyV0gpN+A5nxh1mfV29BH2bH6CeII032yNStc+mywgIb7bkMMiAb5rSmKyXK1m5dC6gZ00YaDYe3CmVU5Ty61633m/fHk6ZyVXEH5fSv098/UDuyLV3/h7VUReTVZD1tNzCvUf6Flb2gWTt/ZiPIekIr4/PzwVCVUFWXqqW8LgbVXGrV1kGzuzu1vjKlFKuEW4c1pZTFOmF89hqKRfo6OJwmDNLGBWMm7k2zPByZKIa5JipImH++AWF6SMuepm7NmDu; 4:602B4/XVLC6lrAwnMmESip0etlKwqrz8jrMTkMqb/buaHMRGeNB1eYMAja6zQSjW0SBQVe8Cg5EBuVa7ooyMj4EpJgscM2FolkBLk6t5kFIlrz9wqeSeDM/9JBKqQSVl+zBkVqPmVbmM58Q3dbj8xxhkLpBMpgRmXULql2XVAnYGyiniY3shYyezy2dyBynvRoArYeXcGZPGVThUoWJZntRakUU502vxBKg0rKBgGpUEQn/LxKPT6DkRsOvkVEGbiLsRW8MGsu3R9AFrfygM5A== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(3002001)(3231254)(944501410)(52105095)(93006095)(93001095)(6055026)(6041310)(20161123564045)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(6072148)(201708071742011); SRVR:AM6PR05MB4422; BCL:0; PCL:0; RULEID:; SRVR:AM6PR05MB4422; X-Forefront-PRVS: 06640999CA X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(376002)(39380400002)(396003)(346002)(39860400002)(189003)(199004)(105586002)(8676002)(8936002)(316002)(2351001)(53936002)(86362001)(2361001)(6116002)(3846002)(106356001)(118296001)(66066001)(36756003)(47776003)(81156014)(55016002)(2906002)(2870700001)(50226002)(4326008)(68736007)(305945005)(7736002)(81166006)(50466002)(25786009)(486006)(5660300001)(476003)(2616005)(69596002)(16526019)(26005)(59450400001)(386003)(97736004)(956004)(186003)(478600001)(7696005)(52116002)(23676004)(6916009)(21086003)(446003)(11346002)(76176011); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR05MB4422; H:mellanox.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtBTTZQUjA1TUI0NDIyOzIzOitYZy9oZTBTWnpLeUVsb3VWVkxDb29FTmFG?= =?utf-8?B?L0ZIR0tmbFVGYStHeXIvTkJtb2piTE5Pdk5INm93NFpvVXBhd3JjZDR5SXds?= =?utf-8?B?aUVFQ0plRmNzQjJGVnExSVBiOU1XM0RUZ2gybTBqUHBwZVZIRlJtcWEzWHIr?= =?utf-8?B?dzkxang3MjRXZ2tXT21KdG15YjloazVSbjdXSEZINHRkT2lOdmg4TTZxN3FS?= =?utf-8?B?UEwzeFU0b0lzZnRlRDVlbHhkOHd6WVBmbldPeWtWQ3FvK3ZLaUhwdEZIbU0r?= =?utf-8?B?MmwyTXdZSEl2WUNVUXV6cUpjQktIYmlFTWFPUklzbjJDUnhuVEZDaDZKVmFF?= =?utf-8?B?TjBvMldmTTBjVTB6UHpybHJ6dytvVEdIUmI0UmNEYVo5T0JidTdHNGgxaFhT?= =?utf-8?B?NTBKdjU2aWExR096M0pqNVB4eHdnTWM5V3k1Smx1TERCRUlSVFA1OTV6RGpu?= =?utf-8?B?QlVTZjdET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sFwhWdgRCy+0XbRszWcf96+Ix7Za+TKg==; 5:eYroqy22CCcKEEAHeBlKhBIeNPRmsvEDw+as2fPiZgNz/kub9CcMWL6r9O7LVoEs9wD9/0CSOkvw1MSt3/nkRUwjE4EMRJYKSH+2xi6agv4Kao4dIrkcZXd97s+rdNACyFoRfo7uzJUGsWaZEbtN00DONNkEtdp8qIdzQNDdYmA=; 24:721R4LaXeAx9fr4j1kzndENTRL7UfqQL/koDbk43syt/crLpP4xcYQdRFlLYaJTQpPN00Bd6ZjJcbLNo6eJFqnfzIuZDkcXEIj96IHax4bE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM6PR05MB4422; 7:I3LtB0Z8CmIu1jK9FKHUZna8SQGlbhfezObeRFD5ezGFOR3VLAwXMgCFL51XPZSipanoGYyfxDYn7QEDQDtcX76spZuyJBLRkF/7T8Zanqt5Jrvh/ta+YjI2mJQp70TQpJOlsMjTGjiggZvVy/bbjzaLLeW11CfaLNg587BCDoQAo5LDEfH4D0IRNJFzYf1E5cpqs48dIlpfApDRF9HjVAiGIldHG6+wKfb1vXNl8wcVenmKym0rgOyhK9mDa+O7 X-MS-Office365-Filtering-Correlation-Id: a2584e9a-c579-408e-d259-08d5b3178c1c X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 May 2018 06:06:45.3643 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a2584e9a-c579-408e-d259-08d5b3178c1c X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB4422 Subject: [dpdk-stable] [PATCH 14/33] net/mlx5: change non failing function return values X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 May 2018 06:06:47 -0000 From: NĂ©lio Laranjeiro [ upstream commit 925061b58b487fba57f55847b1447417fed715fb ] These functions return int although they are not supposed to fail, resulting in unnecessary checks in their callers. Some are returning error where is should be a boolean. Signed-off-by: Nelio Laranjeiro Acked-by: Adrien Mazarguil --- drivers/net/mlx5/mlx5.h | 4 ++-- drivers/net/mlx5/mlx5_mr.c | 4 ++-- drivers/net/mlx5/mlx5_rxq.c | 25 ++++++++++--------------- drivers/net/mlx5/mlx5_socket.c | 6 +----- drivers/net/mlx5/mlx5_trigger.c | 6 +----- drivers/net/mlx5/mlx5_txq.c | 17 ++++++----------- 6 files changed, 22 insertions(+), 40 deletions(-) diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index 2cb463b622..86310404a0 100644 --- a/drivers/net/mlx5/mlx5.h +++ b/drivers/net/mlx5/mlx5.h @@ -242,7 +242,7 @@ int mlx5_vlan_offload_set(struct rte_eth_dev *dev, int mask); int mlx5_dev_start(struct rte_eth_dev *dev); void mlx5_dev_stop(struct rte_eth_dev *dev); int mlx5_traffic_enable(struct rte_eth_dev *dev); -int mlx5_traffic_disable(struct rte_eth_dev *dev); +void mlx5_traffic_disable(struct rte_eth_dev *dev); int mlx5_traffic_restart(struct rte_eth_dev *dev); /* mlx5_flow.c */ @@ -287,7 +287,7 @@ void mlx5_flow_delete_drop_queue(struct rte_eth_dev *dev); /* mlx5_socket.c */ int mlx5_socket_init(struct rte_eth_dev *priv); -int mlx5_socket_uninit(struct rte_eth_dev *priv); +void mlx5_socket_uninit(struct rte_eth_dev *priv); void mlx5_socket_handle(struct rte_eth_dev *priv); int mlx5_socket_connect(struct rte_eth_dev *priv); diff --git a/drivers/net/mlx5/mlx5_mr.c b/drivers/net/mlx5/mlx5_mr.c index fe60dd1329..5c4e687369 100644 --- a/drivers/net/mlx5/mlx5_mr.c +++ b/drivers/net/mlx5/mlx5_mr.c @@ -307,7 +307,7 @@ mlx5_mr_get(struct rte_eth_dev *dev, struct rte_mempool *mp) * Pointer to memory region to release. * * @return - * 0 on success, errno on failure. + * 1 while a reference on it exists, 0 when freed. */ int mlx5_mr_release(struct mlx5_mr *mr) @@ -321,7 +321,7 @@ mlx5_mr_release(struct mlx5_mr *mr) rte_free(mr); return 0; } - return EBUSY; + return 1; } /** diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c index a3b08a1a3b..8e7693df2f 100644 --- a/drivers/net/mlx5/mlx5_rxq.c +++ b/drivers/net/mlx5/mlx5_rxq.c @@ -840,7 +840,7 @@ mlx5_rxq_ibv_get(struct rte_eth_dev *dev, uint16_t idx) * Verbs Rx queue object. * * @return - * 0 on success, errno value on failure. + * 1 while a reference on it exists, 0 when freed. */ int mlx5_rxq_ibv_release(struct mlx5_rxq_ibv *rxq_ibv) @@ -867,7 +867,7 @@ mlx5_rxq_ibv_release(struct mlx5_rxq_ibv *rxq_ibv) rte_free(rxq_ibv); return 0; } - return EBUSY; + return 1; } /** @@ -1074,7 +1074,7 @@ mlx5_rxq_get(struct rte_eth_dev *dev, uint16_t idx) * TX queue index. * * @return - * 0 on success, errno value on failure. + * 1 while a reference on it exists, 0 when freed. */ int mlx5_rxq_release(struct rte_eth_dev *dev, uint16_t idx) @@ -1086,13 +1086,8 @@ mlx5_rxq_release(struct rte_eth_dev *dev, uint16_t idx) return 0; rxq_ctrl = container_of((*priv->rxqs)[idx], struct mlx5_rxq_ctrl, rxq); assert(rxq_ctrl->priv); - if (rxq_ctrl->ibv) { - int ret; - - ret = mlx5_rxq_ibv_release(rxq_ctrl->ibv); - if (!ret) - rxq_ctrl->ibv = NULL; - } + if (rxq_ctrl->ibv && !mlx5_rxq_ibv_release(rxq_ctrl->ibv)) + rxq_ctrl->ibv = NULL; DEBUG("%p: Rx queue %p: refcnt %d", (void *)dev, (void *)rxq_ctrl, rte_atomic32_read(&rxq_ctrl->refcnt)); if (rte_atomic32_dec_and_test(&rxq_ctrl->refcnt)) { @@ -1101,7 +1096,7 @@ mlx5_rxq_release(struct rte_eth_dev *dev, uint16_t idx) (*priv->rxqs)[idx] = NULL; return 0; } - return EBUSY; + return 1; } /** @@ -1261,7 +1256,7 @@ mlx5_ind_table_ibv_get(struct rte_eth_dev *dev, uint16_t queues[], * Indirection table to release. * * @return - * 0 on success, errno value on failure. + * 1 while a reference on it exists, 0 when freed. */ int mlx5_ind_table_ibv_release(struct rte_eth_dev *dev, @@ -1281,7 +1276,7 @@ mlx5_ind_table_ibv_release(struct rte_eth_dev *dev, rte_free(ind_tbl); return 0; } - return EBUSY; + return 1; } /** @@ -1439,7 +1434,7 @@ mlx5_hrxq_get(struct rte_eth_dev *dev, uint8_t *rss_key, uint8_t rss_key_len, * Pointer to Hash Rx queue to release. * * @return - * 0 on success, errno value on failure. + * 1 while a reference on it exists, 0 when freed. */ int mlx5_hrxq_release(struct rte_eth_dev *dev, struct mlx5_hrxq *hrxq) @@ -1454,7 +1449,7 @@ mlx5_hrxq_release(struct rte_eth_dev *dev, struct mlx5_hrxq *hrxq) return 0; } claim_nonzero(mlx5_ind_table_ibv_release(dev, hrxq->ind_table)); - return EBUSY; + return 1; } /** diff --git a/drivers/net/mlx5/mlx5_socket.c b/drivers/net/mlx5/mlx5_socket.c index b8f610df30..8db25cff17 100644 --- a/drivers/net/mlx5/mlx5_socket.c +++ b/drivers/net/mlx5/mlx5_socket.c @@ -82,11 +82,8 @@ mlx5_socket_init(struct rte_eth_dev *dev) * * @param[in] dev * Pointer to Ethernet device. - * - * @return - * 0 on success, errno value on failure. */ -int +void mlx5_socket_uninit(struct rte_eth_dev *dev) { struct priv *priv = dev->data->dev_private; @@ -95,7 +92,6 @@ mlx5_socket_uninit(struct rte_eth_dev *dev) claim_zero(close(priv->primary_socket)); priv->primary_socket = 0; claim_zero(remove(path)); - return 0; } /** diff --git a/drivers/net/mlx5/mlx5_trigger.c b/drivers/net/mlx5/mlx5_trigger.c index 07226b8641..a3ccebdd66 100644 --- a/drivers/net/mlx5/mlx5_trigger.c +++ b/drivers/net/mlx5/mlx5_trigger.c @@ -363,17 +363,13 @@ mlx5_traffic_enable(struct rte_eth_dev *dev) * * @param dev * Pointer to Ethernet device private data. - * - * @return - * 0 on success. */ -int +void mlx5_traffic_disable(struct rte_eth_dev *dev) { struct priv *priv = dev->data->dev_private; mlx5_flow_list_flush(dev, &priv->ctrl_flows); - return 0; } /** diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c index 54ed972d71..a5e2c7fa71 100644 --- a/drivers/net/mlx5/mlx5_txq.c +++ b/drivers/net/mlx5/mlx5_txq.c @@ -572,7 +572,7 @@ mlx5_txq_ibv_get(struct rte_eth_dev *dev, uint16_t idx) * Verbs Tx queue object. * * @return - * 0 on success, errno on failure. + * 1 while a reference on it exists, 0 when freed. */ int mlx5_txq_ibv_release(struct mlx5_txq_ibv *txq_ibv) @@ -587,7 +587,7 @@ mlx5_txq_ibv_release(struct mlx5_txq_ibv *txq_ibv) rte_free(txq_ibv); return 0; } - return EBUSY; + return 1; } /** @@ -824,7 +824,7 @@ mlx5_txq_get(struct rte_eth_dev *dev, uint16_t idx) * TX queue index. * * @return - * 0 on success, errno on failure. + * 1 while a reference on it exists, 0 when freed. */ int mlx5_txq_release(struct rte_eth_dev *dev, uint16_t idx) @@ -839,13 +839,8 @@ mlx5_txq_release(struct rte_eth_dev *dev, uint16_t idx) txq = container_of((*priv->txqs)[idx], struct mlx5_txq_ctrl, txq); DEBUG("%p: Tx queue %p: refcnt %d", (void *)dev, (void *)txq, rte_atomic32_read(&txq->refcnt)); - if (txq->ibv) { - int ret; - - ret = mlx5_txq_ibv_release(txq->ibv); - if (!ret) - txq->ibv = NULL; - } + if (txq->ibv && !mlx5_txq_ibv_release(txq->ibv)) + txq->ibv = NULL; for (i = 0; i != MLX5_PMD_TX_MP_CACHE; ++i) { if (txq->txq.mp2mr[i]) { mlx5_mr_release(txq->txq.mp2mr[i]); @@ -862,7 +857,7 @@ mlx5_txq_release(struct rte_eth_dev *dev, uint16_t idx) (*priv->txqs)[idx] = NULL; return 0; } - return EBUSY; + return 1; } /** -- 2.12.0