.. | .. |
---|
95 | 95 | .eh_device_reset_handler = iscsi_eh_device_reset, |
---|
96 | 96 | .eh_target_reset_handler = iscsi_eh_recover_target, |
---|
97 | 97 | .target_alloc = iscsi_target_alloc, |
---|
98 | | - .use_clustering = DISABLE_CLUSTERING, |
---|
| 98 | + .dma_boundary = PAGE_SIZE - 1, |
---|
99 | 99 | .this_id = -1, |
---|
100 | 100 | .track_queue_depth = 1, |
---|
101 | 101 | }; |
---|
.. | .. |
---|
117 | 117 | /* connection management */ |
---|
118 | 118 | .create_conn = cxgbi_create_conn, |
---|
119 | 119 | .bind_conn = cxgbi_bind_conn, |
---|
| 120 | + .unbind_conn = iscsi_conn_unbind, |
---|
120 | 121 | .destroy_conn = iscsi_tcp_conn_teardown, |
---|
121 | 122 | .start_conn = iscsi_conn_start, |
---|
122 | 123 | .stop_conn = iscsi_conn_stop, |
---|
.. | .. |
---|
361 | 362 | /* len includes the length of any HW ULP additions */ |
---|
362 | 363 | req->len = htonl(len); |
---|
363 | 364 | /* V_TX_ULP_SUBMODE sets both the mode and submode */ |
---|
364 | | - req->flags = htonl(V_TX_ULP_SUBMODE(cxgbi_skcb_ulp_mode(skb)) | |
---|
| 365 | + req->flags = htonl(V_TX_ULP_SUBMODE(cxgbi_skcb_tx_ulp_mode(skb)) | |
---|
365 | 366 | V_TX_SHOVE((skb_peek(&csk->write_queue) ? 0 : 1))); |
---|
366 | 367 | req->sndseq = htonl(csk->snd_nxt); |
---|
367 | 368 | req->param = htonl(V_TX_PORT(l2t->smt_idx)); |
---|
.. | .. |
---|
375 | 376 | } |
---|
376 | 377 | } |
---|
377 | 378 | |
---|
378 | | -/** |
---|
| 379 | +/* |
---|
379 | 380 | * push_tx_frames -- start transmit |
---|
380 | | - * @c3cn: the offloaded connection |
---|
381 | | - * @req_completion: request wr_ack or not |
---|
382 | 381 | * |
---|
383 | 382 | * Prepends TX_DATA_WR or CPL_CLOSE_CON_REQ headers to buffers waiting in a |
---|
384 | 383 | * connection's send queue and sends them on to T3. Must be called with the |
---|
.. | .. |
---|
442 | 441 | req_completion = 1; |
---|
443 | 442 | csk->wr_una_cred = 0; |
---|
444 | 443 | } |
---|
445 | | - len += cxgbi_ulp_extra_len(cxgbi_skcb_ulp_mode(skb)); |
---|
| 444 | + len += cxgbi_ulp_extra_len(cxgbi_skcb_tx_ulp_mode(skb)); |
---|
446 | 445 | make_tx_data_wr(csk, skb, len, req_completion); |
---|
447 | 446 | csk->snd_nxt += len; |
---|
448 | 447 | cxgbi_skcb_clear_flag(skb, SKCBF_TX_NEED_HDR); |
---|
.. | .. |
---|
645 | 644 | int *need_rst) |
---|
646 | 645 | { |
---|
647 | 646 | switch (abort_reason) { |
---|
648 | | - case CPL_ERR_BAD_SYN: /* fall through */ |
---|
| 647 | + case CPL_ERR_BAD_SYN: |
---|
649 | 648 | case CPL_ERR_CONN_RESET: |
---|
650 | 649 | return csk->state > CTP_ESTABLISHED ? -EPIPE : -ECONNRESET; |
---|
651 | 650 | case CPL_ERR_XMIT_TIMEDOUT: |
---|
.. | .. |
---|
886 | 885 | return -ENOMEM; |
---|
887 | 886 | } |
---|
888 | 887 | |
---|
889 | | -/** |
---|
890 | | - * release_offload_resources - release offload resource |
---|
891 | | - * @c3cn: the offloaded iscsi tcp connection. |
---|
892 | | - * Release resources held by an offload connection (TID, L2T entry, etc.) |
---|
893 | | - */ |
---|
894 | 888 | static void l2t_put(struct cxgbi_sock *csk) |
---|
895 | 889 | { |
---|
896 | 890 | struct t3cdev *t3dev = (struct t3cdev *)csk->cdev->lldev; |
---|
.. | .. |
---|
902 | 896 | } |
---|
903 | 897 | } |
---|
904 | 898 | |
---|
| 899 | +/* |
---|
| 900 | + * release_offload_resources - release offload resource |
---|
| 901 | + * Release resources held by an offload connection (TID, L2T entry, etc.) |
---|
| 902 | + */ |
---|
905 | 903 | static void release_offload_resources(struct cxgbi_sock *csk) |
---|
906 | 904 | { |
---|
907 | 905 | struct t3cdev *t3dev = (struct t3cdev *)csk->cdev->lldev; |
---|
.. | .. |
---|
959 | 957 | struct net_device *ndev = cdev->ports[csk->port_id]; |
---|
960 | 958 | struct cxgbi_hba *chba = cdev->hbas[csk->port_id]; |
---|
961 | 959 | struct sk_buff *skb = NULL; |
---|
| 960 | + int ret; |
---|
962 | 961 | |
---|
963 | 962 | log_debug(1 << CXGBI_DBG_TOE | 1 << CXGBI_DBG_SOCK, |
---|
964 | 963 | "csk 0x%p,%u,0x%lx.\n", csk, csk->state, csk->flags); |
---|
.. | .. |
---|
979 | 978 | csk->atid = cxgb3_alloc_atid(t3dev, &t3_client, csk); |
---|
980 | 979 | if (csk->atid < 0) { |
---|
981 | 980 | pr_err("NO atid available.\n"); |
---|
982 | | - goto rel_resource; |
---|
| 981 | + ret = -EINVAL; |
---|
| 982 | + goto put_sock; |
---|
983 | 983 | } |
---|
984 | 984 | cxgbi_sock_set_flag(csk, CTPF_HAS_ATID); |
---|
985 | 985 | cxgbi_sock_get(csk); |
---|
986 | 986 | |
---|
987 | 987 | skb = alloc_wr(sizeof(struct cpl_act_open_req), 0, GFP_KERNEL); |
---|
988 | | - if (!skb) |
---|
989 | | - goto rel_resource; |
---|
| 988 | + if (!skb) { |
---|
| 989 | + ret = -ENOMEM; |
---|
| 990 | + goto free_atid; |
---|
| 991 | + } |
---|
990 | 992 | skb->sk = (struct sock *)csk; |
---|
991 | 993 | set_arp_failure_handler(skb, act_open_arp_failure); |
---|
992 | 994 | csk->snd_win = cxgb3i_snd_win; |
---|
.. | .. |
---|
1008 | 1010 | send_act_open_req(csk, skb, csk->l2t); |
---|
1009 | 1011 | return 0; |
---|
1010 | 1012 | |
---|
1011 | | -rel_resource: |
---|
1012 | | - if (skb) |
---|
1013 | | - __kfree_skb(skb); |
---|
1014 | | - return -EINVAL; |
---|
| 1013 | +free_atid: |
---|
| 1014 | + cxgb3_free_atid(t3dev, csk->atid); |
---|
| 1015 | +put_sock: |
---|
| 1016 | + cxgbi_sock_put(csk); |
---|
| 1017 | + l2t_release(t3dev, csk->l2t); |
---|
| 1018 | + csk->l2t = NULL; |
---|
| 1019 | + |
---|
| 1020 | + return ret; |
---|
1015 | 1021 | } |
---|
1016 | 1022 | |
---|
1017 | 1023 | cxgb3_cpl_handler_func cxgb3i_cpl_handlers[NUM_CPL_CMDS] = { |
---|
.. | .. |
---|
1245 | 1251 | tformat.pgsz_order[i] = uinfo.pgsz_factor[i]; |
---|
1246 | 1252 | cxgbi_tagmask_check(tagmask, &tformat); |
---|
1247 | 1253 | |
---|
1248 | | - cxgbi_ddp_ppm_setup(&tdev->ulp_iscsi, cdev, &tformat, ppmax, |
---|
1249 | | - uinfo.llimit, uinfo.llimit, 0); |
---|
| 1254 | + err = cxgbi_ddp_ppm_setup(&tdev->ulp_iscsi, cdev, &tformat, |
---|
| 1255 | + (uinfo.ulimit - uinfo.llimit + 1), |
---|
| 1256 | + uinfo.llimit, uinfo.llimit, 0, 0, 0); |
---|
| 1257 | + if (err) |
---|
| 1258 | + return err; |
---|
| 1259 | + |
---|
1250 | 1260 | if (!(cdev->flags & CXGBI_FLAG_DDP_OFF)) { |
---|
1251 | 1261 | uinfo.tagmask = tagmask; |
---|
1252 | 1262 | uinfo.ulimit = uinfo.llimit + (ppmax << PPOD_SIZE_SHIFT); |
---|
.. | .. |
---|
1320 | 1330 | |
---|
1321 | 1331 | err = cxgb3i_ddp_init(cdev); |
---|
1322 | 1332 | if (err) { |
---|
1323 | | - pr_info("0x%p ddp init failed\n", cdev); |
---|
| 1333 | + pr_info("0x%p ddp init failed %d\n", cdev, err); |
---|
1324 | 1334 | goto err_out; |
---|
1325 | 1335 | } |
---|
1326 | 1336 | |
---|