call_object.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607
  1. /* RxRPC individual remote procedure call handling
  2. *
  3. * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
  4. * Written by David Howells (dhowells@redhat.com)
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * as published by the Free Software Foundation; either version
  9. * 2 of the License, or (at your option) any later version.
  10. */
  11. #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
  12. #include <linux/slab.h>
  13. #include <linux/module.h>
  14. #include <linux/circ_buf.h>
  15. #include <linux/spinlock_types.h>
  16. #include <net/sock.h>
  17. #include <net/af_rxrpc.h>
  18. #include "ar-internal.h"
  19. const char *const rxrpc_call_states[NR__RXRPC_CALL_STATES] = {
  20. [RXRPC_CALL_UNINITIALISED] = "Uninit ",
  21. [RXRPC_CALL_CLIENT_AWAIT_CONN] = "ClWtConn",
  22. [RXRPC_CALL_CLIENT_SEND_REQUEST] = "ClSndReq",
  23. [RXRPC_CALL_CLIENT_AWAIT_REPLY] = "ClAwtRpl",
  24. [RXRPC_CALL_CLIENT_RECV_REPLY] = "ClRcvRpl",
  25. [RXRPC_CALL_SERVER_PREALLOC] = "SvPrealc",
  26. [RXRPC_CALL_SERVER_SECURING] = "SvSecure",
  27. [RXRPC_CALL_SERVER_ACCEPTING] = "SvAccept",
  28. [RXRPC_CALL_SERVER_RECV_REQUEST] = "SvRcvReq",
  29. [RXRPC_CALL_SERVER_ACK_REQUEST] = "SvAckReq",
  30. [RXRPC_CALL_SERVER_SEND_REPLY] = "SvSndRpl",
  31. [RXRPC_CALL_SERVER_AWAIT_ACK] = "SvAwtACK",
  32. [RXRPC_CALL_COMPLETE] = "Complete",
  33. };
  34. const char *const rxrpc_call_completions[NR__RXRPC_CALL_COMPLETIONS] = {
  35. [RXRPC_CALL_SUCCEEDED] = "Complete",
  36. [RXRPC_CALL_REMOTELY_ABORTED] = "RmtAbort",
  37. [RXRPC_CALL_LOCALLY_ABORTED] = "LocAbort",
  38. [RXRPC_CALL_LOCAL_ERROR] = "LocError",
  39. [RXRPC_CALL_NETWORK_ERROR] = "NetError",
  40. };
  41. struct kmem_cache *rxrpc_call_jar;
  42. static void rxrpc_call_timer_expired(unsigned long _call)
  43. {
  44. struct rxrpc_call *call = (struct rxrpc_call *)_call;
  45. _enter("%d", call->debug_id);
  46. if (call->state < RXRPC_CALL_COMPLETE)
  47. rxrpc_set_timer(call, rxrpc_timer_expired, ktime_get_real());
  48. }
  49. /*
  50. * find an extant server call
  51. * - called in process context with IRQs enabled
  52. */
  53. struct rxrpc_call *rxrpc_find_call_by_user_ID(struct rxrpc_sock *rx,
  54. unsigned long user_call_ID)
  55. {
  56. struct rxrpc_call *call;
  57. struct rb_node *p;
  58. _enter("%p,%lx", rx, user_call_ID);
  59. read_lock(&rx->call_lock);
  60. p = rx->calls.rb_node;
  61. while (p) {
  62. call = rb_entry(p, struct rxrpc_call, sock_node);
  63. if (user_call_ID < call->user_call_ID)
  64. p = p->rb_left;
  65. else if (user_call_ID > call->user_call_ID)
  66. p = p->rb_right;
  67. else
  68. goto found_extant_call;
  69. }
  70. read_unlock(&rx->call_lock);
  71. _leave(" = NULL");
  72. return NULL;
  73. found_extant_call:
  74. rxrpc_get_call(call, rxrpc_call_got);
  75. read_unlock(&rx->call_lock);
  76. _leave(" = %p [%d]", call, atomic_read(&call->usage));
  77. return call;
  78. }
  79. /*
  80. * allocate a new call
  81. */
  82. struct rxrpc_call *rxrpc_alloc_call(gfp_t gfp)
  83. {
  84. struct rxrpc_call *call;
  85. call = kmem_cache_zalloc(rxrpc_call_jar, gfp);
  86. if (!call)
  87. return NULL;
  88. call->rxtx_buffer = kcalloc(RXRPC_RXTX_BUFF_SIZE,
  89. sizeof(struct sk_buff *),
  90. gfp);
  91. if (!call->rxtx_buffer)
  92. goto nomem;
  93. call->rxtx_annotations = kcalloc(RXRPC_RXTX_BUFF_SIZE, sizeof(u8), gfp);
  94. if (!call->rxtx_annotations)
  95. goto nomem_2;
  96. mutex_init(&call->user_mutex);
  97. setup_timer(&call->timer, rxrpc_call_timer_expired,
  98. (unsigned long)call);
  99. INIT_WORK(&call->processor, &rxrpc_process_call);
  100. INIT_LIST_HEAD(&call->link);
  101. INIT_LIST_HEAD(&call->chan_wait_link);
  102. INIT_LIST_HEAD(&call->accept_link);
  103. INIT_LIST_HEAD(&call->recvmsg_link);
  104. INIT_LIST_HEAD(&call->sock_link);
  105. init_waitqueue_head(&call->waitq);
  106. spin_lock_init(&call->lock);
  107. rwlock_init(&call->state_lock);
  108. atomic_set(&call->usage, 1);
  109. call->debug_id = atomic_inc_return(&rxrpc_debug_id);
  110. call->tx_total_len = -1;
  111. memset(&call->sock_node, 0xed, sizeof(call->sock_node));
  112. /* Leave space in the ring to handle a maxed-out jumbo packet */
  113. call->rx_winsize = rxrpc_rx_window_size;
  114. call->tx_winsize = 16;
  115. call->rx_expect_next = 1;
  116. call->cong_cwnd = 2;
  117. call->cong_ssthresh = RXRPC_RXTX_BUFF_SIZE - 1;
  118. return call;
  119. nomem_2:
  120. kfree(call->rxtx_buffer);
  121. nomem:
  122. kmem_cache_free(rxrpc_call_jar, call);
  123. return NULL;
  124. }
  125. /*
  126. * Allocate a new client call.
  127. */
  128. static struct rxrpc_call *rxrpc_alloc_client_call(struct sockaddr_rxrpc *srx,
  129. gfp_t gfp)
  130. {
  131. struct rxrpc_call *call;
  132. ktime_t now;
  133. _enter("");
  134. call = rxrpc_alloc_call(gfp);
  135. if (!call)
  136. return ERR_PTR(-ENOMEM);
  137. call->state = RXRPC_CALL_CLIENT_AWAIT_CONN;
  138. call->service_id = srx->srx_service;
  139. call->tx_phase = true;
  140. now = ktime_get_real();
  141. call->acks_latest_ts = now;
  142. call->cong_tstamp = now;
  143. _leave(" = %p", call);
  144. return call;
  145. }
  146. /*
  147. * Initiate the call ack/resend/expiry timer.
  148. */
  149. static void rxrpc_start_call_timer(struct rxrpc_call *call)
  150. {
  151. ktime_t now = ktime_get_real(), expire_at;
  152. expire_at = ktime_add_ms(now, rxrpc_max_call_lifetime);
  153. call->expire_at = expire_at;
  154. call->ack_at = expire_at;
  155. call->ping_at = expire_at;
  156. call->resend_at = expire_at;
  157. call->timer.expires = jiffies + LONG_MAX / 2;
  158. rxrpc_set_timer(call, rxrpc_timer_begin, now);
  159. }
  160. /*
  161. * Set up a call for the given parameters.
  162. * - Called with the socket lock held, which it must release.
  163. * - If it returns a call, the call's lock will need releasing by the caller.
  164. */
  165. struct rxrpc_call *rxrpc_new_client_call(struct rxrpc_sock *rx,
  166. struct rxrpc_conn_parameters *cp,
  167. struct sockaddr_rxrpc *srx,
  168. unsigned long user_call_ID,
  169. s64 tx_total_len,
  170. gfp_t gfp)
  171. __releases(&rx->sk.sk_lock.slock)
  172. {
  173. struct rxrpc_call *call, *xcall;
  174. struct rxrpc_net *rxnet = rxrpc_net(sock_net(&rx->sk));
  175. struct rb_node *parent, **pp;
  176. const void *here = __builtin_return_address(0);
  177. int ret;
  178. _enter("%p,%lx", rx, user_call_ID);
  179. call = rxrpc_alloc_client_call(srx, gfp);
  180. if (IS_ERR(call)) {
  181. release_sock(&rx->sk);
  182. _leave(" = %ld", PTR_ERR(call));
  183. return call;
  184. }
  185. call->tx_total_len = tx_total_len;
  186. trace_rxrpc_call(call, rxrpc_call_new_client, atomic_read(&call->usage),
  187. here, (const void *)user_call_ID);
  188. /* We need to protect a partially set up call against the user as we
  189. * will be acting outside the socket lock.
  190. */
  191. mutex_lock(&call->user_mutex);
  192. /* Publish the call, even though it is incompletely set up as yet */
  193. write_lock(&rx->call_lock);
  194. pp = &rx->calls.rb_node;
  195. parent = NULL;
  196. while (*pp) {
  197. parent = *pp;
  198. xcall = rb_entry(parent, struct rxrpc_call, sock_node);
  199. if (user_call_ID < xcall->user_call_ID)
  200. pp = &(*pp)->rb_left;
  201. else if (user_call_ID > xcall->user_call_ID)
  202. pp = &(*pp)->rb_right;
  203. else
  204. goto error_dup_user_ID;
  205. }
  206. rcu_assign_pointer(call->socket, rx);
  207. call->user_call_ID = user_call_ID;
  208. __set_bit(RXRPC_CALL_HAS_USERID, &call->flags);
  209. rxrpc_get_call(call, rxrpc_call_got_userid);
  210. rb_link_node(&call->sock_node, parent, pp);
  211. rb_insert_color(&call->sock_node, &rx->calls);
  212. list_add(&call->sock_link, &rx->sock_calls);
  213. write_unlock(&rx->call_lock);
  214. write_lock(&rxnet->call_lock);
  215. list_add_tail(&call->link, &rxnet->calls);
  216. write_unlock(&rxnet->call_lock);
  217. /* From this point on, the call is protected by its own lock. */
  218. release_sock(&rx->sk);
  219. /* Set up or get a connection record and set the protocol parameters,
  220. * including channel number and call ID.
  221. */
  222. ret = rxrpc_connect_call(call, cp, srx, gfp);
  223. if (ret < 0)
  224. goto error;
  225. trace_rxrpc_call(call, rxrpc_call_connected, atomic_read(&call->usage),
  226. here, NULL);
  227. spin_lock_bh(&call->conn->params.peer->lock);
  228. hlist_add_head(&call->error_link,
  229. &call->conn->params.peer->error_targets);
  230. spin_unlock_bh(&call->conn->params.peer->lock);
  231. rxrpc_start_call_timer(call);
  232. _net("CALL new %d on CONN %d", call->debug_id, call->conn->debug_id);
  233. _leave(" = %p [new]", call);
  234. return call;
  235. /* We unexpectedly found the user ID in the list after taking
  236. * the call_lock. This shouldn't happen unless the user races
  237. * with itself and tries to add the same user ID twice at the
  238. * same time in different threads.
  239. */
  240. error_dup_user_ID:
  241. write_unlock(&rx->call_lock);
  242. release_sock(&rx->sk);
  243. ret = -EEXIST;
  244. error:
  245. __rxrpc_set_call_completion(call, RXRPC_CALL_LOCAL_ERROR,
  246. RX_CALL_DEAD, ret);
  247. trace_rxrpc_call(call, rxrpc_call_error, atomic_read(&call->usage),
  248. here, ERR_PTR(ret));
  249. rxrpc_release_call(rx, call);
  250. mutex_unlock(&call->user_mutex);
  251. rxrpc_put_call(call, rxrpc_call_put);
  252. _leave(" = %d", ret);
  253. return ERR_PTR(ret);
  254. }
  255. /*
  256. * Set up an incoming call. call->conn points to the connection.
  257. * This is called in BH context and isn't allowed to fail.
  258. */
  259. void rxrpc_incoming_call(struct rxrpc_sock *rx,
  260. struct rxrpc_call *call,
  261. struct sk_buff *skb)
  262. {
  263. struct rxrpc_connection *conn = call->conn;
  264. struct rxrpc_skb_priv *sp = rxrpc_skb(skb);
  265. u32 chan;
  266. _enter(",%d", call->conn->debug_id);
  267. rcu_assign_pointer(call->socket, rx);
  268. call->call_id = sp->hdr.callNumber;
  269. call->service_id = sp->hdr.serviceId;
  270. call->cid = sp->hdr.cid;
  271. call->state = RXRPC_CALL_SERVER_ACCEPTING;
  272. if (sp->hdr.securityIndex > 0)
  273. call->state = RXRPC_CALL_SERVER_SECURING;
  274. call->cong_tstamp = skb->tstamp;
  275. /* Set the channel for this call. We don't get channel_lock as we're
  276. * only defending against the data_ready handler (which we're called
  277. * from) and the RESPONSE packet parser (which is only really
  278. * interested in call_counter and can cope with a disagreement with the
  279. * call pointer).
  280. */
  281. chan = sp->hdr.cid & RXRPC_CHANNELMASK;
  282. conn->channels[chan].call_counter = call->call_id;
  283. conn->channels[chan].call_id = call->call_id;
  284. rcu_assign_pointer(conn->channels[chan].call, call);
  285. spin_lock(&conn->params.peer->lock);
  286. hlist_add_head(&call->error_link, &conn->params.peer->error_targets);
  287. spin_unlock(&conn->params.peer->lock);
  288. _net("CALL incoming %d on CONN %d", call->debug_id, call->conn->debug_id);
  289. rxrpc_start_call_timer(call);
  290. _leave("");
  291. }
  292. /*
  293. * Queue a call's work processor, getting a ref to pass to the work queue.
  294. */
  295. bool rxrpc_queue_call(struct rxrpc_call *call)
  296. {
  297. const void *here = __builtin_return_address(0);
  298. int n = __atomic_add_unless(&call->usage, 1, 0);
  299. if (n == 0)
  300. return false;
  301. if (rxrpc_queue_work(&call->processor))
  302. trace_rxrpc_call(call, rxrpc_call_queued, n + 1, here, NULL);
  303. else
  304. rxrpc_put_call(call, rxrpc_call_put_noqueue);
  305. return true;
  306. }
  307. /*
  308. * Queue a call's work processor, passing the callers ref to the work queue.
  309. */
  310. bool __rxrpc_queue_call(struct rxrpc_call *call)
  311. {
  312. const void *here = __builtin_return_address(0);
  313. int n = atomic_read(&call->usage);
  314. ASSERTCMP(n, >=, 1);
  315. if (rxrpc_queue_work(&call->processor))
  316. trace_rxrpc_call(call, rxrpc_call_queued_ref, n, here, NULL);
  317. else
  318. rxrpc_put_call(call, rxrpc_call_put_noqueue);
  319. return true;
  320. }
  321. /*
  322. * Note the re-emergence of a call.
  323. */
  324. void rxrpc_see_call(struct rxrpc_call *call)
  325. {
  326. const void *here = __builtin_return_address(0);
  327. if (call) {
  328. int n = atomic_read(&call->usage);
  329. trace_rxrpc_call(call, rxrpc_call_seen, n, here, NULL);
  330. }
  331. }
  332. /*
  333. * Note the addition of a ref on a call.
  334. */
  335. void rxrpc_get_call(struct rxrpc_call *call, enum rxrpc_call_trace op)
  336. {
  337. const void *here = __builtin_return_address(0);
  338. int n = atomic_inc_return(&call->usage);
  339. trace_rxrpc_call(call, op, n, here, NULL);
  340. }
  341. /*
  342. * Detach a call from its owning socket.
  343. */
  344. void rxrpc_release_call(struct rxrpc_sock *rx, struct rxrpc_call *call)
  345. {
  346. const void *here = __builtin_return_address(0);
  347. struct rxrpc_connection *conn = call->conn;
  348. bool put = false;
  349. int i;
  350. _enter("{%d,%d}", call->debug_id, atomic_read(&call->usage));
  351. trace_rxrpc_call(call, rxrpc_call_release, atomic_read(&call->usage),
  352. here, (const void *)call->flags);
  353. ASSERTCMP(call->state, ==, RXRPC_CALL_COMPLETE);
  354. spin_lock_bh(&call->lock);
  355. if (test_and_set_bit(RXRPC_CALL_RELEASED, &call->flags))
  356. BUG();
  357. spin_unlock_bh(&call->lock);
  358. del_timer_sync(&call->timer);
  359. /* Make sure we don't get any more notifications */
  360. write_lock_bh(&rx->recvmsg_lock);
  361. if (!list_empty(&call->recvmsg_link)) {
  362. _debug("unlinking once-pending call %p { e=%lx f=%lx }",
  363. call, call->events, call->flags);
  364. list_del(&call->recvmsg_link);
  365. put = true;
  366. }
  367. /* list_empty() must return false in rxrpc_notify_socket() */
  368. call->recvmsg_link.next = NULL;
  369. call->recvmsg_link.prev = NULL;
  370. write_unlock_bh(&rx->recvmsg_lock);
  371. if (put)
  372. rxrpc_put_call(call, rxrpc_call_put);
  373. write_lock(&rx->call_lock);
  374. if (test_and_clear_bit(RXRPC_CALL_HAS_USERID, &call->flags)) {
  375. rb_erase(&call->sock_node, &rx->calls);
  376. memset(&call->sock_node, 0xdd, sizeof(call->sock_node));
  377. rxrpc_put_call(call, rxrpc_call_put_userid);
  378. }
  379. list_del(&call->sock_link);
  380. write_unlock(&rx->call_lock);
  381. _debug("RELEASE CALL %p (%d CONN %p)", call, call->debug_id, conn);
  382. if (conn)
  383. rxrpc_disconnect_call(call);
  384. for (i = 0; i < RXRPC_RXTX_BUFF_SIZE; i++) {
  385. rxrpc_free_skb(call->rxtx_buffer[i],
  386. (call->tx_phase ? rxrpc_skb_tx_cleaned :
  387. rxrpc_skb_rx_cleaned));
  388. call->rxtx_buffer[i] = NULL;
  389. }
  390. _leave("");
  391. }
  392. /*
  393. * release all the calls associated with a socket
  394. */
  395. void rxrpc_release_calls_on_socket(struct rxrpc_sock *rx)
  396. {
  397. struct rxrpc_call *call;
  398. _enter("%p", rx);
  399. while (!list_empty(&rx->to_be_accepted)) {
  400. call = list_entry(rx->to_be_accepted.next,
  401. struct rxrpc_call, accept_link);
  402. list_del(&call->accept_link);
  403. rxrpc_abort_call("SKR", call, 0, RX_CALL_DEAD, -ECONNRESET);
  404. rxrpc_put_call(call, rxrpc_call_put);
  405. }
  406. while (!list_empty(&rx->sock_calls)) {
  407. call = list_entry(rx->sock_calls.next,
  408. struct rxrpc_call, sock_link);
  409. rxrpc_get_call(call, rxrpc_call_got);
  410. rxrpc_abort_call("SKT", call, 0, RX_CALL_DEAD, -ECONNRESET);
  411. rxrpc_send_abort_packet(call);
  412. rxrpc_release_call(rx, call);
  413. rxrpc_put_call(call, rxrpc_call_put);
  414. }
  415. _leave("");
  416. }
  417. /*
  418. * release a call
  419. */
  420. void rxrpc_put_call(struct rxrpc_call *call, enum rxrpc_call_trace op)
  421. {
  422. struct rxrpc_net *rxnet;
  423. const void *here = __builtin_return_address(0);
  424. int n;
  425. ASSERT(call != NULL);
  426. n = atomic_dec_return(&call->usage);
  427. trace_rxrpc_call(call, op, n, here, NULL);
  428. ASSERTCMP(n, >=, 0);
  429. if (n == 0) {
  430. _debug("call %d dead", call->debug_id);
  431. ASSERTCMP(call->state, ==, RXRPC_CALL_COMPLETE);
  432. if (!list_empty(&call->link)) {
  433. rxnet = rxrpc_net(sock_net(&call->socket->sk));
  434. write_lock(&rxnet->call_lock);
  435. list_del_init(&call->link);
  436. write_unlock(&rxnet->call_lock);
  437. }
  438. rxrpc_cleanup_call(call);
  439. }
  440. }
  441. /*
  442. * Final call destruction under RCU.
  443. */
  444. static void rxrpc_rcu_destroy_call(struct rcu_head *rcu)
  445. {
  446. struct rxrpc_call *call = container_of(rcu, struct rxrpc_call, rcu);
  447. rxrpc_put_peer(call->peer);
  448. kfree(call->rxtx_buffer);
  449. kfree(call->rxtx_annotations);
  450. kmem_cache_free(rxrpc_call_jar, call);
  451. }
  452. /*
  453. * clean up a call
  454. */
  455. void rxrpc_cleanup_call(struct rxrpc_call *call)
  456. {
  457. int i;
  458. _net("DESTROY CALL %d", call->debug_id);
  459. memset(&call->sock_node, 0xcd, sizeof(call->sock_node));
  460. del_timer_sync(&call->timer);
  461. ASSERTCMP(call->state, ==, RXRPC_CALL_COMPLETE);
  462. ASSERT(test_bit(RXRPC_CALL_RELEASED, &call->flags));
  463. ASSERTCMP(call->conn, ==, NULL);
  464. /* Clean up the Rx/Tx buffer */
  465. for (i = 0; i < RXRPC_RXTX_BUFF_SIZE; i++)
  466. rxrpc_free_skb(call->rxtx_buffer[i],
  467. (call->tx_phase ? rxrpc_skb_tx_cleaned :
  468. rxrpc_skb_rx_cleaned));
  469. rxrpc_free_skb(call->tx_pending, rxrpc_skb_tx_cleaned);
  470. call_rcu(&call->rcu, rxrpc_rcu_destroy_call);
  471. }
  472. /*
  473. * Make sure that all calls are gone from a network namespace. To reach this
  474. * point, any open UDP sockets in that namespace must have been closed, so any
  475. * outstanding calls cannot be doing I/O.
  476. */
  477. void rxrpc_destroy_all_calls(struct rxrpc_net *rxnet)
  478. {
  479. struct rxrpc_call *call;
  480. _enter("");
  481. if (list_empty(&rxnet->calls))
  482. return;
  483. write_lock(&rxnet->call_lock);
  484. while (!list_empty(&rxnet->calls)) {
  485. call = list_entry(rxnet->calls.next, struct rxrpc_call, link);
  486. _debug("Zapping call %p", call);
  487. rxrpc_see_call(call);
  488. list_del_init(&call->link);
  489. pr_err("Call %p still in use (%d,%s,%lx,%lx)!\n",
  490. call, atomic_read(&call->usage),
  491. rxrpc_call_states[call->state],
  492. call->flags, call->events);
  493. write_unlock(&rxnet->call_lock);
  494. cond_resched();
  495. write_lock(&rxnet->call_lock);
  496. }
  497. write_unlock(&rxnet->call_lock);
  498. }