linux/net/rds/iw_cm.c
<<
lue= 9/spa2> 9/form> 9a lue= href="../linux+v3.6710/net/rds/iw_cm.c">lue= 9img src="../.static/gfx/right.png" alt=">>">lu9/spa2> lu9spa2 class="lxr_search">lue= 2="+search" method="post" onsubmit="return do_search(this);">lue= 9input typ hidden" nam navtarget" io2> ">lue= 9input typ text" nam search" id search">lue= 9buttopttyp submit">Search 9/form> 9/spa2> lu9spa2 class="lxr_prefs"> 9a href="+prefs?return=net/rds/iw_cm.c"lue= onclick="return ajax_prefs();">lue= Prefs 9/a>lu9/spa2> e= 9/div> e= 9form ac > 2="ajax+*" method="post" onsubmit="return false;">lu9input typ hidden" nam ajax_lookup" id ajax_lookup" io2> ">le= 9/form> le= 9div class="headingbottom">
e=
e= 9div id search_results" class="search_results" > e= 9/div> 9div id content"> 9div id file_contents">
   19/a>9spa2 class="comment">/*9/spa2>    29/a>9spa2 class="comment"> * Copyright (c) 2006 Oracle.  All rights reserved.9/spa2>    39/a>9spa2 class="comment"> *9/spa2>    49/a>9spa2 class="comment"> * This software is available to you under a choice of one of two9/spa2>    59/a>9spa2 class="comment"> * licenses.  You may choose to be licensed under the terms of the GNU9/spa2>    69/a>9spa2 class="comment"> * General Public License (GPL) Vers/opt2, available from the file9/spa2>    79/a>9spa2 class="comment"> * COPYING in the main directory of this source tree, or the9/spa2>    89/a>9spa2 class="comment"> * OpenIB.org BSD license below:9/spa2>    99/a>9spa2 class="comment"> *9/spa2>     >
a>9spa2 class="comment"> *     Redistribut/optand use in source and binary forms, with or9/spa2>   119/a>9spa2 class="comment"> *     without modificat/op, are permitted provided that the following9/spa2>   129/a>9spa2 class="comment"> *     condit/ops are met:9/spa2>   139/a>9spa2 class="comment"> *9/spa2>   149/a>9spa2 class="comment"> *      - Redistribut/ops of source code must retain the above9/spa2>   159/a>9spa2 class="comment"> *        copyright notice, this list of condit/ops and the following9/spa2>   169/a>9spa2 class="comment"> *        disclaimer.9/spa2>   179/a>9spa2 class="comment"> *9/spa2>   189/a>9spa2 class="comment"> *      - Redistribut/ops in binary form must reproduce the above9/spa2>   199/a>9spa2 class="comment"> *        copyright notice, this list of condit/ops and the following9/spa2>   2 >
a>9spa2 class="comment"> *        disclaimer in the documentat/optand/or other materials9/spa2>   219/a>9spa2 class="comment"> *        provided with the distribut/op.9/spa2>   229/a>9spa2 class="comment"> *9/spa2>   239/a>9spa2 class="comment"> * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,9/spa2>   249/a>9spa2 class="comment"> * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF9/spa2>   259/a>9spa2 class="comment"> * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND9/spa2>   269/a>9spa2 class="comment"> * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS9/spa2>   279/a>9spa2 class="comment"> * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN9/spa2>   289/a>9spa2 class="comment"> * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN9/spa2>   299/a>9spa2 class="comment"> * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE9/spa2>   3 >
a>9spa2 class="comment"> * SOFTWARE.9/spa2>   319/a>9spa2 class="comment"> *9/spa2>   329/a>9spa2 class="comment"> */9/spa2>   339/a>#include <linux/kernel.h9/a>>   349/a>#include <linux/in.h9/a>>   359/a>#include <linux/slab.h9/a>>   369/a>#include <linux/vmalloc.h9/a>>   379/a>#include <linux/ratelimit.h9/a>>   389/a>   399/a>#include "rds.h9/a>"   409/a>#include "iw.h9/a>"   419/a>   429/a>9spa2 class="comment">/*9/spa2>   439/a>9spa2 class="comment"> * Set the selected protocol vers/op9/spa2>   449/a>9spa2 class="comment"> */9/spa2>   459/a>static void 9a href="+code=rds_iw_set_protocol" class="sref">rds_iw_set_protocol9/a>(struct 9a href="+code=rds_connec >
2" class="sref">rds_connec >
29/a> *9a href="+code=conn" class="sref">conn9/a>, unsigned int 9a href="+code=vers/op" class="sref">vers/op9/a>)   469/a>{   479/a>        9a href="+code=conn" class="sref">conn9/a>->9a href="+code=c_vers/op" class="sref">c_vers/op9/a> = 9a href="+code=vers/op" class="sref">vers/op9/a>;   489/a>}   499/a>   5 >
a>9spa2 class="comment">/*9/spa2>   519/a>9spa2 class="comment"> * Set up flow control9/spa2>   529/a>9spa2 class="comment"> */9/spa2>   539/a>static void 9a href="+code=rds_iw_set_flow_control" class="sref">rds_iw_set_flow_control9/a>(struct 9a href="+code=rds_connec >
2" class="sref">rds_connec >
29/a> *9a href="+code=conn" class="sref">conn9/a>, 9a href="+code=u32" class="sref">u329/a> 9a href="+code=credits" class="sref">credits9/a>)   549/a>{   559/a>        struct 9a href="+code=rds_iw_connec >
2" class="sref">rds_iw_connec >
29/a> *9a href="+code=ic" class="sref">ic9/a> = 9a href="+code=conn" class="sref">conn9/a>->9a href="+code=c_transport_data" class="sref">c_transport_data9/a>;   569/a>   579/a>        if (9a href="+code=rds_iw_sysctl_flow_control" class="sref">rds_iw_sysctl_flow_control9/a> && 9a href="+code=credits" class="sref">credits9/a> != 0) {   589/a>                9spa2 class="comment">/* We're doing flow control */9/spa2>   599/a>                9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_flowctl" class="sref">i_flowctl9/a> = 1;   609/a>                9a href="+code=rds_iw_send_add_credits" class="sref">rds_iw_send_add_credits9/a>(9a href="+code=conn" class="sref">conn9/a>, 9a href="+code=credits" class="sref">credits9/a>);   619/a>        } else {   629/a>                9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_flowctl" class="sref">i_flowctl9/a> = 0;   639/a>        }   649/a>}   659/a>   669/a>9spa2 class="comment">/*9/spa2>   679/a>9spa2 class="comment"> * Connec >
2 established.9/spa2>   689/a>9spa2 class="comment"> * We get here for both outgoing and incoming connec >
2.9/spa2>   699/a>9spa2 class="comment"> */9/spa2>   709/a>void 9a href="+code=rds_iw_cm_connec _complete" class="sref">rds_iw_cm_connec _complete9/a>(struct 9a href="+code=rds_connec >
2" class="sref">rds_connec >
29/a> *9a href="+code=conn" class="sref">conn9/a>, struct 9a href="+code=rdma_cm_event" class="sref">rdma_cm_event9/a> *9a href="+code=event" class="sref">event9/a>)   719/a>{   729/a>        const struct 9a href="+code=rds_iw_connec _private" class="sref">rds_iw_connec _private9/a> *9a href="+code=dp" class="sref">dp9/a> = 9a href="+code=NULL" class="sref">NULL9/a>;   739/a>        struct 9a href="+code=rds_iw_connec >
2" class="sref">rds_iw_connec >
29/a> *9a href="+code=ic" class="sref">ic9/a> = 9a href="+code=conn" class="sref">conn9/a>->9a href="+code=c_transport_data" class="sref">c_transport_data9/a>;   749/a>        struct 9a href="+code=rds_iw_device" class="sref">rds_iw_device9/a> *9a href="+code=rds_iwdev" class="sref">rds_iwdev9/a>;   759/a>        int 9a href="+code=err" class="sref">err9/a>;   769/a>   779/a>        if (9a href="+code=event" class="sref">event9/a>->9a href="+code=param" class="sref">param9/a>.9a href="+code=conn" class="sref">conn9/a>.9a href="+code=private_data_len" class="sref">private_data_len9/a>) {   789/a>                9a href="+code=dp" class="sref">dp9/a> = 9a href="+code=event" class="sref">event9/a>->9a href="+code=param" class="sref">param9/a>.9a href="+code=conn" class="sref">conn9/a>.9a href="+code=private_data" class="sref">private_data9/a>;   799/a>   809/a>                9a href="+code=rds_iw_set_protocol" class="sref">rds_iw_set_protocol9/a>(9a href="+code=conn" class="sref">conn9/a>,   819/a>                                9a href="+code=RDS_PROTOCOL" class="sref">RDS_PROTOCOL9/a>(9a href="+code=dp" class="sref">dp9/a>->9a href="+code=dp_protocol_major" class="sref">dp_protocol_major9/a>,   829/a>                                        9a href="+code=dp" class="sref">dp9/a>->9a href="+code=dp_protocol_minor" class="sref">dp_protocol_minor9/a>));   839/a>                9a href="+code=rds_iw_set_flow_control" class="sref">rds_iw_set_flow_control9/a>(9a href="+code=conn" class="sref">conn9/a>, 9a href="+code=be32_to_cpu" class="sref">be32_to_cpu9/a>(9a href="+code=dp" class="sref">dp9/a>->9a href="+code=dp_credit" class="sref">dp_credit9/a>));   849/a>        }   859/a>   869/a>        9spa2 class="comment">/* update ib_device with this local ipaddr & conn */9/spa2>   879/a>        9a href="+code=rds_iwdev" class="sref">rds_iwdev9/a> = 9a href="+code=ib_get_client_data" class="sref">ib_get_client_data9/a>(9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_cm_id" class="sref">i_cm_id9/a>->9a href="+code=device" class="sref">device9/a>, &9a href="+code=rds_iw_client" class="sref">rds_iw_client9/a>);   889/a>        9a href="+code=err" class="sref">err9/a> = 9a href="+code=rds_iw_update_cm_id" class="sref">rds_iw_update_cm_id9/a>(9a href="+code=rds_iwdev" class="sref">rds_iwdev9/a>, 9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_cm_id" class="sref">i_cm_id9/a>);   899/a>        if (9a href="+code=err" class="sref">err9/a>)   909/a>                9a href="+code=printk" class="sref">printk9/a>(9a href="+code=KERN_ERR" class="sref">KERN_ERR9/a> 9spa2 class="string">"rds_iw_update_ipaddr failed (%d)\n", 9a href="+code=err" class="sref">err9/a>);   919/a>        9a href="+code=rds_iw_add_conn" class="sref">rds_iw_add_conn9/a>(9a href="+code=rds_iwdev" class="sref">rds_iwdev9/a>, 9a href="+code=conn" class="sref">conn9/a>);   929/a>   939/a>        9spa2 class="comment">/* If the peer gave us the last packet it saw, process this as if9/spa2>   949/a>9spa2 class="comment">         * we had received a regular ACK. */9/spa2>   959/a>        if (9a href="+code=dp" class="sref">dp9/a> && 9a href="+code=dp" class="sref">dp9/a>->9a href="+code=dp_ack_seq" class="sref">dp_ack_seq9/a>)   969/a>                9a href="+code=rds_send_drop_acked" class="sref">rds_send_drop_acked9/a>(9a href="+code=conn" class="sref">conn9/a>, 9a href="+code=be64_to_cpu" class="sref">be64_to_cpu9/a>(9a href="+code=dp" class="sref">dp9/a>->9a href="+code=dp_ack_seq" class="sref">dp_ack_seq9/a>), 9a href="+code=NULL" class="sref">NULL9/a>);   979/a>   989/a>        9a href="+code=printk" class="sref">printk9/a>(9a href="+code=KERN_NOTICE" class="sref">KERN_NOTICE9/a> 9spa2 class="string">"RDS/IW: connec ed to %pI4<->%pI4 vers/op %u.%u%s\n",   999/a>                        &9a href="+code=conn" class="sref">conn9/a>->9a href="+code=c_laddr" class="sref">c_laddr9/a>, &9a href="+code=conn" class="sref">conn9/a>->9a href="+code=c_faddr" class="sref">c_faddr9/a>,  1009/a>                        9a href="+code=RDS_PROTOCOL_MAJOR" class="sref">RDS_PROTOCOL_MAJOR9/a>(9a href="+code=conn" class="sref">conn9/a>->9a href="+code=c_vers/op" class="sref">c_vers/op9/a>),  1019/a>                        9a href="+code=RDS_PROTOCOL_MINOR" class="sref">RDS_PROTOCOL_MINOR9/a>(9a href="+code=conn" class="sref">conn9/a>->9a href="+code=c_vers/op" class="sref">c_vers/op9/a>),  1029/a>                        9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_flowctl" class="sref">i_flowctl9/a> ? 9spa2 class="string">", flow control" : 9spa2 class="string">"");  1039/a>  1049/a>        9a href="+code=rds_connec _complete" class="sref">rds_connec _complete9/a>(9a href="+code=conn" class="sref">conn9/a>);  1059/a>}  1069/a>  1079/a>static void 9a href="+code=rds_iw_cm_fill_conn_param" class="sref">rds_iw_cm_fill_conn_param9/a>(struct 9a href="+code=rds_connec >
2" class="sref">rds_connec >
29/a> *9a href="+code=conn" class="sref">conn9/a>,  1089/a>                        struct 9a href="+code=rdma_conn_param" class="sref">rdma_conn_param9/a> *9a href="+code=conn_param" class="sref">conn_param9/a>,  1099/a>                        struct 9a href="+code=rds_iw_connec _private" class="sref">rds_iw_connec _private9/a> *9a href="+code=dp" class="sref">dp9/a>,  1109/a>                        9a href="+code=u32" class="sref">u329/a> 9a href="+code=protocol_vers/op" class="sref">protocol_vers/op9/a>)  1119/a>{  1129/a>        struct 9a href="+code=rds_iw_connec >
2" class="sref">rds_iw_connec >
29/a> *9a href="+code=ic" class="sref">ic9/a> = 9a href="+code=conn" class="sref">conn9/a>->9a href="+code=c_transport_data" class="sref">c_transport_data9/a>;  1139/a>  1149/a>        9a href="+code=memset" class="sref">memset9/a>(9a href="+code=conn_param" class="sref">conn_param9/a>, 0, sizeof(struct 9a href="+code=rdma_conn_param" class="sref">rdma_conn_param9/a>));  1159/a>        9spa2 class="comment">/* XXX tune these? */9/spa2>  1169/a>        9a href="+code=conn_param" class="sref">conn_param9/a>->9a href="+code=responder_resources" class="sref">responder_resources9/a> = 1;  1179/a>        9a href="+code=conn_param" class="sref">conn_param9/a>->9a href="+code=initiator_depth" class="sref">initiator_depth9/a> = 1;  1189/a>  1199/a>        if (9a href="+code=dp" class="sref">dp9/a>) {  1209/a>                9a href="+code=memset" class="sref">memset9/a>(9a href="+code=dp" class="sref">dp9/a>, 0, sizeof(*9a href="+code=dp" class="sref">dp9/a>));  1219/a>                9a href="+code=dp" class="sref">dp9/a>->9a href="+code=dp_saddr" class="sref">dp_saddr9/a> = 9a href="+code=conn" class="sref">conn9/a>->9a href="+code=c_laddr" class="sref">c_laddr9/a>;  1229/a>                9a href="+code=dp" class="sref">dp9/a>->9a href="+code=dp_daddr" class="sref">dp_daddr9/a> = 9a href="+code=conn" class="sref">conn9/a>->9a href="+code=c_faddr" class="sref">c_faddr9/a>;  1239/a>                9a href="+code=dp" class="sref">dp9/a>->9a href="+code=dp_protocol_major" class="sref">dp_protocol_major9/a> = 9a href="+code=RDS_PROTOCOL_MAJOR" class="sref">RDS_PROTOCOL_MAJOR9/a>(9a href="+code=protocol_vers/op" class="sref">protocol_vers/op9/a>);  1249/a>                9a href="+code=dp" class="sref">dp9/a>->9a href="+code=dp_protocol_minor" class="sref">dp_protocol_minor9/a> = 9a href="+code=RDS_PROTOCOL_MINOR" class="sref">RDS_PROTOCOL_MINOR9/a>(9a href="+code=protocol_vers/op" class="sref">protocol_vers/op9/a>);  1259/a>                9a href="+code=dp" class="sref">dp9/a>->9a href="+code=dp_protocol_minor_mask" class="sref">dp_protocol_minor_mask9/a> = 9a href="+code=cpu_to_be16" class="sref">cpu_to_be169/a>(9a href="+code=RDS_IW_SUPPORTED_PROTOCOLS" class="sref">RDS_IW_SUPPORTED_PROTOCOLS9/a>);  1269/a>                9a href="+code=dp" class="sref">dp9/a>->9a href="+code=dp_ack_seq" class="sref">dp_ack_seq9/a> = 9a href="+code=rds_iw_piggyb_ack" class="sref">rds_iw_piggyb_ack9/a>(9a href="+code=ic" class="sref">ic9/a>);  1279/a>  1289/a>                9spa2 class="comment">/* Advertise flow control */9/spa2>  1299/a>                if (9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_flowctl" class="sref">i_flowctl9/a>) {  1309/a>                        unsigned int 9a href="+code=credits" class="sref">credits9/a>;  1319/a>  1329/a>                        9a href="+code=credits" class="sref">credits9/a> = 9a href="+code=IB_GET_POST_CREDITS" class="sref">IB_GET_POST_CREDITS9/a>(9a href="+code=atomic_read" class="sref">atomic_read9/a>(&9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_credits" class="sref">i_credits9/a>));  1339/a>                        9a href="+code=dp" class="sref">dp9/a>->9a href="+code=dp_credit" class="sref">dp_credit9/a> = 9a href="+code=cpu_to_be32" class="sref">cpu_to_be329/a>(9a href="+code=credits" class="sref">credits9/a>);  1349/a>                        9a href="+code=atomic_sub" class="sref">atomic_sub9/a>(9a href="+code=IB_SET_POST_CREDITS" class="sref">IB_SET_POST_CREDITS9/a>(9a href="+code=credits" class="sref">credits9/a>), &9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_credits" class="sref">i_credits9/a>);  1359/a>                }  1369/a>  1379/a>                9a href="+code=conn_param" class="sref">conn_param9/a>->9a href="+code=private_data" class="sref">private_data9/a> = 9a href="+code=dp" class="sref">dp9/a>;  1389/a>                9a href="+code=conn_param" class="sref">conn_param9/a>->9a href="+code=private_data_len" class="sref">private_data_len9/a> = sizeof(*9a href="+code=dp" class="sref">dp9/a>);  1399/a>        }  1409/a>}  1419/a>  1429/a>static void 9a href="+code=rds_iw_cq_event_handler" class="sref">rds_iw_cq_event_handler9/a>(struct 9a href="+code=ib_event" class="sref">ib_event9/a> *9a href="+code=event" class="sref">event9/a>, void *9a href="+code=data" class="sref">data9/a>)  1439/a>{  1449/a>        9a href="+code=rdsdebug" class="sref">rdsdebug9/a>(9spa2 class="string">"event %u data %p\n", 9a href="+code=event" class="sref">event9/a>->9a href="+code=event" class="sref">event9/a>, 9a href="+code=data" class="sref">data9/a>);  1459/a>}  1469/a>  1479/a>static void 9a href="+code=rds_iw_qp_event_handler" class="sref">rds_iw_qp_event_handler9/a>(struct 9a href="+code=ib_event" class="sref">ib_event9/a> *9a href="+code=event" class="sref">event9/a>, void *9a href="+code=data" class="sref">data9/a>)  1489/a>{  1499/a>        struct 9a href="+code=rds_connec >
2" class="sref">rds_connec >
29/a> *9a href="+code=conn" class="sref">conn9/a> = 9a href="+code=data" class="sref">data9/a>;  1509/a>        struct 9a href="+code=rds_iw_connec >
2" class="sref">rds_iw_connec >
29/a> *9a href="+code=ic" class="sref">ic9/a> = 9a href="+code=conn" class="sref">conn9/a>->9a href="+code=c_transport_data" class="sref">c_transport_data9/a>;  1519/a>  1529/a>        9a href="+code=rdsdebug" class="sref">rdsdebug9/a>(9spa2 class="string">"conn %p ic %p event %u\n", 9a href="+code=conn" class="sref">conn9/a>, 9a href="+code=ic" class="sref">ic9/a>, 9a href="+code=event" class="sref">event9/a>->9a href="+code=event" class="sref">event9/a>);  1539/a>  1549/a>        switch (9a href="+code=event" class="sref">event9/a>->9a href="+code=event" class="sref">event9/a>) {  1559/a>        case 9a href="+code=IB_EVENT_COMM_EST" class="sref">IB_EVENT_COMM_EST9/a>:  1569/a>                9a href="+code=rdma_notify" class="sref">rdma_notify9/a>(9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_cm_id" class="sref">i_cm_id9/a>, 9a href="+code=IB_EVENT_COMM_EST" class="sref">IB_EVENT_COMM_EST9/a>);  1579/a>                break;  1589/a>        case 9a href="+code=IB_EVENT_QP_REQ_ERR" class="sref">IB_EVENT_QP_REQ_ERR9/a>:  1599/a>        case 9a href="+code=IB_EVENT_QP_FATAL" class="sref">IB_EVENT_QP_FATAL9/a>:  1609/a>        default:  1619/a>                9a href="+code=rdsdebug" class="sref">rdsdebug9/a>(9spa2 class="string">"Fatal QP Event %u "  1629/a>                        9spa2 class="string">"- connec >
2 %pI4->%pI4, reconnec >ng\n",  1639/a>                        9a href="+code=event" class="sref">event9/a>->9a href="+code=event" class="sref">event9/a>, &9a href="+code=conn" class="sref">conn9/a>->9a href="+code=c_laddr" class="sref">c_laddr9/a>,  1649/a>                        &9a href="+code=conn" class="sref">conn9/a>->9a href="+code=c_faddr" class="sref">c_faddr9/a>);  1659/a>                9a href="+code=rds_conn_drop" class="sref">rds_conn_drop9/a>(9a href="+code=conn" class="sref">conn9/a>);  1669/a>                break;  1679/a>        }  1689/a>}  1699/a>  17 >
a>9spa2 class="comment">/*9/spa2>  1719/a>9spa2 class="comment"> * Create a QP9/spa2>  1729/a>9spa2 class="comment"> */9/spa2>  1739/a>static int 9a href="+code=rds_iw_init_qp_attrs" class="sref">rds_iw_init_qp_attrs9/a>(struct 9a href="+code=ib_qp_init_attr" class="sref">ib_qp_init_attr9/a> *9a href="+code=attr" class="sref">attr9/a>,  1749/a>                struct 9a href="+code=rds_iw_device" class="sref">rds_iw_device9/a> *9a href="+code=rds_iwdev" class="sref">rds_iwdev9/a>,  1759/a>                struct 9a href="+code=rds_iw_work_ring" class="sref">rds_iw_work_ring9/a> *9a href="+code=send_ring" class="sref">send_ring9/a>,  1769/a>                void (*9a href="+code=send_cq_handler" class="sref">send_cq_handler9/a>)(struct 9a href="+code=ib_cq" class="sref">ib_cq9/a> *, void *),  1779/a>                struct 9a href="+code=rds_iw_work_ring" class="sref">rds_iw_work_ring9/a> *9a href="+code=recv_ring" class="sref">recv_ring9/a>,  1789/a>                void (*9a href="+code=recv_cq_handler" class="sref">recv_cq_handler9/a>)(struct 9a href="+code=ib_cq" class="sref">ib_cq9/a> *, void *),  1799/a>                void *9a href="+code=context" class="sref">context9/a>)  1809/a>{  1819/a>        struct 9a href="+code=ib_device" class="sref">ib_device9/a> *9a href="+code=dev" class="sref">dev9/a> = 9a href="+code=rds_iwdev" class="sref">rds_iwdev9/a>->9a href="+code=dev" class="sref">dev9/a>;  1829/a>        unsigned int 9a href="+code=send_size" class="sref">send_size9/a>, 9a href="+code=recv_size" class="sref">recv_size9/a>;  1839/a>        int 9a href="+code=ret" class="sref">ret9/a>;  1849/a>  1859/a>        9spa2 class="comment">/* The offset of 1 is to accommodate the addit/opal ACK WR. */9/spa2>  1869/a>        9a href="+code=send_size" class="sref">send_size9/a> = 9a href="+code=min_t" class="sref">min_t9/a>(unsigned int, 9a href="+code=rds_iwdev" class="sref">rds_iwdev9/a>->9a href="+code=max_wrs" class="sref">max_wrs9/a>, 9a href="+code=rds_iw_sysctl_max_send_wr" class="sref">rds_iw_sysctl_max_send_wre9/a>+ 1;  1879/a>        9a href="+code=recv_size" class="sref">recv_size9/a> = 9a href="+code=min_t" class="sref">min_t9/a>(unsigned int, 9a href="+code=rds_iwdev" class="sref">rds_iwdev9/a>->9a href="+code=max_wrs" class="sref">max_wrs9/a>, 9a href="+code=rds_iw_sysctl_max_recv_wr" class="sref">rds_iw_sysctl_max_recv_wre9/a>+ 1;  1889/a>        9a href="+code=rds_iw_ring_resize" class="sref">rds_iw_ring_resize9/a>(9a href="+code=send_ring" class="sref">send_ring9/a>, 9a href="+code=send_size" class="sref">send_size9/a> - 1;  1899/a>        9a href="+code=rds_iw_ring_resize" class="sref">rds_iw_ring_resize9/a>(9a href="+code=recv_ring" class="sref">recv_ring9/a>, 9a href="+code=recv_size" class="sref">recv_size9/a> - 1;  1909/a> 1919/a>        9a href="+code=memset" class="sref">memset9/a>(9a href="+code=attr" class="sref">attr9/a>, 0, sizeof(*9a href="+code=attr" class="sref">attr9/a>));  1929/a>        9a href="+code=attr" class="sref">attr9/a>->9a href="+code=event_handler" class="sref">event_handler9/a> = 9a href="+code=rds_iw_qp_event_handler" class="sref">rds_iw_qp_event_handler9/a>;  1939/a>        9a href="+code=attr" class="sref">attr9/a>->9a href="+code=qp_context" class="sref">qp_context9/a> = 9a href="+code=context" class="sref">context9/a>;  1949/a>        9a href="+code=attr" class="sref">attr9/a>->9a href="+code=cap" class="sref">cap9/a>.9a href="+code=max_send_wr" class="sref">max_send_wre9/a>= 9a href="+code=send_size" class="sref">send_size9/a>;  1959/a>        9a href="+code=attr" class="sref">attr9/a>->9a href="+code=cap" class="sref">cap9/a>.9a href="+code=max_recv_wr" class="sref">max_recv_wre9/a>= 9a href="+code=recv_size" class="sref">recv_size9/a>;  1969/a>        9a href="+code=attr" class="sref">attr9/a>->9a href="+code=cap" class="sref">cap9/a>.9a href="+code=max_send_sge" class="sref">max_send_sge9/a> = 9a href="+code=rds_iwdev" class="sref">rds_iwdev9/a>->9a href="+code=max_sge" class="sref">max_sge9/a>;  1979/a>        9a href="+code=attr" class="sref">attr9/a>->9a href="+code=cap" class="sref">cap9/a>.9a href="+code=max_recv_sge" class="sref">max_recv_sge9/a> = 9a href="+code=RDS_IW_RECV_SGE" class="sref">RDS_IW_RECV_SGE9/a>;  1989/a>        9a href="+code=attr" class="sref">attr9/a>->9a href="+code=sq_sig_type" class="sref">sq_sig_type9/a> = 9a href="+code=IB_SIGNAL_REQ_WR" class="sref">IB_SIGNAL_REQ_WR9/a>;  1999/a>        9a href="+code=attr" class="sref">attr9/a>->9a href="+code=qp_type" class="sref">qp_type9/a> = 9a href="+code=IB_QPT_RC" class="sref">IB_QPT_RC9/a>;  2009/a> 2019/a>        9a href="+code=attr" class="sref">attr9/a>->9a href="+code=send_cq" class="sref">send_cq9/a> = 9a href="+code=ib_create_cq" class="sref">ib_create_cq9/a>(9a href="+code=dev" class="sref">dev9/a>, 9a href="+code=send_cq_handler" class="sref">send_cq_handler9/a>,  2029/a>                                     9a href="+code=rds_iw_cq_event_handler" class="sref">rds_iw_cq_event_handler9/a>,  2039/a>                                     9a href="+code=context" class="sref">context9/a>, 9a href="+code=send_size" class="sref">send_size9/a>, 0);  2049/a>        if (9a href="+code=IS_ERR" class="sref">IS_ERR9/a>(9a href="+code=attr" class="sref">attr9/a>->9a href="+code=send_cq" class="sref">send_cq9/a>)) {  2059/a>                9a href="+code=ret" class="sref">ret9/a> = 9a href="+code=PTR_ERR" class="sref">PTR_ERR9/a>(9a href="+code=attr" class="sref">attr9/a>->9a href="+code=send_cq" class="sref">send_cq9/a>);  2069/a>                9a href="+code=attr" class="sref">attr9/a>->9a href="+code=send_cq" class="sref">send_cq9/a> = 9a href="+code=NULL" class="sref">NULL9/a>;  2079/a>                9a href="+code=rdsdebug" class="sref">rdsdebug9/a>(9spa2 class="string">"ib_create_cq send failed: %d\n", 9a href="+code=ret" class="sref">ret9/a>);  2089/a>                goto 9a href="+code=out" class="sref">out9/a>;  2099/a>        }  2109/a> 2119/a>        9a href="+code=attr" class="sref">attr9/a>->9a href="+code=recv_cq" class="sref">recv_cq9/a> = 9a href="+code=ib_create_cq" class="sref">ib_create_cq9/a>(9a href="+code=dev" class="sref">dev9/a>, 9a href="+code=recv_cq_handler" class="sref">recv_cq_handler9/a>,  2129/a>                                     9a href="+code=rds_iw_cq_event_handler" class="sref">rds_iw_cq_event_handler9/a>,  2139/a>                                     9a href="+code=context" class="sref">context9/a>, 9a href="+code=recv_size" class="sref">recv_size9/a>, 0);  2149/a>        if (9a href="+code=IS_ERR" class="sref">IS_ERR9/a>(9a href="+code=attr" class="sref">attr9/a>->9a href="+code=recv_cq" class="sref">recv_cq9/a>)) {  2159/a>                9a href="+code=ret" class="sref">ret9/a> = 9a href="+code=PTR_ERR" class="sref">PTR_ERR9/a>(9a href="+code=attr" class="sref">attr9/a>->9a href="+code=recv_cq" class="sref">recv_cq9/a>);  2169/a>                9a href="+code=attr" class="sref">attr9/a>->9a href="+code=recv_cq" class="sref">recv_cq9/a> = 9a href="+code=NULL" class="sref">NULL9/a>;  2179/a>                9a href="+code=rdsdebug" class="sref">rdsdebug9/a>(9spa2 class="string">"ib_create_cq send failed: %d\n", 9a href="+code=ret" class="sref">ret9/a>);  2189/a>                goto 9a href="+code=out" class="sref">out9/a>;  2199/a>        }  2209/a> 2219/a>        9a href="+code=ret" class="sref">ret9/a> = 9a href="+code=ib_req_notify_cq" class="sref">ib_req_notify_cq9/a>(9a href="+code=attr" class="sref">attr9/a>->9a href="+code=send_cq" class="sref">send_cq9/a>, 9a href="+code=IB_CQ_NEXT_COMP" class="sref">IB_CQ_NEXT_COMP9/a>);  2229/a>        if (9a href="+code=ret" class="sref">ret9/a>) {  2239/a>                9a href="+code=rdsdebug" class="sref">rdsdebug9/a>(9spa2 class="string">"ib_req_notify_cq send failed: %d\n", 9a href="+code=ret" class="sref">ret9/a>);  2249/a>                goto 9a href="+code=out" class="sref">out9/a>;  2259/a>        }  2269/a>  2279/a>        9a href="+code=ret" class="sref">ret9/a> = 9a href="+code=ib_req_notify_cq" class="sref">ib_req_notify_cq9/a>(9a href="+code=attr" class="sref">attr9/a>->9a href="+code=recv_cq" class="sref">recv_cq9/a>, 9a href="+code=IB_CQ_SOLICITED" class="sref">IB_CQ_SOLICITED9/a>);  2289/a>        if (9a href="+code=ret" class="sref">ret9/a>) {  2299/a>                9a href="+code=rdsdebug" class="sref">rdsdebug9/a>(9spa2 class="string">"ib_req_notify_cq recv failed: %d\n", 9a href="+code=ret" class="sref">ret9/a>);  2309/a>                goto 9a href="+code=out" class="sref">out9/a>;  2319/a>        }  2329/a>  2339/a>9a href="+code=out" class="sref">out9/a>:  2349/a>        if (9a href="+code=ret" class="sref">ret9/a>) {  2359/a>                if (9a href="+code=attr" class="sref">attr9/a>->9a href="+code=send_cq" class="sref">send_cq9/a>)  2369/a>                        9a href="+code=ib_destroy_cq" class="sref">ib_destroy_cq9/a>(9a href="+code=attr" class="sref">attr9/a>->9a href="+code=send_cq" class="sref">send_cq9/a>);  2379/a>                if (9a href="+code=attr" class="sref">attr9/a>->9a href="+code=recv_cq" class="sref">recv_cq9/a>)  2389/a>                        9a href="+code=ib_destroy_cq" class="sref">ib_destroy_cq9/a>(9a href="+code=attr" class="sref">attr9/a>->9a href="+code=recv_cq" class="sref">recv_cq9/a>);  2399/a>        }  2409/a>        return 9a href="+code=ret" class="sref">ret9/a>;  2419/a>}  2429/a>  2439/a>9spa2 class="comment">/*9/spa2>  2449/a>9spa2 class="comment"> * This needs to be very careful to not leave IS_ERR pointers around for9/spa2>  2459/a>9spa2 class="comment"> * cleanup to trip over.9/spa2>  2469/a>9spa2 class="comment"> */9/spa2>  2479/a>static int 9a href="+code=rds_iw_setup_qp" class="sref">rds_iw_setup_qp9/a>(struct 9a href="+code=rds_connec >
2" class="sref">rds_connec >
29/a> *9a href="+code=conn" class="sref">conn9/a>)  2489/a>{  2499/a>        struct 9a href="+code=rds_iw_connec >
2" class="sref">rds_iw_connec >
29/a> *9a href="+code=ic" class="sref">ic9/a> = 9a href="+code=conn" class="sref">conn9/a>->9a href="+code=c_transport_data" class="sref">c_transport_data9/a>;  2509/a>        struct 9a href="+code=ib_device" class="sref">ib_device9/a> *9a href="+code=dev" class="sref">dev9/a> = 9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_cm_id" class="sref">i_cm_id9/a>->9a href="+code=device" class="sref">device9/a>;  2519/a>        struct 9a href="+code=ib_qp_init_attr" class="sref">ib_qp_init_attr9/a> 9a href="+code=attr" class="sref">attr9/a>;  2529/a>        struct 9a href="+code=rds_iw_device" class="sref">rds_iw_device9/a> *9a href="+code=rds_iwdev" class="sref">rds_iwdev9/a>;  2539/a>        int 9a href="+code=ret" class="sref">ret9/a>;  2549/a>  2559/a>        9spa2 class="comment">/* rds_iw_add_one creates a rds_iw_device objec  per IB device,9/spa2>  2569/a>9spa2 class="comment">         * and allocates a protec >
2 domain, memory range and MR pool9/spa2>  2579/a>9spa2 class="comment">         * for each.  If that fails for any reason, it will not register9/spa2>  2589/a>9spa2 class="comment">         * the rds_iwdev at all.9/spa2>  2599/a>9spa2 class="comment">         */9/spa2>  2609/a>        9a href="+code=rds_iwdev" class="sref">rds_iwdev9/a> = 9a href="+code=ib_get_client_data" class="sref">ib_get_client_data9/a>(9a href="+code=dev" class="sref">dev9/a>, &9a href="+code=rds_iw_client" class="sref">rds_iw_client9/a>);  2619/a>        if (!9a href="+code=rds_iwdev" class="sref">rds_iwdev9/a>) {  2629/a>                9a href="+code=printk_ratelimited" class="sref">printk_ratelimited9/a>(9a href="+code=KERN_NOTICE" class="sref">KERN_NOTICE9/a> 9spa2 class="string">"RDS/IW: No client_data for device %s\n",  2639/a>                                        9a href="+code=dev" class="sref">dev9/a>->9a href="+code=nam " class="sref">nam 9/a>);  2649/a>                return -9a href="+code=EOPNOTSUPP" class="sref">EOPNOTSUPP9/a>;  2659/a>        }  2669/a>  2679/a>        9spa2 class="comment">/* Protec >
2 domain and memory range */9/spa2>  2689/a>        9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_pd" class="sref">i_pd9/a> = 9a href="+code=rds_iwdev" class="sref">rds_iwdev9/a>->9a href="+code=pd" class="sref">pd9/a>;  2699/a>        9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_mr" class="sref">i_mr9/a> = 9a href="+code=rds_iwdev" class="sref">rds_iwdev9/a>->9a href="+code=mr" class="sref">mr9/a>;  2709/a> 2719/a>        9a href="+code=ret" class="sref">ret9/a> = 9a href="+code=rds_iw_init_qp_attrs" class="sref">rds_iw_init_qp_attrs9/a>(&9a href="+code=attr" class="sref">attr9/a>, 9a href="+code=rds_iwdev" class="sref">rds_iwdev9/a>,  2729/a>                        &9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_send_ring" class="sref">i_send_ring9/a>, 9a href="+code=rds_iw_send_cq_comp_handler" class="sref">rds_iw_send_cq_comp_handler9/a>,  2739/a>                        &9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_recv_ring" class="sref">i_recv_ring9/a>, 9a href="+code=rds_iw_recv_cq_comp_handler" class="sref">rds_iw_recv_cq_comp_handler9/a>,  2749/a>                        9a href="+code=conn" class="sref">conn9/a>);  2759/a>        if (9a href="+code=ret" class="sref">ret9/a> < 0)  2769/a>                goto 9a href="+code=out" class="sref">out9/a>;  2779/a>  2789/a>        9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_send_cq" class="sref">i_send_cq9/a> = 9a href="+code=attr" class="sref">attr9/a>.9a href="+code=send_cq" class="sref">send_cq9/a>;  2799/a>        9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_recv_cq" class="sref">i_recv_cq9/a> = 9a href="+code=attr" class="sref">attr9/a>.9a href="+code=recv_cq" class="sref">recv_cq9/a>;  2809/a> 2819/a>        9spa2 class="comment">/*9/spa2>  2829/a>9spa2 class="comment">         * XXX this ca2 fail if max_*_wr is too large?  Are we supposed9/spa2>  2839/a>9spa2 class="comment">         * to back off until we get a value that the hardware ca2 support?9/spa2>  2849/a>9spa2 class="comment">         */9/spa2>  2859/a>        9a href="+code=ret" class="sref">ret9/a> = 9a href="+code=rdma_create_qp" class="sref">rdma_create_qp9/a>(9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_cm_id" class="sref">i_cm_id9/a>, 9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_pd" class="sref">i_pd9/a>, &9a href="+code=attr" class="sref">attr9/a>);  2869/a>        if (9a href="+code=ret" class="sref">ret9/a>) {  2879/a>                9a href="+code=rdsdebug" class="sref">rdsdebug9/a>(9spa2 class="string">"rdma_create_qp failed: %d\n", 9a href="+code=ret" class="sref">ret9/a>);  2889/a>                goto 9a href="+code=out" class="sref">out9/a>;  2899/a>        }  2909/a> 2919/a>        9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_send_hdrs" class="sref">i_send_hdrs9/a> = 9a href="+code=ib_dma_alloc_coherent" class="sref">ib_dma_alloc_coherent9/a>(9a href="+code=dev" class="sref">dev9/a>, 2929/a>                                           9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_send_ring" class="sref">i_send_ring9/a>.9a href="+code=w_nr" class="sref">w_nr9/a> * 2939/a>                                                sizeof(struct 9a href="+code=rds_header" class="sref">rds_header9/a>), 2949/a>                                           &9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_send_hdrs_dma" class="sref">i_send_hdrs_dma9/a>, 9a href="+code=GFP_KERNEL" class="sref">GFP_KERNEL9/a>);  2959/a>        if (!9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_send_hdrs" class="sref">i_send_hdrs9/a>) {  2969/a>                9a href="+code=ret" class="sref">ret9/a> = -9a href="+code=ENOMEM" class="sref">ENOMEM9/a>;  2979/a>                9a href="+code=rdsdebug" class="sref">rdsdebug9/a>(9spa2 class="string">"ib_dma_alloc_coherent send failed\n");  2989/a>                goto 9a href="+code=out" class="sref">out9/a>;  2999/a>        }  3009/a> 3019/a>        9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_recv_hdrs" class="sref">i_recv_hdrs9/a> = 9a href="+code=ib_dma_alloc_coherent" class="sref">ib_dma_alloc_coherent9/a>(9a href="+code=dev" class="sref">dev9/a>, 3029/a>                                           9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_recv_ring" class="sref">i_recv_ring9/a>.9a href="+code=w_nr" class="sref">w_nr9/a> * 3039/a>                                                sizeof(struct 9a href="+code=rds_header" class="sref">rds_header9/a>), 3049/a>                                           &9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_recv_hdrs_dma" class="sref">i_recv_hdrs_dma9/a>, 9a href="+code=GFP_KERNEL" class="sref">GFP_KERNEL9/a>);  3059/a>        if (!9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_recv_hdrs" class="sref">i_recv_hdrs9/a>) {  3069/a>                9a href="+code=ret" class="sref">ret9/a> = -9a href="+code=ENOMEM" class="sref">ENOMEM9/a>;  3079/a>                9a href="+code=rdsdebug" class="sref">rdsdebug9/a>(9spa2 class="string">"ib_dma_alloc_coherent recv failed\n");  3089/a>                goto 9a href="+code=out" class="sref">out9/a>;  3099/a>        }  3109/a> 3119/a>        9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_ack" class="sref">i_ack9/a> = 9a href="+code=ib_dma_alloc_coherent" class="sref">ib_dma_alloc_coherent9/a>(9a href="+code=dev" class="sref">dev9/a>, sizeof(struct 9a href="+code=rds_header" class="sref">rds_header9/a>), 3129/a>                                       &9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_ack_dma" class="sref">i_ack_dma9/a>, 9a href="+code=GFP_KERNEL" class="sref">GFP_KERNEL9/a>);  3139/a>        if (!9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_ack" class="sref">i_ack9/a>) {  3149/a>                9a href="+code=ret" class="sref">ret9/a> = -9a href="+code=ENOMEM" class="sref">ENOMEM9/a>;  3159/a>                9a href="+code=rdsdebug" class="sref">rdsdebug9/a>(9spa2 class="string">"ib_dma_alloc_coherent ack failed\n");  3169/a>                goto 9a href="+code=out" class="sref">out9/a>;  3179/a>        }  3189/a>  3199/a>        9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_sends" class="sref">i_sends9/a> = 9a href="+code=vmalloc" class="sref">vmalloc9/a>(9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_send_ring" class="sref">i_send_ring9/a>.9a href="+code=w_nr" class="sref">w_nr9/a> * sizeof(struct 9a href="+code=rds_iw_send_work" class="sref">rds_iw_send_work9/a>));  3209/a>        if (!9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_sends" class="sref">i_sends9/a>) {  3219/a>                9a href="+code=ret" class="sref">ret9/a> = -9a href="+code=ENOMEM" class="sref">ENOMEM9/a>;  3229/a>                9a href="+code=rdsdebug" class="sref">rdsdebug9/a>(9spa2 class="string">"send allocat>
2 failed\n");  3239/a>                goto 9a href="+code=out" class="sref">out9/a>;  3249/a>        }  3259/a>        9a href="+code=rds_iw_send_init_ring" class="sref">rds_iw_send_init_ring9/a>(9a href="+code=ic" class="sref">ic9/a>);  3269/a>  3279/a>        9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_recvs" class="sref">i_recvs9/a> = 9a href="+code=vmalloc" class="sref">vmalloc9/a>(9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_recv_ring" class="sref">i_recv_ring9/a>.9a href="+code=w_nr" class="sref">w_nr9/a> * sizeof(struct 9a href="+code=rds_iw_recv_work" class="sref">rds_iw_recv_work9/a>));  3289/a>        if (!9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_recvs" class="sref">i_recvs9/a>) {  3299/a>                9a href="+code=ret" class="sref">ret9/a> = -9a href="+code=ENOMEM" class="sref">ENOMEM9/a>;  3309/a>                9a href="+code=rdsdebug" class="sref">rdsdebug9/a>(9spa2 class="string">"recv allocat>
2 failed\n");  3319/a>                goto 9a href="+code=out" class="sref">out9/a>;  3329/a>        }  3339/a>  3349/a>        9a href="+code=rds_iw_recv_init_ring" class="sref">rds_iw_recv_init_ring9/a>(9a href="+code=ic" class="sref">ic9/a>);  3359/a>        9a href="+code=rds_iw_recv_init_ack" class="sref">rds_iw_recv_init_ack9/a>(9a href="+code=ic" class="sref">ic9/a>);  3369/a>  3379/a>        9spa2 class="comment">/* Post receive buffers - as a side effect, this will update9/spa2>  3389/a>9spa2 class="comment">         * the posted credit count. */9/spa2>  3399/a>        9a href="+code=rds_iw_recv_refill" class="sref">rds_iw_recv_refill9/a>(9a href="+code=conn" class="sref">conn9/a>, 9a href="+code=GFP_KERNEL" class="sref">GFP_KERNEL9/a>, 9a href="+code=GFP_HIGHUSER" class="sref">GFP_HIGHUSER9/a>, 1;  3409/a> 3419/a>        9a href="+code=rdsdebug" class="sref">rdsdebug9/a>(9spa2 class="string">"conn %p pd %p mr %p cq %p %p\n", 9a href="+code=conn" class="sref">conn9/a>, 9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_pd" class="sref">i_pd9/a>, 9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_mr" class="sref">i_mr9/a>, 3429/a>                 9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_send_cq" class="sref">i_send_cq9/a>, 9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_recv_cq" class="sref">i_recv_cq9/a>;  3439/a>  3449/a>9a href="+code=out" class="sref">out9/a>:  3459/a>        return 9a href="+code=ret" class="sref">ret9/a>;  3469/a>}  3479/a>  3489/a>static 9a href="+code=u32" class="sref">u329/a> 9a href="+code=rds_iw_protocol_compatible" class="sref">rds_iw_protocol_compatible9/a>(const struct 9a href="+code=rds_iw_connec _private" class="sref">rds_iw_connec _private9/a> *9a href="+code=dp" class="sref">dp9/a>)  3499/a>{  3509/a>        9a href="+code=u16" class="sref">u169/a> 9a href="+code=comm
2" class="sref">comm
29/a>;  3519/a>        9a href="+code=u32" class="sref">u329/a> 9a href="+code=vers>
2" class="sref">vers>
29/a> = 0;  3529/a>  3539/a>        9spa2 class="comment">/* rdma_cm private data is odd - when there is any private data in the9/spa2>  3549/a>9spa2 class="comment">         * request, we will be given a pretty large buffer without telling us the9/spa2>  3559/a>9spa2 class="comment">         * origipal size. The only way to tell the difference is by looking at9/spa2>  3569/a>9spa2 class="comment">         * the contents, which are initialized to zero.9/spa2>  3579/a>9spa2 class="comment">         * If the protocol vers>
2 fields aren't set, this is a connec >
2 attempt9/spa2>  3589/a>9spa2 class="comment">         * from an older vers>
2. This could could be 3.0 or 2.0 - we can't tell.9/spa2>  3599/a>9spa2 class="comment">         * We really should have changed this for OFED 1.3 :-( */9/spa2>  3609/a>        if (9a href="+code=dp" class="sref">dp9/a>->9a href="+code=dp_protocol_major" class="sref">dp_protocol_major9/a> == 0)  3619/a>                return 9a href="+code=RDS_PROTOCOL_3_0" class="sref">RDS_PROTOCOL_3_09/a>;  3629/a>  3639/a>        9a href="+code=comm
2" class="sref">comm
29/a> = 9a href="+code=be16_to_cpu" class="sref">be16_to_cpu9/a>(9a href="+code=dp" class="sref">dp9/a>->9a href="+code=dp_protocol_minor_mask" class="sref">dp_protocol_minor_mask9/a>) & 9a href="+code=RDS_IW_SUPPORTED_PROTOCOLS" class="sref">RDS_IW_SUPPORTED_PROTOCOLS9/a>;  3649/a>        if (9a href="+code=dp" class="sref">dp9/a>->9a href="+code=dp_protocol_major" class="sref">dp_protocol_major9/a> == 3 && 9a href="+code=comm
2" class="sref">comm
29/a>) {  3659/a>                9a href="+code=vers>
2" class="sref">vers>
29/a> = 9a href="+code=RDS_PROTOCOL_3_0" class="sref">RDS_PROTOCOL_3_09/a>;  3669/a>                while ((9a href="+code=comm
2" class="sref">comm
29/a> >>= 1) != 0)  3679/a>                        9a href="+code=vers>
2" class="sref">vers>
29/a>++;  3689/a>        }  3699/a>        9a href="+code=printk_ratelimited" class="sref">printk_ratelimited9/a>(9a href="+code=KERN_NOTICE" class="sref">KERN_NOTICE9/a> 9spa2 class="string">"RDS: Connec >
2 from %pI4 using "  3709/a>                        9spa2 class="string">"incompatible protocol vers>
2 %u.%u\n",  3719/a>                        &9a href="+code=dp" class="sref">dp9/a>->9a href="+code=dp_saddr" class="sref">dp_saddr9/a>, 3729/a>                        9a href="+code=dp" class="sref">dp9/a>->9a href="+code=dp_protocol_major" class="sref">dp_protocol_major9/a>, 3739/a>                        9a href="+code=dp" class="sref">dp9/a>->9a href="+code=dp_protocol_minor" class="sref">dp_protocol_minor9/a>;  3749/a>        return 9a href="+code=vers>
2" class="sref">vers>
29/a>  3759/a>}  3769/a>  3779/a>int 9a href="+code=rds_iw_cm_handle_connec " class="sref">rds_iw_cm_handle_connec 9/a>(struct 9a href="+code=rdma_cm_id" class="sref">rdma_cm_id9/a> *9a href="+code=cm_id" class="sref">cm_id9/a>,  3789/a>                                    struct 9a href="+code=rdma_cm_event" class="sref">rdma_cm_event9/a> *9a href="+code=event" class="sref">event9/a>)  3799/a>{  3809/a>        const struct 9a href="+code=rds_iw_connec _private" class="sref">rds_iw_connec _private9/a> *9a href="+code=dp" class="sref">dp9/a> = 9a href="+code=event" class="sref">event9/a>->9a href="+code=param" class="sref">param9/a>.9a href="+code=conn" class="sref">conn9/a>.9a href="+code=private_data" class="sref">private_data9/a>  3819/a>        struct 9a href="+code=rds_iw_connec _private" class="sref">rds_iw_connec _private9/a> 9a href="+code=dp_rep" class="sref">dp_rep9/a>  3829/a>        struct 9a href="+code=rds_connec >
2" class="sref">rds_connec >
29/a> *9a href="+code=conn" class="sref">conn9/a> = 9a href="+code=NULL" class="sref">NULL9/a>;  3839/a>        struct 9a href="+code=rds_iw_connec >
2" class="sref">rds_iw_connec >
29/a> *9a href="+code=ic" class="sref">ic9/a> = 9a href="+code=NULL" class="sref">NULL9/a>;  3849/a>        struct 9a href="+code=rdma_conn_param" class="sref">rdma_conn_param9/a> 9a href="+code=conn_param" class="sref">conn_param9/a>;  3859/a>        struct 9a href="+code=rds_iw_device" class="sref">rds_iw_device9/a> *9a href="+code=rds_iwdev" class="sref">rds_iwdev9/a>;  3869/a>        9a href="+code=u32" class="sref">u329/a> 9a href="+code=vers>
2" class="sref">vers>
29/a>;  3879/a>        int 9a href="+code=err" class="sref">err9/a>, 9a href="+code=destroy" class="sref">destroy9/a> = 1;  3889/a>  3899/a>        9spa2 class="comment">/* Check whether the remote protocol vers>
2 matches ours. */9/spa2>  3909/a>        9a href="+code=vers>
2" class="sref">vers>
29/a> = 9a href="+code=rds_iw_protocol_compatible" class="sref">rds_iw_protocol_compatible9/a>(9a href="+code=dp" class="sref">dp9/a>);  3919/a>        if (!9a href="+code=vers>
2" class="sref">vers>
29/a>)  3929/a>                goto 9a href="+code=out" class="sref">out9/a>;  3939/a>  3949/a>        9a href="+code=rdsdebug" class="sref">rdsdebug9/a>(9spa2 class="string">"saddr %pI4 daddr %pI4 RDSv%u.%u\n",  3959/a>                 &9a href="+code=dp" class="sref">dp9/a>->9a href="+code=dp_saddr" class="sref">dp_saddr9/a>, &9a href="+code=dp" class="sref">dp9/a>->9a href="+code=dp_daddr" class="sref">dp_daddr9/a>, 3969/a>                 9a href="+code=RDS_PROTOCOL_MAJOR" class="sref">RDS_PROTOCOL_MAJOR9/a>(9a href="+code=vers>
2" class="sref">vers>
29/a>), 9a href="+code=RDS_PROTOCOL_MINOR" class="sref">RDS_PROTOCOL_MINOR9/a>(9a href="+code=vers>
2" class="sref">vers>
29/a>));  3979/a>  3989/a>        9a href="+code=conn" class="sref">conn9/a> = 9a href="+code=rds_conn_create" class="sref">rds_conn_create9/a>(9a href="+code=dp" class="sref">dp9/a>->9a href="+code=dp_daddr" class="sref">dp_daddr9/a>, 9a href="+code=dp" class="sref">dp9/a>->9a href="+code=dp_saddr" class="sref">dp_saddr9/a>, &9a href="+code=rds_iw_transport" class="sref">rds_iw_transport9/a>, 3999/a>                               9a href="+code=GFP_KERNEL" class="sref">GFP_KERNEL9/a>);  4009/a>        if (9a href="+code=IS_ERR" class="sref">IS_ERR9/a>(9a href="+code=conn" class="sref">conn9/a>)) {  4019/a>                9a href="+code=rdsdebug" class="sref">rdsdebug9/a>(9spa2 class="string">"rds_conn_create failed (%ld)\n", 9a href="+code=PTR_ERR" class="sref">PTR_ERR9/a>(9a href="+code=conn" class="sref">conn9/a>));  4029/a>                9a href="+code=conn" class="sref">conn9/a> = 9a href="+code=NULL" class="sref">NULL9/a>;  4039/a>                goto 9a href="+code=out" class="sref">out9/a>;  4049/a>        }  4059/a>  4069/a>        9spa2 class="comment">/*9/spa2>  4079/a>9spa2 class="comment">         * The connec >
2 request may occur while the9/spa2>  4089/a>9spa2 class="comment">         * previous connec >
2 exist, e.g. in case of failover.9/spa2>  4099/a>9spa2 class="comment">         * But as connec >
2s may be initiated simultaneously9/spa2>  4109/a>9spa2 class="comment">         * by both hosts, we have a random backoff mechanism -9/spa2>  4119/a>9spa2 class="comment">         * see the comment above rds_queue_reconnec ()9/spa2>  4129/a>9spa2 class="comment">         */9/spa2>  4139/a>        9a href="+code=mutex_lock" class="sref">mutex_lock9/a>(&9a href="+code=conn" class="sref">conn9/a>->9a href="+code=c_cm_lock" class="sref">c_cm_lock9/a>);  4149/a>        if (!9a href="+code=rds_conn_transi >
2" class="sref">rds_conn_transi >
29/a>(9a href="+code=conn" class="sref">conn9/a>, 9a href="+code=RDS_CONN_DOWN" class="sref">RDS_CONN_DOWN9/a>, 9a href="+code=RDS_CONN_CONNECTING" class="sref">RDS_CONN_CONNECTING9/a>)) {  4159/a>                if (9a href="+code=rds_conn_state" class="sref">rds_conn_state9/a>(9a href="+code=conn" class="sref">conn9/a>) == 9a href="+code=RDS_CONN_UP" class="sref">RDS_CONN_UP9/a>) {  4169/a>                        9a href="+code=rdsdebug" class="sref">rdsdebug9/a>(9spa2 class="string">"incoming connec  while connec >ng\n");  4179/a>                        9a href="+code=rds_conn_drop" class="sref">rds_conn_drop9/a>(9a href="+code=conn" class="sref">conn9/a>);  4189/a>                        9a href="+code=rds_iw_stats_inc" class="sref">rds_iw_stats_inc9/a>(9a href="+code=s_iw_listen_closed_stale" class="sref">s_iw_listen_closed_stale9/a>);  4199/a>                } else  4209/a>                if (9a href="+code=rds_conn_state" class="sref">rds_conn_state9/a>(9a href="+code=conn" class="sref">conn9/a>) == 9a href="+code=RDS_CONN_CONNECTING" class="sref">RDS_CONN_CONNECTING9/a>) {  4219/a>                        9spa2 class="comment">/* Wait and see - our connec  may still be succeeding */9/spa2>  4229/a>                        9a href="+code=rds_iw_stats_inc" class="sref">rds_iw_stats_inc9/a>(9a href="+code=s_iw_connec _raced" class="sref">s_iw_connec _raced9/a>);  4239/a>                }  4249/a>                9a href="+code=mutex_unlock" class="sref">mutex_unlock9/a>(&9a href="+code=conn" class="sref">conn9/a>->9a href="+code=c_cm_lock" class="sref">c_cm_lock9/a>);  4259/a>                goto 9a href="+code=out" class="sref">out9/a>;  4269/a>        }  4279/a>  4289/a>        9a href="+code=ic" class="sref">ic9/a> = 9a href="+code=conn" class="sref">conn9/a>->9a href="+code=c_transport_data" class="sref">c_transport_data9/a>;  4299/a>  4309/a>        9a href="+code=rds_iw_set_protocol" class="sref">rds_iw_set_protocol9/a>(9a href="+code=conn" class="sref">conn9/a>, 9a href="+code=vers>
2" class="sref">vers>
29/a>);  4319/a>        9a href="+code=rds_iw_set_flow_control" class="sref">rds_iw_set_flow_control9/a>(9a href="+code=conn" class="sref">conn9/a>, 9a href="+code=be32_to_cpu" class="sref">be32_to_cpu9/a>(9a href="+code=dp" class="sref">dp9/a>->9a href="+code=dp_credit" class="sref">dp_credit9/a>));  4329/a>  4339/a>        9spa2 class="comment">/* If the peer gave us the last packet it saw, process this as if9/spa2>  4349/a>9spa2 class="comment">         * we had received a regular ACK. */9/spa2>  4359/a>        if (9a href="+code=dp" class="sref">dp9/a>->9a href="+code=dp_ack_seq" class="sref">dp_ack_seq9/a>)  4369/a>                9a href="+code=rds_send_drop_acked" class="sref">rds_send_drop_acked9/a>(9a href="+code=conn" class="sref">conn9/a>, 9a href="+code=be64_to_cpu" class="sref">be64_to_cpu9/a>(9a href="+code=dp" class="sref">dp9/a>->9a href="+code=dp_ack_seq" class="sref">dp_ack_seq9/a>), 9a href="+code=NULL" class="sref">NULL9/a>);  4379/a>  4389/a>        9a href="+code=BUG_ON" class="sref">BUG_ON9/a>(9a href="+code=cm_id" class="sref">cm_id9/a>->9a href="+code=context" class="sref">context9/a>);  4399/a>        9a href="+code=BUG_ON" class="sref">BUG_ON9/a>(9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_cm_id" class="sref">i_cm_id9/a>);  4409/a> 4419/a>        9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_cm_id" class="sref">i_cm_id9/a> = 9a href="+code=cm_id" class="sref">cm_id9/a>;  4429/a>        9a href="+code=cm_id" class="sref">cm_id9/a>->9a href="+code=context" class="sref">context9/a> = 9a href="+code=conn" class="sref">conn9/a>;  4439/a>  4449/a>        9a href="+code=rds_iwdev" class="sref">rds_iwdev9/a> = 9a href="+code=ib_get_client_data" class="sref">ib_get_client_data9/a>(9a href="+code=cm_id" class="sref">cm_id9/a>->9a href="+code=device" class="sref">device9/a>, &9a href="+code=rds_iw_client" class="sref">rds_iw_client9/a>);  4459/a>        9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_dma_local_lkey" class="sref">i_dma_local_lkey9/a> = 9a href="+code=rds_iwdev" class="sref">rds_iwdev9/a>->9a href="+code=dma_local_lkey" class="sref">dma_local_lkey9/a>;  4469/a>  4479/a>        9spa2 class="comment">/* We got halfway through setting up the ib_connec >
2, if we9/spa2>  4489/a>9spa2 class="comment">         * fail now, we have to take the long route out of this mess. */9/spa2>  4499/a>        9a href="+code=destroy" class="sref">destroy9/a> = 0;  4509/a> 4519/a>        9a href="+code=err" class="sref">err9/a> = 9a href="+code=rds_iw_setup_qp" class="sref">rds_iw_setup_qp9/a>(9a href="+code=conn" class="sref">conn9/a>);  4529/a>        if (9a href="+code=err" class="sref">err9/a>) {  4539/a>                9a href="+code=rds_iw_conn_error" class="sref">rds_iw_conn_error9/a>(9a href="+code=conn" class="sref">conn9/a>, 9spa2 class="string">"rds_iw_setup_qp failed (%d)\n", 9a href="+code=err" class="sref">err9/a>);  4549/a>                9a href="+code=mutex_unlock" class="sref">mutex_unlock9/a>(&9a href="+code=conn" class="sref">conn9/a>->9a href="+code=c_cm_lock" class="sref">c_cm_lock9/a>);  4559/a>                goto 9a href="+code=out" class="sref">out9/a>;  4569/a>        }  4579/a>  4589/a>        9a href="+code=rds_iw_cm_fill_conn_param" class="sref">rds_iw_cm_fill_conn_param9/a>(9a href="+code=conn" class="sref">conn9/a>, &9a href="+code=conn_param" class="sref">conn_param9/a>, &9a href="+code=dp_rep" class="sref">dp_rep9/a>, 9a href="+code=vers>
2" class="sref">vers>
29/a>);  4599/a>  4609/a>        9spa2 class="comment">/* rdma_accept() calls rdma_rejec () internally if it fails */9/spa2>  4619/a>        9a href="+code=err" class="sref">err9/a> = 9a href="+code=rdma_accept" class="sref">rdma_accept9/a>(9a href="+code=cm_id" class="sref">cm_id9/a>, &9a href="+code=conn_param" class="sref">conn_param9/a>);  4629/a>        9a href="+code=mutex_unlock" class="sref">mutex_unlock9/a>(&9a href="+code=conn" class="sref">conn9/a>->9a href="+code=c_cm_lock" class="sref">c_cm_lock9/a>);  4639/a>        if (9a href="+code=err" class="sref">err9/a>) {  4649/a>                9a href="+code=rds_iw_conn_error" class="sref">rds_iw_conn_error9/a>(9a href="+code=conn" class="sref">conn9/a>, 9spa2 class="string">"rdma_accept failed (%d)\n", 9a href="+code=err" class="sref">err9/a>);  4659/a>                goto 9a href="+code=out" class="sref">out9/a>;  4669/a>        }  4679/a>  4689/a>        return 0;  4699/a>  4709/a>9a href="+code=out" class="sref">out9/a>:  4719/a>        9a href="+code=rdma_rejec " class="sref">rdma_rejec 9/a>(9a href="+code=cm_id" class="sref">cm_id9/a>, 9a href="+code=NULL" class="sref">NULL9/a>, 0);  4729/a>        return 9a href="+code=destroy" class="sref">destroy9/a>;  4739/a>}  4749/a>  4759/a>  4769/a>int 9a href="+code=rds_iw_cm_initiate_connec " class="sref">rds_iw_cm_initiate_connec 9/a>(struct 9a href="+code=rdma_cm_id" class="sref">rdma_cm_id9/a> *9a href="+code=cm_id" class="sref">cm_id9/a>)  4779/a>{  4789/a>        struct 9a href="+code=rds_connec >
2" class="sref">rds_connec >
29/a> *9a href="+code=conn" class="sref">conn9/a> = 9a href="+code=cm_id" class="sref">cm_id9/a>->9a href="+code=context" class="sref">context9/a>;  4799/a>        struct 9a href="+code=rds_iw_connec >
2" class="sref">rds_iw_connec >
29/a> *9a href="+code=ic" class="sref">ic9/a> = 9a href="+code=conn" class="sref">conn9/a>->9a href="+code=c_transport_data" class="sref">c_transport_data9/a>;  4809/a>        struct 9a href="+code=rdma_conn_param" class="sref">rdma_conn_param9/a> 9a href="+code=conn_param" class="sref">conn_param9/a>;  4819/a>        struct 9a href="+code=rds_iw_connec _private" class="sref">rds_iw_connec _private9/a> 9a href="+code=dp" class="sref">dp9/a>;  4829/a>        int 9a href="+code=ret" class="sref">ret9/a>;  4839/a>  4849/a>        9spa2 class="comment">/* If the peer doesn't do protocol negotia >
2, we must9/spa2>  4859/a>9spa2 class="comment">         * default to RDSv3.0 */9/spa2>  4869/a>        9a href="+code=rds_iw_set_protocol" class="sref">rds_iw_set_protocol9/a>(9a href="+code=conn" class="sref">conn9/a>, 9a href="+code=RDS_PROTOCOL_3_0" class="sref">RDS_PROTOCOL_3_09/a>);  4879/a>        9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_flowctl" class="sref">i_flowctl9/a> = 9a href="+code=rds_iw_sysctl_flow_control" class="sref">rds_iw_sysctl_flow_control9/a>;     9spa2 class="comment">/* advertise flow control */9/spa2>  4889/a>  4899/a>        9a href="+code=ret" class="sref">ret9/a> = 9a href="+code=rds_iw_setup_qp" class="sref">rds_iw_setup_qp9/a>(9a href="+code=conn" class="sref">conn9/a>);  4909/a>        if (9a href="+code=ret" class="sref">ret9/a>) {  4919/a>                9a href="+code=rds_iw_conn_error" class="sref">rds_iw_conn_error9/a>(9a href="+code=conn" class="sref">conn9/a>, 9spa2 class="string">"rds_iw_setup_qp failed (%d)\n", 9a href="+code=ret" class="sref">ret9/a>);  4929/a>                goto 9a href="+code=out" class="sref">out9/a>;  4939/a>        }  4949/a>  4959/a>        9a href="+code=rds_iw_cm_fill_conn_param" class="sref">rds_iw_cm_fill_conn_param9/a>(9a href="+code=conn" class="sref">conn9/a>, &9a href="+code=conn_param" class="sref">conn_param9/a>, &9a href="+code=dp" class="sref">dp9/a>, 9a href="+code=RDS_PROTOCOL_VERSION" class="sref">RDS_PROTOCOL_VERSION9/a>);  4969/a>  4979/a>        9a href="+code=ret" class="sref">ret9/a> = 9a href="+code=rdma_connec " class="sref">rdma_connec 9/a>(9a href="+code=cm_id" class="sref">cm_id9/a>, &9a href="+code=conn_param" class="sref">conn_param9/a>);  4989/a>        if (9a href="+code=ret" class="sref">ret9/a>)  4999/a>                9a href="+code=rds_iw_conn_error" class="sref">rds_iw_conn_error9/a>(9a href="+code=conn" class="sref">conn9/a>, 9spa2 class="string">"rdma_connec  failed (%d)\n", 9a href="+code=ret" class="sref">ret9/a>);  5009/a> 5019/a>9a href="+code=out" class="sref">out9/a>:  5029/a>        9spa2 class="comment">/* Beware - returning non-zero tells the rdma_cm to destroy9/spa2>  5039/a>9spa2 class="comment">         * the cm_id. We should certainly not do it as long as we still9/spa2>  5049/a>9spa2 class="comment">         * "own" the cm_id. */9/spa2>  5059/a>        if (9a href="+code=ret" class="sref">ret9/a>) {  5069/a>                struct 9a href="+code=rds_iw_connec >
2" class="sref">rds_iw_connec >
29/a> *9a href="+code=ic" class="sref">ic9/a> = 9a href="+code=conn" class="sref">conn9/a>->9a href="+code=c_transport_data" class="sref">c_transport_data9/a>;  5079/a>  5089/a>                if (9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_cm_id" class="sref">i_cm_id9/a> == 9a href="+code=cm_id" class="sref">cm_id9/a>)  5099/a>                        9a href="+code=ret" class="sref">ret9/a> = 0;  5109/a>        }  5119/a>        return 9a href="+code=ret" class="sref">ret9/a>;  5129/a>}  5139/a>  5149/a>int 9a href="+code=rds_iw_conn_connec " class="sref">rds_iw_conn_connec 9/a>(struct 9a href="+code=rds_connec >
2" class="sref">rds_connec >
29/a> *9a href="+code=conn" class="sref">conn9/a>)  5159/a>{  5169/a>        struct 9a href="+code=rds_iw_connec >
2" class="sref">rds_iw_connec >
29/a> *9a href="+code=ic" class="sref">ic9/a> = 9a href="+code=conn" class="sref">conn9/a>->9a href="+code=c_transport_data" class="sref">c_transport_data9/a>;  5179/a>        struct 9a href="+code=rds_iw_device" class="sref">rds_iw_device9/a> *9a href="+code=rds_iwdev" class="sref">rds_iwdev9/a>;  5189/a>        struct 9a href="+code=sockaddr_in" class="sref">sockaddr_in9/a> 9a href="+code=src" class="sref">src9/a>, 9a href="+code=dest" class="sref">dest9/a>;  5199/a>        int 9a href="+code=ret" class="sref">ret9/a>;  5209/a> 5219/a>        9spa2 class="comment">/* XXX I wonder what affec  the port space has */9/spa2>  5229/a>        9spa2 class="comment">/* delegate cm event handler to rdma_transport */9/spa2>  5239/a>        9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_cm_id" class="sref">i_cm_id9/a> = 9a href="+code=rdma_create_id" class="sref">rdma_create_id9/a>(9a href="+code=rds_rdma_cm_event_handler" class="sref">rds_rdma_cm_event_handler9/a>, 9a href="+code=conn" class="sref">conn9/a>,  5249/a>                                     9a href="+code=RDMA_PS_TCP" class="sref">RDMA_PS_TCP9/a>, 9a href="+code=IB_QPT_RC" class="sref">IB_QPT_RC9/a>);  5259/a>        if (9a href="+code=IS_ERR" class="sref">IS_ERR9/a>(9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_cm_id" class="sref">i_cm_id9/a>)) {  5269/a>                9a href="+code=ret" class="sref">ret9/a> = 9a href="+code=PTR_ERR" class="sref">PTR_ERR9/a>(9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_cm_id" class="sref">i_cm_id9/a>);  5279/a>                9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_cm_id" class="sref">i_cm_id9/a> = 9a href="+code=NULL" class="sref">NULL9/a>;  5289/a>                9a href="+code=rdsdebug" class="sref">rdsdebug9/a>(9spa2 class="string">"rdma_create_id() failed: %d\n", 9a href="+code=ret" class="sref">ret9/a>);  5299/a>                goto 9a href="+code=out" class="sref">out9/a>;  5309/a>        }  5319/a>  5329/a>        9a href="+code=rdsdebug" class="sref">rdsdebug9/a>(9spa2 class="string">"created cm id %p for conn %p\n", 9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_cm_id" class="sref">i_cm_id9/a>, 9a href="+code=conn" class="sref">conn9/a>);  5339/a>  5349/a>        9a href="+code=src" class="sref">src9/a>.9a href="+code=sin_family" class="sref">sin_family9/a> = 9a href="+code=AF_INET" class="sref">AF_INET9/a>;  5359/a>        9a href="+code=src" class="sref">src9/a>.9a href="+code=sin_addr" class="sref">sin_addr9/a>.9a href="+code=s_addr" class="sref">s_addr9/a> = (9a href="+code=__force" class="sref">__force9/a> 9a href="+code=u32" class="sref">u329/a>)9a href="+code=conn" class="sref">conn9/a>->9a href="+code=c_laddr" class="sref">c_laddr9/a>;  5369/a>        9a href="+code=src" class="sref">src9/a>.9a href="+code=sin_port" class="sref">sin_port9/a> = (9a href="+code=__force" class="sref">__force9/a> 9a href="+code=u16" class="sref">u169/a>)9a href="+code=htons" class="sref">htons9/a>(0);  5379/a>  5389/a>        9spa2 class="comment">/* First, bind to the local address and device. */9/spa2>  5399/a>        9a href="+code=ret" class="sref">ret9/a> = 9a href="+code=rdma_bind_addr" class="sref">rdma_bind_addr9/a>(9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_cm_id" class="sref">i_cm_id9/a>, (struct 9a href="+code=sockaddr" class="sref">sockaddr9/a> *) &9a href="+code=src" class="sref">src9/a>);  5409/a>        if (9a href="+code=ret" class="sref">ret9/a>) {  5419/a>                9a href="+code=rdsdebug" class="sref">rdsdebug9/a>(9spa2 class="string">"rdma_bind_addr(%pI4) failed: %d\n",  5429/a>                                &9a href="+code=conn" class="sref">conn9/a>->9a href="+code=c_laddr" class="sref">c_laddr9/a>, 9a href="+code=ret" class="sref">ret9/a>);  5439/a>                9a href="+code=rdma_destroy_id" class="sref">rdma_destroy_id9/a>(9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_cm_id" class="sref">i_cm_id9/a>);  5449/a>                9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_cm_id" class="sref">i_cm_id9/a> = 9a href="+code=NULL" class="sref">NULL9/a>;  5459/a>                goto 9a href="+code=out" class="sref">out9/a>;  5469/a>        }  5479/a>  5489/a>        9a href="+code=rds_iwdev" class="sref">rds_iwdev9/a> = 9a href="+code=ib_get_client_data" class="sref">ib_get_client_data9/a>(9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_cm_id" class="sref">i_cm_id9/a>->9a href="+code=device" class="sref">device9/a>, &9a href="+code=rds_iw_client" class="sref">rds_iw_client9/a>);  5499/a>        9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_dma_local_lkey" class="sref">i_dma_local_lkey9/a> = 9a href="+code=rds_iwdev" class="sref">rds_iwdev9/a>->9a href="+code=dma_local_lkey" class="sref">dma_local_lkey9/a>;  5509/a> 5519/a>        9a href="+code=dest" class="sref">dest9/a>.9a href="+code=sin_family" class="sref">sin_family9/a> = 9a href="+code=AF_INET" class="sref">AF_INET9/a>;  5529/a>        9a href="+code=dest" class="sref">dest9/a>.9a href="+code=sin_addr" class="sref">sin_addr9/a>.9a href="+code=s_addr" class="sref">s_addr9/a> = (9a href="+code=__force" class="sref">__force9/a> 9a href="+code=u32" class="sref">u329/a>)9a href="+code=conn" class="sref">conn9/a>->9a href="+code=c_faddr" class="sref">c_faddr9/a>;  5539/a>        9a href="+code=dest" class="sref">dest9/a>.9a href="+code=sin_port" class="sref">sin_port9/a> = (9a href="+code=__force" class="sref">__force9/a> 9a href="+code=u16" class="sref">u169/a>)9a href="+code=htons" class="sref">htons9/a>(9a href="+code=RDS_PORT" class="sref">RDS_PORT9/a>);  5549/a>  5559/a>        9a href="+code=ret" class="sref">ret9/a> = 9a href="+code=rdma_resolve_addr" class="sref">rdma_resolve_addr9/a>(9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_cm_id" class="sref">i_cm_id9/a>, (struct 9a href="+code=sockaddr" class="sref">sockaddr9/a> *)&9a href="+code=src" class="sref">src9/a>,  5569/a>                                (struct 9a href="+code=sockaddr" class="sref">sockaddr9/a> *)&9a href="+code=dest" class="sref">dest9/a>,  5579/a>                                9a href="+code=RDS_RDMA_RESOLVE_TIMEOUT_MS" class="sref">RDS_RDMA_RESOLVE_TIMEOUT_MS9/a>);  5589/a>        if (9a href="+code=ret" class="sref">ret9/a>) {  5599/a>                9a href="+code=rdsdebug" class="sref">rdsdebug9/a>(9spa2 class="string">"addr resolve failed for cm id %p: %d\n", 9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_cm_id" class="sref">i_cm_id9/a>,  5609/a>                         9a href="+code=ret" class="sref">ret9/a>);  5619/a>                9a href="+code=rdma_destroy_id" class="sref">rdma_destroy_id9/a>(9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_cm_id" class="sref">i_cm_id9/a>);  5629/a>                9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_cm_id" class="sref">i_cm_id9/a> = 9a href="+code=NULL" class="sref">NULL9/a>;  5639/a>        }  5649/a>  5659/a>9a href="+code=out" class="sref">out9/a>:  5669/a>        return 9a href="+code=ret" class="sref">ret9/a>;  5679/a>}  5689/a>  5699/a>9spa2 class="comment">/*9/spa2>  5709/a>9spa2 class="comment"> * This is so careful about only cleaning up resources that were built up9/spa2>  5719/a>9spa2 class="comment"> * so that it can be called at any point during startup.  In fact it9/spa2>  5729/a>9spa2 class="comment"> * can be called multiple times for a given connec >
2.9/spa2>  5739/a>9spa2 class="comment"> */9/spa2>  5749/a>void 9a href="+code=rds_iw_conn_shutdow2" class="sref">rds_iw_conn_shutdow29/a>(struct 9a href="+code=rds_connec >
2" class="sref">rds_connec >
29/a> *9a href="+code=conn" class="sref">conn9/a>)  5759/a>{  5769/a>        struct 9a href="+code=rds_iw_connec >
2" class="sref">rds_iw_connec >
29/a> *9a href="+code=ic" class="sref">ic9/a> = 9a href="+code=conn" class="sref">conn9/a>->9a href="+code=c_transport_data" class="sref">c_transport_data9/a>;  5779/a>        int 9a href="+code=err" class="sref">err9/a> = 0;  5789/a>        struct 9a href="+code=ib_qp_attr" class="sref">ib_qp_attr9/a> 9a href="+code=qp_attr" class="sref">qp_attr9/a>;  5799/a>  5809/a>        9a href="+code=rdsdebug" class="sref">rdsdebug9/a>(9spa2 class="string">"cm %p pd %p cq %p %p qp %p\n", 9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_cm_id" class="sref">i_cm_id9/a>,  5819/a>                 9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_pd" class="sref">i_pd9/a>, 9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_send_cq" class="sref">i_send_cq9/a>, 9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_recv_cq" class="sref">i_recv_cq9/a>,  5829/a>                 9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_cm_id" class="sref">i_cm_id9/a> ? 9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_cm_id" class="sref">i_cm_id9/a>->9a href="+code=qp" class="sref">qp9/a> : 9a href="+code=NULL" class="sref">NULL9/a>);  5839/a>  5849/a>        if (9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_cm_id" class="sref">i_cm_id9/a>) {  5859/a>                struct 9a href="+code=ib_device" class="sref">ib_device9/a> *9a href="+code=dev" class="sref">dev9/a> = 9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_cm_id" class="sref">i_cm_id9/a>->9a href="+code=device" class="sref">device9/a>;  5869/a>  5879/a>                9a href="+code=rdsdebug" class="sref">rdsdebug9/a>(9spa2 class="string">"disconnec >ng cm %p\n", 9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_cm_id" class="sref">i_cm_id9/a>);  5889/a>                9a href="+code=err" class="sref">err9/a> = 9a href="+code=rdma_disconnec " class="sref">rdma_disconnec 9/a>(9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_cm_id" class="sref">i_cm_id9/a>);  5899/a>                if (9a href="+code=err" class="sref">err9/a>) {  5909/a>                        9spa2 class="comment">/* Actually this may happen quite frequently, when9/spa2>  5919/a>9spa2 class="comment">                         * a2 outgo>ng connec  raced with a2 incom>ng connec .9/spa2>  5929/a>9spa2 class="comment">                         */9/spa2>  5939/a>                        9a href="+code=rdsdebug" class="sref">rdsdebug9/a>(9spa2 class="string">"rds_iw_conn_shutdow2: failed to disconnec ,"  5949/a>                                   9spa2 class="string">" cm: %p err %d\n", 9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_cm_id" class="sref">i_cm_id9/a>, 9a href="+code=err" class="sref">err9/a>);  5959/a>                }  5969/a>  5979/a>                if (9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_cm_id" class="sref">i_cm_id9/a>->9a href="+code=qp" class="sref">qp9/a>) {  5989/a>                        9a href="+code=qp_attr" class="sref">qp_attr9/a>.9a href="+code=qp_state" class="sref">qp_state9/a> = 9a href="+code=IB_QPS_ERR" class="sref">IB_QPS_ERR9/a>;  5999/a>                        9a href="+code=ib_modify_qp" class="sref">ib_modify_qp9/a>(9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_cm_id" class="sref">i_cm_id9/a>->9a href="+code=qp" class="sref">qp9/a>, &9a href="+code=qp_attr" class="sref">qp_attr9/a>, 9a href="+code=IB_QP_STATE" class="sref">IB_QP_STATE9/a>);  6009/a>                }  6019/a>  6029/a>                9a href="+code=wait_event" class="sref">wait_event9/a>(9a href="+code=rds_iw_ring_empty_wait" class="sref">rds_iw_ring_empty_wait9/a>,  6039/a>                        9a href="+code=rds_iw_ring_empty" class="sref">rds_iw_ring_empty9/a>(&9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_send_ring" class="sref">i_send_ring9/a>) &&  6049/a>                        9a href="+code=rds_iw_ring_empty" class="sref">rds_iw_ring_empty9/a>(&9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_recv_ring" class="sref">i_recv_ring9/a>));  6059/a>  6069/a>                if (9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_send_hdrs" class="sref">i_send_hdrs9/a>)  6079/a>                        9a href="+code=ib_dma_free_coherent" class="sref">ib_dma_free_coherent9/a>(9a href="+code=dev" class="sref">dev9/a>,  6089/a>                                           9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_send_ring" class="sref">i_send_ring9/a>.9a href="+code=w_nr" class="sref">w_nr9/a> *  6099/a>                                                sizeof(struct 9a href="+code=rds_header" class="sref">rds_header9/a>),  6109/a>                                           9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_send_hdrs" class="sref">i_send_hdrs9/a>,  6119/a>                                           9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_send_hdrs_dma" class="sref">i_send_hdrs_dma9/a>);  6129/a>  6139/a>                if (9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_recv_hdrs" class="sref">i_recv_hdrs9/a>)  6149/a>                        9a href="+code=ib_dma_free_coherent" class="sref">ib_dma_free_coherent9/a>(9a href="+code=dev" class="sref">dev9/a>,  6159/a>                                           9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_recv_ring" class="sref">i_recv_ring9/a>.9a href="+code=w_nr" class="sref">w_nr9/a> *  6169/a>                                                sizeof(struct 9a href="+code=rds_header" class="sref">rds_header9/a>),  6179/a>                                           9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_recv_hdrs" class="sref">i_recv_hdrs9/a>,  6189/a>                                           9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_recv_hdrs_dma" class="sref">i_recv_hdrs_dma9/a>);  6199/a>  6209/a>                if (9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_ack" class="sref">i_ack9/a>)  6219/a>                        9a href="+code=ib_dma_free_coherent" class="sref">ib_dma_free_coherent9/a>(9a href="+code=dev" class="sref">dev9/a>, sizeof(struct 9a href="+code=rds_header" class="sref">rds_header9/a>),  6229/a>                                             9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_ack" class="sref">i_ack9/a>, 9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_ack_dma" class="sref">i_ack_dma9/a>);  6239/a>  6249/a>                if (9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_sends" class="sref">i_sends9/a>)  6259/a>                        9a href="+code=rds_iw_send_clear_ring" class="sref">rds_iw_send_clear_ring9/a>(9a href="+code=ic" class="sref">ic9/a>);  6269/a>                if (9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_recvs" class="sref">i_recvs9/a>)  6279/a>                        9a href="+code=rds_iw_recv_clear_ring" class="sref">rds_iw_recv_clear_ring9/a>(9a href="+code=ic" class="sref">ic9/a>);  6289/a>  6299/a>                if (9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_cm_id" class="sref">i_cm_id9/a>->9a href="+code=qp" class="sref">qp9/a>)  6309/a>                        9a href="+code=rdma_destroy_qp" class="sref">rdma_destroy_qp9/a>(9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_cm_id" class="sref">i_cm_id9/a>);  6319/a>                if (9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_send_cq" class="sref">i_send_cq9/a>)  6329/a>                        9a href="+code=ib_destroy_cq" class="sref">ib_destroy_cq9/a>(9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_send_cq" class="sref">i_send_cq9/a>);  6339/a>                if (9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_recv_cq" class="sref">i_recv_cq9/a>)  6349/a>                        9a href="+code=ib_destroy_cq" class="sref">ib_destroy_cq9/a>(9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_recv_cq" class="sref">i_recv_cq9/a>);  6359/a>  6369/a>                9spa2 class="comment">/*9/spa2>  6379/a>9spa2 class="comment">                 * If associated with a2 rds_iw_device:9/spa2>  6389/a>9spa2 class="comment">                 *      Move connec >
2 back to the nodev lis .9/spa2>  6399/a>9spa2 class="comment">                 *      Remove cm_id from the device cm_id lis .9/spa2>  6409/a>9spa2 class="comment">                 */9/spa2>  6419/a>                if (9a href="+code=ic" class="sref">ic9/a>->9a href="+code=rds_iwdev" class="sref">rds_iwdev9/a>)  6429/a>                        9a href="+code=rds_iw_remove_conn" class="sref">rds_iw_remove_conn9/a>(9a href="+code=ic" class="sref">ic9/a>->9a href="+code=rds_iwdev" class="sref">rds_iwdev9/a>, 9a href="+code=conn" class="sref">conn9/a>);  6439/a>  6449/a>                9a href="+code=rdma_destroy_id" class="sref">rdma_destroy_id9/a>(9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_cm_id" class="sref">i_cm_id9/a>);  6459/a>  6469/a>                9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_cm_id" class="sref">i_cm_id9/a> = 9a href="+code=NULL" class="sref">NULL9/a>;  6479/a>                9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_pd" class="sref">i_pd9/a> = 9a href="+code=NULL" class="sref">NULL9/a>;  6489/a>                9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_mr" class="sref">i_mr9/a> = 9a href="+code=NULL" class="sref">NULL9/a>;  6499/a>                9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_send_cq" class="sref">i_send_cq9/a> = 9a href="+code=NULL" class="sref">NULL9/a>;  6509/a>                9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_recv_cq" class="sref">i_recv_cq9/a> = 9a href="+code=NULL" class="sref">NULL9/a>;  6519/a>                9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_send_hdrs" class="sref">i_send_hdrs9/a> = 9a href="+code=NULL" class="sref">NULL9/a>;  6529/a>                9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_recv_hdrs" class="sref">i_recv_hdrs9/a> = 9a href="+code=NULL" class="sref">NULL9/a>;  6539/a>                9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_ack" class="sref">i_ack9/a> = 9a href="+code=NULL" class="sref">NULL9/a>;  6549/a>        }  6559/a>        9a href="+code=BUG_ON" class="sref">BUG_ON9/a>(9a href="+code=ic" class="sref">ic9/a>->9a href="+code=rds_iwdev" class="sref">rds_iwdev9/a>);  6569/a>  6579/a>        9spa2 class="comment">/* Clear pend>ng transmit */9/spa2>  6589/a>        if (9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_rm" class="sref">i_rm9/a>) {  6599/a>                9a href="+code=rds_message_put" class="sref">rds_message_put9/a>(9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_rm" class="sref">i_rm9/a>);  6609/a>                9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_rm" class="sref">i_rm9/a> = 9a href="+code=NULL" class="sref">NULL9/a>;  6619/a>        }  6629/a>  6639/a>        9spa2 class="comment">/* Clear the ACK state */9/spa2>  6649/a>        9a href="+code=clear_bit" class="sref">clear_bit9/a>(9a href="+code=IB_ACK_IN_FLIGHT" class="sref">IB_ACK_IN_FLIGHT9/a>, &9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_ack_flags" class="sref">i_ack_flags9/a>);  6659/a>#ifdef 9a href="+code=KERNEL_HAS_ATOMIC64" class="sref">KERNEL_HAS_ATOMIC649/a>  6669/a>        9a href="+code=atomic64_set" class="sref">atomic64_set9/a>(&9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_ack_next" class="sref">i_ack_next9/a>, 0);  6679/a>#else  6689/a>        9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_ack_next" class="sref">i_ack_next9/a> = 0;  6699/a>#end>f  6709/a>        9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_ack_recv" class="sref">i_ack_recv9/a> = 0;  6719/a>  6729/a>        9spa2 class="comment">/* Clear flow control state */9/spa2>  6739/a>        9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_flowctl" class="sref">i_flowctl9/a> = 0;  6749/a>        9a href="+code=atomic_set" class="sref">atomic_set9/a>(&9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_credits" class="sref">i_credits9/a>, 0);  6759/a>  6769/a>        9a href="+code=rds_iw_ring_init" class="sref">rds_iw_ring_init9/a>(&9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_send_ring" class="sref">i_send_ring9/a>, 9a href="+code=rds_iw_sysctl_max_send_wr" class="sref">rds_iw_sysctl_max_send_wr9/a>);  6779/a>        9a href="+code=rds_iw_ring_init" class="sref">rds_iw_ring_init9/a>(&9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_recv_ring" class="sref">i_recv_ring9/a>, 9a href="+code=rds_iw_sysctl_max_recv_wr" class="sref">rds_iw_sysctl_max_recv_wr9/a>);  6789/a>  6799/a>        if (9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_iwinc" class="sref">i_iwinc9/a>) {  6809/a>                9a href="+code=rds_inc_put" class="sref">rds_inc_put9/a>(&9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_iwinc" class="sref">i_iwinc9/a>->9a href="+code=ii_inc" class="sref">ii_inc9/a>);  6819/a>                9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_iwinc" class="sref">i_iwinc9/a> = 9a href="+code=NULL" class="sref">NULL9/a>;  6829/a>        }  6839/a>  6849/a>        9a href="+code=vfree" class="sref">vfree9/a>(9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_sends" class="sref">i_sends9/a>);  6859/a>        9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_sends" class="sref">i_sends9/a> = 9a href="+code=NULL" class="sref">NULL9/a>;  6869/a>        9a href="+code=vfree" class="sref">vfree9/a>(9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_recvs" class="sref">i_recvs9/a>);  6879/a>        9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_recvs" class="sref">i_recvs9/a> = 9a href="+code=NULL" class="sref">NULL9/a>;  6889/a>        9a href="+code=rdsdebug" class="sref">rdsdebug9/a>(9spa2 class="string">"shutdow2 complete\n");  6899/a>}  6909/a> 6919/a>int 9a href="+code=rds_iw_conn_alloc" class="sref">rds_iw_conn_alloc9/a>(struct 9a href="+code=rds_connec >
2" class="sref">rds_connec >
29/a> *9a href="+code=conn" class="sref">conn9/a>, 9a href="+code=gfp_t" class="sref">gfp_t9/a> 9a href="+code=gfp" class="sref">gfp9/a>) 6929/a>{  6939/a>        struct 9a href="+code=rds_iw_connec >
2" class="sref">rds_iw_connec >
29/a> *9a href="+code=ic" class="sref">ic9/a>;  6949/a>        unsigned long 9a href="+code=flags" class="sref">flags9/a>;  6959/a>  6969/a>        9spa2 class="comment">/* XXX too lazy? */9/spa2>  6979/a>        9a href="+code=ic" class="sref">ic9/a> = 9a href="+code=kzalloc" class="sref">kzalloc9/a>(sizeof(struct 9a href="+code=rds_iw_connec >
2" class="sref">rds_iw_connec >
29/a>), 9a href="+code=gfp" class="sref">gfp9/a>);  6989/a>        if (!9a href="+code=ic" class="sref">ic9/a>) 6999/a>                return -9a href="+code=ENOMEM" class="sref">ENOMEM9/a>;  7009/a> 7019/a>        9a href="+code=INIT_LIST_HEAD" class="sref">INIT_LIST_HEAD9/a>(&9a href="+code=ic" class="sref">ic9/a>->9a href="+code=iw_node" class="sref">iw_node9/a>);  7029/a>        9a href="+code=tasklet_init" class="sref">tasklet_init9/a>(&9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_recv_tasklet" class="sref">i_recv_tasklet9/a>, 9a href="+code=rds_iw_recv_tasklet_fn" class="sref">rds_iw_recv_tasklet_fn9/a>,  7039/a>                     (unsigned long) 9a href="+code=ic" class="sref">ic9/a>);  7049/a>        9a href="+code=mutex_init" class="sref">mutex_init9/a>(&9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_recv_mutex" class="sref">i_recv_mutex9/a>);  7059/a>#ifndef 9a href="+code=KERNEL_HAS_ATOMIC64" class="sref">KERNEL_HAS_ATOMIC649/a>  7069/a>        9a href="+code=spin_lock_init" class="sref">spin_lock_init9/a>(&9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_ack_lock" class="sref">i_ack_lock9/a>);  7079/a>#end>f  7089/a>  7099/a>        9spa2 class="comment">/*9/spa2>  7109/a>9spa2 class="comment">         * rds_iw_conn_shutdow2() waits for these to be emptied so they9/spa2>  7119/a>9spa2 class="comment">         * must be initialized before it can be called.9/spa2>  7129/a>9spa2 class="comment">         */9/spa2>  7139/a>        9a href="+code=rds_iw_ring_init" class="sref">rds_iw_ring_init9/a>(&9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_send_ring" class="sref">i_send_ring9/a>, 9a href="+code=rds_iw_sysctl_max_send_wr" class="sref">rds_iw_sysctl_max_send_wr9/a>);  7149/a>        9a href="+code=rds_iw_ring_init" class="sref">rds_iw_ring_init9/a>(&9a href="+code=ic" class="sref">ic9/a>->9a href="+code=i_recv_ring" class="sref">i_recv_ring9/a>, 9a href="+code=rds_iw_sysctl_max_recv_wr" class="sref">rds_iw_sysctl_max_recv_wr9/a>);  7159/a>  7169/a>        9a href="+code=ic" class="sref">ic9/a>->9a href="+code=conn" class="sref">conn9/a> = 9a href="+code=conn" class="sref">conn9/a>;  7179/a>        9a href="+code=conn" class="sref">conn9/a>->9a href="+code=c_transport_data" class="sref">c_transport_data9/a> = 9a href="+code=ic" class="sref">ic9/a>;  7189/a>  7199/a>        9a href="+code=spin_lock_irqsave" class="sref">spin_lock_irqsave9/a>(&9a href="+code=iw_nodev_conns_lock" class="sref">iw_nodev_conns_lock9/a>, 9a href="+code=flags" class="sref">flags9/a>);  7209/a>        9a href="+code=lis _add_tail" class="sref">lis _add_tail9/a>(&9a href="+code=ic" class="sref">ic9/a>->9a href="+code=iw_node" class="sref">iw_node9/a>, &9a href="+code=iw_nodev_conns" class="sref">iw_nodev_conns9/a>);  7219/a>        9a href="+code=spin_unlock_irqrestore" class="sref">spin_unlock_irqrestore9/a>(&9a href="+code=iw_nodev_conns_lock" class="sref">iw_nodev_conns_lock9/a>, 9a href="+code=flags" class="sref">flags9/a>);  7229/a>  7239/a>  7249/a>        9a href="+code=rdsdebug" class="sref">rdsdebug9/a>(9spa2 class="string">"conn %p conn ic %p\n", 9a href="+code=conn" class="sref">conn9/a>, 9a href="+code=conn" class="sref">conn9/a>->9a href="+code=c_transport_data" class="sref">c_transport_data9/a>);  7259/a>        return 0;  7269/a>}  7279/a>  7289/a>9spa2 class="comment">/*9/spa2>  7299/a>9spa2 class="comment"> * Free a connec >
2. Connec >
2 must be shut dow2 and not set for reconnec .9/spa2>  7309/a>9spa2 class="comment"> */9/spa2>  7319/a>void 9a href="+code=rds_iw_conn_free" class="sref">rds_iw_conn_free9/a>(void *9a href="+code=arg" class="sref">arg9/a>) 7329/a>{  7339/a>        struct 9a href="+code=rds_iw_connec >
2" class="sref">rds_iw_connec >
29/a> *9a href="+code=ic" class="sref">ic9/a> = 9a href="+code=arg" class="sref">arg9/a>;  7349/a>        9a href="+code=spinlock_t" class="sref">spinlock_t9/a>      *9a href="+code=lock_ptr" class="sref">lock_ptr9/a>;  7359/a>  7369/a>        9a href="+code=rdsdebug" class="sref">rdsdebug9/a>(9spa2 class="string">"ic %p\n", 9a href="+code=ic" class="sref">ic9/a>);  7379/a>  7389/a>        9spa2 class="comment">/*9/spa2>  7399/a>9spa2 class="comment">         * Conn is either 
2 a dev's lis  or 
2 the nodev lis .9/spa2>  7409/a>9spa2 class="comment">         * A race with shutdow2() or connec () would cause problems9/spa2>  7419/a>9spa2 class="comment">         * (since rds_iwdev would change) but that should never happen.9/spa2>  7429/a>9spa2 class="comment">         */9/spa2>  7439/a>        9a href="+code=lock_ptr" class="sref">lock_ptr9/a> = 9a href="+code=ic" class="sref">ic9/a>->9a href="+code=rds_iwdev" class="sref">rds_iwdev9/a> ? &9a href="+code=ic" class="sref">ic9/a>->9a href="+code=rds_iwdev" class="sref">rds_iwdev9/a>->9a href="+code=spinlock" class="sref">spinlock9/a> : &9a href="+code=iw_nodev_conns_lock" class="sref">iw_nodev_conns_lock9/a>;  7449/a>  7459/a>        9a href="+code=spin_lock_irq" class="sref">spin_lock_irq9/a>(9a href="+code=lock_ptr" class="sref">lock_ptr9/a>);  7469/a>        9a href="+code=lis _del" class="sref">lis _del9/a>(&9a href="+code=ic" class="sref">ic9/a>->9a href="+code=iw_node" class="sref">iw_node9/a>);  7479/a>        9a href="+code=spin_unlock_irq" class="sref">spin_unlock_irq9/a>(9a href="+code=lock_ptr" class="sref">lock_ptr9/a>);  7489/a>  7499/a>        9a href="+code=kfree" class="sref">kfree9/a>(9a href="+code=ic" class="sref">ic9/a>);  7509/a>}  7519/a>  7529/a>9spa2 class="comment">/*9/spa2>  7539/a>9spa2 class="comment"> * An error 
ccurred 
2 the connec >
29/spa2>  7549/a>9spa2 class="comment"> */9/spa2>  7559/a>void  7569/a>9a href="+code=__rds_iw_conn_error" class="sref">__rds_iw_conn_error9/a>(struct 9a href="+code=rds_connec >
2" class="sref">rds_connec >
29/a> *9a href="+code=conn" class="sref">conn9/a>, cons  char *9a href="+code=fmt" class="sref">fmt9/a>, ...) 7579/a>{  7589/a>        9a href="+code=va_lis " class="sref">va_lis 9/a> 9a href="+code=ap" class="sref">ap9/a>;  7599/a>  7609/a>        9a href="+code=rds_conn_drop" class="sref">rds_conn_drop9/a>(9a href="+code=conn" class="sref">conn9/a>);  7619/a>  7629/a>        9a href="+code=va_star " class="sref">va_star 9/a>(9a href="+code=ap" class="sref">ap9/a>, 9a href="+code=fmt" class="sref">fmt9/a>);  7639/a>        9a href="+code=vprintk" class="sref">vprintk9/a>(9a href="+code=fmt" class="sref">fmt9/a>, 9a href="+code=ap" class="sref">ap9/a>);  7649/a>        9a href="+code=va_end" class="sref">va_end9/a>(9a href="+code=ap" class="sref">ap9/a>);  7659/a>}  7669/a>
lxr.linux.no kindly hosted by Redpill Linpro AS9/a>, provider f Linux consul >ng and opera > 2s services since 1995.