DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/2] net/mlx4: fix initialization of struct members
@ 2018-11-13 19:11 Ali Alnubani
  2018-11-13 19:11 ` [dpdk-dev] [PATCH 2/2] net/mlx5: " Ali Alnubani
  2018-11-15  8:49 ` [dpdk-dev] [PATCH 1/2] net/mlx4: " Shahaf Shuler
  0 siblings, 2 replies; 5+ messages in thread
From: Ali Alnubani @ 2018-11-13 19:11 UTC (permalink / raw)
  To: dev; +Cc: Thomas Monjalon, Shahaf Shuler, stable

This patch fixes compilation errors with meson and the clang
compiler caused by some of the struct members not being
initialized.

```
../drivers/net/mlx4/mlx4_mr.c:357:37: error: missing field 'end'
initializer [-Werror,-Wmissing-field-initializers]
                struct mlx4_mr_cache entry = { 0, };
                                                  ^
../drivers/net/mlx4/mlx4_mr.c:401:36: error: missing field 'end'
initializer [-Werror,-Wmissing-field-initializers]
                        struct mlx4_mr_cache ret = { 0, };
                                                        ^
../drivers/net/mlx4/mlx4_mr.c:691:35: error: missing field 'end'
initializer [-Werror,-Wmissing-field-initializers]
                struct mlx4_mr_cache ret = { 0, };
                                                ^
```

The compilation errors reproduce with
clang version 3.4.2 (tags/RELEASE_34/dot2-final) on RHEL.

Fixes: 9797bfcce1c9 ("net/mlx4: add new memory region support")
Cc: stable@dpdk.org

Signed-off-by: Ali Alnubani <alialnu@mellanox.com>
---
 drivers/net/mlx4/mlx4_mr.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/mlx4/mlx4_mr.c b/drivers/net/mlx4/mlx4_mr.c
index c2066ea4b..726788a60 100644
--- a/drivers/net/mlx4/mlx4_mr.c
+++ b/drivers/net/mlx4/mlx4_mr.c
@@ -354,8 +354,9 @@ mr_insert_dev_cache(struct rte_eth_dev *dev, struct mlx4_mr *mr)
 	DEBUG("port %u inserting MR(%p) to global cache",
 	      dev->data->port_id, (void *)mr);
 	for (n = 0; n < mr->ms_bmp_n; ) {
-		struct mlx4_mr_cache entry = { 0, };
+		struct mlx4_mr_cache entry;
 
+		memset(&entry, 0, sizeof(entry));
 		/* Find a contiguous chunk and advance the index. */
 		n = mr_find_next_chunk(mr, &entry, n);
 		if (!entry.end)
@@ -398,8 +399,9 @@ mr_lookup_dev_list(struct rte_eth_dev *dev, struct mlx4_mr_cache *entry,
 		if (mr->ms_n == 0)
 			continue;
 		for (n = 0; n < mr->ms_bmp_n; ) {
-			struct mlx4_mr_cache ret = { 0, };
+			struct mlx4_mr_cache ret;
 
+			memset(&ret, 0, sizeof(ret));
 			n = mr_find_next_chunk(mr, &ret, n);
 			if (addr >= ret.start && addr < ret.end) {
 				/* Found. */
@@ -688,8 +690,9 @@ mlx4_mr_create(struct rte_eth_dev *dev, struct mlx4_mr_cache *entry,
 	 */
 	for (n = 0; n < ms_n; ++n) {
 		uintptr_t start;
-		struct mlx4_mr_cache ret = { 0, };
+		struct mlx4_mr_cache ret;
 
+		memset(&ret, 0, sizeof(ret));
 		start = data_re.start + n * msl->page_sz;
 		/* Exclude memsegs already registered by other MRs. */
 		if (mr_lookup_dev(dev, &ret, start) == UINT32_MAX) {
@@ -1277,8 +1280,9 @@ mlx4_mr_dump_dev(struct rte_eth_dev *dev)
 		if (mr->ms_n == 0)
 			continue;
 		for (n = 0; n < mr->ms_bmp_n; ) {
-			struct mlx4_mr_cache ret = { 0, };
+			struct mlx4_mr_cache ret;
 
+			memset(&ret, 0, sizeof(ret));
 			n = mr_find_next_chunk(mr, &ret, n);
 			if (!ret.end)
 				break;
-- 
2.11.0

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [dpdk-dev] [PATCH 2/2] net/mlx5: fix initialization of struct members
  2018-11-13 19:11 [dpdk-dev] [PATCH 1/2] net/mlx4: fix initialization of struct members Ali Alnubani
@ 2018-11-13 19:11 ` Ali Alnubani
  2018-11-14 12:06   ` Shahaf Shuler
  2018-11-15  8:49 ` [dpdk-dev] [PATCH 1/2] net/mlx4: " Shahaf Shuler
  1 sibling, 1 reply; 5+ messages in thread
From: Ali Alnubani @ 2018-11-13 19:11 UTC (permalink / raw)
  To: dev; +Cc: Thomas Monjalon, Shahaf Shuler, stable

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")
Cc: stable@dpdk.org

Signed-off-by: Ali Alnubani <alialnu@mellanox.com>
---
 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 = { 0 };
+	struct flow_tcf_stats_basic sb_data;
 	struct rte_flow_query_count *qc = data;
 	struct priv *priv = dev->data->dev_private;
 	struct mlx5_flow_tcf_context *ctx = priv->tcf_context;
@@ -5553,6 +5553,7 @@ flow_tcf_query_count(struct rte_eth_dev *dev,
 	ssize_t ret;
 	assert(qc);
 
+	memset(&sb_data, 0, sizeof(sb_data));
 	dev_flow = 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_flow_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 = 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) {
 		rte_errno = 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 mlx5_mr *mr)
 	DRV_LOG(DEBUG, "port %u inserting MR(%p) to global cache",
 		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);
 		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 == 0)
 			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) {
 				/* Found. */
@@ -688,8 +690,9 @@ mlx5_mr_create(struct rte_eth_dev *dev, struct mlx5_mr_cache *entry,
 	 */
 	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. */
 		if (mr_lookup_dev(dev, &ret, start) == 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 = {0};
+	struct mlx5dv_qp_init_attr qp_init_attr;
 #endif
 	int err;
 
@@ -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 =
 				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 = 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) {
 		struct mlx5_rxq_data *rxq = (*priv->rxqs)[i];
-- 
2.11.0

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH 2/2] net/mlx5: fix initialization of struct members
  2018-11-13 19:11 ` [dpdk-dev] [PATCH 2/2] net/mlx5: " Ali Alnubani
@ 2018-11-14 12:06   ` Shahaf Shuler
  2018-11-15  5:50     ` Yongseok Koh
  0 siblings, 1 reply; 5+ messages in thread
From: Shahaf Shuler @ 2018-11-14 12:06 UTC (permalink / raw)
  To: Ali Alnubani, dev, Yongseok Koh; +Cc: Thomas Monjalon, stable

Adding Koh, see below 

Tuesday, November 13, 2018 9:11 PM, Ali Alnubani:
> Subject: [PATCH 2/2] net/mlx5: fix initialization of struct members
> 
> 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")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Ali Alnubani <alialnu@mellanox.com>

[...]

> 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 mlx5_mr *mr)
>  	DRV_LOG(DEBUG, "port %u inserting MR(%p) to global cache",
>  		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);
>  		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 == 0)
>  			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));

do you have concerns about the performance w/ this extra memset? 

>  			n = mr_find_next_chunk(mr, &ret, n);
>  			if (addr >= 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 = 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. */
>  		if (mr_lookup_dev(dev, &ret, start) == 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 = {0};
> +	struct mlx5dv_qp_init_attr qp_init_attr;
>  #endif
>  	int err;
> 
> @@ -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 =
> 
> 	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 = 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) {
>  		struct mlx5_rxq_data *rxq = (*priv->rxqs)[i];
> --
> 2.11.0

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH 2/2] net/mlx5: fix initialization of struct members
  2018-11-14 12:06   ` Shahaf Shuler
@ 2018-11-15  5:50     ` Yongseok Koh
  0 siblings, 0 replies; 5+ messages in thread
From: Yongseok Koh @ 2018-11-15  5:50 UTC (permalink / raw)
  To: Shahaf Shuler; +Cc: Ali Alnubani, dev, Thomas Monjalon, stable


> On Nov 14, 2018, at 4:06 AM, Shahaf Shuler <shahafs@mellanox.com> wrote:
> 
> Adding Koh, see below 
> 
> Tuesday, November 13, 2018 9:11 PM, Ali Alnubani:
>> Subject: [PATCH 2/2] net/mlx5: fix initialization of struct members
>> 
>> 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")
>> Cc: stable@dpdk.org
>> 
>> Signed-off-by: Ali Alnubani <alialnu@mellanox.com>
> 
> [...]
> 
>> 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 mlx5_mr *mr)
>> 	DRV_LOG(DEBUG, "port %u inserting MR(%p) to global cache",
>> 		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);
>> 		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 == 0)
>> 			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));
> 
> do you have concerns about the performance w/ this extra memset?

For the three funcs modified with memset here are all slow-paths for the MR.
It is safe for performance.

Thanks,
Yongseok

> 
>> 			n = mr_find_next_chunk(mr, &ret, n);
>> 			if (addr >= 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 = 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. */
>> 		if (mr_lookup_dev(dev, &ret, start) == 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 = {0};
>> +	struct mlx5dv_qp_init_attr qp_init_attr;
>> #endif
>> 	int err;
>> 
>> @@ -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 =
>> 
>> 	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 = 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) {
>> 		struct mlx5_rxq_data *rxq = (*priv->rxqs)[i];
>> --
>> 2.11.0
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH 1/2] net/mlx4: fix initialization of struct members
  2018-11-13 19:11 [dpdk-dev] [PATCH 1/2] net/mlx4: fix initialization of struct members Ali Alnubani
  2018-11-13 19:11 ` [dpdk-dev] [PATCH 2/2] net/mlx5: " Ali Alnubani
@ 2018-11-15  8:49 ` Shahaf Shuler
  1 sibling, 0 replies; 5+ messages in thread
From: Shahaf Shuler @ 2018-11-15  8:49 UTC (permalink / raw)
  To: Ali Alnubani, dev; +Cc: Thomas Monjalon, stable

Tuesday, November 13, 2018 9:11 PM, Ali Alnubani:
> Subject: [PATCH 1/2] net/mlx4: fix initialization of struct members
> 
> This patch fixes compilation errors with meson and the clang compiler caused
> by some of the struct members not being initialized.
> 
> ```
> ../drivers/net/mlx4/mlx4_mr.c:357:37: error: missing field 'end'
> initializer [-Werror,-Wmissing-field-initializers]
>                 struct mlx4_mr_cache entry = { 0, };
>                                                   ^
> ../drivers/net/mlx4/mlx4_mr.c:401:36: error: missing field 'end'
> initializer [-Werror,-Wmissing-field-initializers]
>                         struct mlx4_mr_cache ret = { 0, };
>                                                         ^
> ../drivers/net/mlx4/mlx4_mr.c:691:35: error: missing field 'end'
> initializer [-Werror,-Wmissing-field-initializers]
>                 struct mlx4_mr_cache ret = { 0, };
>                                                 ^ ```
> 
> The compilation errors reproduce with
> clang version 3.4.2 (tags/RELEASE_34/dot2-final) on RHEL.
> 
> Fixes: 9797bfcce1c9 ("net/mlx4: add new memory region support")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Ali Alnubani <alialnu@mellanox.com>

Series applied to next-net-mlx, thanks. 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-11-15  8:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-13 19:11 [dpdk-dev] [PATCH 1/2] net/mlx4: fix initialization of struct members Ali Alnubani
2018-11-13 19:11 ` [dpdk-dev] [PATCH 2/2] net/mlx5: " Ali Alnubani
2018-11-14 12:06   ` Shahaf Shuler
2018-11-15  5:50     ` Yongseok Koh
2018-11-15  8:49 ` [dpdk-dev] [PATCH 1/2] net/mlx4: " Shahaf Shuler

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git