From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0085.outbound.protection.outlook.com [104.47.1.85]) by dpdk.org (Postfix) with ESMTP id 3E8211B121 for ; Mon, 8 Oct 2018 15:57:51 +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:X-MS-Exchange-SenderADCheck; bh=phVWPrL1oyXITty6fZ1IbmKr0Hyw2xMhRxnVEvkOkrI=; b=pCnQixLNbkgvcOA9HOqOIbBm6yhZM9BLlZnaWy2r9QQ61V2hbzEhQ5xBYcPw8oHHhP7WjYb3pqwgYAjCqsUpG6AG222inOXuHOU/f23XHrJ3AdsXYu6x8uUifiPqd1OBBEo2GhERE+95sWeB1OdTlwPwAIdrt29uWqqRdQ7i05o= Received: from AM4PR05MB3425.eurprd05.prod.outlook.com (10.171.187.142) by AM4PR05MB3426.eurprd05.prod.outlook.com (10.171.187.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.27; Mon, 8 Oct 2018 13:57:49 +0000 Received: from AM4PR05MB3425.eurprd05.prod.outlook.com ([fe80::fdeb:3890:f0f0:2202]) by AM4PR05MB3425.eurprd05.prod.outlook.com ([fe80::fdeb:3890:f0f0:2202%4]) with mapi id 15.20.1207.024; Mon, 8 Oct 2018 13:57:49 +0000 From: Ori Kam To: Dekel Peled , Yongseok Koh , Shahaf Shuler CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] net/mlx5: fix calculation of struct size in bytes Thread-Index: AQHUXwvwS/HTowbpvk2tLS2ulYTGcqUVXaeA Date: Mon, 8 Oct 2018 13:57:49 +0000 Message-ID: References: <1539005674-57499-1-git-send-email-dekelp@mellanox.com> In-Reply-To: <1539005674-57499-1-git-send-email-dekelp@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM4PR05MB3426; 6:GH3N5dWW09XHDlNCtPpowheCMMB9h3/h3OYcuATzWrt/26OakN9Q7ef+BEXQbGvSthNdg89qObziOtW5yjaCGkFJGLl9kdcd2/xVDIdyEwo8nfnKEHekZezH4WTzlS+Mgxay5W96stW9jgQmrCC06ow+DZFKPktGFmOCbdQvrYlQZa4VPTyjlJwm3i3NtHDyWi+5RX3Ei5u0ZIOpEKdyGR7LkhCaJNl3Ou7cNpDxLQ7+xtxpBUqhLXY5XJPDo/NihZQOvz4HuFe4q27xgGDk1X0yv8hV6xKaXasboTAYX1i394IaqLAtEVYn/qL7BrnMO+ykXenXUTi1QOXF5QjrBw4b3q4ynWzjY5Y3f81R6EMQi6N1E9YMQwmLpFWmwzVIn2MVkzqcmTQTZNSefWFfFX17bj6ZJDtzby/XGl1qji01s789PQ0zSu63z+8/Q0bF869uMuH9tfShQWOD4IGhvg==; 5:KcAGQEXDrgrw3RqVxA5W72mkfHCt6ZiGK9+uIFFdgp5E2ABj2Gj/l04/bk1hjr2xZm/nOLrxjO9G2rZzZktM/nvtBv3JJTv62VkrJKj6yU+PCm8outFYGrpTxmAEKFKug7HX8acTZcdD3oPb6WeCa5yT1siSEnEgD6pblrTy5W4=; 7:qLpkGrXJAdRz1xe89iS1l7VkoiRUWNIjUdggKf/sGP2VoRHRbU5Gbhaf2oRJ/V5iiwLzvMvXEuLpz2epLeALMR2Cu2A9GXd6XZ2MGf0pGRFVlo8DIpymFBA+FmgeUyLLsUsPy7mcgUN+4BeJLO9obTpw1+tC/YR5z/+T81nKw4MjrhwiacvLrKvQBrs5hoSTr2KFJnVVfrt6RR7MWtq7ojnfjcecVlgiPgk0b5OL0cW2K+TsIMgV6gnbcMoqGo6V x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 96bdd9db-15ed-4bab-0e5c-08d62d2608a2 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM4PR05MB3426; x-ms-traffictypediagnostic: AM4PR05MB3426: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(3231355)(944501410)(52105095)(10201501046)(6055026)(149066)(150057)(6041310)(20161123562045)(20161123558120)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991055); SRVR:AM4PR05MB3426; BCL:0; PCL:0; RULEID:; SRVR:AM4PR05MB3426; x-forefront-prvs: 081904387B x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(366004)(376002)(346002)(396003)(39860400002)(13464003)(199004)(189003)(6346003)(14444005)(6246003)(256004)(97736004)(186003)(8676002)(26005)(446003)(5250100002)(8936002)(81156014)(305945005)(81166006)(74316002)(7736002)(68736007)(476003)(486006)(71200400001)(71190400001)(11346002)(106356001)(25786009)(14454004)(4326008)(53936002)(66066001)(102836004)(2906002)(110136005)(6506007)(76176011)(478600001)(2900100001)(99286004)(6636002)(7696005)(316002)(86362001)(33656002)(105586002)(3846002)(6116002)(55016002)(6436002)(9686003)(53546011)(5660300001)(229853002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB3426; H:AM4PR05MB3425.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=orika@mellanox.com; x-microsoft-antispam-message-info: rlpbFpkB7aAAl351n2UaDkBoMY1KPSXPqzp5d3RYsNeMoQ/IyUpcxshM0CBGFCCOKwYj8FXSeAwbDG+fUicQQE4a2IRs1m3RvXPkdZUpP3c/RgoAPQCIw7PDERLphM5wxlW2hX75mfCM1tFwsdvvQTFnrHzcNP5Gv09M9KFIaLC0l66P99KPjbbv9+8NzG+ZEMshX5es64rB5cxX4aCnYYYxlpvAoYGjm0B37QmPW8BQsG7y7X2ZEbxsuf5ehup7UOybttENIKA8eHXiVjYHZwlgbUzj0uvG2iu7kERhlQ4H2V4gYCFhSVjMUkZ9cr9+TrRV6Z5bRZr/noiE9+nKVfpEVc8f062GSDGrX3vNJWc= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 96bdd9db-15ed-4bab-0e5c-08d62d2608a2 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Oct 2018 13:57:49.4943 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB3426 Subject: Re: [dpdk-dev] [PATCH] net/mlx5: fix calculation of struct size in bytes 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: Mon, 08 Oct 2018 13:57:51 -0000 > -----Original Message----- > From: dev On Behalf Of Dekel Peled > Sent: Monday, October 8, 2018 4:35 PM > To: Yongseok Koh ; Shahaf Shuler > > Cc: dev@dpdk.org; Ori Kam > Subject: [dpdk-dev] [PATCH] net/mlx5: fix calculation of struct size in b= ytes >=20 > Update definition of MLX5_ST_SZ_DB to calculate struct size correctly. >=20 > Fixes: 86a8d2b59f54 ("net/mlx5: add Direct Verbs prepare function") > Cc: orika@mellanox.com >=20 > Signed-off-by: Dekel Peled > --- > drivers/net/mlx5/mlx5_prm.h | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) >=20 > diff --git a/drivers/net/mlx5/mlx5_prm.h b/drivers/net/mlx5/mlx5_prm.h > index a905397..29742b1 100644 > --- a/drivers/net/mlx5/mlx5_prm.h > +++ b/drivers/net/mlx5/mlx5_prm.h > @@ -376,7 +376,7 @@ struct mlx5_modification_cmd { > (__mlx5_bit_off(typ, fld) & 0xf)) > #define __mlx5_mask16(typ, fld) ((u16)((1ull << __mlx5_bit_sz(typ, fld))= - 1)) > #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) / 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)= ) >=20 > -- > 1.7.1 Acked-by: Ori Kam Thanks, Ori Kam