Lines Matching defs:conn
44 static void rds_iw_set_protocol(struct rds_connection *conn, unsigned int version)
46 conn->c_version = version;
52 static void rds_iw_set_flow_control(struct rds_connection *conn, u32 credits)
54 struct rds_iw_connection *ic = conn->c_transport_data;
59 rds_iw_send_add_credits(conn, credits);
69 void rds_iw_cm_connect_complete(struct rds_connection *conn, struct rdma_cm_event *event)
72 struct rds_iw_connection *ic = conn->c_transport_data;
76 if (event->param.conn.private_data_len) {
77 dp = event->param.conn.private_data;
79 rds_iw_set_protocol(conn,
82 rds_iw_set_flow_control(conn, be32_to_cpu(dp->dp_credit));
85 /* update ib_device with this local ipaddr & conn */
90 rds_iw_add_conn(rds_iwdev, conn);
95 rds_send_drop_acked(conn, be64_to_cpu(dp->dp_ack_seq), NULL);
98 &conn->c_laddr, &conn->c_faddr,
99 RDS_PROTOCOL_MAJOR(conn->c_version),
100 RDS_PROTOCOL_MINOR(conn->c_version),
103 rds_connect_complete(conn);
106 static void rds_iw_cm_fill_conn_param(struct rds_connection *conn,
111 struct rds_iw_connection *ic = conn->c_transport_data;
119 dp->dp_saddr = conn->c_laddr;
120 dp->dp_daddr = conn->c_faddr;
147 struct rds_connection *conn = data;
148 struct rds_iw_connection *ic = conn->c_transport_data;
150 rdsdebug("conn %p ic %p event %u\n", conn, ic, event->event);
161 event->event, &conn->c_laddr,
162 &conn->c_faddr);
163 rds_conn_drop(conn);
245 static int rds_iw_setup_qp(struct rds_connection *conn)
247 struct rds_iw_connection *ic = conn->c_transport_data;
273 conn);
334 rds_iw_recv_refill(conn, GFP_KERNEL, GFP_HIGHUSER, 1);
336 rdsdebug("conn %p pd %p mr %p cq %p %p\n", conn, ic->i_pd, ic->i_mr,
376 const struct rds_iw_connect_private *dp = event->param.conn.private_data;
378 struct rds_connection *conn = NULL;
394 conn = rds_conn_create(dp->dp_daddr, dp->dp_saddr, &rds_iw_transport,
396 if (IS_ERR(conn)) {
397 rdsdebug("rds_conn_create failed (%ld)\n", PTR_ERR(conn));
398 conn = NULL;
409 mutex_lock(&conn->c_cm_lock);
410 if (!rds_conn_transition(conn, RDS_CONN_DOWN, RDS_CONN_CONNECTING)) {
411 if (rds_conn_state(conn) == RDS_CONN_UP) {
413 rds_conn_drop(conn);
416 if (rds_conn_state(conn) == RDS_CONN_CONNECTING) {
420 mutex_unlock(&conn->c_cm_lock);
424 ic = conn->c_transport_data;
426 rds_iw_set_protocol(conn, version);
427 rds_iw_set_flow_control(conn, be32_to_cpu(dp->dp_credit));
432 rds_send_drop_acked(conn, be64_to_cpu(dp->dp_ack_seq), NULL);
438 cm_id->context = conn;
447 err = rds_iw_setup_qp(conn);
449 rds_iw_conn_error(conn, "rds_iw_setup_qp failed (%d)\n", err);
450 mutex_unlock(&conn->c_cm_lock);
454 rds_iw_cm_fill_conn_param(conn, &conn_param, &dp_rep, version);
458 mutex_unlock(&conn->c_cm_lock);
460 rds_iw_conn_error(conn, "rdma_accept failed (%d)\n", err);
474 struct rds_connection *conn = cm_id->context;
475 struct rds_iw_connection *ic = conn->c_transport_data;
482 rds_iw_set_protocol(conn, RDS_PROTOCOL_3_0);
485 ret = rds_iw_setup_qp(conn);
487 rds_iw_conn_error(conn, "rds_iw_setup_qp failed (%d)\n", ret);
491 rds_iw_cm_fill_conn_param(conn, &conn_param, &dp, RDS_PROTOCOL_VERSION);
495 rds_iw_conn_error(conn, "rdma_connect failed (%d)\n", ret);
502 struct rds_iw_connection *ic = conn->c_transport_data;
510 int rds_iw_conn_connect(struct rds_connection *conn)
512 struct rds_iw_connection *ic = conn->c_transport_data;
518 ic->i_cm_id = rdma_create_id(rds_rdma_cm_event_handler, conn,
527 rdsdebug("created cm id %p for conn %p\n", ic->i_cm_id, conn);
530 src.sin_addr.s_addr = (__force u32)conn->c_laddr;
537 &conn->c_laddr, ret);
547 dest.sin_addr.s_addr = (__force u32)conn->c_faddr;
569 void rds_iw_conn_shutdown(struct rds_connection *conn)
571 struct rds_iw_connection *ic = conn->c_transport_data;
637 rds_iw_remove_conn(ic->rds_iwdev, conn);
686 int rds_iw_conn_alloc(struct rds_connection *conn, gfp_t gfp)
710 ic->conn = conn;
711 conn->c_transport_data = ic;
718 rdsdebug("conn %p conn ic %p\n", conn, conn->c_transport_data);
750 __rds_iw_conn_error(struct rds_connection *conn, const char *fmt, ...)
754 rds_conn_drop(conn);