• Home
  • Raw
  • Download

Lines Matching refs:call

42 int rxrpc_queue_rcv_skb(struct rxrpc_call *call, struct sk_buff *skb,  in rxrpc_queue_rcv_skb()  argument
46 struct rxrpc_sock *rx = call->socket; in rxrpc_queue_rcv_skb()
55 ASSERTCMP(sp->call, ==, call); in rxrpc_queue_rcv_skb()
59 if (test_bit(RXRPC_CALL_TERMINAL_MSG, &call->flags)) { in rxrpc_queue_rcv_skb()
61 ASSERTCMP(call->state, >=, RXRPC_CALL_COMPLETE); in rxrpc_queue_rcv_skb()
63 sp->call = NULL; in rxrpc_queue_rcv_skb()
64 rxrpc_put_call(call); in rxrpc_queue_rcv_skb()
86 if (!test_bit(RXRPC_CALL_TERMINAL_MSG, &call->flags) && in rxrpc_queue_rcv_skb()
87 !test_bit(RXRPC_CALL_RELEASED, &call->flags) && in rxrpc_queue_rcv_skb()
88 call->socket->sk.sk_state != RXRPC_CLOSE) { in rxrpc_queue_rcv_skb()
96 set_bit(RXRPC_CALL_TERMINAL_MSG, &call->flags); in rxrpc_queue_rcv_skb()
101 rx->interceptor(sk, call->user_call_ID, skb); in rxrpc_queue_rcv_skb()
121 sp->call = NULL; in rxrpc_queue_rcv_skb()
122 rxrpc_put_call(call); in rxrpc_queue_rcv_skb()
134 static int rxrpc_fast_process_data(struct rxrpc_call *call, in rxrpc_fast_process_data() argument
141 _enter("{%u,%u},,{%u}", call->rx_data_post, call->rx_first_oos, seq); in rxrpc_fast_process_data()
144 ASSERTCMP(sp->call, ==, NULL); in rxrpc_fast_process_data()
146 spin_lock(&call->lock); in rxrpc_fast_process_data()
148 if (call->state > RXRPC_CALL_COMPLETE) in rxrpc_fast_process_data()
151 ASSERTCMP(call->rx_data_expect, >=, call->rx_data_post); in rxrpc_fast_process_data()
152 ASSERTCMP(call->rx_data_post, >=, call->rx_data_recv); in rxrpc_fast_process_data()
153 ASSERTCMP(call->rx_data_recv, >=, call->rx_data_eaten); in rxrpc_fast_process_data()
155 if (seq < call->rx_data_post) { in rxrpc_fast_process_data()
156 _debug("dup #%u [-%u]", seq, call->rx_data_post); in rxrpc_fast_process_data()
163 ackbit = seq - (call->rx_data_eaten + 1); in rxrpc_fast_process_data()
165 if (__test_and_set_bit(ackbit, call->ackr_window)) { in rxrpc_fast_process_data()
167 seq, call->rx_data_eaten, call->rx_data_post); in rxrpc_fast_process_data()
172 if (seq >= call->ackr_win_top) { in rxrpc_fast_process_data()
173 _debug("exceed #%u [%u]", seq, call->ackr_win_top); in rxrpc_fast_process_data()
174 __clear_bit(ackbit, call->ackr_window); in rxrpc_fast_process_data()
179 if (seq == call->rx_data_expect) { in rxrpc_fast_process_data()
180 clear_bit(RXRPC_CALL_EXPECT_OOS, &call->flags); in rxrpc_fast_process_data()
181 call->rx_data_expect++; in rxrpc_fast_process_data()
182 } else if (seq > call->rx_data_expect) { in rxrpc_fast_process_data()
183 _debug("oos #%u [%u]", seq, call->rx_data_expect); in rxrpc_fast_process_data()
184 call->rx_data_expect = seq + 1; in rxrpc_fast_process_data()
185 if (test_and_set_bit(RXRPC_CALL_EXPECT_OOS, &call->flags)) { in rxrpc_fast_process_data()
192 if (seq != call->rx_data_post) { in rxrpc_fast_process_data()
193 _debug("ahead #%u [%u]", seq, call->rx_data_post); in rxrpc_fast_process_data()
197 if (test_bit(RXRPC_CALL_RCVD_LAST, &call->flags)) in rxrpc_fast_process_data()
202 if (call->conn->security) in rxrpc_fast_process_data()
205 sp->call = call; in rxrpc_fast_process_data()
206 rxrpc_get_call(call); in rxrpc_fast_process_data()
209 ret = rxrpc_queue_rcv_skb(call, skb, false, terminal); in rxrpc_fast_process_data()
212 __clear_bit(ackbit, call->ackr_window); in rxrpc_fast_process_data()
222 ASSERTCMP(call->rx_data_post, ==, seq); in rxrpc_fast_process_data()
223 call->rx_data_post++; in rxrpc_fast_process_data()
226 set_bit(RXRPC_CALL_RCVD_LAST, &call->flags); in rxrpc_fast_process_data()
230 if (call->rx_data_post == call->rx_first_oos) { in rxrpc_fast_process_data()
232 read_lock(&call->state_lock); in rxrpc_fast_process_data()
233 if (call->state < RXRPC_CALL_COMPLETE && in rxrpc_fast_process_data()
234 !test_and_set_bit(RXRPC_CALL_DRAIN_RX_OOS, &call->events)) in rxrpc_fast_process_data()
235 rxrpc_queue_call(call); in rxrpc_fast_process_data()
236 read_unlock(&call->state_lock); in rxrpc_fast_process_data()
239 spin_unlock(&call->lock); in rxrpc_fast_process_data()
240 atomic_inc(&call->ackr_not_idle); in rxrpc_fast_process_data()
241 rxrpc_propose_ACK(call, RXRPC_ACK_DELAY, sp->hdr.serial, false); in rxrpc_fast_process_data()
248 spin_unlock(&call->lock); in rxrpc_fast_process_data()
254 __rxrpc_propose_ACK(call, ack, sp->hdr.serial, true); in rxrpc_fast_process_data()
256 spin_unlock(&call->lock); in rxrpc_fast_process_data()
262 __rxrpc_propose_ACK(call, ack, sp->hdr.serial, true); in rxrpc_fast_process_data()
265 spin_unlock(&call->lock); in rxrpc_fast_process_data()
266 skb_queue_tail(&call->rx_queue, skb); in rxrpc_fast_process_data()
267 atomic_inc(&call->ackr_not_idle); in rxrpc_fast_process_data()
268 read_lock(&call->state_lock); in rxrpc_fast_process_data()
269 if (call->state < RXRPC_CALL_DEAD) in rxrpc_fast_process_data()
270 rxrpc_queue_call(call); in rxrpc_fast_process_data()
271 read_unlock(&call->state_lock); in rxrpc_fast_process_data()
280 static void rxrpc_assume_implicit_ackall(struct rxrpc_call *call, u32 serial) in rxrpc_assume_implicit_ackall() argument
282 write_lock_bh(&call->state_lock); in rxrpc_assume_implicit_ackall()
284 switch (call->state) { in rxrpc_assume_implicit_ackall()
286 call->state = RXRPC_CALL_CLIENT_RECV_REPLY; in rxrpc_assume_implicit_ackall()
287 call->acks_latest = serial; in rxrpc_assume_implicit_ackall()
289 _debug("implicit ACKALL %%%u", call->acks_latest); in rxrpc_assume_implicit_ackall()
290 set_bit(RXRPC_CALL_RCVD_ACKALL, &call->events); in rxrpc_assume_implicit_ackall()
291 write_unlock_bh(&call->state_lock); in rxrpc_assume_implicit_ackall()
293 if (try_to_del_timer_sync(&call->resend_timer) >= 0) { in rxrpc_assume_implicit_ackall()
294 clear_bit(RXRPC_CALL_RESEND_TIMER, &call->events); in rxrpc_assume_implicit_ackall()
295 clear_bit(RXRPC_CALL_RESEND, &call->events); in rxrpc_assume_implicit_ackall()
296 clear_bit(RXRPC_CALL_RUN_RTIMER, &call->flags); in rxrpc_assume_implicit_ackall()
301 write_unlock_bh(&call->state_lock); in rxrpc_assume_implicit_ackall()
310 void rxrpc_fast_process_packet(struct rxrpc_call *call, struct sk_buff *skb) in rxrpc_fast_process_packet() argument
316 _enter("%p,%p", call, skb); in rxrpc_fast_process_packet()
334 hi_serial = atomic_read(&call->conn->hi_serial); in rxrpc_fast_process_packet()
336 hi_serial = atomic_cmpxchg(&call->conn->hi_serial, hi_serial, in rxrpc_fast_process_packet()
343 rxrpc_propose_ACK(call, RXRPC_ACK_REQUESTED, sp->hdr.serial, false); in rxrpc_fast_process_packet()
357 write_lock_bh(&call->state_lock); in rxrpc_fast_process_packet()
358 if (call->state < RXRPC_CALL_COMPLETE) { in rxrpc_fast_process_packet()
359 call->state = RXRPC_CALL_REMOTELY_ABORTED; in rxrpc_fast_process_packet()
360 call->abort_code = abort_code; in rxrpc_fast_process_packet()
361 set_bit(RXRPC_CALL_RCVD_ABORT, &call->events); in rxrpc_fast_process_packet()
362 rxrpc_queue_call(call); in rxrpc_fast_process_packet()
369 if (call->conn->out_clientflag) in rxrpc_fast_process_packet()
372 write_lock_bh(&call->state_lock); in rxrpc_fast_process_packet()
373 switch (call->state) { in rxrpc_fast_process_packet()
375 call->state = RXRPC_CALL_SERVER_BUSY; in rxrpc_fast_process_packet()
376 set_bit(RXRPC_CALL_RCVD_BUSY, &call->events); in rxrpc_fast_process_packet()
377 rxrpc_queue_call(call); in rxrpc_fast_process_packet()
396 call->ackr_prev_seq = sp->hdr.seq; in rxrpc_fast_process_packet()
400 if (call->state == RXRPC_CALL_CLIENT_AWAIT_REPLY) in rxrpc_fast_process_packet()
401 rxrpc_assume_implicit_ackall(call, serial); in rxrpc_fast_process_packet()
403 switch (rxrpc_fast_process_data(call, skb, seq)) { in rxrpc_fast_process_packet()
419 read_lock_bh(&call->state_lock); in rxrpc_fast_process_packet()
420 if (call->state < RXRPC_CALL_DEAD) { in rxrpc_fast_process_packet()
421 skb_queue_tail(&call->rx_queue, skb); in rxrpc_fast_process_packet()
422 rxrpc_queue_call(call); in rxrpc_fast_process_packet()
425 read_unlock_bh(&call->state_lock); in rxrpc_fast_process_packet()
431 write_lock_bh(&call->state_lock); in rxrpc_fast_process_packet()
433 if (call->state <= RXRPC_CALL_COMPLETE) { in rxrpc_fast_process_packet()
434 call->state = RXRPC_CALL_LOCALLY_ABORTED; in rxrpc_fast_process_packet()
435 call->abort_code = RX_PROTOCOL_ERROR; in rxrpc_fast_process_packet()
436 set_bit(RXRPC_CALL_ABORT, &call->events); in rxrpc_fast_process_packet()
437 rxrpc_queue_call(call); in rxrpc_fast_process_packet()
440 write_unlock_bh(&call->state_lock); in rxrpc_fast_process_packet()
450 static void rxrpc_process_jumbo_packet(struct rxrpc_call *call, in rxrpc_process_jumbo_packet() argument
491 rxrpc_fast_process_packet(call, part); in rxrpc_process_jumbo_packet()
496 rxrpc_fast_process_packet(call, jumbo); in rxrpc_process_jumbo_packet()
504 write_lock_bh(&call->state_lock); in rxrpc_process_jumbo_packet()
505 if (call->state <= RXRPC_CALL_COMPLETE) { in rxrpc_process_jumbo_packet()
506 call->state = RXRPC_CALL_LOCALLY_ABORTED; in rxrpc_process_jumbo_packet()
507 call->abort_code = RX_PROTOCOL_ERROR; in rxrpc_process_jumbo_packet()
508 set_bit(RXRPC_CALL_ABORT, &call->events); in rxrpc_process_jumbo_packet()
509 rxrpc_queue_call(call); in rxrpc_process_jumbo_packet()
511 write_unlock_bh(&call->state_lock); in rxrpc_process_jumbo_packet()
519 static void rxrpc_post_packet_to_call(struct rxrpc_call *call, in rxrpc_post_packet_to_call() argument
524 _enter("%p,%p", call, skb); in rxrpc_post_packet_to_call()
528 _debug("extant call [%d]", call->state); in rxrpc_post_packet_to_call()
530 read_lock(&call->state_lock); in rxrpc_post_packet_to_call()
531 switch (call->state) { in rxrpc_post_packet_to_call()
533 if (!test_and_set_bit(RXRPC_CALL_ABORT, &call->events)) { in rxrpc_post_packet_to_call()
534 rxrpc_queue_call(call); in rxrpc_post_packet_to_call()
544 if (call->conn->in_clientflag) in rxrpc_post_packet_to_call()
548 rxrpc_get_call(call); in rxrpc_post_packet_to_call()
549 set_bit(RXRPC_CALL_ACK_FINAL, &call->events); in rxrpc_post_packet_to_call()
550 rxrpc_queue_call(call); in rxrpc_post_packet_to_call()
556 read_unlock(&call->state_lock); in rxrpc_post_packet_to_call()
557 rxrpc_get_call(call); in rxrpc_post_packet_to_call()
561 rxrpc_process_jumbo_packet(call, skb); in rxrpc_post_packet_to_call()
563 rxrpc_fast_process_packet(call, skb); in rxrpc_post_packet_to_call()
565 rxrpc_put_call(call); in rxrpc_post_packet_to_call()
571 rxrpc_reject_packet(call->conn->trans->local, skb); in rxrpc_post_packet_to_call()
577 read_unlock(&call->state_lock); in rxrpc_post_packet_to_call()
720 struct rxrpc_call *call; in rxrpc_data_ready() local
725 call = rxrpc_find_call_hash(in_clientflag, sp->hdr.cid, in rxrpc_data_ready()
729 if (call) in rxrpc_data_ready()
730 rxrpc_post_packet_to_call(call, skb); in rxrpc_data_ready()