aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/ulp
diff options
context:
space:
mode:
authorSagi Grimberg <sagig@mellanox.com>2014-12-02 09:57:37 -0500
committerNicholas Bellinger <nab@linux-iscsi.org>2014-12-13 02:32:27 -0500
commit68a86dee8a32358ffd9dfa6d2acde4f71a572285 (patch)
treecf69250052a0a885331d85f12680bc3089ef736b /drivers/infiniband/ulp
parent268e6811f5729fb9ce7415586bd992b504fe95a2 (diff)
iser-target: Remove interrupt coalescing
It is disabled at the moment, we will get that back in once the target is more stable. This reverts commit 95b60f0 "Add support for completion interrupt coalescing" Signed-off-by: Sagi Grimberg <sagig@mellanox.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/infiniband/ulp')
-rw-r--r--drivers/infiniband/ulp/isert/ib_isert.c120
-rw-r--r--drivers/infiniband/ulp/isert/ib_isert.h6
2 files changed, 10 insertions, 116 deletions
diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c
index b88686e96a54..992e452c9570 100644
--- a/drivers/infiniband/ulp/isert/ib_isert.c
+++ b/drivers/infiniband/ulp/isert/ib_isert.c
@@ -22,7 +22,6 @@
22#include <linux/socket.h> 22#include <linux/socket.h>
23#include <linux/in.h> 23#include <linux/in.h>
24#include <linux/in6.h> 24#include <linux/in6.h>
25#include <linux/llist.h>
26#include <rdma/ib_verbs.h> 25#include <rdma/ib_verbs.h>
27#include <rdma/rdma_cm.h> 26#include <rdma/rdma_cm.h>
28#include <target/target_core_base.h> 27#include <target/target_core_base.h>
@@ -1063,7 +1062,7 @@ isert_init_tx_hdrs(struct isert_conn *isert_conn,
1063 1062
1064static void 1063static void
1065isert_init_send_wr(struct isert_conn *isert_conn, struct isert_cmd *isert_cmd, 1064isert_init_send_wr(struct isert_conn *isert_conn, struct isert_cmd *isert_cmd,
1066 struct ib_send_wr *send_wr, bool coalesce) 1065 struct ib_send_wr *send_wr)
1067{ 1066{
1068 struct iser_tx_desc *tx_desc = &isert_cmd->tx_desc; 1067 struct iser_tx_desc *tx_desc = &isert_cmd->tx_desc;
1069 1068
@@ -1072,22 +1071,6 @@ isert_init_send_wr(struct isert_conn *isert_conn, struct isert_cmd *isert_cmd,
1072 send_wr->opcode = IB_WR_SEND; 1071 send_wr->opcode = IB_WR_SEND;
1073 send_wr->sg_list = &tx_desc->tx_sg[0]; 1072 send_wr->sg_list = &tx_desc->tx_sg[0];
1074 send_wr->num_sge = isert_cmd->tx_desc.num_sge; 1073 send_wr->num_sge = isert_cmd->tx_desc.num_sge;
1075 /*
1076 * Coalesce send completion interrupts by only setting IB_SEND_SIGNALED
1077 * bit for every ISERT_COMP_BATCH_COUNT number of ib_post_send() calls.
1078 */
1079 mutex_lock(&isert_conn->conn_mutex);
1080 if (coalesce && isert_conn->state == ISER_CONN_FULL_FEATURE &&
1081 ++isert_conn->conn_comp_batch < ISERT_COMP_BATCH_COUNT) {
1082 tx_desc->llnode_active = true;
1083 llist_add(&tx_desc->comp_llnode, &isert_conn->conn_comp_llist);
1084 mutex_unlock(&isert_conn->conn_mutex);
1085 return;
1086 }
1087 isert_conn->conn_comp_batch = 0;
1088 tx_desc->comp_llnode_batch = llist_del_all(&isert_conn->conn_comp_llist);
1089 mutex_unlock(&isert_conn->conn_mutex);
1090
1091 send_wr->send_flags = IB_SEND_SIGNALED; 1074 send_wr->send_flags = IB_SEND_SIGNALED;
1092} 1075}
1093 1076
@@ -1988,8 +1971,8 @@ isert_response_completion(struct iser_tx_desc *tx_desc,
1988} 1971}
1989 1972
1990static void 1973static void
1991__isert_send_completion(struct iser_tx_desc *tx_desc, 1974isert_send_completion(struct iser_tx_desc *tx_desc,
1992 struct isert_conn *isert_conn) 1975 struct isert_conn *isert_conn)
1993{ 1976{
1994 struct ib_device *ib_dev = isert_conn->conn_cm_id->device; 1977 struct ib_device *ib_dev = isert_conn->conn_cm_id->device;
1995 struct isert_cmd *isert_cmd = tx_desc->isert_cmd; 1978 struct isert_cmd *isert_cmd = tx_desc->isert_cmd;
@@ -2031,87 +2014,10 @@ __isert_send_completion(struct iser_tx_desc *tx_desc,
2031} 2014}
2032 2015
2033static void 2016static void
2034isert_send_completion(struct iser_tx_desc *tx_desc,
2035 struct isert_conn *isert_conn)
2036{
2037 struct llist_node *llnode = tx_desc->comp_llnode_batch;
2038 struct iser_tx_desc *t;
2039 /*
2040 * Drain coalesced completion llist starting from comp_llnode_batch
2041 * setup in isert_init_send_wr(), and then complete trailing tx_desc.
2042 */
2043 while (llnode) {
2044 t = llist_entry(llnode, struct iser_tx_desc, comp_llnode);
2045 llnode = llist_next(llnode);
2046 __isert_send_completion(t, isert_conn);
2047 }
2048 __isert_send_completion(tx_desc, isert_conn);
2049}
2050
2051static void
2052isert_cq_drain_comp_llist(struct isert_conn *isert_conn, struct ib_device *ib_dev)
2053{
2054 struct llist_node *llnode;
2055 struct isert_rdma_wr *wr;
2056 struct iser_tx_desc *t;
2057
2058 mutex_lock(&isert_conn->conn_mutex);
2059 llnode = llist_del_all(&isert_conn->conn_comp_llist);
2060 isert_conn->conn_comp_batch = 0;
2061 mutex_unlock(&isert_conn->conn_mutex);
2062
2063 while (llnode) {
2064 t = llist_entry(llnode, struct iser_tx_desc, comp_llnode);
2065 llnode = llist_next(llnode);
2066 wr = &t->isert_cmd->rdma_wr;
2067
2068 /**
2069 * If send_wr_num is 0 this means that we got
2070 * RDMA completion and we cleared it and we should
2071 * simply decrement the response post. else the
2072 * response is incorporated in send_wr_num, just
2073 * sub it.
2074 **/
2075 if (wr->send_wr_num)
2076 atomic_sub(wr->send_wr_num,
2077 &isert_conn->post_send_buf_count);
2078 else
2079 atomic_dec(&isert_conn->post_send_buf_count);
2080
2081 isert_completion_put(t, t->isert_cmd, ib_dev, true);
2082 }
2083}
2084
2085static void
2086isert_cq_tx_comp_err(struct iser_tx_desc *tx_desc, struct isert_conn *isert_conn) 2017isert_cq_tx_comp_err(struct iser_tx_desc *tx_desc, struct isert_conn *isert_conn)
2087{ 2018{
2088 struct ib_device *ib_dev = isert_conn->conn_cm_id->device; 2019 struct ib_device *ib_dev = isert_conn->conn_cm_id->device;
2089 struct isert_cmd *isert_cmd = tx_desc->isert_cmd; 2020 struct isert_cmd *isert_cmd = tx_desc->isert_cmd;
2090 struct llist_node *llnode = tx_desc->comp_llnode_batch;
2091 struct isert_rdma_wr *wr;
2092 struct iser_tx_desc *t;
2093
2094 while (llnode) {
2095 t = llist_entry(llnode, struct iser_tx_desc, comp_llnode);
2096 llnode = llist_next(llnode);
2097 wr = &t->isert_cmd->rdma_wr;
2098
2099 /**
2100 * If send_wr_num is 0 this means that we got
2101 * RDMA completion and we cleared it and we should
2102 * simply decrement the response post. else the
2103 * response is incorporated in send_wr_num, just
2104 * sub it.
2105 **/
2106 if (wr->send_wr_num)
2107 atomic_sub(wr->send_wr_num,
2108 &isert_conn->post_send_buf_count);
2109 else
2110 atomic_dec(&isert_conn->post_send_buf_count);
2111
2112 isert_completion_put(t, t->isert_cmd, ib_dev, true);
2113 }
2114 tx_desc->comp_llnode_batch = NULL;
2115 2021
2116 if (!isert_cmd) 2022 if (!isert_cmd)
2117 isert_unmap_tx_desc(tx_desc, ib_dev); 2023 isert_unmap_tx_desc(tx_desc, ib_dev);
@@ -2122,14 +2028,11 @@ isert_cq_tx_comp_err(struct iser_tx_desc *tx_desc, struct isert_conn *isert_conn
2122static void 2028static void
2123isert_cq_rx_comp_err(struct isert_conn *isert_conn) 2029isert_cq_rx_comp_err(struct isert_conn *isert_conn)
2124{ 2030{
2125 struct ib_device *ib_dev = isert_conn->conn_cm_id->device;
2126 struct iscsi_conn *conn = isert_conn->conn; 2031 struct iscsi_conn *conn = isert_conn->conn;
2127 2032
2128 if (isert_conn->post_recv_buf_count) 2033 if (isert_conn->post_recv_buf_count)
2129 return; 2034 return;
2130 2035
2131 isert_cq_drain_comp_llist(isert_conn, ib_dev);
2132
2133 if (conn->sess) { 2036 if (conn->sess) {
2134 target_sess_cmd_list_set_waiting(conn->sess->se_sess); 2037 target_sess_cmd_list_set_waiting(conn->sess->se_sess);
2135 target_wait_for_sess_cmds(conn->sess->se_sess); 2038 target_wait_for_sess_cmds(conn->sess->se_sess);
@@ -2171,9 +2074,6 @@ isert_cq_tx_work(struct work_struct *work)
2171 pr_debug("TX wc.vendor_err: 0x%08x\n", wc.vendor_err); 2074 pr_debug("TX wc.vendor_err: 0x%08x\n", wc.vendor_err);
2172 2075
2173 if (wc.wr_id != ISER_FASTREG_LI_WRID) { 2076 if (wc.wr_id != ISER_FASTREG_LI_WRID) {
2174 if (tx_desc->llnode_active)
2175 continue;
2176
2177 atomic_dec(&isert_conn->post_send_buf_count); 2077 atomic_dec(&isert_conn->post_send_buf_count);
2178 isert_cq_tx_comp_err(tx_desc, isert_conn); 2078 isert_cq_tx_comp_err(tx_desc, isert_conn);
2179 } 2079 }
@@ -2293,7 +2193,7 @@ isert_put_response(struct iscsi_conn *conn, struct iscsi_cmd *cmd)
2293 isert_cmd->tx_desc.num_sge = 2; 2193 isert_cmd->tx_desc.num_sge = 2;
2294 } 2194 }
2295 2195
2296 isert_init_send_wr(isert_conn, isert_cmd, send_wr, false); 2196 isert_init_send_wr(isert_conn, isert_cmd, send_wr);
2297 2197
2298 pr_debug("Posting SCSI Response IB_WR_SEND >>>>>>>>>>>>>>>>>>>>>>\n"); 2198 pr_debug("Posting SCSI Response IB_WR_SEND >>>>>>>>>>>>>>>>>>>>>>\n");
2299 2199
@@ -2351,7 +2251,7 @@ isert_put_nopin(struct iscsi_cmd *cmd, struct iscsi_conn *conn,
2351 &isert_cmd->tx_desc.iscsi_header, 2251 &isert_cmd->tx_desc.iscsi_header,
2352 nopout_response); 2252 nopout_response);
2353 isert_init_tx_hdrs(isert_conn, &isert_cmd->tx_desc); 2253 isert_init_tx_hdrs(isert_conn, &isert_cmd->tx_desc);
2354 isert_init_send_wr(isert_conn, isert_cmd, send_wr, false); 2254 isert_init_send_wr(isert_conn, isert_cmd, send_wr);
2355 2255
2356 pr_debug("Posting NOPIN Response IB_WR_SEND >>>>>>>>>>>>>>>>>>>>>>\n"); 2256 pr_debug("Posting NOPIN Response IB_WR_SEND >>>>>>>>>>>>>>>>>>>>>>\n");
2357 2257
@@ -2369,7 +2269,7 @@ isert_put_logout_rsp(struct iscsi_cmd *cmd, struct iscsi_conn *conn)
2369 iscsit_build_logout_rsp(cmd, conn, (struct iscsi_logout_rsp *) 2269 iscsit_build_logout_rsp(cmd, conn, (struct iscsi_logout_rsp *)
2370 &isert_cmd->tx_desc.iscsi_header); 2270 &isert_cmd->tx_desc.iscsi_header);
2371 isert_init_tx_hdrs(isert_conn, &isert_cmd->tx_desc); 2271 isert_init_tx_hdrs(isert_conn, &isert_cmd->tx_desc);
2372 isert_init_send_wr(isert_conn, isert_cmd, send_wr, false); 2272 isert_init_send_wr(isert_conn, isert_cmd, send_wr);
2373 2273
2374 pr_debug("Posting Logout Response IB_WR_SEND >>>>>>>>>>>>>>>>>>>>>>\n"); 2274 pr_debug("Posting Logout Response IB_WR_SEND >>>>>>>>>>>>>>>>>>>>>>\n");
2375 2275
@@ -2387,7 +2287,7 @@ isert_put_tm_rsp(struct iscsi_cmd *cmd, struct iscsi_conn *conn)
2387 iscsit_build_task_mgt_rsp(cmd, conn, (struct iscsi_tm_rsp *) 2287 iscsit_build_task_mgt_rsp(cmd, conn, (struct iscsi_tm_rsp *)
2388 &isert_cmd->tx_desc.iscsi_header); 2288 &isert_cmd->tx_desc.iscsi_header);
2389 isert_init_tx_hdrs(isert_conn, &isert_cmd->tx_desc); 2289 isert_init_tx_hdrs(isert_conn, &isert_cmd->tx_desc);
2390 isert_init_send_wr(isert_conn, isert_cmd, send_wr, false); 2290 isert_init_send_wr(isert_conn, isert_cmd, send_wr);
2391 2291
2392 pr_debug("Posting Task Management Response IB_WR_SEND >>>>>>>>>>>>>>>>>>>>>>\n"); 2292 pr_debug("Posting Task Management Response IB_WR_SEND >>>>>>>>>>>>>>>>>>>>>>\n");
2393 2293
@@ -2419,7 +2319,7 @@ isert_put_reject(struct iscsi_cmd *cmd, struct iscsi_conn *conn)
2419 tx_dsg->lkey = isert_conn->conn_mr->lkey; 2319 tx_dsg->lkey = isert_conn->conn_mr->lkey;
2420 isert_cmd->tx_desc.num_sge = 2; 2320 isert_cmd->tx_desc.num_sge = 2;
2421 2321
2422 isert_init_send_wr(isert_conn, isert_cmd, send_wr, false); 2322 isert_init_send_wr(isert_conn, isert_cmd, send_wr);
2423 2323
2424 pr_debug("Posting Reject IB_WR_SEND >>>>>>>>>>>>>>>>>>>>>>\n"); 2324 pr_debug("Posting Reject IB_WR_SEND >>>>>>>>>>>>>>>>>>>>>>\n");
2425 2325
@@ -2459,7 +2359,7 @@ isert_put_text_rsp(struct iscsi_cmd *cmd, struct iscsi_conn *conn)
2459 tx_dsg->lkey = isert_conn->conn_mr->lkey; 2359 tx_dsg->lkey = isert_conn->conn_mr->lkey;
2460 isert_cmd->tx_desc.num_sge = 2; 2360 isert_cmd->tx_desc.num_sge = 2;
2461 } 2361 }
2462 isert_init_send_wr(isert_conn, isert_cmd, send_wr, false); 2362 isert_init_send_wr(isert_conn, isert_cmd, send_wr);
2463 2363
2464 pr_debug("Posting Text Response IB_WR_SEND >>>>>>>>>>>>>>>>>>>>>>\n"); 2364 pr_debug("Posting Text Response IB_WR_SEND >>>>>>>>>>>>>>>>>>>>>>\n");
2465 2365
@@ -3026,7 +2926,7 @@ isert_put_datain(struct iscsi_conn *conn, struct iscsi_cmd *cmd)
3026 &isert_cmd->tx_desc.iscsi_header); 2926 &isert_cmd->tx_desc.iscsi_header);
3027 isert_init_tx_hdrs(isert_conn, &isert_cmd->tx_desc); 2927 isert_init_tx_hdrs(isert_conn, &isert_cmd->tx_desc);
3028 isert_init_send_wr(isert_conn, isert_cmd, 2928 isert_init_send_wr(isert_conn, isert_cmd,
3029 &isert_cmd->tx_desc.send_wr, false); 2929 &isert_cmd->tx_desc.send_wr);
3030 isert_cmd->rdma_wr.s_send_wr.next = &isert_cmd->tx_desc.send_wr; 2930 isert_cmd->rdma_wr.s_send_wr.next = &isert_cmd->tx_desc.send_wr;
3031 wr->send_wr_num += 1; 2931 wr->send_wr_num += 1;
3032 } 2932 }
diff --git a/drivers/infiniband/ulp/isert/ib_isert.h b/drivers/infiniband/ulp/isert/ib_isert.h
index 141905f446dd..b3735a07ca47 100644
--- a/drivers/infiniband/ulp/isert/ib_isert.h
+++ b/drivers/infiniband/ulp/isert/ib_isert.h
@@ -45,9 +45,6 @@ struct iser_tx_desc {
45 struct ib_sge tx_sg[2]; 45 struct ib_sge tx_sg[2];
46 int num_sge; 46 int num_sge;
47 struct isert_cmd *isert_cmd; 47 struct isert_cmd *isert_cmd;
48 struct llist_node *comp_llnode_batch;
49 struct llist_node comp_llnode;
50 bool llnode_active;
51 struct ib_send_wr send_wr; 48 struct ib_send_wr send_wr;
52} __packed; 49} __packed;
53 50
@@ -158,9 +155,6 @@ struct isert_conn {
158 /* lock to protect fastreg pool */ 155 /* lock to protect fastreg pool */
159 spinlock_t conn_lock; 156 spinlock_t conn_lock;
160 struct work_struct release_work; 157 struct work_struct release_work;
161#define ISERT_COMP_BATCH_COUNT 8
162 int conn_comp_batch;
163 struct llist_head conn_comp_llist;
164}; 158};
165 159
166#define ISERT_MAX_CQ 64 160#define ISERT_MAX_CQ 64