Lines Matching +full:serial +full:- +full:state

1 /* SPDX-License-Identifier: GPL-2.0-or-later */
15 #include <keys/rxrpc-type.h>
36 * Mark applied to socket buffers in skb->mark. skb->priority is used
44 RXRPC_SKB_MARK_REJECT_ABORT, /* Reject with ABORT (code in skb->priority) */
62 * Per-network namespace data.
66 u32 epoch; /* Local epoch for detecting local-end reset */
68 spinlock_t call_lock; /* Lock for ->calls */
75 rwlock_t conn_lock; /* Lock for ->conn_proc_list, ->service_conns */
84 struct mutex local_mutex; /* Lock for ->local_endpoints */
87 spinlock_t peer_hash_lock; /* Lock for ->peer_hash */
160 struct rb_root calls; /* User ID -> call mapping */
181 * CPU-byteorder normalised Rx packet header.
186 u32 callNumber; /* call ID (0 for connection-level packets) */
188 u32 serial; /* serial number of pkt sent to network */ member
191 u8 userStatus; /* app-layer defined status */
202 * - max 48 bytes (struct sk_buff::cb)
224 #define rxrpc_skb(__skb) ((struct rxrpc_skb_priv *) &(__skb)->cb)
287 * - owned by a single AF_RXRPC socket
288 * - pointed to by transport socket struct sk_user_data
324 spinlock_t client_call_lock; /* Lock for ->new_client_calls */
336 * - matched by local endpoint, remote port, address and protocol type
346 struct list_head keepalive_link; /* Link in net->peer_keepalive[] */
356 unsigned int pmtud_bad; /* Smallest non-working MTU probe we've tried */
361 bool ackr_adv_pmtud; /* T if the peer advertises path-MTU */
363 unsigned int if_mtu; /* Local interface MTU (- hdrsize) for this peer */
372 u8 cong_ssthresh; /* Congestion slow-start threshold */
399 * Call completion condition (state == RXRPC_CALL_COMPLETE).
402 RXRPC_CALL_SUCCEEDED, /* - Normal termination */
403 RXRPC_CALL_REMOTELY_ABORTED, /* - call aborted by peer */
404 RXRPC_CALL_LOCALLY_ABORTED, /* - call aborted locally on error or close */
405 RXRPC_CALL_LOCAL_ERROR, /* - call failed due to local error */
406 RXRPC_CALL_NETWORK_ERROR, /* - call terminated by network error */
414 RXRPC_CONN_IN_SERVICE_CONNS, /* Conn is in peer->service_conns */
437 * The connection protocol state.
458 struct list_head proc_link; /* Link in net->bundle_proc_list */
469 struct rb_node local_node; /* Node in local->client_conns */
478 * - matched by { local, peer, epoch, conn_id, direction }
479 * - each connection can only handle four simultaneous calls
487 struct list_head attend_link; /* Link in local->conn_attend_q */
498 unsigned int call_debug_id; /* call->debug_id */
511 struct work_struct destructor; /* In-process-context destroyer */
513 struct rb_node service_node; /* Node in peer->service_conns */
516 struct sk_buff_head rx_queue; /* received conn-level packets */
526 u32 nonce; /* response re-use preventer */
532 spinlock_t state_lock; /* state-change lock */
533 enum rxrpc_conn_proto_state state; /* current state of connection */ member
537 rxrpc_serial_t tx_serial; /* Outgoing packet serial number counter */
538 unsigned int hi_serial; /* highest serial number received */
539 rxrpc_serial_t pmtud_probe; /* Serial of MTU probe (or 0) */
545 u8 bundle_shift; /* Index into bundle->avail_chans */
554 return sp->hdr.flags & RXRPC_CLIENT_INITIATED; in rxrpc_to_server()
563 * Flags in call->flags.
566 RXRPC_CALL_RELEASED, /* call has been released - no more message to userspace */
572 RXRPC_CALL_TX_ALL_ACKED, /* Last packet has been hard-acked */
581 RXRPC_CALL_EXCLUSIVE, /* The call uses a once-only connection */
582 RXRPC_CALL_RX_IS_IDLE, /* recvmsg() is idle - send an ACK */
600 RXRPC_CALL_CLIENT_AWAIT_CONN, /* - client waiting for connection to become available */
601 RXRPC_CALL_CLIENT_SEND_REQUEST, /* - client sending request phase */
602 RXRPC_CALL_CLIENT_AWAIT_REPLY, /* - client awaiting reply */
603 RXRPC_CALL_CLIENT_RECV_REPLY, /* - client receiving reply phase */
604 RXRPC_CALL_SERVER_PREALLOC, /* - service preallocation */
605 RXRPC_CALL_SERVER_RECV_REQUEST, /* - server receiving request */
606 RXRPC_CALL_SERVER_ACK_REQUEST, /* - server pending ACK of request */
607 RXRPC_CALL_SERVER_SEND_REPLY, /* - server sending reply */
608 RXRPC_CALL_SERVER_AWAIT_ACK, /* - server awaiting final ACK */
609 RXRPC_CALL_COMPLETE, /* - call complete */
625 * Current purpose of call RACK timer. According to the RACK-TLP protocol
626 * [RFC8985], the transmission timer (call->rack_timo_at) may only be used for
638 * - matched by { connection, call_id }
663 struct work_struct destroyer; /* In-process-context destroyer */
666 struct list_head wait_link; /* Link in local->new_client_calls */
668 struct list_head accept_link; /* Link in rx->acceptq */
669 struct list_head recvmsg_link; /* Link in rx->recvmsg_q */
670 struct list_head sock_link; /* Link in rx->sock_calls */
671 struct rb_node sock_node; /* Node in rx->calls */
672 struct list_head attend_link; /* Link in local->call_attend_q */
675 s64 tx_total_len; /* Total length left to be transmitted (or -1) */
676 unsigned long user_call_ID; /* user-defined call ID */
686 enum rxrpc_call_state _state; /* Current state of call (needs barrier) */
709 rxrpc_serial_t tx_last_serial; /* Serial of last DATA transmitted */
726 rxrpc_serial_t rx_serial; /* Highest serial received for this call */
729 /* TCP-style slow-start congestion control [RFC5681]. Since the SMSS
735 enum rxrpc_ca_state cong_ca_state; /* Congestion control state */
738 u16 cong_ssthresh; /* Slow-start threshold */
743 /* RACK-TLP [RFC8985] state. */
757 rxrpc_serial_t tlp_serial; /* Serial of TLP probe (or 0 if none in progress) */
762 /* Receive-phase ACK management (ACKs we send). */
771 /* SACK table for soft-acked packets */
776 rxrpc_serial_t rtt_serial[4]; /* Serial number of DATA or PING sent */
778 unsigned long rtt_avail; /* Mask of available slots in bits 0-3,
779 * Mask of pending samples in 8-11 */
783 /* Transmission-phase ACK management (ACKs we've received). */
788 rxrpc_serial_t acks_highest_serial; /* Highest serial number ACK'd */
809 rxrpc_serial_t ack_serial; /* Serial number of ACK */
810 rxrpc_serial_t acked_serial; /* Serial number ACK'd */
827 * sendmsg() cmsg-specified parameters.
863 rxrpc_serial_t serial; /* Last serial number transmitted with */ member
875 bool jumboable; /* Can be non-terminal jumbo subpacket */
881 return txb->flags & RXRPC_CLIENT_INITIATED; in rxrpc_sending_to_server()
890 * Transmit queue element, including RACK [RFC8985] per-segment metadata. The
899 unsigned long segment_acked; /* Bit-per-buf: Set if ACK'd */
900 unsigned long segment_lost; /* Bit-per-buf: Set if declared lost */
901 unsigned long segment_retransmitted; /* Bit-per-buf: Set if retransmitted */
902 unsigned long rtt_samples; /* Bit-per-buf: Set if available for RTT */
903 unsigned long ever_retransmitted; /* Bit-per-buf: Set if ever retransmitted */
908 #define RXRPC_TXQ_MASK (RXRPC_NR_TXQUEUE - 1)
932 * Allocate the next serial number on a connection. 0 must be skipped.
936 rxrpc_serial_t serial; in rxrpc_get_next_serial() local
938 serial = conn->tx_serial; in rxrpc_get_next_serial()
939 if (serial == 0) in rxrpc_get_next_serial()
940 serial = 1; in rxrpc_get_next_serial()
941 conn->tx_serial = serial + 1; in rxrpc_get_next_serial()
942 return serial; in rxrpc_get_next_serial()
946 * Allocate the next serial n numbers on a connection. 0 must be skipped.
951 rxrpc_serial_t serial; in rxrpc_get_next_serials() local
953 serial = conn->tx_serial; in rxrpc_get_next_serials()
954 if (serial + n <= n) in rxrpc_get_next_serials()
955 serial = 1; in rxrpc_get_next_serials()
956 conn->tx_serial = serial + n; in rxrpc_get_next_serials()
957 return serial; in rxrpc_get_next_serials()
981 void rxrpc_propose_ping(struct rxrpc_call *call, u32 serial,
1018 return test_bit(RXRPC_CALL_IS_SERVICE, &call->flags); in rxrpc_is_service_call()
1040 enum rxrpc_call_state state) in rxrpc_set_call_state() argument
1042 /* Order write of completion info before write of ->state. */ in rxrpc_set_call_state()
1043 smp_store_release(&call->_state, state); in rxrpc_set_call_state()
1044 wake_up(&call->waitq); in rxrpc_set_call_state()
1049 return call->_state; /* Only inside I/O thread */ in __rxrpc_call_state()
1059 /* Order read ->state before read of completion info. */ in rxrpc_call_state()
1060 return smp_load_acquire(&call->_state); in rxrpc_call_state()
1070 return rxrpc_call_is_complete(call) && call->completion != RXRPC_CALL_SUCCEEDED; in rxrpc_call_has_failed()
1105 /* Order reading the abort info after the state check. */ in rxrpc_is_conn_aborted()
1106 return smp_load_acquire(&conn->state) == RXRPC_CONN_ABORTED; in rxrpc_is_conn_aborted()
1135 return conn->out_clientflag; in rxrpc_conn_is_client()
1146 timer_reduce(&conn->timer, expire_at); in rxrpc_reduce_conn_timer()
1184 /* Initialise TLP state [RFC8958 7.1]. */
1187 call->tlp_serial = 0; in rxrpc_tlp_init()
1188 call->tlp_seq = call->acks_hard_ack; in rxrpc_tlp_init()
1189 call->tlp_is_retrans = false; in rxrpc_tlp_init()
1202 wake_up_process(READ_ONCE(local->io_thread)); in rxrpc_wake_up_io_thread()
1207 return rxrpc_direct_abort(skb, why, RX_PROTOCOL_ERROR, -EPROTO); in rxrpc_protocol_error()
1250 r = refcount_read(&local->ref); in __rxrpc_use_local()
1251 u = atomic_fetch_add_unless(&local->active_users, 1, 0); in __rxrpc_use_local()
1252 trace_rxrpc_local(local->debug_id, why, r, u); in __rxrpc_use_local()
1261 r = refcount_read(&local->ref); in rxrpc_see_local()
1262 u = atomic_read(&local->active_users); in rxrpc_see_local()
1263 trace_rxrpc_local(local->debug_id, why, r, u); in rxrpc_see_local()
1294 rxrpc_serial_t serial, enum rxrpc_propose_ack_trace why);
1350 rxrpc_abort_call(call, sp->hdr.seq, abort_code, -EPROTO, why); in rxrpc_abort_eproto()
1351 return -EPROTO; in rxrpc_abort_eproto()
1415 #define rxrpc_inc_stat(rxnet, s) atomic_inc(&(rxnet)->s)
1416 #define rxrpc_dec_stat(rxnet, s) atomic_dec(&(rxnet)->s)
1446 return (s32)(seq1 - seq2) < 0; in before()
1450 return (s32)(seq1 - seq2) <= 0; in before_eq()
1454 return (s32)(seq1 - seq2) > 0; in after()
1458 return (s32)(seq1 - seq2) >= 0; in after_eq()
1473 return (seq & (RXRPC_NR_TXQUEUE - 1)) == tq->qbase; in rxrpc_seq_in_txq()
1479 __skb_queue_tail(&call->rx_queue, skb); in rxrpc_queue_rx_call_packet()
1488 int winsize = umin(call->tx_winsize, call->cong_cwnd + call->cong_extra); in rxrpc_tx_window_space()
1489 int transmitted = call->tx_top - call->tx_bottom; in rxrpc_tx_window_space()
1491 return max(winsize - transmitted, 0); in rxrpc_tx_window_space()
1496 return call->acks_nr_sacks + call->tx_nr_lost; in rxrpc_left_out()
1505 return call->tx_nr_sent - rxrpc_left_out(call) + call->tx_nr_resent; in rxrpc_tx_in_flight()
1514 printk("[%-6.6s] "FMT"\n", current->comm ,##__VA_ARGS__)
1573 pr_err("Assertion failed - %lu(0x%lx) %s %lu(0x%lx) is false\n", \
1593 pr_err("Assertion failed - %lu(0x%lx) %s %lu(0x%lx) is false\n", \