net/mlx5: remove redundant new line in logs
authorDekel Peled <dekelp@mellanox.com>
Wed, 30 Oct 2019 08:42:08 +0000 (10:42 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 8 Nov 2019 22:15:04 +0000 (23:15 +0100)
DRV_LOG macro is used to print log messages, one per line.
In several locations this macro is used with redundant '\n' character
at the end of the log message, causing blank lines between log lines.

This patch removes the '\n' character where it is redundant.

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
drivers/net/mlx5/mlx5.c
drivers/net/mlx5/mlx5_devx_cmds.c
drivers/net/mlx5/mlx5_flow.c
drivers/net/mlx5/mlx5_rxtx.c

index 0bbc8d1..72c30bf 100644 (file)
@@ -819,7 +819,7 @@ mlx5_init_shared_data(void)
                                                 SOCKET_ID_ANY, 0);
                        if (mz == NULL) {
                                DRV_LOG(ERR,
-                                       "Cannot allocate mlx5 shared data\n");
+                                       "Cannot allocate mlx5 shared data");
                                ret = -rte_errno;
                                goto error;
                        }
@@ -831,7 +831,7 @@ mlx5_init_shared_data(void)
                        mz = rte_memzone_lookup(MZ_MLX5_PMD_SHARED_DATA);
                        if (mz == NULL) {
                                DRV_LOG(ERR,
-                                       "Cannot attach mlx5 shared data\n");
+                                       "Cannot attach mlx5 shared data");
                                ret = -rte_errno;
                                goto error;
                        }
@@ -2019,7 +2019,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
                              MLX5DV_DEVX_PORT_MATCH_REG_C_0;
        err = mlx5_glue->devx_port_query(sh->ctx, spawn->ibv_port, &devx_port);
        if (err) {
-               DRV_LOG(WARNING, "can't query devx port %d on device %s\n",
+               DRV_LOG(WARNING, "can't query devx port %d on device %s",
                        spawn->ibv_port, spawn->ibv_dev->name);
                devx_port.comp_mask = 0;
        }
@@ -2028,14 +2028,14 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
                priv->vport_meta_mask = devx_port.reg_c_0.mask;
                if (!priv->vport_meta_mask) {
                        DRV_LOG(ERR, "vport zero mask for port %d"
-                                    " on bonding device %s\n",
+                                    " on bonding device %s",
                                     spawn->ibv_port, spawn->ibv_dev->name);
                        err = ENOTSUP;
                        goto error;
                }
                if (priv->vport_meta_tag & ~priv->vport_meta_mask) {
                        DRV_LOG(ERR, "invalid vport tag for port %d"
-                                    " on bonding device %s\n",
+                                    " on bonding device %s",
                                     spawn->ibv_port, spawn->ibv_dev->name);
                        err = ENOTSUP;
                        goto error;
@@ -2044,7 +2044,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
                priv->vport_id = devx_port.vport_num;
        } else if (spawn->pf_bond >= 0) {
                DRV_LOG(ERR, "can't deduce vport index for port %d"
-                            " on bonding device %s\n",
+                            " on bonding device %s",
                             spawn->ibv_port, spawn->ibv_dev->name);
                err = ENOTSUP;
                goto error;
@@ -2191,7 +2191,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
                priv->counter_fallback = 1;
 #endif
                if (priv->counter_fallback)
-                       DRV_LOG(INFO, "Use fall-back DV counter management\n");
+                       DRV_LOG(INFO, "Use fall-back DV counter management");
                /* Check for LRO support. */
                if (config.dest_tir && config.hca_attr.lro_cap &&
                    config.dv_flow_en) {
index 3471a9b..d6e89b6 100644 (file)
@@ -40,7 +40,7 @@ mlx5_devx_cmd_flow_counter_alloc(struct ibv_context *ctx, uint32_t bulk_n_128)
        dcs->obj = mlx5_glue->devx_obj_create(ctx, in,
                                              sizeof(in), out, sizeof(out));
        if (!dcs->obj) {
-               DRV_LOG(ERR, "Can't allocate counters - error %d\n", errno);
+               DRV_LOG(ERR, "Can't allocate counters - error %d", errno);
                rte_errno = errno;
                rte_free(dcs);
                return NULL;
@@ -111,7 +111,7 @@ mlx5_devx_cmd_flow_counter_query(struct mlx5_devx_obj *dcs,
                                                     out_len, async_id,
                                                     cmd_comp);
        if (rc) {
-               DRV_LOG(ERR, "Failed to query devx counters with rc %d\n ", rc);
+               DRV_LOG(ERR, "Failed to query devx counters with rc %d", rc);
                rte_errno = rc;
                return -rc;
        }
@@ -171,7 +171,7 @@ mlx5_devx_cmd_mkey_create(struct ibv_context *ctx,
        mkey->obj = mlx5_glue->devx_obj_create(ctx, in, sizeof(in), out,
                                               sizeof(out));
        if (!mkey->obj) {
-               DRV_LOG(ERR, "Can't create mkey - error %d\n", errno);
+               DRV_LOG(ERR, "Can't create mkey - error %d", errno);
                rte_errno = errno;
                rte_free(mkey);
                return NULL;
@@ -202,7 +202,7 @@ mlx5_devx_get_out_command_status(void *out)
        if (status) {
                int syndrome = MLX5_GET(query_flow_counter_out, out, syndrome);
 
-               DRV_LOG(ERR, "Bad devX status %x, syndrome = %x\n", status,
+               DRV_LOG(ERR, "Bad devX status %x, syndrome = %x", status,
                        syndrome);
        }
        return status;
index 5f01f9c..b4b08f4 100644 (file)
@@ -3136,7 +3136,7 @@ mlx5_ctrl_flow_source_queue(struct rte_eth_dev *dev,
        if (!flow) {
                DRV_LOG(DEBUG,
                        "Failed to create ctrl flow: rte_errno(%d),"
-                       " type(%d), message(%s)\n",
+                       " type(%d), message(%s)",
                        rte_errno, error.type,
                        error.message ? error.message : " (no stated reason)");
                return -rte_errno;
@@ -3856,10 +3856,10 @@ mlx5_set_query_alarm(struct mlx5_ibv_shared *sh)
        cont = MLX5_CNT_CONTAINER(sh, 1, 0);
        pools_n += rte_atomic16_read(&cont->n_valid);
        us = MLX5_POOL_QUERY_FREQ_US / pools_n;
-       DRV_LOG(DEBUG, "Set alarm for %u pools each %u us\n", pools_n, us);
+       DRV_LOG(DEBUG, "Set alarm for %u pools each %u us", pools_n, us);
        if (rte_eal_alarm_set(us, mlx5_flow_query_alarm, sh)) {
                sh->cmng.query_thread_on = 0;
-               DRV_LOG(ERR, "Cannot reinitialize query alarm\n");
+               DRV_LOG(ERR, "Cannot reinitialize query alarm");
        } else {
                sh->cmng.query_thread_on = 1;
        }
@@ -3931,7 +3931,7 @@ next_container:
                                               (uint64_t)(uintptr_t)pool);
        if (ret) {
                DRV_LOG(ERR, "Failed to trigger asynchronous query for dcs ID"
-                       " %d\n", pool->min_dcs->id);
+                       " %d", pool->min_dcs->id);
                pool->raw_hw = NULL;
                goto set_alarm;
        }
index f597c89..7f99f22 100644 (file)
@@ -583,18 +583,16 @@ mlx5_dump_debug_information(const char *fname, const char *hex_title,
        MKSTR(path, "%s/%s", MLX5_SYSTEM_LOG_DIR, fname);
        fd = fopen(path, "a+");
        if (!fd) {
-               DRV_LOG(WARNING, "cannot open %s for debug dump\n",
-                       path);
+               DRV_LOG(WARNING, "cannot open %s for debug dump", path);
                MKSTR(path2, "./%s", fname);
                fd = fopen(path2, "a+");
                if (!fd) {
-                       DRV_LOG(ERR, "cannot open %s for debug dump\n",
-                               path2);
+                       DRV_LOG(ERR, "cannot open %s for debug dump", path2);
                        return;
                }
-               DRV_LOG(INFO, "New debug dump in file %s\n", path2);
+               DRV_LOG(INFO, "New debug dump in file %s", path2);
        } else {
-               DRV_LOG(INFO, "New debug dump in file %s\n", path);
+               DRV_LOG(INFO, "New debug dump in file %s", path);
        }
        if (hex_title)
                rte_hexdump(fd, hex_title, buf, hex_len);
@@ -850,7 +848,7 @@ mlx5_queue_state_modify_primary(struct rte_eth_dev *dev,
                                                      &rq_attr);
                }
                if (ret) {
-                       DRV_LOG(ERR, "Cannot change Rx WQ state to %u  - %s\n",
+                       DRV_LOG(ERR, "Cannot change Rx WQ state to %u  - %s",
                                        sm->state, strerror(errno));
                        rte_errno = errno;
                        return ret;
@@ -868,7 +866,7 @@ mlx5_queue_state_modify_primary(struct rte_eth_dev *dev,
                ret = mlx5_glue->modify_qp(qp, &mod, IBV_QP_STATE);
                if (ret) {
                        DRV_LOG(ERR, "Cannot change the Tx QP state to RESET "
-                               "%s\n", strerror(errno));
+                               "%s", strerror(errno));
                        rte_errno = errno;
                        return ret;
                }
@@ -876,7 +874,7 @@ mlx5_queue_state_modify_primary(struct rte_eth_dev *dev,
                ret = mlx5_glue->modify_qp(qp, &mod,
                                           (IBV_QP_STATE | IBV_QP_PORT));
                if (ret) {
-                       DRV_LOG(ERR, "Cannot change Tx QP state to INIT %s\n",
+                       DRV_LOG(ERR, "Cannot change Tx QP state to INIT %s",
                                strerror(errno));
                        rte_errno = errno;
                        return ret;
@@ -884,7 +882,7 @@ mlx5_queue_state_modify_primary(struct rte_eth_dev *dev,
                mod.qp_state = IBV_QPS_RTR;
                ret = mlx5_glue->modify_qp(qp, &mod, IBV_QP_STATE);
                if (ret) {
-                       DRV_LOG(ERR, "Cannot change Tx QP state to RTR %s\n",
+                       DRV_LOG(ERR, "Cannot change Tx QP state to RTR %s",
                                strerror(errno));
                        rte_errno = errno;
                        return ret;
@@ -892,7 +890,7 @@ mlx5_queue_state_modify_primary(struct rte_eth_dev *dev,
                mod.qp_state = IBV_QPS_RTS;
                ret = mlx5_glue->modify_qp(qp, &mod, IBV_QP_STATE);
                if (ret) {
-                       DRV_LOG(ERR, "Cannot change Tx QP state to RTS %s\n",
+                       DRV_LOG(ERR, "Cannot change Tx QP state to RTS %s",
                                strerror(errno));
                        rte_errno = errno;
                        return ret;