RDMA/rtrs-clt: Output sg index when warning on

Output the sg index, so it's a bit easier for debug.

Signed-off-by: Jack Wang <jinpu.wang@ionos.com>
Reviewed-by: Aleksei Marov <aleksei.marov@ionos.com>
Link: https://lore.kernel.org/r/20220818105355.110344-2-haris.iqbal@ionos.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
This commit is contained in:
Jack Wang 2022-08-18 12:53:53 +02:00 committed by Leon Romanovsky
parent c16762b7bf
commit b722d3e63f

View File

@ -175,7 +175,7 @@ int rtrs_iu_post_rdma_write_imm(struct rtrs_con *con, struct rtrs_iu *iu,
* length error
*/
for (i = 0; i < num_sge; i++)
if (WARN_ON(sge[i].length == 0))
if (WARN_ONCE(sge[i].length == 0, "sg %d is zero length\n", i))
return -EINVAL;
return rtrs_post_send(con->qp, head, &wr.wr, tail);