From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 28A4E1B4BA for ; Thu, 29 Nov 2018 14:23:17 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8C8085A1E3; Thu, 29 Nov 2018 13:23:16 +0000 (UTC) Received: from ktraynor.remote.csb (ovpn-117-230.ams2.redhat.com [10.36.117.230]) by smtp.corp.redhat.com (Postfix) with ESMTP id 653A81001F50; Thu, 29 Nov 2018 13:23:14 +0000 (UTC) From: Kevin Traynor To: Ali Alnubani Cc: Shahaf Shuler , dpdk stable Date: Thu, 29 Nov 2018 13:20:46 +0000 Message-Id: <20181129132128.7609-46-ktraynor@redhat.com> In-Reply-To: <20181129132128.7609-1-ktraynor@redhat.com> References: <20181129132128.7609-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 29 Nov 2018 13:23:16 +0000 (UTC) Subject: [dpdk-stable] patch 'net/mlx5: fix initialization of struct members' has been queued to stable release 18.08.1 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: Thu, 29 Nov 2018 13:23:17 -0000 Hi, FYI, your patch has been queued to stable release 18.08.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 12/08/18. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. If the code is different (ie: not only metadata diffs), due for example to a change in context or macro names, please double check it. Thanks. Kevin Traynor --- >>From 8c30982d9c5d1da706ba34cd87af1f2f1dd64c73 Mon Sep 17 00:00:00 2001 From: Ali Alnubani Date: Tue, 13 Nov 2018 19:11:07 +0000 Subject: [PATCH] net/mlx5: fix initialization of struct members [ upstream commit 0c15f3c010322853078c20a2a9926d3fb5986548 ] 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 = { 0, }; ^ ../drivers/net/mlx5/mlx5_mr.c:389:36: error: missing field 'end' initializer [-Werror,-Wmissing-field-initializers] struct mlx5_mr_cache ret = { 0, }; ^ ../drivers/net/mlx5/mlx5_mr.c:691:35: error: missing field 'end' initializer [-Werror,-Wmissing-field-initializers] struct mlx5_mr_cache ret = { 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") Signed-off-by: Ali Alnubani Acked-by: Shahaf Shuler --- drivers/net/mlx5/mlx5_mr.c | 9 ++++++--- drivers/net/mlx5/mlx5_stats.c | 3 ++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/mlx5/mlx5_mr.c b/drivers/net/mlx5/mlx5_mr.c index f8b7dcaa0..6d7653d7d 100644 --- a/drivers/net/mlx5/mlx5_mr.c +++ b/drivers/net/mlx5/mlx5_mr.c @@ -343,6 +343,7 @@ mr_insert_dev_cache(struct rte_eth_dev *dev, struct mlx5_mr *mr) dev->data->port_id, (void *)mr); for (n = 0; n < mr->ms_bmp_n; ) { - struct mlx5_mr_cache entry = { 0, }; + struct mlx5_mr_cache entry; + memset(&entry, 0, sizeof(entry)); /* Find a contiguous chunk and advance the index. */ n = mr_find_next_chunk(mr, &entry, n); @@ -387,6 +388,7 @@ mr_lookup_dev_list(struct rte_eth_dev *dev, struct mlx5_mr_cache *entry, continue; for (n = 0; n < mr->ms_bmp_n; ) { - struct mlx5_mr_cache ret = { 0, }; + struct mlx5_mr_cache ret; + memset(&ret, 0, sizeof(ret)); n = mr_find_next_chunk(mr, &ret, n); if (addr >= ret.start && addr < ret.end) { @@ -689,6 +691,7 @@ alloc_resources: for (n = 0; n < ms_n; ++n) { uintptr_t start; - struct mlx5_mr_cache ret = { 0, }; + struct mlx5_mr_cache ret; + memset(&ret, 0, sizeof(ret)); start = data_re.start + n * msl->page_sz; /* Exclude memsegs already registered by other MRs. */ 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 @@ -355,8 +355,9 @@ mlx5_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) { struct priv *priv = dev->data->dev_private; - struct rte_eth_stats tmp = {0}; + struct rte_eth_stats tmp; unsigned int i; unsigned int idx; + memset(&tmp, 0, sizeof(tmp)); /* Add software counters. */ for (i = 0; (i != priv->rxqs_n); ++i) { -- 2.19.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2018-11-29 13:11:36.214297565 +0000 +++ 0045-net-mlx5-fix-initialization-of-struct-members.patch 2018-11-29 13:11:34.000000000 +0000 @@ -1,8 +1,10 @@ -From 0c15f3c010322853078c20a2a9926d3fb5986548 Mon Sep 17 00:00:00 2001 +From 8c30982d9c5d1da706ba34cd87af1f2f1dd64c73 Mon Sep 17 00:00:00 2001 From: Ali Alnubani Date: Tue, 13 Nov 2018 19:11:07 +0000 Subject: [PATCH] net/mlx5: fix initialization of struct members +[ upstream commit 0c15f3c010322853078c20a2a9926d3fb5986548 ] + This patch fixes compilation errors with meson and the clang compiler caused by some of the struct members not being initialized. @@ -30,49 +32,14 @@ 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 Acked-by: Shahaf Shuler --- - 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 98ecaec3f..2f6b7d637 100644 ---- a/drivers/net/mlx5/mlx5_flow_tcf.c -+++ b/drivers/net/mlx5/mlx5_flow_tcf.c -@@ -5697,5 +5697,5 @@ flow_tcf_query_count(struct rte_eth_dev *dev, - struct rte_flow_error *error) - { -- struct flow_tcf_stats_basic sb_data = { 0 }; -+ struct flow_tcf_stats_basic sb_data; - struct rte_flow_query_count *qc = data; - struct priv *priv = dev->data->dev_private; -@@ -5708,4 +5708,5 @@ flow_tcf_query_count(struct rte_eth_dev *dev, - assert(qc); - -+ memset(&sb_data, 0, sizeof(sb_data)); - dev_flow = LIST_FIRST(&flow->dev_flows); - /* E-Switch flow can't be expanded. */ -diff --git a/drivers/net/mlx5/mlx5_flow_verbs.c b/drivers/net/mlx5/mlx5_flow_verbs.c -index d6d95db56..13fbf2496 100644 ---- a/drivers/net/mlx5/mlx5_flow_verbs.c -+++ b/drivers/net/mlx5/mlx5_flow_verbs.c -@@ -69,7 +69,8 @@ flow_verbs_counter_create(struct rte_eth_dev *dev, - struct priv *priv = dev->data->dev_private; - struct ibv_counters_init_attr init = {0}; -- struct ibv_counter_attach_attr attach = {0}; -+ struct ibv_counter_attach_attr attach; - int ret; - -+ memset(&attach, 0, sizeof(attach)); - counter->cs = mlx5_glue->create_counters(priv->ctx, &init); - if (!counter->cs) { + drivers/net/mlx5/mlx5_mr.c | 9 ++++++--- + drivers/net/mlx5/mlx5_stats.c | 3 ++- + 2 files changed, 8 insertions(+), 4 deletions(-) + diff --git a/drivers/net/mlx5/mlx5_mr.c b/drivers/net/mlx5/mlx5_mr.c index f8b7dcaa0..6d7653d7d 100644 --- a/drivers/net/mlx5/mlx5_mr.c @@ -104,23 +71,6 @@ + memset(&ret, 0, sizeof(ret)); start = data_re.start + n * msl->page_sz; /* Exclude memsegs already registered by other MRs. */ -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 -@@ -1783,5 +1783,5 @@ mlx5_hrxq_new(struct rte_eth_dev *dev, - struct ibv_qp *qp; - #ifdef HAVE_IBV_DEVICE_TUNNEL_SUPPORT -- struct mlx5dv_qp_init_attr qp_init_attr = {0}; -+ struct mlx5dv_qp_init_attr qp_init_attr; - #endif - int err; -@@ -1796,4 +1796,5 @@ mlx5_hrxq_new(struct rte_eth_dev *dev, - } - #ifdef HAVE_IBV_DEVICE_TUNNEL_SUPPORT -+ memset(&qp_init_attr, 0, sizeof(qp_init_attr)); - if (tunnel) { - qp_init_attr.comp_mask = 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