Lines Matching refs:xprt

148 xprt_rdma_format_addresses4(struct rpc_xprt *xprt, struct sockaddr *sap)  in xprt_rdma_format_addresses4()  argument
154 xprt->address_strings[RPC_DISPLAY_HEX_ADDR] = kstrdup(buf, GFP_KERNEL); in xprt_rdma_format_addresses4()
156 xprt->address_strings[RPC_DISPLAY_NETID] = RPCBIND_NETID_RDMA; in xprt_rdma_format_addresses4()
160 xprt_rdma_format_addresses6(struct rpc_xprt *xprt, struct sockaddr *sap) in xprt_rdma_format_addresses6() argument
166 xprt->address_strings[RPC_DISPLAY_HEX_ADDR] = kstrdup(buf, GFP_KERNEL); in xprt_rdma_format_addresses6()
168 xprt->address_strings[RPC_DISPLAY_NETID] = RPCBIND_NETID_RDMA6; in xprt_rdma_format_addresses6()
172 xprt_rdma_format_addresses(struct rpc_xprt *xprt, struct sockaddr *sap) in xprt_rdma_format_addresses() argument
178 xprt_rdma_format_addresses4(xprt, sap); in xprt_rdma_format_addresses()
181 xprt_rdma_format_addresses6(xprt, sap); in xprt_rdma_format_addresses()
189 xprt->address_strings[RPC_DISPLAY_ADDR] = kstrdup(buf, GFP_KERNEL); in xprt_rdma_format_addresses()
192 xprt->address_strings[RPC_DISPLAY_PORT] = kstrdup(buf, GFP_KERNEL); in xprt_rdma_format_addresses()
195 xprt->address_strings[RPC_DISPLAY_HEX_PORT] = kstrdup(buf, GFP_KERNEL); in xprt_rdma_format_addresses()
197 xprt->address_strings[RPC_DISPLAY_PROTO] = "rdma"; in xprt_rdma_format_addresses()
201 xprt_rdma_free_addresses(struct rpc_xprt *xprt) in xprt_rdma_free_addresses() argument
211 kfree(xprt->address_strings[i]); in xprt_rdma_free_addresses()
228 struct rpc_xprt *xprt = &r_xprt->rx_xprt; in xprt_rdma_connect_worker() local
232 if (atomic_read(&xprt->swapper)) in xprt_rdma_connect_worker()
235 xprt_clear_connecting(xprt); in xprt_rdma_connect_worker()
237 xprt->connect_cookie++; in xprt_rdma_connect_worker()
238 xprt->stat.connect_count++; in xprt_rdma_connect_worker()
239 xprt->stat.connect_time += (long)jiffies - in xprt_rdma_connect_worker()
240 xprt->stat.connect_start; in xprt_rdma_connect_worker()
241 xprt_set_connected(xprt); in xprt_rdma_connect_worker()
245 xprt_unlock_connect(xprt, r_xprt); in xprt_rdma_connect_worker()
246 xprt_wake_pending_tasks(xprt, rc); in xprt_rdma_connect_worker()
260 xprt_rdma_inject_disconnect(struct rpc_xprt *xprt) in xprt_rdma_inject_disconnect() argument
262 struct rpcrdma_xprt *r_xprt = rpcx_to_rdmax(xprt); in xprt_rdma_inject_disconnect()
276 xprt_rdma_destroy(struct rpc_xprt *xprt) in xprt_rdma_destroy() argument
278 struct rpcrdma_xprt *r_xprt = rpcx_to_rdmax(xprt); in xprt_rdma_destroy()
285 xprt_rdma_free_addresses(xprt); in xprt_rdma_destroy()
286 xprt_free(xprt); in xprt_rdma_destroy()
305 struct rpc_xprt *xprt; in xprt_setup_rdma() local
310 if (args->addrlen > sizeof(xprt->addr)) in xprt_setup_rdma()
316 xprt = xprt_alloc(args->net, sizeof(struct rpcrdma_xprt), 0, in xprt_setup_rdma()
318 if (!xprt) { in xprt_setup_rdma()
323 xprt->timeout = &xprt_rdma_default_timeout; in xprt_setup_rdma()
324 xprt->connect_timeout = xprt->timeout->to_initval; in xprt_setup_rdma()
325 xprt->max_reconnect_timeout = xprt->timeout->to_maxval; in xprt_setup_rdma()
326 xprt->bind_timeout = RPCRDMA_BIND_TO; in xprt_setup_rdma()
327 xprt->reestablish_timeout = RPCRDMA_INIT_REEST_TO; in xprt_setup_rdma()
328 xprt->idle_timeout = RPCRDMA_IDLE_DISC_TO; in xprt_setup_rdma()
330 xprt->resvport = 0; /* privileged port not needed */ in xprt_setup_rdma()
331 xprt->ops = &xprt_rdma_procs; in xprt_setup_rdma()
340 xprt->prot = IPPROTO_TCP; in xprt_setup_rdma()
341 xprt->xprt_class = &xprt_rdma; in xprt_setup_rdma()
342 xprt->addrlen = args->addrlen; in xprt_setup_rdma()
343 memcpy(&xprt->addr, sap, xprt->addrlen); in xprt_setup_rdma()
346 xprt_set_bound(xprt); in xprt_setup_rdma()
347 xprt_rdma_format_addresses(xprt, sap); in xprt_setup_rdma()
349 new_xprt = rpcx_to_rdmax(xprt); in xprt_setup_rdma()
352 xprt_rdma_free_addresses(xprt); in xprt_setup_rdma()
353 xprt_free(xprt); in xprt_setup_rdma()
361 xprt->max_payload = RPCRDMA_MAX_DATA_SEGS << PAGE_SHIFT; in xprt_setup_rdma()
363 return xprt; in xprt_setup_rdma()
375 void xprt_rdma_close(struct rpc_xprt *xprt) in xprt_rdma_close() argument
377 struct rpcrdma_xprt *r_xprt = rpcx_to_rdmax(xprt); in xprt_rdma_close()
381 xprt->reestablish_timeout = 0; in xprt_rdma_close()
382 ++xprt->connect_cookie; in xprt_rdma_close()
383 xprt_disconnect_done(xprt); in xprt_rdma_close()
394 xprt_rdma_set_port(struct rpc_xprt *xprt, u16 port) in xprt_rdma_set_port() argument
396 struct sockaddr *sap = (struct sockaddr *)&xprt->addr; in xprt_rdma_set_port()
401 kfree(xprt->address_strings[RPC_DISPLAY_PORT]); in xprt_rdma_set_port()
403 xprt->address_strings[RPC_DISPLAY_PORT] = kstrdup(buf, GFP_KERNEL); in xprt_rdma_set_port()
405 kfree(xprt->address_strings[RPC_DISPLAY_HEX_PORT]); in xprt_rdma_set_port()
407 xprt->address_strings[RPC_DISPLAY_HEX_PORT] = kstrdup(buf, GFP_KERNEL); in xprt_rdma_set_port()
424 xprt_rdma_timer(struct rpc_xprt *xprt, struct rpc_task *task) in xprt_rdma_timer() argument
426 xprt_force_disconnect(xprt); in xprt_rdma_timer()
436 static void xprt_rdma_set_connect_timeout(struct rpc_xprt *xprt, in xprt_rdma_set_connect_timeout() argument
440 struct rpcrdma_xprt *r_xprt = rpcx_to_rdmax(xprt); in xprt_rdma_set_connect_timeout()
444 spin_lock(&xprt->transport_lock); in xprt_rdma_set_connect_timeout()
446 if (connect_timeout < xprt->connect_timeout) { in xprt_rdma_set_connect_timeout()
450 to = *xprt->timeout; in xprt_rdma_set_connect_timeout()
457 xprt->timeout = &r_xprt->rx_timeout; in xprt_rdma_set_connect_timeout()
458 xprt->connect_timeout = connect_timeout; in xprt_rdma_set_connect_timeout()
461 if (reconnect_timeout < xprt->max_reconnect_timeout) in xprt_rdma_set_connect_timeout()
462 xprt->max_reconnect_timeout = reconnect_timeout; in xprt_rdma_set_connect_timeout()
464 spin_unlock(&xprt->transport_lock); in xprt_rdma_set_connect_timeout()
474 xprt_rdma_connect(struct rpc_xprt *xprt, struct rpc_task *task) in xprt_rdma_connect() argument
476 struct rpcrdma_xprt *r_xprt = rpcx_to_rdmax(xprt); in xprt_rdma_connect()
480 WARN_ON_ONCE(!xprt_lock_connect(xprt, task, r_xprt)); in xprt_rdma_connect()
484 delay = xprt_reconnect_delay(xprt); in xprt_rdma_connect()
485 xprt_reconnect_backoff(xprt, RPCRDMA_INIT_REEST_TO); in xprt_rdma_connect()
501 xprt_rdma_alloc_slot(struct rpc_xprt *xprt, struct rpc_task *task) in xprt_rdma_alloc_slot() argument
503 struct rpcrdma_xprt *r_xprt = rpcx_to_rdmax(xprt); in xprt_rdma_alloc_slot()
515 xprt_add_backlog(xprt, task); in xprt_rdma_alloc_slot()
525 xprt_rdma_free_slot(struct rpc_xprt *xprt, struct rpc_rqst *rqst) in xprt_rdma_free_slot() argument
528 container_of(xprt, struct rpcrdma_xprt, rx_xprt); in xprt_rdma_free_slot()
531 if (!xprt_wake_up_backlog(xprt, rqst)) { in xprt_rdma_free_slot()
624 struct rpc_xprt *xprt = rqst->rq_xprt; in xprt_rdma_send_request() local
626 struct rpcrdma_xprt *r_xprt = rpcx_to_rdmax(xprt); in xprt_rdma_send_request()
634 if (!xprt_connected(xprt)) in xprt_rdma_send_request()
637 if (!xprt_request_get_cong(xprt, rqst)) in xprt_rdma_send_request()
645 if (rqst->rq_connect_cookie == xprt->connect_cookie) in xprt_rdma_send_request()
665 xprt_rdma_close(xprt); in xprt_rdma_send_request()
669 void xprt_rdma_print_stats(struct rpc_xprt *xprt, struct seq_file *seq) in xprt_rdma_print_stats() argument
671 struct rpcrdma_xprt *r_xprt = rpcx_to_rdmax(xprt); in xprt_rdma_print_stats()
674 if (xprt_connected(xprt)) in xprt_rdma_print_stats()
675 idle_time = (long)(jiffies - xprt->last_used) / HZ; in xprt_rdma_print_stats()
680 xprt->stat.bind_count, in xprt_rdma_print_stats()
681 xprt->stat.connect_count, in xprt_rdma_print_stats()
682 xprt->stat.connect_time / HZ, in xprt_rdma_print_stats()
684 xprt->stat.sends, in xprt_rdma_print_stats()
685 xprt->stat.recvs, in xprt_rdma_print_stats()
686 xprt->stat.bad_xids, in xprt_rdma_print_stats()
687 xprt->stat.req_u, in xprt_rdma_print_stats()
688 xprt->stat.bklog_u); in xprt_rdma_print_stats()
711 xprt_rdma_enable_swap(struct rpc_xprt *xprt) in xprt_rdma_enable_swap() argument
717 xprt_rdma_disable_swap(struct rpc_xprt *xprt) in xprt_rdma_disable_swap() argument