From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130081.outbound.protection.outlook.com [40.107.13.81]) by dpdk.org (Postfix) with ESMTP id E12825F16; Wed, 14 Nov 2018 13:06:17 +0100 (CET) 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=qY50NiBC6cajY6eez12azJnZ4u6wi/uCbS0b7W8s/AQ=; b=teQIE2ympGNCW2pYYHl/qj7Sikbs/uWjKBpxlSK8NvXM3XstGv2O5ZR4c7utmAB1Bv2RvC4LErdT8Lry+Y9ai+98Zewx19AeWxfHtZeyEe1WEqAvnDmMI5vyxKgwSdLvy8uGooQgjm1cg3E3E3yXJMcD6lpBor3G2rKlg5cvAjs= Received: from DB7PR05MB4426.eurprd05.prod.outlook.com (52.134.109.15) by DB7PR05MB5243.eurprd05.prod.outlook.com (20.178.42.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.20; Wed, 14 Nov 2018 12:06:15 +0000 Received: from DB7PR05MB4426.eurprd05.prod.outlook.com ([fe80::bc22:c2f5:208d:826f]) by DB7PR05MB4426.eurprd05.prod.outlook.com ([fe80::bc22:c2f5:208d:826f%2]) with mapi id 15.20.1294.044; Wed, 14 Nov 2018 12:06:15 +0000 From: Shahaf Shuler To: Ali Alnubani , "dev@dpdk.org" , Yongseok Koh CC: Thomas Monjalon , "stable@dpdk.org" Thread-Topic: [PATCH 2/2] net/mlx5: fix initialization of struct members Thread-Index: AQHUe4SiLQ6WRfedxU+JOEHk/jzEI6VPLXyA Date: Wed, 14 Nov 2018 12:06:15 +0000 Message-ID: References: <20181113191039.12720-1-alialnu@mellanox.com> <20181113191039.12720-2-alialnu@mellanox.com> In-Reply-To: <20181113191039.12720-2-alialnu@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB7PR05MB5243; 6:2PLN/w6/IwDDOQ9UfKtYqy0e+9IEc7JNHt4KheRPQ3YH6qGOdhNqJUBLDxtrrG3u/gUNlAwEmBpAs9h/WfgY422MYRZbG9jtzyetJOwY6BPXn/mM6YuGzWE5+wkdTAJ7N6rwlrR3AjuNHaWrgKdin+y8AgeEBlQdj+V2enszPiMVD6R8jqdPAKGYK0pBT74P7NXDGxUEUjeNh96w7PhF5xningBW4sJqAOg5gza1Gk1Cao5vbq0U9i65yHxw7g4DUxW3FlwS5pjvnrdbSb4x1FzB3tATDnW3iOGRO742LoPIWF+M1DAVnjqwsEEhjtTtCZtXJ9o/bvvI8kvMXUhgZdtvUzv2SGNbMGubQpvmukLEuMraT0eQbaXpHlm3xFuXxnXN2N4f2qidXCWFgHdFvIb9JcjLWM6ROlixBU1/q4CQ2215yQPMIAixuW9ejfrZxdMrixW21vHzzBeH7QbynA==; 5:rDKARDrU0mi6SVEGyIdY1H+telGerVPbxhpZfD1eEbP33KwhIoTAsOCsBESjizrKG6l4hQJFTEaB3INrQtrdRy7j5d6fWbFQbq4fciWJGKUkf0a/ks3OCV4jusf64JqspvvcRUjXSbzDdaR8P5UAOrE5lv9OJ8UyJ3JQCpqLvHc=; 7:IIJ+6PtAlGoNPEtOUU5n/3jmezSkN0ThgeAeE2350fMrcjom7oiNHffNX1EVXpuc72ZocmwsnUdFi83nc+e6QTA9zZ2kw0OI78CiRYG77NyIZUnyMXfIennJ3tNKqpBSgW93BpgIHvAruoK//nIYZA== x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 2ab043b9-cce8-4300-ffec-08d64a2993ea x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390098)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:DB7PR05MB5243; x-ms-traffictypediagnostic: DB7PR05MB5243: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr 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)(10201501046)(3002001)(3231382)(944501410)(52105112)(6055026)(148016)(149066)(150057)(6041310)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(201708071742011)(7699051)(76991095); SRVR:DB7PR05MB5243; BCL:0; PCL:0; RULEID:; SRVR:DB7PR05MB5243; x-forefront-prvs: 085634EFF4 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(366004)(376002)(346002)(39860400002)(396003)(189003)(199004)(305945005)(8936002)(97736004)(45080400002)(256004)(2900100001)(7736002)(8676002)(6246003)(186003)(110136005)(5660300001)(9686003)(486006)(68736007)(3846002)(54906003)(316002)(6116002)(53936002)(71200400001)(74316002)(25786009)(102836004)(71190400001)(229853002)(55016002)(4326008)(33656002)(86362001)(575784001)(446003)(11346002)(66066001)(476003)(81156014)(478600001)(99286004)(14454004)(2906002)(7696005)(76176011)(6436002)(81166006)(6636002)(26005)(106356001)(105586002)(2501003)(6506007); DIR:OUT; SFP:1101; SCL:1; SRVR:DB7PR05MB5243; H:DB7PR05MB4426.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-microsoft-antispam-message-info: b6jZWvpc/ST96HEIK8iVCMkYNBv6kUkiR2b2BdBTAwAPb5Vupj4bC3IoNAOXMpXcxfcT9zUGsYTsix3RfHmi59B6UaaDoYMR0L3QNd5v24+Z0y6hBM4NFmkDk2iwsaptt0dnqu8Q65Yt6KIAF8SfBtWm9rGMAiJtPNtscfcRofoaTlM6Uy1FAHJM2IvvE3t964u7KwZAmKwIwoF8J+/hM98MLEeA7M2iM93vx55BGvNLHhqO/2zWIjpxtmBB4fYK2cDtVEIu4tN9DgheN/825f8l/lpJ3Il+9tg/25iCMli8HIGZ5cNh49NkgM7dagAFXcGgqYZHfOUCbm3tZmXFVQI1LENXBoBzPjuZjsSgNPs= 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: 2ab043b9-cce8-4300-ffec-08d64a2993ea X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Nov 2018 12:06:15.4176 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR05MB5243 Subject: Re: [dpdk-dev] [PATCH 2/2] net/mlx5: fix initialization of struct members 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, 14 Nov 2018 12:06:18 -0000 Adding Koh, see below=20 Tuesday, November 13, 2018 9:11 PM, Ali Alnubani: > Subject: [PATCH 2/2] net/mlx5: fix initialization of struct members >=20 > This patch fixes compilation errors with meson and the clang compiler cau= sed > by some of the struct members not being initialized. >=20 > ``` > ../drivers/net/mlx5/mlx5_mr.c:345:37: error: missing field 'end' > initializer [-Werror,-Wmissing-field-initializers] > struct mlx5_mr_cache entry =3D { 0, }; > ^ > ../drivers/net/mlx5/mlx5_mr.c:389:36: error: missing field 'end' > initializer [-Werror,-Wmissing-field-initializers] > struct mlx5_mr_cache ret =3D { 0, }; > ^ > ../drivers/net/mlx5/mlx5_mr.c:691:35: error: missing field 'end' > initializer [-Werror,-Wmissing-field-initializers] > struct mlx5_mr_cache ret =3D { 0, }; > ^ ``` >=20 > The compilation errors reproduce with > clang version 3.4.2 (tags/RELEASE_34/dot2-final) on RHEL. >=20 > Fixes: e1114ff6a5ab ("net/mlx5: support e-switch flow count action") > Fixes: db48f9db5d9f ("net/mlx5: support new flow counter API") > Fixes: 974f1e7ef146 ("net/mlx5: add new memory region support") > Fixes: 65c9d24170c9 ("net/mlx5: enable loopback by configured mode") > Fixes: 87011737b715 ("mlx5: add software counters") > Cc: stable@dpdk.org >=20 > Signed-off-by: Ali Alnubani [...] > diff --git a/drivers/net/mlx5/mlx5_mr.c b/drivers/net/mlx5/mlx5_mr.c inde= x > f4b15d3f6..435eaeee2 100644 > --- a/drivers/net/mlx5/mlx5_mr.c > +++ b/drivers/net/mlx5/mlx5_mr.c > @@ -342,8 +342,9 @@ mr_insert_dev_cache(struct rte_eth_dev *dev, > struct mlx5_mr *mr) > DRV_LOG(DEBUG, "port %u inserting MR(%p) to global cache", > dev->data->port_id, (void *)mr); > for (n =3D 0; n < mr->ms_bmp_n; ) { > - struct mlx5_mr_cache entry =3D { 0, }; > + struct mlx5_mr_cache entry; >=20 > + memset(&entry, 0, sizeof(entry)); > /* Find a contiguous chunk and advance the index. */ > n =3D mr_find_next_chunk(mr, &entry, n); > if (!entry.end) > @@ -386,8 +387,9 @@ mr_lookup_dev_list(struct rte_eth_dev *dev, struct > mlx5_mr_cache *entry, > if (mr->ms_n =3D=3D 0) > continue; > for (n =3D 0; n < mr->ms_bmp_n; ) { > - struct mlx5_mr_cache ret =3D { 0, }; > + struct mlx5_mr_cache ret; >=20 > + memset(&ret, 0, sizeof(ret)); do you have concerns about the performance w/ this extra memset?=20 > n =3D mr_find_next_chunk(mr, &ret, n); > if (addr >=3D ret.start && addr < ret.end) { > /* Found. */ > @@ -688,8 +690,9 @@ mlx5_mr_create(struct rte_eth_dev *dev, struct > mlx5_mr_cache *entry, > */ > for (n =3D 0; n < ms_n; ++n) { > uintptr_t start; > - struct mlx5_mr_cache ret =3D { 0, }; > + struct mlx5_mr_cache ret; >=20 > + memset(&ret, 0, sizeof(ret)); > start =3D data_re.start + n * msl->page_sz; > /* Exclude memsegs already registered by other MRs. */ > if (mr_lookup_dev(dev, &ret, start) =3D=3D UINT32_MAX) { diff -- > git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c index > eef485021..b27fc4798 100644 > --- a/drivers/net/mlx5/mlx5_rxq.c > +++ b/drivers/net/mlx5/mlx5_rxq.c > @@ -1782,7 +1782,7 @@ mlx5_hrxq_new(struct rte_eth_dev *dev, > struct mlx5_ind_table_ibv *ind_tbl; > struct ibv_qp *qp; > #ifdef HAVE_IBV_DEVICE_TUNNEL_SUPPORT > - struct mlx5dv_qp_init_attr qp_init_attr =3D {0}; > + struct mlx5dv_qp_init_attr qp_init_attr; > #endif > int err; >=20 > @@ -1795,6 +1795,7 @@ mlx5_hrxq_new(struct rte_eth_dev *dev, > return NULL; > } > #ifdef HAVE_IBV_DEVICE_TUNNEL_SUPPORT > + memset(&qp_init_attr, 0, sizeof(qp_init_attr)); > if (tunnel) { > qp_init_attr.comp_mask =3D >=20 > MLX5DV_QP_INIT_ATTR_MASK_QP_CREATE_FLAGS; > diff --git a/drivers/net/mlx5/mlx5_stats.c b/drivers/net/mlx5/mlx5_stats.= c > index a14d1e491..fccb9af0d 100644 > --- a/drivers/net/mlx5/mlx5_stats.c > +++ b/drivers/net/mlx5/mlx5_stats.c > @@ -354,10 +354,11 @@ int > mlx5_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) { > struct priv *priv =3D dev->data->dev_private; > - struct rte_eth_stats tmp =3D {0}; > + struct rte_eth_stats tmp; > unsigned int i; > unsigned int idx; >=20 > + memset(&tmp, 0, sizeof(tmp)); > /* Add software counters. */ > for (i =3D 0; (i !=3D priv->rxqs_n); ++i) { > struct mlx5_rxq_data *rxq =3D (*priv->rxqs)[i]; > -- > 2.11.0