From 157c596683bcb91905bf33a5cf53f4a6ea3e76e3 Mon Sep 17 00:00:00 2001 From: Pradeep Gopanapalli Date: Tue, 9 Feb 2016 23:15:19 +0000 Subject: [PATCH] Fixed wrongly checked return type Added Debug print In xs_post_recv instead of checking for -ENOMEM xscore driver is checking ENOMEM, fixed this by checking proper return type Orabug: 22862488 Reported-by: Haakon Bugge Signed-off-by: Pradeep Gopanapalli Reviewed-by: sajid zia Signed-off-by: Qing Huang --- drivers/infiniband/ulp/xsigo/xscore/Makefile | 2 +- drivers/infiniband/ulp/xsigo/xscore/xscore_api.c | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/infiniband/ulp/xsigo/xscore/Makefile b/drivers/infiniband/ulp/xsigo/xscore/Makefile index 1814c4879d53..2dfe848a30cd 100644 --- a/drivers/infiniband/ulp/xsigo/xscore/Makefile +++ b/drivers/infiniband/ulp/xsigo/xscore/Makefile @@ -2,7 +2,7 @@ obj-$(CONFIG_INFINIBAND_XSCORE) := xscore.o xscore-y := xscore_impl.o xs_ud.o xscore_api.o xsmp.o \ xscore_stats.o xscore_uadm.o -ccflags-y += -DXSIGO_LOCAL_VERSION=\"6.0.r8008\" +ccflags-y += -DXSIGO_LOCAL_VERSION=\"6.0.r8012\" ccflags-y += -DRDMA_PORT_LINK_LAYER_CHANGES -DHAS_SKB_ACCESS_FUNCTIONS ccflags-y += -DSCSI_STRUCT_CHANGES -DSCSI_TIMEOUT_CHANGES -DLLE ccflags-y += -DXG_FRAG_SIZE_PRESENT -DXG_FRAG_PAGE_PRESENT diff --git a/drivers/infiniband/ulp/xsigo/xscore/xscore_api.c b/drivers/infiniband/ulp/xsigo/xscore/xscore_api.c index 8b00c2734cc6..524922010f2d 100644 --- a/drivers/infiniband/ulp/xsigo/xscore/xscore_api.c +++ b/drivers/infiniband/ulp/xsigo/xscore/xscore_api.c @@ -393,7 +393,9 @@ static int xs_post_recv(struct xscore_conn_ctx *ctx, int offset, int n, ret = -ENOMEM; } - if (ret == ENOMEM) { + if (ret == -ENOMEM) { + IB_ERROR("%s Memory errors i%d ret%d", + __func__, i, ret); if (fillholes) return ret; goto partial_failure; @@ -701,6 +703,9 @@ static int xscore_poll_recv(struct xscore_conn_ctx *ctx) err++; break; } + if (wc.status) + IB_ERROR("%s completion error wr_id%d status %d\n", + __func__, i, wc.status); desc = &ctx->rx_ring[i]; if (desc->page) { for (j = 0; j < (desc->size / PAGE_SIZE); ++j) @@ -719,7 +724,6 @@ static int xscore_poll_recv(struct xscore_conn_ctx *ctx) size = wc.byte_len; xscore_reset_rxdescriptor(desc); - /* * Call completion callback, pass buffer size * and client arg and status @@ -1443,8 +1447,9 @@ static void handle_cm_rep(struct xscore_conn_ctx *ctx) if (ctx->features & XSCORE_RDMA_SUPPORT) { attr_mask |= IB_QP_MAX_DEST_RD_ATOMIC; - qp_attr.max_dest_rd_atomic = min (ctx->port->xs_dev->dev_attr.max_qp_rd_atom, - rdma_responder_resources); + qp_attr.max_dest_rd_atomic = + min(ctx->port->xs_dev->dev_attr.max_qp_rd_atom, + rdma_responder_resources); } else { qp_attr.max_dest_rd_atomic = 4; } -- 2.50.1