io_thread.c (0d6bf319bc5aba4535bb46e1b607973688a2248a) io_thread.c (9d35d880e0e4a3ab32d8c12f9e4d76198aadd42d)
1// SPDX-License-Identifier: GPL-2.0-or-later
2/* RxRPC packet reception
3 *
4 * Copyright (C) 2007, 2016, 2022 Red Hat, Inc. All Rights Reserved.
5 * Written by David Howells (dhowells@redhat.com)
6 */
7
8#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

--- 355 unchanged lines hidden (view full) ---

364 trace_rxrpc_rx_data(chan->call_debug_id,
365 sp->hdr.seq,
366 sp->hdr.serial,
367 sp->hdr.flags);
368 rxrpc_conn_retransmit_call(conn, skb, channel);
369 return just_discard;
370 }
371
1// SPDX-License-Identifier: GPL-2.0-or-later
2/* RxRPC packet reception
3 *
4 * Copyright (C) 2007, 2016, 2022 Red Hat, Inc. All Rights Reserved.
5 * Written by David Howells (dhowells@redhat.com)
6 */
7
8#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

--- 355 unchanged lines hidden (view full) ---

364 trace_rxrpc_rx_data(chan->call_debug_id,
365 sp->hdr.seq,
366 sp->hdr.serial,
367 sp->hdr.flags);
368 rxrpc_conn_retransmit_call(conn, skb, channel);
369 return just_discard;
370 }
371
372 rcu_read_lock();
373 call = rxrpc_try_get_call(rcu_dereference(chan->call),
374 rxrpc_call_get_input);
375 rcu_read_unlock();
372 call = rxrpc_try_get_call(chan->call, rxrpc_call_get_input);
376
377 if (sp->hdr.callNumber > chan->call_id) {
378 if (rxrpc_to_client(sp)) {
379 rxrpc_put_call(call, rxrpc_call_put_input);
380 return rxrpc_protocol_error(skb,
381 rxrpc_eproto_unexpected_implicit_end);
382 }
383

--- 64 unchanged lines hidden (view full) ---

448 spin_unlock_bh(&local->lock);
449
450 trace_rxrpc_call_poked(call);
451 rxrpc_input_call_event(call, NULL);
452 rxrpc_put_call(call, rxrpc_call_put_poke);
453 continue;
454 }
455
373
374 if (sp->hdr.callNumber > chan->call_id) {
375 if (rxrpc_to_client(sp)) {
376 rxrpc_put_call(call, rxrpc_call_put_input);
377 return rxrpc_protocol_error(skb,
378 rxrpc_eproto_unexpected_implicit_end);
379 }
380

--- 64 unchanged lines hidden (view full) ---

445 spin_unlock_bh(&local->lock);
446
447 trace_rxrpc_call_poked(call);
448 rxrpc_input_call_event(call, NULL);
449 rxrpc_put_call(call, rxrpc_call_put_poke);
450 continue;
451 }
452
453 if (!list_empty(&local->new_client_calls))
454 rxrpc_connect_client_calls(local);
455
456 /* Process received packets and errors. */
457 if ((skb = __skb_dequeue(&rx_queue))) {
458 struct rxrpc_skb_priv *sp = rxrpc_skb(skb);
459 switch (skb->mark) {
460 case RXRPC_SKB_MARK_PACKET:
461 skb->priority = 0;
462 if (!rxrpc_input_packet(local, &skb))
463 rxrpc_reject_packet(local, skb);

--- 23 unchanged lines hidden (view full) ---

487 spin_unlock_irq(&local->rx_queue.lock);
488 continue;
489 }
490
491 set_current_state(TASK_INTERRUPTIBLE);
492 should_stop = kthread_should_stop();
493 if (!skb_queue_empty(&local->rx_queue) ||
494 !list_empty(&local->call_attend_q) ||
456 /* Process received packets and errors. */
457 if ((skb = __skb_dequeue(&rx_queue))) {
458 struct rxrpc_skb_priv *sp = rxrpc_skb(skb);
459 switch (skb->mark) {
460 case RXRPC_SKB_MARK_PACKET:
461 skb->priority = 0;
462 if (!rxrpc_input_packet(local, &skb))
463 rxrpc_reject_packet(local, skb);

--- 23 unchanged lines hidden (view full) ---

487 spin_unlock_irq(&local->rx_queue.lock);
488 continue;
489 }
490
491 set_current_state(TASK_INTERRUPTIBLE);
492 should_stop = kthread_should_stop();
493 if (!skb_queue_empty(&local->rx_queue) ||
494 !list_empty(&local->call_attend_q) ||
495 !list_empty(&local->conn_attend_q)) {
495 !list_empty(&local->conn_attend_q) ||
496 !list_empty(&local->new_client_calls) ||
497 test_bit(RXRPC_CLIENT_CONN_REAP_TIMER,
498 &local->client_conn_flags)) {
496 __set_current_state(TASK_RUNNING);
497 continue;
498 }
499
500 if (should_stop)
501 break;
502 schedule();
503 }
504
505 __set_current_state(TASK_RUNNING);
506 rxrpc_see_local(local, rxrpc_local_stop);
507 rxrpc_destroy_local(local);
508 local->io_thread = NULL;
509 rxrpc_see_local(local, rxrpc_local_stopped);
510 return 0;
511}
499 __set_current_state(TASK_RUNNING);
500 continue;
501 }
502
503 if (should_stop)
504 break;
505 schedule();
506 }
507
508 __set_current_state(TASK_RUNNING);
509 rxrpc_see_local(local, rxrpc_local_stop);
510 rxrpc_destroy_local(local);
511 local->io_thread = NULL;
512 rxrpc_see_local(local, rxrpc_local_stopped);
513 return 0;
514}