[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6713b0b5394cfcc5b2b2c6c2f2fb48920a3f2efa.camel@perches.com>
Date: Fri, 24 Jan 2020 14:15:31 -0800
From: Joe Perches <joe@...ches.com>
To: Saeed Mahameed <saeedm@...lanox.com>,
"David S. Miller" <davem@...emloft.net>
Cc: "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [net-next 06/14] mlx5: Use proper logging and tracing line
terminations
On Fri, 2020-01-24 at 21:55 +0000, Saeed Mahameed wrote:
> From: Joe Perches <joe@...ches.com>
Not really from me.
> netdev_err should use newline termination but mlx5_health_report
> is used in a trace output function devlink_health_report where
> no newline should be used.
>
> Remove the newlines from a couple formats and add a format string
> of "%s\n" to the netdev_err call to not directly output the
> logging string.
>
> Also use snprintf to avoid any possible output string overrun.
[]
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c
[]
> @@ -389,10 +389,10 @@ int mlx5e_reporter_tx_timeout(struct mlx5e_txqsq *sq)
> err_ctx.ctx = sq;
> err_ctx.recover = mlx5e_tx_reporter_timeout_recover;
> err_ctx.dump = mlx5e_tx_reporter_dump_sq;
> - sprintf(err_str,
> - "TX timeout on queue: %d, SQ: 0x%x, CQ: 0x%x, SQ Cons: 0x%x SQ Prod: 0x%x, usecs since last trans: %u\n",
> - sq->channel->ix, sq->sqn, sq->cq.mcq.cqn, sq->cc, sq->pc,
> - jiffies_to_usecs(jiffies - sq->txq->trans_start));
> + snprintf(err_str, sizeof(err_str),
> + "TX timeout on queue: %d, SQ: 0x%x, CQ: 0x%x, SQ Cons: 0x%x SQ Prod: 0x%x, usecs since last trans: %u\n",
> + sq->channel->ix, sq->sqn, sq->cq.mcq.cqn, sq->cc, sq->pc,
> + jiffies_to_usecs(jiffies - sq->txq->trans_start));
This is not the patch I sent.
There should not be a newline here and
there was no newline in the patch I sent.
> return mlx5e_health_report(priv, priv->tx_reporter, err_str, &err_ctx);
> }
Powered by blists - more mailing lists