From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id BDE034CA6 for ; Wed, 15 May 2019 12:14:46 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE2 (envelope-from dekelp@mellanox.com) with ESMTPS (AES256-SHA encrypted); 15 May 2019 13:14:46 +0300 Received: from mtl-vdi-280.wap.labs.mlnx. (mtl-vdi-280.wap.labs.mlnx [10.128.130.87]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x4FAEkK6014316; Wed, 15 May 2019 13:14:46 +0300 From: Dekel Peled To: yskoh@mellanox.com, shahafs@mellanox.com Cc: dev@dpdk.org, orika@mellanox.com Date: Wed, 15 May 2019 13:11:38 +0300 Message-Id: X-Mailer: git-send-email 1.7.1 Subject: [dpdk-dev] [PATCH] net/mlx5: remove redundant size calculation macro 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: , X-List-Received-Date: Wed, 15 May 2019 10:14:47 -0000 Patch [1] added, among other definitions, the macro MLX5_ST_SZ_DB. Patch [2] added later the macro MLX5_ST_SZ_BYTES, which is exactly the same macro with a different name. Each of these macros was used in very few places. This patch removes the definition of MLX5_ST_SZ_DB, and replaces it with MLX5_ST_SZ_BYTES wherever it was used. Macro MLX5_ST_SZ_BYTES was preffered since it is the same macro name used in kernel code, see [3]. [1] http://patches.dpdk.org/patch/45254/ [2] http://patches.dpdk.org/patch/49403/ [3] https://lists.openwall.net/netdev/2014/10/02/75 Signed-off-by: Dekel Peled --- drivers/net/mlx5/mlx5_flow_dv.c | 4 ++-- drivers/net/mlx5/mlx5_prm.h | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index cf255ca..b9f42d6 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -2486,7 +2486,7 @@ struct field_modify_info modify_tcp[] = { "not enough memory to create flow"); return NULL; } - flow->dv.value.size = MLX5_ST_SZ_DB(fte_match_param); + flow->dv.value.size = MLX5_ST_SZ_BYTES(fte_match_param); return flow; } @@ -2510,7 +2510,7 @@ struct field_modify_info modify_tcp[] = { uint8_t *v = match_value; unsigned int i; - for (i = 0; i < MLX5_ST_SZ_DB(fte_match_param); ++i) { + for (i = 0; i < MLX5_ST_SZ_BYTES(fte_match_param); ++i) { if (v[i] & ~m[i]) { DRV_LOG(ERR, "match_value differs from match_criteria" diff --git a/drivers/net/mlx5/mlx5_prm.h b/drivers/net/mlx5/mlx5_prm.h index 8c42380..602a5ac 100644 --- a/drivers/net/mlx5/mlx5_prm.h +++ b/drivers/net/mlx5/mlx5_prm.h @@ -378,7 +378,6 @@ struct mlx5_modification_cmd { #define __mlx5_mask16(typ, fld) ((u16)((1ull << __mlx5_bit_sz(typ, fld)) - 1)) #define MLX5_ST_SZ_BYTES(typ) (sizeof(struct mlx5_ifc_##typ##_bits) / 8) #define MLX5_ST_SZ_DW(typ) (sizeof(struct mlx5_ifc_##typ##_bits) / 32) -#define MLX5_ST_SZ_DB(typ) (sizeof(struct mlx5_ifc_##typ##_bits) / 8) #define MLX5_BYTE_OFF(typ, fld) (__mlx5_bit_off(typ, fld) / 8) #define MLX5_ADDR_OF(typ, p, fld) ((char *)(p) + MLX5_BYTE_OFF(typ, fld)) -- 1.8.3.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 47803A00E6 for ; Wed, 15 May 2019 12:14:48 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8104D5F1C; Wed, 15 May 2019 12:14:47 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id BDE034CA6 for ; Wed, 15 May 2019 12:14:46 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE2 (envelope-from dekelp@mellanox.com) with ESMTPS (AES256-SHA encrypted); 15 May 2019 13:14:46 +0300 Received: from mtl-vdi-280.wap.labs.mlnx. (mtl-vdi-280.wap.labs.mlnx [10.128.130.87]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x4FAEkK6014316; Wed, 15 May 2019 13:14:46 +0300 From: Dekel Peled To: yskoh@mellanox.com, shahafs@mellanox.com Cc: dev@dpdk.org, orika@mellanox.com Date: Wed, 15 May 2019 13:11:38 +0300 Message-Id: X-Mailer: git-send-email 1.7.1 Subject: [dpdk-dev] [PATCH] net/mlx5: remove redundant size calculation macro 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" Content-Type: text/plain; charset="UTF-8" Message-ID: <20190515101138.OstK6LMMc60JSztE0rjri00XmGEqEGfmLAqu6deBjNo@z> Patch [1] added, among other definitions, the macro MLX5_ST_SZ_DB. Patch [2] added later the macro MLX5_ST_SZ_BYTES, which is exactly the same macro with a different name. Each of these macros was used in very few places. This patch removes the definition of MLX5_ST_SZ_DB, and replaces it with MLX5_ST_SZ_BYTES wherever it was used. Macro MLX5_ST_SZ_BYTES was preffered since it is the same macro name used in kernel code, see [3]. [1] http://patches.dpdk.org/patch/45254/ [2] http://patches.dpdk.org/patch/49403/ [3] https://lists.openwall.net/netdev/2014/10/02/75 Signed-off-by: Dekel Peled --- drivers/net/mlx5/mlx5_flow_dv.c | 4 ++-- drivers/net/mlx5/mlx5_prm.h | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index cf255ca..b9f42d6 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -2486,7 +2486,7 @@ struct field_modify_info modify_tcp[] = { "not enough memory to create flow"); return NULL; } - flow->dv.value.size = MLX5_ST_SZ_DB(fte_match_param); + flow->dv.value.size = MLX5_ST_SZ_BYTES(fte_match_param); return flow; } @@ -2510,7 +2510,7 @@ struct field_modify_info modify_tcp[] = { uint8_t *v = match_value; unsigned int i; - for (i = 0; i < MLX5_ST_SZ_DB(fte_match_param); ++i) { + for (i = 0; i < MLX5_ST_SZ_BYTES(fte_match_param); ++i) { if (v[i] & ~m[i]) { DRV_LOG(ERR, "match_value differs from match_criteria" diff --git a/drivers/net/mlx5/mlx5_prm.h b/drivers/net/mlx5/mlx5_prm.h index 8c42380..602a5ac 100644 --- a/drivers/net/mlx5/mlx5_prm.h +++ b/drivers/net/mlx5/mlx5_prm.h @@ -378,7 +378,6 @@ struct mlx5_modification_cmd { #define __mlx5_mask16(typ, fld) ((u16)((1ull << __mlx5_bit_sz(typ, fld)) - 1)) #define MLX5_ST_SZ_BYTES(typ) (sizeof(struct mlx5_ifc_##typ##_bits) / 8) #define MLX5_ST_SZ_DW(typ) (sizeof(struct mlx5_ifc_##typ##_bits) / 32) -#define MLX5_ST_SZ_DB(typ) (sizeof(struct mlx5_ifc_##typ##_bits) / 8) #define MLX5_BYTE_OFF(typ, fld) (__mlx5_bit_off(typ, fld) / 8) #define MLX5_ADDR_OF(typ, p, fld) ((char *)(p) + MLX5_BYTE_OFF(typ, fld)) -- 1.8.3.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 4899AA0AC5 for ; Sun, 26 May 2019 21:23:24 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E715E28F3; Sun, 26 May 2019 21:23:22 +0200 (CEST) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70073.outbound.protection.outlook.com [40.107.7.73]) by dpdk.org (Postfix) with ESMTP id 14E72F11 for ; Sun, 26 May 2019 21:23:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6jelTBcAriAqDemZCBHwX39Qsz8DZRzWwG3Guo7n0gc=; b=LzWzMl7N/ai7o/N9qHkMmnH96InWjZ6uJDMEnd7RP4EqG7cSPyf7NXnXsvIHk1+cITfJCfm4lJN+glfgEEn3BYLqqk/wYTJAPgviUyj5+KqZWyrn3g82QmnZ7d3/4ETD7POLycjq6Us6u6b4c6bVeH/JhpYdyndIu7bkQq+06yE= Received: from AM0PR0502MB3795.eurprd05.prod.outlook.com (52.133.45.150) by AM0PR0502MB3697.eurprd05.prod.outlook.com (52.133.46.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1922.18; Sun, 26 May 2019 19:23:20 +0000 Received: from AM0PR0502MB3795.eurprd05.prod.outlook.com ([fe80::8c0:a6ef:6abc:334d]) by AM0PR0502MB3795.eurprd05.prod.outlook.com ([fe80::8c0:a6ef:6abc:334d%7]) with mapi id 15.20.1922.021; Sun, 26 May 2019 19:23:20 +0000 From: Shahaf Shuler To: Shahaf Shuler , Yongseok Koh CC: "dev@dpdk.org" , Ori Kam , Dekel Peled Thread-Topic: [dpdk-dev] [PATCH] net/mlx5: remove redundant size calculation macro Thread-Index: AQHVE/h6i4hBy3UIwEyH8TIdYN21KA== Date: Sun, 26 May 2019 19:23:19 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 1.7.1 x-clientproxiedby: LO2P265CA0220.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:b::16) To AM0PR0502MB3795.eurprd05.prod.outlook.com (2603:10a6:208:1b::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-patchwork-submitter: Dekel Peled x-patchwork-id: 53428 x-patchwork-delegate: shahafs@mellanox.com x-originating-ip: [141.226.120.58] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b35bac6a-a86d-4bb5-745b-08d6e20f9c70 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020); SRVR:AM0PR0502MB3697; x-ms-traffictypediagnostic: AM0PR0502MB3697: x-ms-exchange-purlcount: 3 x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5236; x-forefront-prvs: 0049B3F387 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(346002)(39860400002)(366004)(396003)(136003)(189003)(199004)(2906002)(386003)(6512007)(81156014)(81166006)(6506007)(52116002)(36756003)(256004)(966005)(8676002)(25786009)(68736007)(4326008)(7736002)(6306002)(6116002)(86362001)(71200400001)(66066001)(71190400001)(6486002)(478600001)(4744005)(305945005)(3846002)(99286004)(14454004)(118296001)(102836004)(486006)(54906003)(53936002)(476003)(6436002)(2616005)(107886003)(316002)(26005)(85306007)(186003)(66946007)(8936002)(66476007)(6636002)(66556008)(64756008)(66446008)(50226002)(5660300002)(110136005)(73956011); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR0502MB3697; H:AM0PR0502MB3795.eurprd05.prod.outlook.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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 3cn+vlFf96XwqMvl819WvNSvbf8VIxuZn9SPfAaztQ8IHsa4aCTbdiysEEzY5vNYElWK+iwuSIqhUty7gjW2L/VhuDiGjRf2v7ptRHBXoXDFqZdc62Vvodo6Ow4V5Qp3jFQentsfUahuWnCak1bF5mS0utResEyChsjQiM6sU/LKeOV4K2jxL4+bsfyH0F6IDFwEcd0n55OGtrkwyQFmXIGDmTJX/d5rHOC48LUuJgV6/hTEoJP5ZTu31hjNRNtUZiG5Tu2smpuJqT1668/nBKM+o2xS9UemZzPzz989Zxp2UfPlHT8wQKKtMQdfTWqytIyK9HVUZed4PbPlRf6bAB+x+OjGJbMYuqgKipsGGUUVgdqEhc5BABsOvI6OSziWNpMmO4QOPwlbVMF7Lj6woDdyHc2vEU2qpMNNRJnKzIk= Content-Type: text/plain; charset="UTF-8" Content-ID: <3AB1EEAEB25683448E18F9C97CFC3CBC@eurprd05.prod.outlook.com> Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: b35bac6a-a86d-4bb5-745b-08d6e20f9c70 X-MS-Exchange-CrossTenant-originalarrivaltime: 26 May 2019 19:23:19.9904 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: shahafs@mellanox.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR0502MB3697 Subject: [dpdk-dev] [PATCH] net/mlx5: remove redundant size calculation macro 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" Message-ID: <20190526192319.X3957bAWU0PU_zdVQNVTKJO4GfyaoAr2n908Jw0zhaU@z> RnJvbTogRGVrZWwgUGVsZWQgPGRla2VscEBtZWxsYW5veC5jb20+DQoNCj5QYXRjaCBbMV0gYWRk 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