From b8b9cdb51194cdd3cb07c81d8418b3729f470858 Mon Sep 17 00:00:00 2001 From: Amir Vadai Date: Thu, 27 Jan 2011 10:42:56 +0200 Subject: [PATCH] rdma_cm, sdp: bug fixes and some changes to APM logic - We no longer rely on the private data buffer of the LAP/APR messages for passive side LID improvement. Instead, we use the protocol defined LID improvement APR error code. - Two paths are allocated on id creation to simplify code. - Various small bug fixes. - Added a missing ref_count get - Some code cleanup. - Important: rdma_enable_apm may be called only upon receiving RDMA_CM_ROUTE_RESOLVED event. This was done to break symmetry on failover and possibly on other occasions. Signed-off-by: Nir Muchtar Signed-off-by: Moni Shoua Signed-off-by: Amir Vadai --- drivers/infiniband/ulp/sdp/sdp.h | 2 +- drivers/infiniband/ulp/sdp/sdp_cma.c | 13 +++++++------ drivers/infiniband/ulp/sdp/sdp_dbg.h | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/infiniband/ulp/sdp/sdp.h b/drivers/infiniband/ulp/sdp/sdp.h index 1c1e7947b4fa..b28df685024e 100644 --- a/drivers/infiniband/ulp/sdp/sdp.h +++ b/drivers/infiniband/ulp/sdp/sdp.h @@ -60,7 +60,7 @@ #define SDP_RX_ARMING_DELAY (msecs_to_jiffies(10)) #define SDP_RDMA_READ_TIMEOUT (60 * HZ) /* timeout - fatal hw error */ -#define SDP_SRCAVAIL_CANCEL_TIMEOUT (HZ * 5) +#define SDP_SRCAVAIL_CANCEL_TIMEOUT (HZ * 60) #define SDP_SRCAVAIL_ADV_TIMEOUT (1 * HZ) #define SDP_RESOLVE_TIMEOUT 1000 diff --git a/drivers/infiniband/ulp/sdp/sdp_cma.c b/drivers/infiniband/ulp/sdp/sdp_cma.c index 52c8a8eea056..93965953600c 100644 --- a/drivers/infiniband/ulp/sdp/sdp_cma.c +++ b/drivers/infiniband/ulp/sdp/sdp_cma.c @@ -418,12 +418,6 @@ int sdp_cma_handler(struct rdma_cm_id *id, struct rdma_cm_event *event) break; } - if (sdp_apm_enable) { - rc = rdma_enable_apm(id, RDMA_ALT_PATH_BEST); - if (rc) - sdp_warn(sk, "APM couldn't be enabled: %d\n", rc); - } - rc = rdma_resolve_route(id, SDP_ROUTE_TIMEOUT); break; case RDMA_CM_EVENT_ADDR_ERROR: @@ -473,6 +467,13 @@ int sdp_cma_handler(struct rdma_cm_id *id, struct rdma_cm_event *event) conn_param.initiator_depth = 4 /* TODO */; conn_param.retry_count = SDP_RETRY_COUNT; SDP_DUMP_PACKET(sk, "TX", NULL, &hh.bsdh); + + if (sdp_apm_enable) { + rc = rdma_enable_apm(id, RDMA_ALT_PATH_BEST); + if (rc) + sdp_warn(sk, "APM couldn't be enabled: %d\n", rc); + } + rc = rdma_connect(id, &conn_param); break; diff --git a/drivers/infiniband/ulp/sdp/sdp_dbg.h b/drivers/infiniband/ulp/sdp/sdp_dbg.h index b02671737142..57c4f811a665 100644 --- a/drivers/infiniband/ulp/sdp/sdp_dbg.h +++ b/drivers/infiniband/ulp/sdp/sdp_dbg.h @@ -108,7 +108,7 @@ extern int sdp_debug_level; sdp_print_history(sk); \ SDP_WARN_ON(1); \ } else { \ - sdp_dbg(sk, "%s:%d - %s (%s) ref = %d.\n", __func__, __LINE__, \ + sdp_dbg_data(sk, "%s:%d - %s (%s) ref = %d.\n", __func__, __LINE__, \ #sock_op, msg, atomic_read(&(sk)->sk_refcnt)); \ sock_op(sk); \ }\ -- 2.50.1