Lines Matching +full:serial +full:- +full:id
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 */
170 u16 from; /* Service ID to upgrade (if not 0) */
171 u16 to; /* service ID to upgrade to */
181 * CPU-byteorder normalised Rx packet header.
185 u32 cid; /* connection and channel ID */
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 */
192 u8 securityIndex; /* security protocol ID */
197 u16 serviceId; /* service ID */
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
319 int debug_id; /* debug ID for printks */
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[] */
351 int debug_id; /* debug ID for printks */
357 unsigned int pmtud_bad; /* Smallest non-working MTU probe we've tried */
362 bool ackr_adv_pmtud; /* T if the peer advertises path-MTU */
364 unsigned int if_mtu; /* Local interface MTU (- hdrsize) for this peer */
373 u8 cong_ssthresh; /* Congestion slow-start threshold */
383 u32 cid; /* connection ID */
394 bool upgrade; /* T if service ID can be upgraded */
395 u16 service_id; /* Service ID for this connection */
403 RXRPC_CALL_SUCCEEDED, /* - Normal termination */
404 RXRPC_CALL_REMOTELY_ABORTED, /* - call aborted by peer */
405 RXRPC_CALL_LOCALLY_ABORTED, /* - call aborted locally on error or close */
406 RXRPC_CALL_LOCAL_ERROR, /* - call failed due to local error */
407 RXRPC_CALL_NETWORK_ERROR, /* - call terminated by network error */
415 RXRPC_CONN_IN_SERVICE_CONNS, /* Conn is in peer->service_conns */
459 struct list_head proc_link; /* Link in net->bundle_proc_list */
465 u16 service_id; /* Service ID for this connection */
468 bool upgrade; /* T if service ID can be upgraded */
470 struct rb_node local_node; /* Node in local->client_conns */
479 * - matched by { local, peer, epoch, conn_id, direction }
480 * - each connection can only handle four simultaneous calls
488 struct list_head attend_link; /* Link in local->conn_attend_q */
499 unsigned int call_debug_id; /* call->debug_id */
500 u32 call_id; /* ID of current call */
501 u32 call_counter; /* Call ID counter */
502 u32 last_call; /* ID of last call */
512 struct work_struct destructor; /* In-process-context destroyer */
514 struct rb_node service_node; /* Node in peer->service_conns */
517 struct sk_buff_head rx_queue; /* received conn-level packets */
527 u32 nonce; /* response re-use preventer */
533 spinlock_t state_lock; /* state-change lock */
537 int debug_id; /* debug ID for printks */
538 rxrpc_serial_t tx_serial; /* Outgoing packet serial number counter */
539 unsigned int hi_serial; /* highest serial number received */
540 rxrpc_serial_t pmtud_probe; /* Serial of MTU probe (or 0) */
541 unsigned int pmtud_call; /* ID of call used for probe */
542 u32 service_id; /* Service ID, possibly upgraded */
546 u8 bundle_shift; /* Index into bundle->avail_chans */
548 bool upgrade; /* T if service ID can be upgraded */
549 u16 orig_service_id; /* Originally requested service ID */
555 return sp->hdr.flags & RXRPC_CLIENT_INITIATED; in rxrpc_to_server()
564 * Flags in call->flags.
567 RXRPC_CALL_RELEASED, /* call has been released - no more message to userspace */
568 RXRPC_CALL_HAS_USERID, /* has a user ID attached */
573 RXRPC_CALL_TX_ALL_ACKED, /* Last packet has been hard-acked */
582 RXRPC_CALL_EXCLUSIVE, /* The call uses a once-only connection */
583 RXRPC_CALL_RX_IS_IDLE, /* recvmsg() is idle - send an ACK */
601 RXRPC_CALL_CLIENT_AWAIT_CONN, /* - client waiting for connection to become available */
602 RXRPC_CALL_CLIENT_SEND_REQUEST, /* - client sending request phase */
603 RXRPC_CALL_CLIENT_AWAIT_REPLY, /* - client awaiting reply */
604 RXRPC_CALL_CLIENT_RECV_REPLY, /* - client receiving reply phase */
605 RXRPC_CALL_SERVER_PREALLOC, /* - service preallocation */
606 RXRPC_CALL_SERVER_RECV_REQUEST, /* - server receiving request */
607 RXRPC_CALL_SERVER_ACK_REQUEST, /* - server pending ACK of request */
608 RXRPC_CALL_SERVER_SEND_REPLY, /* - server sending reply */
609 RXRPC_CALL_SERVER_AWAIT_ACK, /* - server awaiting final ACK */
610 RXRPC_CALL_COMPLETE, /* - call complete */
626 * Current purpose of call RACK timer. According to the RACK-TLP protocol
627 * [RFC8985], the transmission timer (call->rack_timo_at) may only be used for
639 * - matched by { connection, call_id }
664 struct work_struct destroyer; /* In-process-context destroyer */
667 struct list_head wait_link; /* Link in local->new_client_calls */
669 struct list_head accept_link; /* Link in rx->acceptq */
670 struct list_head recvmsg_link; /* Link in rx->recvmsg_q */
671 struct list_head sock_link; /* Link in rx->sock_calls */
672 struct rb_node sock_node; /* Node in rx->calls */
673 struct list_head attend_link; /* Link in local->call_attend_q */
676 s64 tx_total_len; /* Total length left to be transmitted (or -1) */
677 unsigned long user_call_ID; /* user-defined call ID */
692 u32 call_id; /* call ID on connection */
693 u32 cid; /* connection ID plus channel index */
695 int debug_id; /* debug ID for printks */
710 rxrpc_serial_t tx_last_serial; /* Serial of last DATA transmitted */
727 rxrpc_serial_t rx_serial; /* Highest serial received for this call */
730 /* TCP-style slow-start congestion control [RFC5681]. Since the SMSS
739 u16 cong_ssthresh; /* Slow-start threshold */
744 /* RACK-TLP [RFC8985] state. */
758 rxrpc_serial_t tlp_serial; /* Serial of TLP probe (or 0 if none in progress) */
763 /* Receive-phase ACK management (ACKs we send). */
772 /* SACK table for soft-acked packets */
777 rxrpc_serial_t rtt_serial[4]; /* Serial number of DATA or PING sent */
779 unsigned long rtt_avail; /* Mask of available slots in bits 0-3,
780 * Mask of pending samples in 8-11 */
784 /* Transmission-phase ACK management (ACKs we've received). */
789 rxrpc_serial_t acks_highest_serial; /* Highest serial number ACK'd */
810 rxrpc_serial_t ack_serial; /* Serial number of ACK */
811 rxrpc_serial_t acked_serial; /* Serial number ACK'd */
828 * sendmsg() cmsg-specified parameters.
839 unsigned long user_call_ID; /* User's call ID */
864 rxrpc_serial_t serial; /* Last serial number transmitted with */ member
876 bool jumboable; /* Can be non-terminal jumbo subpacket */
882 return txb->flags & RXRPC_CLIENT_INITIATED; in rxrpc_sending_to_server()
891 * Transmit queue element, including RACK [RFC8985] per-segment metadata. The
900 unsigned long segment_acked; /* Bit-per-buf: Set if ACK'd */
901 unsigned long segment_lost; /* Bit-per-buf: Set if declared lost */
902 unsigned long segment_retransmitted; /* Bit-per-buf: Set if retransmitted */
903 unsigned long rtt_samples; /* Bit-per-buf: Set if available for RTT */
904 unsigned long ever_retransmitted; /* Bit-per-buf: Set if ever retransmitted */
909 #define RXRPC_TXQ_MASK (RXRPC_NR_TXQUEUE - 1)
933 * Allocate the next serial number on a connection. 0 must be skipped.
937 rxrpc_serial_t serial; in rxrpc_get_next_serial() local
939 serial = conn->tx_serial; in rxrpc_get_next_serial()
940 if (serial == 0) in rxrpc_get_next_serial()
941 serial = 1; in rxrpc_get_next_serial()
942 conn->tx_serial = serial + 1; in rxrpc_get_next_serial()
943 return serial; in rxrpc_get_next_serial()
947 * Allocate the next serial n numbers on a connection. 0 must be skipped.
952 rxrpc_serial_t serial; in rxrpc_get_next_serials() local
954 serial = conn->tx_serial; in rxrpc_get_next_serials()
955 if (serial + n <= n) in rxrpc_get_next_serials()
956 serial = 1; in rxrpc_get_next_serials()
957 conn->tx_serial = serial + n; in rxrpc_get_next_serials()
958 return serial; in rxrpc_get_next_serials()
982 void rxrpc_propose_ping(struct rxrpc_call *call, u32 serial,
1019 return test_bit(RXRPC_CALL_IS_SERVICE, &call->flags); in rxrpc_is_service_call()
1043 /* Order write of completion info before write of ->state. */ in rxrpc_set_call_state()
1044 smp_store_release(&call->_state, state); in rxrpc_set_call_state()
1045 wake_up(&call->waitq); in rxrpc_set_call_state()
1050 return call->_state; /* Only inside I/O thread */ in __rxrpc_call_state()
1060 /* Order read ->state before read of completion info. */ in rxrpc_call_state()
1061 return smp_load_acquire(&call->_state); in rxrpc_call_state()
1071 return rxrpc_call_is_complete(call) && call->completion != RXRPC_CALL_SUCCEEDED; in rxrpc_call_has_failed()
1107 return smp_load_acquire(&conn->state) == RXRPC_CONN_ABORTED; in rxrpc_is_conn_aborted()
1136 return conn->out_clientflag; in rxrpc_conn_is_client()
1147 timer_reduce(&conn->timer, expire_at); in rxrpc_reduce_conn_timer()
1188 call->tlp_serial = 0; in rxrpc_tlp_init()
1189 call->tlp_seq = call->acks_hard_ack; in rxrpc_tlp_init()
1190 call->tlp_is_retrans = false; in rxrpc_tlp_init()
1203 wake_up_process(READ_ONCE(local->io_thread)); in rxrpc_wake_up_io_thread()
1208 return rxrpc_direct_abort(skb, why, RX_PROTOCOL_ERROR, -EPROTO); in rxrpc_protocol_error()
1251 r = refcount_read(&local->ref); in __rxrpc_use_local()
1252 u = atomic_fetch_add_unless(&local->active_users, 1, 0); in __rxrpc_use_local()
1253 trace_rxrpc_local(local->debug_id, why, r, u); in __rxrpc_use_local()
1262 r = refcount_read(&local->ref); in rxrpc_see_local()
1263 u = atomic_read(&local->active_users); in rxrpc_see_local()
1264 trace_rxrpc_local(local->debug_id, why, r, u); in rxrpc_see_local()
1295 rxrpc_serial_t serial, enum rxrpc_propose_ack_trace why);
1351 rxrpc_abort_call(call, sp->hdr.seq, abort_code, -EPROTO, why); in rxrpc_abort_eproto()
1352 return -EPROTO; in rxrpc_abort_eproto()
1416 #define rxrpc_inc_stat(rxnet, s) atomic_inc(&(rxnet)->s)
1417 #define rxrpc_dec_stat(rxnet, s) atomic_dec(&(rxnet)->s)
1447 return (s32)(seq1 - seq2) < 0; in before()
1451 return (s32)(seq1 - seq2) <= 0; in before_eq()
1455 return (s32)(seq1 - seq2) > 0; in after()
1459 return (s32)(seq1 - seq2) >= 0; in after_eq()
1474 return (seq & (RXRPC_NR_TXQUEUE - 1)) == tq->qbase; in rxrpc_seq_in_txq()
1480 __skb_queue_tail(&call->rx_queue, skb); in rxrpc_queue_rx_call_packet()
1489 int winsize = umin(call->tx_winsize, call->cong_cwnd + call->cong_extra); in rxrpc_tx_window_space()
1490 int transmitted = call->tx_top - call->tx_bottom; in rxrpc_tx_window_space()
1492 return max(winsize - transmitted, 0); in rxrpc_tx_window_space()
1497 return call->acks_nr_sacks + call->tx_nr_lost; in rxrpc_left_out()
1506 return call->tx_nr_sent - rxrpc_left_out(call) + call->tx_nr_resent; in rxrpc_tx_in_flight()
1515 printk("[%-6.6s] "FMT"\n", current->comm ,##__VA_ARGS__)
1574 pr_err("Assertion failed - %lu(0x%lx) %s %lu(0x%lx) is false\n", \
1594 pr_err("Assertion failed - %lu(0x%lx) %s %lu(0x%lx) is false\n", \