From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20072.outbound.protection.outlook.com [40.107.2.72]) by dpdk.org (Postfix) with ESMTP id A6AD12D13; Tue, 13 Nov 2018 20:11:09 +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=7MGyRALM9jxhGR0IdHgaBJ+hNQDA9sBFv+bEeniil94=; b=ymRTwY0nR+IYgjjw0B9Udz17gmP0FPsVL35cGCZqrWnaom+yx2XRxbGAOHgRixnp4CKxOj9V9iZ58A7b5G96AnGkh5VHOd/ekoj/S5sz6QUdSN9BalG/HiTYFsI+2dNicptJmTKTTH7ufv3FcHYYG4k0mnaCC9n6ugmDYCSKPks= Received: from VI1PR05MB4269.eurprd05.prod.outlook.com (52.133.12.22) by VI1PR05MB4190.eurprd05.prod.outlook.com (10.171.183.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.27; Tue, 13 Nov 2018 19:11:08 +0000 Received: from VI1PR05MB4269.eurprd05.prod.outlook.com ([fe80::68d6:1233:5e0c:143a]) by VI1PR05MB4269.eurprd05.prod.outlook.com ([fe80::68d6:1233:5e0c:143a%5]) with mapi id 15.20.1294.045; Tue, 13 Nov 2018 19:11:08 +0000 From: Ali Alnubani To: "dev@dpdk.org" CC: Thomas Monjalon , Shahaf Shuler , "stable@dpdk.org" Thread-Topic: [PATCH 2/2] net/mlx5: fix initialization of struct members Thread-Index: AQHUe4Shi7gwHq3EU0qyaedsiSRXCQ== Date: Tue, 13 Nov 2018 19:11:07 +0000 Message-ID: <20181113191039.12720-2-alialnu@mellanox.com> References: <20181113191039.12720-1-alialnu@mellanox.com> In-Reply-To: <20181113191039.12720-1-alialnu@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.11.0 x-clientproxiedby: PR2P264CA0020.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::32) To VI1PR05MB4269.eurprd05.prod.outlook.com (2603:10a6:803:40::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=alialnu@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2001:4b98:dc0:51:216:3eff:feac:53b] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR05MB4190; 6:S/vGcLaGKhVgnXS5uDWZUPLaARfc96uZI+MsId/tcyfCJla7m5rp0MWuwysqLL4Yrq66N4HsxZfncskLBRTeJqL9IjdSesd6oqYlWWxh4PW5clTAw4NmGOnt8EFd/FI5NHbX97FL/z9eeeZdJTWJ6zvodxvb45eeI4KfXlk2VrSqx+HEfH9CyzpFIcDeFLtdN6a9w2AkxyWF+UEw9/bJ1oe+RjYZFzW9p4mRjsggJV93XO2W/WAnKrg+w+4wWoeVEX7KHniGL4kOama1YQqQBi3DJlg7h600MtMgHhkQ1EhauQlNEgmvFXAp5nVFOeSYTcOkr/Y21QQHLnS79f5dbGyoudBc8c9t2EIihJppqxwmoUOhAFDt5FAwE3hedO+sdohkKkZ7PMsDZAwK22H32QEfzkuNEnINsMAnK9+JcyYo1wVMpgPYPeelZh/kD188b9XjwNrzroIP5lctkgpE/Q==; 5:kSHrMzrEC5H68oSZzlWj1PnQsQtpSZpT/fvtdznRlb6gEnW1bIWw7A+jw+WQbxZ5u0a34gbvPWObfnjW8m+kQLi1qytmXD0jkeTjl5E3lppe2k2C+uEZk5FoVDfXenZYfAsTUH1/Sqm8j+4W7aEtf32TmFl697GihxKn38fz0/4=; 7:qVzMKfmVq3JktY0KCFf4gB4j2Kw5oNN2p6aOwwjXeUCI+GyH2+9IL+k59CI2hokZazEv5kixqKiU8O4c5u5w1Yxgs1zLTRU6nugdO35nLjweVpcGWiJ30SRYLMXCNrEs4j8Njuwt/M5VryusXJKoJQ== x-ms-office365-filtering-correlation-id: 5fcf660b-5d15-4c40-82d5-08d6499bc3d9 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390060)(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:VI1PR05MB4190; x-ms-traffictypediagnostic: VI1PR05MB4190: 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)(5005006)(8121501046)(93006095)(93001095)(3002001)(3231382)(944501410)(52105112)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:VI1PR05MB4190; BCL:0; PCL:0; RULEID:; SRVR:VI1PR05MB4190; x-forefront-prvs: 085551F5A8 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(39860400002)(366004)(376002)(396003)(136003)(189003)(199004)(86362001)(52116002)(575784001)(76176011)(6486002)(53936002)(81156014)(5640700003)(71190400001)(4326008)(2906002)(14454004)(71200400001)(36756003)(25786009)(1730700003)(6436002)(50226002)(386003)(8676002)(46003)(6506007)(81166006)(6916009)(305945005)(2900100001)(105586002)(6512007)(99286004)(2501003)(8936002)(316002)(186003)(486006)(7736002)(2616005)(2351001)(5660300001)(97736004)(476003)(446003)(11346002)(68736007)(102836004)(478600001)(256004)(6116002)(106356001)(5024004)(1076002)(45080400002)(54906003); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB4190; H:VI1PR05MB4269.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: 0GVgtbt3MRT/6hKeBAr/wgJR6xTntszVWM40tP73/UdyHbvvUUikZiBq8RtWZ+0duo/yoXATrn00xjblWhRpPypbIFm+2dnxHfBsZW8NhXiBPnMVnusw+iDmd4ShM/lKB1P3ZLQPVTh5hINDSosN4Fp2RjmstIfHCKFFpD0mrgKU8/lVXeaO+riL+sqP0pviZyPSZb2I0iAkgsRcLOumYNQ0XZvx5nvH0V2tP7etCXD/xq8XBB+QU4ZpHYDLkMkkYs/2QtPgpIydYCuFPfaZrSiX6mSp5vzGZrN48HLoHNwW/f6/xI0xArzETZYd5buekbRewAvdl0U/henPb30iMvkxdkGkZnkN5431Zt9FWAM= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5fcf660b-5d15-4c40-82d5-08d6499bc3d9 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Nov 2018 19:11:07.6385 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB4190 Subject: [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: Tue, 13 Nov 2018 19:11:09 -0000 This patch fixes compilation errors with meson and the clang compiler caused by some of the struct members not being initialized. ``` ../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, }; ^ ``` The compilation errors reproduce with clang version 3.4.2 (tags/RELEASE_34/dot2-final) on RHEL. 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 Signed-off-by: Ali Alnubani --- drivers/net/mlx5/mlx5_flow_tcf.c | 3 ++- drivers/net/mlx5/mlx5_flow_verbs.c | 3 ++- drivers/net/mlx5/mlx5_mr.c | 9 ++++++--- drivers/net/mlx5/mlx5_rxq.c | 3 ++- drivers/net/mlx5/mlx5_stats.c | 3 ++- 5 files changed, 14 insertions(+), 7 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow_tcf.c b/drivers/net/mlx5/mlx5_flow_= tcf.c index 790663e99..53cc83205 100644 --- a/drivers/net/mlx5/mlx5_flow_tcf.c +++ b/drivers/net/mlx5/mlx5_flow_tcf.c @@ -5542,7 +5542,7 @@ flow_tcf_query_count(struct rte_eth_dev *dev, void *data, struct rte_flow_error *error) { - struct flow_tcf_stats_basic sb_data =3D { 0 }; + struct flow_tcf_stats_basic sb_data; struct rte_flow_query_count *qc =3D data; struct priv *priv =3D dev->data->dev_private; struct mlx5_flow_tcf_context *ctx =3D priv->tcf_context; @@ -5553,6 +5553,7 @@ flow_tcf_query_count(struct rte_eth_dev *dev, ssize_t ret; assert(qc); =20 + memset(&sb_data, 0, sizeof(sb_data)); dev_flow =3D LIST_FIRST(&flow->dev_flows); /* E-Switch flow can't be expanded. */ assert(!LIST_NEXT(dev_flow, next)); diff --git a/drivers/net/mlx5/mlx5_flow_verbs.c b/drivers/net/mlx5/mlx5_flo= w_verbs.c index d6d95db56..13fbf2496 100644 --- a/drivers/net/mlx5/mlx5_flow_verbs.c +++ b/drivers/net/mlx5/mlx5_flow_verbs.c @@ -68,9 +68,10 @@ flow_verbs_counter_create(struct rte_eth_dev *dev, #elif defined(HAVE_IBV_DEVICE_COUNTERS_SET_V45) struct priv *priv =3D dev->data->dev_private; struct ibv_counters_init_attr init =3D {0}; - struct ibv_counter_attach_attr attach =3D {0}; + struct ibv_counter_attach_attr attach; int ret; =20 + memset(&attach, 0, sizeof(attach)); counter->cs =3D mlx5_glue->create_counters(priv->ctx, &init); if (!counter->cs) { rte_errno =3D ENOTSUP; diff --git a/drivers/net/mlx5/mlx5_mr.c b/drivers/net/mlx5/mlx5_mr.c index 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 mlx= 5_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)); 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 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]; --=20 2.11.0