iser_initiator.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561
  1. /*
  2. * Copyright (c) 2004, 2005, 2006 Voltaire, Inc. All rights reserved.
  3. *
  4. * This software is available to you under a choice of one of two
  5. * licenses. You may choose to be licensed under the terms of the GNU
  6. * General Public License (GPL) Version 2, available from the file
  7. * COPYING in the main directory of this source tree, or the
  8. * OpenIB.org BSD license below:
  9. *
  10. * Redistribution and use in source and binary forms, with or
  11. * without modification, are permitted provided that the following
  12. * conditions are met:
  13. *
  14. * - Redistributions of source code must retain the above
  15. * copyright notice, this list of conditions and the following
  16. * disclaimer.
  17. *
  18. * - Redistributions in binary form must reproduce the above
  19. * copyright notice, this list of conditions and the following
  20. * disclaimer in the documentation and/or other materials
  21. * provided with the distribution.
  22. *
  23. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  24. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  25. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  26. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
  27. * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  28. * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  29. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  30. * SOFTWARE.
  31. */
  32. #include <linux/kernel.h>
  33. #include <linux/slab.h>
  34. #include <linux/mm.h>
  35. #include <linux/scatterlist.h>
  36. #include <linux/kfifo.h>
  37. #include <scsi/scsi_cmnd.h>
  38. #include <scsi/scsi_host.h>
  39. #include "iscsi_iser.h"
  40. /* Register user buffer memory and initialize passive rdma
  41. * dto descriptor. Total data size is stored in
  42. * iser_task->data[ISER_DIR_IN].data_len
  43. */
  44. static int iser_prepare_read_cmd(struct iscsi_task *task,
  45. unsigned int edtl)
  46. {
  47. struct iscsi_iser_task *iser_task = task->dd_data;
  48. struct iser_regd_buf *regd_buf;
  49. int err;
  50. struct iser_hdr *hdr = &iser_task->desc.iser_header;
  51. struct iser_data_buf *buf_in = &iser_task->data[ISER_DIR_IN];
  52. err = iser_dma_map_task_data(iser_task,
  53. buf_in,
  54. ISER_DIR_IN,
  55. DMA_FROM_DEVICE);
  56. if (err)
  57. return err;
  58. if (edtl > iser_task->data[ISER_DIR_IN].data_len) {
  59. iser_err("Total data length: %ld, less than EDTL: "
  60. "%d, in READ cmd BHS itt: %d, conn: 0x%p\n",
  61. iser_task->data[ISER_DIR_IN].data_len, edtl,
  62. task->itt, iser_task->iser_conn);
  63. return -EINVAL;
  64. }
  65. err = iser_reg_rdma_mem(iser_task,ISER_DIR_IN);
  66. if (err) {
  67. iser_err("Failed to set up Data-IN RDMA\n");
  68. return err;
  69. }
  70. regd_buf = &iser_task->rdma_regd[ISER_DIR_IN];
  71. hdr->flags |= ISER_RSV;
  72. hdr->read_stag = cpu_to_be32(regd_buf->reg.rkey);
  73. hdr->read_va = cpu_to_be64(regd_buf->reg.va);
  74. iser_dbg("Cmd itt:%d READ tags RKEY:%#.4X VA:%#llX\n",
  75. task->itt, regd_buf->reg.rkey,
  76. (unsigned long long)regd_buf->reg.va);
  77. return 0;
  78. }
  79. /* Register user buffer memory and initialize passive rdma
  80. * dto descriptor. Total data size is stored in
  81. * task->data[ISER_DIR_OUT].data_len
  82. */
  83. static int
  84. iser_prepare_write_cmd(struct iscsi_task *task,
  85. unsigned int imm_sz,
  86. unsigned int unsol_sz,
  87. unsigned int edtl)
  88. {
  89. struct iscsi_iser_task *iser_task = task->dd_data;
  90. struct iser_regd_buf *regd_buf;
  91. int err;
  92. struct iser_hdr *hdr = &iser_task->desc.iser_header;
  93. struct iser_data_buf *buf_out = &iser_task->data[ISER_DIR_OUT];
  94. struct ib_sge *tx_dsg = &iser_task->desc.tx_sg[1];
  95. err = iser_dma_map_task_data(iser_task,
  96. buf_out,
  97. ISER_DIR_OUT,
  98. DMA_TO_DEVICE);
  99. if (err)
  100. return err;
  101. if (edtl > iser_task->data[ISER_DIR_OUT].data_len) {
  102. iser_err("Total data length: %ld, less than EDTL: %d, "
  103. "in WRITE cmd BHS itt: %d, conn: 0x%p\n",
  104. iser_task->data[ISER_DIR_OUT].data_len,
  105. edtl, task->itt, task->conn);
  106. return -EINVAL;
  107. }
  108. err = iser_reg_rdma_mem(iser_task,ISER_DIR_OUT);
  109. if (err != 0) {
  110. iser_err("Failed to register write cmd RDMA mem\n");
  111. return err;
  112. }
  113. regd_buf = &iser_task->rdma_regd[ISER_DIR_OUT];
  114. if (unsol_sz < edtl) {
  115. hdr->flags |= ISER_WSV;
  116. hdr->write_stag = cpu_to_be32(regd_buf->reg.rkey);
  117. hdr->write_va = cpu_to_be64(regd_buf->reg.va + unsol_sz);
  118. iser_dbg("Cmd itt:%d, WRITE tags, RKEY:%#.4X "
  119. "VA:%#llX + unsol:%d\n",
  120. task->itt, regd_buf->reg.rkey,
  121. (unsigned long long)regd_buf->reg.va, unsol_sz);
  122. }
  123. if (imm_sz > 0) {
  124. iser_dbg("Cmd itt:%d, WRITE, adding imm.data sz: %d\n",
  125. task->itt, imm_sz);
  126. tx_dsg->addr = regd_buf->reg.va;
  127. tx_dsg->length = imm_sz;
  128. tx_dsg->lkey = regd_buf->reg.lkey;
  129. iser_task->desc.num_sge = 2;
  130. }
  131. return 0;
  132. }
  133. /* creates a new tx descriptor and adds header regd buffer */
  134. static void iser_create_send_desc(struct iser_conn *ib_conn,
  135. struct iser_tx_desc *tx_desc)
  136. {
  137. struct iser_device *device = ib_conn->device;
  138. ib_dma_sync_single_for_cpu(device->ib_device,
  139. tx_desc->dma_addr, ISER_HEADERS_LEN, DMA_TO_DEVICE);
  140. memset(&tx_desc->iser_header, 0, sizeof(struct iser_hdr));
  141. tx_desc->iser_header.flags = ISER_VER;
  142. tx_desc->num_sge = 1;
  143. if (tx_desc->tx_sg[0].lkey != device->mr->lkey) {
  144. tx_desc->tx_sg[0].lkey = device->mr->lkey;
  145. iser_dbg("sdesc %p lkey mismatch, fixing\n", tx_desc);
  146. }
  147. }
  148. static int iser_alloc_rx_descriptors(struct iser_conn *ib_conn)
  149. {
  150. int i, j;
  151. u64 dma_addr;
  152. struct iser_rx_desc *rx_desc;
  153. struct ib_sge *rx_sg;
  154. struct iser_device *device = ib_conn->device;
  155. ib_conn->rx_descs = kmalloc(ISER_QP_MAX_RECV_DTOS *
  156. sizeof(struct iser_rx_desc), GFP_KERNEL);
  157. if (!ib_conn->rx_descs)
  158. goto rx_desc_alloc_fail;
  159. rx_desc = ib_conn->rx_descs;
  160. for (i = 0; i < ISER_QP_MAX_RECV_DTOS; i++, rx_desc++) {
  161. dma_addr = ib_dma_map_single(device->ib_device, (void *)rx_desc,
  162. ISER_RX_PAYLOAD_SIZE, DMA_FROM_DEVICE);
  163. if (ib_dma_mapping_error(device->ib_device, dma_addr))
  164. goto rx_desc_dma_map_failed;
  165. rx_desc->dma_addr = dma_addr;
  166. rx_sg = &rx_desc->rx_sg;
  167. rx_sg->addr = rx_desc->dma_addr;
  168. rx_sg->length = ISER_RX_PAYLOAD_SIZE;
  169. rx_sg->lkey = device->mr->lkey;
  170. }
  171. ib_conn->rx_desc_head = 0;
  172. return 0;
  173. rx_desc_dma_map_failed:
  174. rx_desc = ib_conn->rx_descs;
  175. for (j = 0; j < i; j++, rx_desc++)
  176. ib_dma_unmap_single(device->ib_device, rx_desc->dma_addr,
  177. ISER_RX_PAYLOAD_SIZE, DMA_FROM_DEVICE);
  178. kfree(ib_conn->rx_descs);
  179. ib_conn->rx_descs = NULL;
  180. rx_desc_alloc_fail:
  181. iser_err("failed allocating rx descriptors / data buffers\n");
  182. return -ENOMEM;
  183. }
  184. void iser_free_rx_descriptors(struct iser_conn *ib_conn)
  185. {
  186. int i;
  187. struct iser_rx_desc *rx_desc;
  188. struct iser_device *device = ib_conn->device;
  189. if (ib_conn->login_buf) {
  190. ib_dma_unmap_single(device->ib_device, ib_conn->login_dma,
  191. ISER_RX_LOGIN_SIZE, DMA_FROM_DEVICE);
  192. kfree(ib_conn->login_buf);
  193. }
  194. if (!ib_conn->rx_descs)
  195. return;
  196. rx_desc = ib_conn->rx_descs;
  197. for (i = 0; i < ISER_QP_MAX_RECV_DTOS; i++, rx_desc++)
  198. ib_dma_unmap_single(device->ib_device, rx_desc->dma_addr,
  199. ISER_RX_PAYLOAD_SIZE, DMA_FROM_DEVICE);
  200. kfree(ib_conn->rx_descs);
  201. }
  202. /**
  203. * iser_conn_set_full_featured_mode - (iSER API)
  204. */
  205. int iser_conn_set_full_featured_mode(struct iscsi_conn *conn)
  206. {
  207. struct iscsi_iser_conn *iser_conn = conn->dd_data;
  208. iser_dbg("Initially post: %d\n", ISER_MIN_POSTED_RX);
  209. /* Check that there is no posted recv or send buffers left - */
  210. /* they must be consumed during the login phase */
  211. BUG_ON(iser_conn->ib_conn->post_recv_buf_count != 0);
  212. BUG_ON(atomic_read(&iser_conn->ib_conn->post_send_buf_count) != 0);
  213. if (iser_alloc_rx_descriptors(iser_conn->ib_conn))
  214. return -ENOMEM;
  215. /* Initial post receive buffers */
  216. if (iser_post_recvm(iser_conn->ib_conn, ISER_MIN_POSTED_RX))
  217. return -ENOMEM;
  218. return 0;
  219. }
  220. /**
  221. * iser_send_command - send command PDU
  222. */
  223. int iser_send_command(struct iscsi_conn *conn,
  224. struct iscsi_task *task)
  225. {
  226. struct iscsi_iser_conn *iser_conn = conn->dd_data;
  227. struct iscsi_iser_task *iser_task = task->dd_data;
  228. unsigned long edtl;
  229. int err;
  230. struct iser_data_buf *data_buf;
  231. struct iscsi_scsi_req *hdr = (struct iscsi_scsi_req *)task->hdr;
  232. struct scsi_cmnd *sc = task->sc;
  233. struct iser_tx_desc *tx_desc = &iser_task->desc;
  234. edtl = ntohl(hdr->data_length);
  235. /* build the tx desc regd header and add it to the tx desc dto */
  236. tx_desc->type = ISCSI_TX_SCSI_COMMAND;
  237. iser_create_send_desc(iser_conn->ib_conn, tx_desc);
  238. if (hdr->flags & ISCSI_FLAG_CMD_READ)
  239. data_buf = &iser_task->data[ISER_DIR_IN];
  240. else
  241. data_buf = &iser_task->data[ISER_DIR_OUT];
  242. if (scsi_sg_count(sc)) { /* using a scatter list */
  243. data_buf->buf = scsi_sglist(sc);
  244. data_buf->size = scsi_sg_count(sc);
  245. }
  246. data_buf->data_len = scsi_bufflen(sc);
  247. if (hdr->flags & ISCSI_FLAG_CMD_READ) {
  248. err = iser_prepare_read_cmd(task, edtl);
  249. if (err)
  250. goto send_command_error;
  251. }
  252. if (hdr->flags & ISCSI_FLAG_CMD_WRITE) {
  253. err = iser_prepare_write_cmd(task,
  254. task->imm_count,
  255. task->imm_count +
  256. task->unsol_r2t.data_length,
  257. edtl);
  258. if (err)
  259. goto send_command_error;
  260. }
  261. iser_task->status = ISER_TASK_STATUS_STARTED;
  262. err = iser_post_send(iser_conn->ib_conn, tx_desc);
  263. if (!err)
  264. return 0;
  265. send_command_error:
  266. iser_err("conn %p failed task->itt %d err %d\n",conn, task->itt, err);
  267. return err;
  268. }
  269. /**
  270. * iser_send_data_out - send data out PDU
  271. */
  272. int iser_send_data_out(struct iscsi_conn *conn,
  273. struct iscsi_task *task,
  274. struct iscsi_data *hdr)
  275. {
  276. struct iscsi_iser_conn *iser_conn = conn->dd_data;
  277. struct iscsi_iser_task *iser_task = task->dd_data;
  278. struct iser_tx_desc *tx_desc = NULL;
  279. struct iser_regd_buf *regd_buf;
  280. unsigned long buf_offset;
  281. unsigned long data_seg_len;
  282. uint32_t itt;
  283. int err = 0;
  284. struct ib_sge *tx_dsg;
  285. itt = (__force uint32_t)hdr->itt;
  286. data_seg_len = ntoh24(hdr->dlength);
  287. buf_offset = ntohl(hdr->offset);
  288. iser_dbg("%s itt %d dseg_len %d offset %d\n",
  289. __func__,(int)itt,(int)data_seg_len,(int)buf_offset);
  290. tx_desc = kmem_cache_zalloc(ig.desc_cache, GFP_ATOMIC);
  291. if (tx_desc == NULL) {
  292. iser_err("Failed to alloc desc for post dataout\n");
  293. return -ENOMEM;
  294. }
  295. tx_desc->type = ISCSI_TX_DATAOUT;
  296. tx_desc->iser_header.flags = ISER_VER;
  297. memcpy(&tx_desc->iscsi_header, hdr, sizeof(struct iscsi_hdr));
  298. /* build the tx desc */
  299. iser_initialize_task_headers(task, tx_desc);
  300. regd_buf = &iser_task->rdma_regd[ISER_DIR_OUT];
  301. tx_dsg = &tx_desc->tx_sg[1];
  302. tx_dsg->addr = regd_buf->reg.va + buf_offset;
  303. tx_dsg->length = data_seg_len;
  304. tx_dsg->lkey = regd_buf->reg.lkey;
  305. tx_desc->num_sge = 2;
  306. if (buf_offset + data_seg_len > iser_task->data[ISER_DIR_OUT].data_len) {
  307. iser_err("Offset:%ld & DSL:%ld in Data-Out "
  308. "inconsistent with total len:%ld, itt:%d\n",
  309. buf_offset, data_seg_len,
  310. iser_task->data[ISER_DIR_OUT].data_len, itt);
  311. err = -EINVAL;
  312. goto send_data_out_error;
  313. }
  314. iser_dbg("data-out itt: %d, offset: %ld, sz: %ld\n",
  315. itt, buf_offset, data_seg_len);
  316. err = iser_post_send(iser_conn->ib_conn, tx_desc);
  317. if (!err)
  318. return 0;
  319. send_data_out_error:
  320. kmem_cache_free(ig.desc_cache, tx_desc);
  321. iser_err("conn %p failed err %d\n",conn, err);
  322. return err;
  323. }
  324. int iser_send_control(struct iscsi_conn *conn,
  325. struct iscsi_task *task)
  326. {
  327. struct iscsi_iser_conn *iser_conn = conn->dd_data;
  328. struct iscsi_iser_task *iser_task = task->dd_data;
  329. struct iser_tx_desc *mdesc = &iser_task->desc;
  330. unsigned long data_seg_len;
  331. int err = 0;
  332. struct iser_device *device;
  333. /* build the tx desc regd header and add it to the tx desc dto */
  334. mdesc->type = ISCSI_TX_CONTROL;
  335. iser_create_send_desc(iser_conn->ib_conn, mdesc);
  336. device = iser_conn->ib_conn->device;
  337. data_seg_len = ntoh24(task->hdr->dlength);
  338. if (data_seg_len > 0) {
  339. struct ib_sge *tx_dsg = &mdesc->tx_sg[1];
  340. if (task != conn->login_task) {
  341. iser_err("data present on non login task!!!\n");
  342. goto send_control_error;
  343. }
  344. memcpy(iser_conn->ib_conn->login_buf, task->data,
  345. task->data_count);
  346. tx_dsg->addr = iser_conn->ib_conn->login_dma;
  347. tx_dsg->length = data_seg_len;
  348. tx_dsg->lkey = device->mr->lkey;
  349. mdesc->num_sge = 2;
  350. }
  351. if (task == conn->login_task) {
  352. err = iser_post_recvl(iser_conn->ib_conn);
  353. if (err)
  354. goto send_control_error;
  355. }
  356. err = iser_post_send(iser_conn->ib_conn, mdesc);
  357. if (!err)
  358. return 0;
  359. send_control_error:
  360. iser_err("conn %p failed err %d\n",conn, err);
  361. return err;
  362. }
  363. /**
  364. * iser_rcv_dto_completion - recv DTO completion
  365. */
  366. void iser_rcv_completion(struct iser_rx_desc *rx_desc,
  367. unsigned long rx_xfer_len,
  368. struct iser_conn *ib_conn)
  369. {
  370. struct iscsi_iser_conn *conn = ib_conn->iser_conn;
  371. struct iscsi_hdr *hdr;
  372. u64 rx_dma;
  373. int rx_buflen, outstanding, count, err;
  374. /* differentiate between login to all other PDUs */
  375. if ((char *)rx_desc == ib_conn->login_buf) {
  376. rx_dma = ib_conn->login_dma;
  377. rx_buflen = ISER_RX_LOGIN_SIZE;
  378. } else {
  379. rx_dma = rx_desc->dma_addr;
  380. rx_buflen = ISER_RX_PAYLOAD_SIZE;
  381. }
  382. ib_dma_sync_single_for_cpu(ib_conn->device->ib_device, rx_dma,
  383. rx_buflen, DMA_FROM_DEVICE);
  384. hdr = &rx_desc->iscsi_header;
  385. iser_dbg("op 0x%x itt 0x%x dlen %d\n", hdr->opcode,
  386. hdr->itt, (int)(rx_xfer_len - ISER_HEADERS_LEN));
  387. iscsi_iser_recv(conn->iscsi_conn, hdr,
  388. rx_desc->data, rx_xfer_len - ISER_HEADERS_LEN);
  389. ib_dma_sync_single_for_device(ib_conn->device->ib_device, rx_dma,
  390. rx_buflen, DMA_FROM_DEVICE);
  391. /* decrementing conn->post_recv_buf_count only --after-- freeing the *
  392. * task eliminates the need to worry on tasks which are completed in *
  393. * parallel to the execution of iser_conn_term. So the code that waits *
  394. * for the posted rx bufs refcount to become zero handles everything */
  395. conn->ib_conn->post_recv_buf_count--;
  396. if (rx_dma == ib_conn->login_dma)
  397. return;
  398. outstanding = ib_conn->post_recv_buf_count;
  399. if (outstanding + ISER_MIN_POSTED_RX <= ISER_QP_MAX_RECV_DTOS) {
  400. count = min(ISER_QP_MAX_RECV_DTOS - outstanding,
  401. ISER_MIN_POSTED_RX);
  402. err = iser_post_recvm(ib_conn, count);
  403. if (err)
  404. iser_err("posting %d rx bufs err %d\n", count, err);
  405. }
  406. }
  407. void iser_snd_completion(struct iser_tx_desc *tx_desc,
  408. struct iser_conn *ib_conn)
  409. {
  410. struct iscsi_task *task;
  411. struct iser_device *device = ib_conn->device;
  412. if (tx_desc->type == ISCSI_TX_DATAOUT) {
  413. ib_dma_unmap_single(device->ib_device, tx_desc->dma_addr,
  414. ISER_HEADERS_LEN, DMA_TO_DEVICE);
  415. kmem_cache_free(ig.desc_cache, tx_desc);
  416. }
  417. atomic_dec(&ib_conn->post_send_buf_count);
  418. if (tx_desc->type == ISCSI_TX_CONTROL) {
  419. /* this arithmetic is legal by libiscsi dd_data allocation */
  420. task = (void *) ((long)(void *)tx_desc -
  421. sizeof(struct iscsi_task));
  422. if (task->hdr->itt == RESERVED_ITT)
  423. iscsi_put_task(task);
  424. }
  425. }
  426. void iser_task_rdma_init(struct iscsi_iser_task *iser_task)
  427. {
  428. iser_task->status = ISER_TASK_STATUS_INIT;
  429. iser_task->dir[ISER_DIR_IN] = 0;
  430. iser_task->dir[ISER_DIR_OUT] = 0;
  431. iser_task->data[ISER_DIR_IN].data_len = 0;
  432. iser_task->data[ISER_DIR_OUT].data_len = 0;
  433. memset(&iser_task->rdma_regd[ISER_DIR_IN], 0,
  434. sizeof(struct iser_regd_buf));
  435. memset(&iser_task->rdma_regd[ISER_DIR_OUT], 0,
  436. sizeof(struct iser_regd_buf));
  437. }
  438. void iser_task_rdma_finalize(struct iscsi_iser_task *iser_task)
  439. {
  440. int is_rdma_aligned = 1;
  441. struct iser_regd_buf *regd;
  442. /* if we were reading, copy back to unaligned sglist,
  443. * anyway dma_unmap and free the copy
  444. */
  445. if (iser_task->data_copy[ISER_DIR_IN].copy_buf != NULL) {
  446. is_rdma_aligned = 0;
  447. iser_finalize_rdma_unaligned_sg(iser_task, ISER_DIR_IN);
  448. }
  449. if (iser_task->data_copy[ISER_DIR_OUT].copy_buf != NULL) {
  450. is_rdma_aligned = 0;
  451. iser_finalize_rdma_unaligned_sg(iser_task, ISER_DIR_OUT);
  452. }
  453. if (iser_task->dir[ISER_DIR_IN]) {
  454. regd = &iser_task->rdma_regd[ISER_DIR_IN];
  455. if (regd->reg.is_fmr)
  456. iser_unreg_mem(&regd->reg);
  457. }
  458. if (iser_task->dir[ISER_DIR_OUT]) {
  459. regd = &iser_task->rdma_regd[ISER_DIR_OUT];
  460. if (regd->reg.is_fmr)
  461. iser_unreg_mem(&regd->reg);
  462. }
  463. /* if the data was unaligned, it was already unmapped and then copied */
  464. if (is_rdma_aligned)
  465. iser_dma_unmap_task_data(iser_task);
  466. }