Lines Matching +full:serial +full:- +full:id

1 /* SPDX-License-Identifier: GPL-2.0-or-later */
15 #include <keys/rxrpc-type.h>
37 * Mark applied to socket buffers in skb->mark. skb->priority is used
46 RXRPC_SKB_MARK_REJECT_ABORT, /* Reject with ABORT (code in skb->priority) */
47 RXRPC_SKB_MARK_REJECT_CONN_ABORT, /* Reject with connection ABORT (code in skb->priority) */
65 * Per-network namespace data.
69 u32 epoch; /* Local epoch for detecting local-end reset */
71 spinlock_t call_lock; /* Lock for ->calls */
78 rwlock_t conn_lock; /* Lock for ->conn_proc_list, ->service_conns */
87 struct mutex local_mutex; /* Lock for ->local_endpoints */
90 spinlock_t peer_hash_lock; /* Lock for ->peer_hash */
157 u64 oob_id_counter; /* OOB message ID counter */
165 struct rb_root calls; /* User ID -> call mapping */
176 u16 from; /* Service ID to upgrade (if not 0) */
177 u16 to; /* service ID to upgrade to */
187 * CPU-byteorder normalised Rx packet header.
191 u32 cid; /* connection and channel ID */
192 u32 callNumber; /* call ID (0 for connection-level packets) */
194 u32 serial; /* serial number of pkt sent to network */ member
197 u8 userStatus; /* app-layer defined status */
198 u8 securityIndex; /* security protocol ID */
203 u16 serviceId; /* service ID */
208 * - max 48 bytes (struct sk_buff::cb)
243 #define rxrpc_skb(__skb) ((struct rxrpc_skb_priv *) &(__skb)->cb)
318 /* Default ticket -> key decoder */
326 * - owned by a single AF_RXRPC socket
327 * - pointed to by transport socket struct sk_user_data
358 int debug_id; /* debug ID for printks */
363 spinlock_t client_call_lock; /* Lock for ->new_client_calls */
378 * - matched by local endpoint, remote port, address and protocol type
388 struct list_head keepalive_link; /* Link in net->peer_keepalive[] */
393 int debug_id; /* debug ID for printks */
399 unsigned int pmtud_bad; /* Smallest non-working MTU probe we've tried */
404 bool ackr_adv_pmtud; /* T if the peer advertises path-MTU */
406 unsigned int if_mtu; /* Local interface MTU (- hdrsize) for this peer */
415 u8 cong_ssthresh; /* Congestion slow-start threshold */
425 u32 cid; /* connection ID */
436 bool upgrade; /* T if service ID can be upgraded */
437 u16 service_id; /* Service ID for this connection */
445 RXRPC_CALL_SUCCEEDED, /* - Normal termination */
446 RXRPC_CALL_REMOTELY_ABORTED, /* - call aborted by peer */
447 RXRPC_CALL_LOCALLY_ABORTED, /* - call aborted locally on error or close */
448 RXRPC_CALL_LOCAL_ERROR, /* - call failed due to local error */
449 RXRPC_CALL_NETWORK_ERROR, /* - call terminated by network error */
457 RXRPC_CONN_IN_SERVICE_CONNS, /* Conn is in peer->service_conns */
501 struct list_head proc_link; /* Link in net->bundle_proc_list */
507 u16 service_id; /* Service ID for this connection */
510 bool upgrade; /* T if service ID can be upgraded */
512 struct rb_node local_node; /* Node in local->client_conns */
521 * - matched by { local, peer, epoch, conn_id, direction }
522 * - each connection can only handle four simultaneous calls
530 struct list_head attend_link; /* Link in local->conn_attend_q */
541 unsigned int call_debug_id; /* call->debug_id */
542 u32 call_id; /* ID of current call */
543 u32 call_counter; /* Call ID counter */
544 u32 last_call; /* ID of last call */
554 struct work_struct destructor; /* In-process-context destroyer */
556 struct rb_node service_node; /* Node in peer->service_conns */
559 struct sk_buff_head rx_queue; /* received conn-level packets */
569 u32 nonce; /* response re-use preventer */
572 struct rxgk_context *keys[4]; /* (Re-)keying buffer */
574 u8 nonce[20]; /* Response re-use preventer */
585 spinlock_t state_lock; /* state-change lock */
589 int debug_id; /* debug ID for printks */
590 rxrpc_serial_t tx_serial; /* Outgoing packet serial number counter */
591 unsigned int hi_serial; /* highest serial number received */
592 rxrpc_serial_t pmtud_probe; /* Serial of MTU probe (or 0) */
593 unsigned int pmtud_call; /* ID of call used for probe */
594 u32 service_id; /* Service ID, possibly upgraded */
598 u8 bundle_shift; /* Index into bundle->avail_chans */
600 bool upgrade; /* T if service ID can be upgraded */
601 u16 orig_service_id; /* Originally requested service ID */
607 return sp->hdr.flags & RXRPC_CLIENT_INITIATED; in rxrpc_to_server()
616 * Flags in call->flags.
619 RXRPC_CALL_RELEASED, /* call has been released - no more message to userspace */
620 RXRPC_CALL_HAS_USERID, /* has a user ID attached */
625 RXRPC_CALL_TX_ALL_ACKED, /* Last packet has been hard-acked */
634 RXRPC_CALL_EXCLUSIVE, /* The call uses a once-only connection */
635 RXRPC_CALL_RX_IS_IDLE, /* recvmsg() is idle - send an ACK */
653 RXRPC_CALL_CLIENT_AWAIT_CONN, /* - client waiting for connection to become available */
654 RXRPC_CALL_CLIENT_SEND_REQUEST, /* - client sending request phase */
655 RXRPC_CALL_CLIENT_AWAIT_REPLY, /* - client awaiting reply */
656 RXRPC_CALL_CLIENT_RECV_REPLY, /* - client receiving reply phase */
657 RXRPC_CALL_SERVER_PREALLOC, /* - service preallocation */
658 RXRPC_CALL_SERVER_RECV_REQUEST, /* - server receiving request */
659 RXRPC_CALL_SERVER_ACK_REQUEST, /* - server pending ACK of request */
660 RXRPC_CALL_SERVER_SEND_REPLY, /* - server sending reply */
661 RXRPC_CALL_SERVER_AWAIT_ACK, /* - server awaiting final ACK */
662 RXRPC_CALL_COMPLETE, /* - call complete */
678 * Current purpose of call RACK timer. According to the RACK-TLP protocol
679 * [RFC8985], the transmission timer (call->rack_timo_at) may only be used for
691 * - matched by { connection, call_id }
716 struct work_struct destroyer; /* In-process-context destroyer */
719 struct list_head wait_link; /* Link in local->new_client_calls */
721 struct list_head accept_link; /* Link in rx->acceptq */
722 struct list_head recvmsg_link; /* Link in rx->recvmsg_q */
723 struct list_head sock_link; /* Link in rx->sock_calls */
724 struct rb_node sock_node; /* Node in rx->calls */
725 struct list_head attend_link; /* Link in local->call_attend_q */
728 s64 tx_total_len; /* Total length left to be transmitted (or -1) */
729 unsigned long user_call_ID; /* user-defined call ID */
744 u32 call_id; /* call ID on connection */
745 u32 cid; /* connection ID plus channel index */
747 u32 security_enctype; /* Security-specific encoding type (or 0) */
748 int debug_id; /* debug ID for printks */
763 rxrpc_serial_t tx_last_serial; /* Serial of last DATA transmitted */
780 rxrpc_serial_t rx_serial; /* Highest serial received for this call */
783 /* TCP-style slow-start congestion control [RFC5681]. Since the SMSS
792 u16 cong_ssthresh; /* Slow-start threshold */
797 /* RACK-TLP [RFC8985] state. */
811 rxrpc_serial_t tlp_serial; /* Serial of TLP probe (or 0 if none in progress) */
816 /* Receive-phase ACK management (ACKs we send). */
825 /* SACK table for soft-acked packets */
830 rxrpc_serial_t rtt_serial[4]; /* Serial number of DATA or PING sent */
832 unsigned long rtt_avail; /* Mask of available slots in bits 0-3,
833 * Mask of pending samples in 8-11 */
837 /* Transmission-phase ACK management (ACKs we've received). */
842 rxrpc_serial_t acks_highest_serial; /* Highest serial number ACK'd */
863 rxrpc_serial_t ack_serial; /* Serial number of ACK */
864 rxrpc_serial_t acked_serial; /* Serial number ACK'd */
881 * sendmsg() cmsg-specified parameters.
892 unsigned long user_call_ID; /* User's call ID */
917 rxrpc_serial_t serial; /* Last serial number transmitted with */ member
931 bool jumboable; /* Can be non-terminal jumbo subpacket */
937 return txb->flags & RXRPC_CLIENT_INITIATED; in rxrpc_sending_to_server()
946 * Transmit queue element, including RACK [RFC8985] per-segment metadata. The
955 unsigned long segment_acked; /* Bit-per-buf: Set if ACK'd */
956 unsigned long segment_lost; /* Bit-per-buf: Set if declared lost */
957 unsigned long segment_retransmitted; /* Bit-per-buf: Set if retransmitted */
958 unsigned long rtt_samples; /* Bit-per-buf: Set if available for RTT */
959 unsigned long ever_retransmitted; /* Bit-per-buf: Set if ever retransmitted */
964 #define RXRPC_TXQ_MASK (RXRPC_NR_TXQUEUE - 1)
988 * Allocate the next serial number on a connection. 0 must be skipped.
992 rxrpc_serial_t serial; in rxrpc_get_next_serial() local
994 serial = conn->tx_serial; in rxrpc_get_next_serial()
995 if (serial == 0) in rxrpc_get_next_serial()
996 serial = 1; in rxrpc_get_next_serial()
997 conn->tx_serial = serial + 1; in rxrpc_get_next_serial()
998 return serial; in rxrpc_get_next_serial()
1002 * Allocate the next serial n numbers on a connection. 0 must be skipped.
1007 rxrpc_serial_t serial; in rxrpc_get_next_serials() local
1009 serial = conn->tx_serial; in rxrpc_get_next_serials()
1010 if (serial + n <= n) in rxrpc_get_next_serials()
1011 serial = 1; in rxrpc_get_next_serials()
1012 conn->tx_serial = serial + n; in rxrpc_get_next_serials()
1013 return serial; in rxrpc_get_next_serials()
1037 void rxrpc_propose_ping(struct rxrpc_call *call, u32 serial,
1060 __releases(&rx->sk.sk_lock)
1061 __acquires(&call->user_mutex);
1076 return test_bit(RXRPC_CALL_IS_SERVICE, &call->flags); in rxrpc_is_service_call()
1100 /* Order write of completion info before write of ->state. */ in rxrpc_set_call_state()
1101 smp_store_release(&call->_state, state); in rxrpc_set_call_state()
1102 wake_up(&call->waitq); in rxrpc_set_call_state()
1107 return call->_state; /* Only inside I/O thread */ in __rxrpc_call_state()
1117 /* Order read ->state before read of completion info. */ in rxrpc_call_state()
1118 return smp_load_acquire(&call->_state); in rxrpc_call_state()
1128 return rxrpc_call_is_complete(call) && call->completion != RXRPC_CALL_SUCCEEDED; in rxrpc_call_has_failed()
1164 return smp_load_acquire(&conn->state) == RXRPC_CONN_ABORTED; in rxrpc_is_conn_aborted()
1193 return conn->out_clientflag; in rxrpc_conn_is_client()
1204 timer_reduce(&conn->timer, expire_at); in rxrpc_reduce_conn_timer()
1245 call->tlp_serial = 0; in rxrpc_tlp_init()
1246 call->tlp_seq = call->acks_hard_ack; in rxrpc_tlp_init()
1247 call->tlp_is_retrans = false; in rxrpc_tlp_init()
1263 if (!local->io_thread) in rxrpc_wake_up_io_thread()
1265 wake_up_process(READ_ONCE(local->io_thread)); in rxrpc_wake_up_io_thread()
1270 return rxrpc_direct_abort(skb, why, RX_PROTOCOL_ERROR, -EPROTO); in rxrpc_protocol_error()
1313 r = refcount_read(&local->ref); in __rxrpc_use_local()
1314 u = atomic_fetch_add_unless(&local->active_users, 1, 0); in __rxrpc_use_local()
1315 trace_rxrpc_local(local->debug_id, why, r, u); in __rxrpc_use_local()
1324 r = refcount_read(&local->ref); in rxrpc_see_local()
1325 u = atomic_read(&local->active_users); in rxrpc_see_local()
1326 trace_rxrpc_local(local->debug_id, why, r, u); in rxrpc_see_local()
1365 rxrpc_serial_t serial, enum rxrpc_propose_ack_trace why);
1423 rxrpc_abort_call(call, sp->hdr.seq, abort_code, -EPROTO, why); in rxrpc_abort_eproto()
1424 return -EPROTO; in rxrpc_abort_eproto()
1493 #define rxrpc_inc_stat(rxnet, s) atomic_inc(&(rxnet)->s)
1494 #define rxrpc_dec_stat(rxnet, s) atomic_dec(&(rxnet)->s)
1523 return (s32)(seq1 - seq2) < 0; in before()
1527 return (s32)(seq1 - seq2) <= 0; in before_eq()
1531 return (s32)(seq1 - seq2) > 0; in after()
1535 return (s32)(seq1 - seq2) >= 0; in after_eq()
1550 return (seq & (RXRPC_NR_TXQUEUE - 1)) == tq->qbase; in rxrpc_seq_in_txq()
1556 __skb_queue_tail(&call->rx_queue, skb); in rxrpc_queue_rx_call_packet()
1565 int winsize = umin(call->tx_winsize, call->cong_cwnd + call->cong_extra); in rxrpc_tx_window_space()
1566 int transmitted = call->tx_top - call->tx_bottom; in rxrpc_tx_window_space()
1568 return max(winsize - transmitted, 0); in rxrpc_tx_window_space()
1573 return call->acks_nr_sacks + call->tx_nr_lost; in rxrpc_left_out()
1582 return call->tx_nr_sent - rxrpc_left_out(call) + call->tx_nr_resent; in rxrpc_tx_in_flight()
1591 printk("[%-6.6s] "FMT"\n", current->comm ,##__VA_ARGS__)
1650 pr_err("Assertion failed - %lu(0x%lx) %s %lu(0x%lx) is false\n", \
1670 pr_err("Assertion failed - %lu(0x%lx) %s %lu(0x%lx) is false\n", \