summaryrefslogtreecommitdiff
path: root/drivers/net/mlx5/mlx5_mr.c
diff options
context:
space:
mode:
authorAli Alnubani <alialnu@mellanox.com>2018-11-13 19:11:07 +0000
committerFerruh Yigit <ferruh.yigit@intel.com>2018-11-16 10:44:55 +0100
commit0c15f3c010322853078c20a2a9926d3fb5986548 (patch)
tree5ec390f8f05c43e9da46c5b330ce473c33eed6cb /drivers/net/mlx5/mlx5_mr.c
parentd924d6b964d1dd4a720f61051c14507428b62e95 (diff)
downloaddpdk-next-eventdev-0c15f3c010322853078c20a2a9926d3fb5986548.zip
dpdk-next-eventdev-0c15f3c010322853078c20a2a9926d3fb5986548.tar.gz
dpdk-next-eventdev-0c15f3c010322853078c20a2a9926d3fb5986548.tar.xz
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> Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Diffstat (limited to 'drivers/net/mlx5/mlx5_mr.c')
-rw-r--r--drivers/net/mlx5/mlx5_mr.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/net/mlx5/mlx5_mr.c b/drivers/net/mlx5/mlx5_mr.c
index f8b7dca..6d7653d 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 @@ 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. */
if (mr_lookup_dev(dev, &ret, start) == UINT32_MAX) {