Lines Matching +full:max +full:- +full:rx +full:- +full:timeout +full:- +full:ms

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 */
165 struct rb_root calls; /* User ID -> call mapping */
187 * CPU-byteorder normalised Rx packet header.
192 u32 callNumber; /* call ID (0 for connection-level packets) */
197 u8 userStatus; /* app-layer defined status */
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
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[] */
399 unsigned int pmtud_bad; /* Smallest non-working MTU probe we've tried */
403 u8 pmtud_jumbo; /* Max jumbo packets for the MTU */
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 */
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 */
512 struct rb_node local_node; /* Node in local->client_conns */
516 struct rxrpc_connection *conns[4]; /* The connections in the bundle (max 4) */
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 */
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 */
598 u8 bundle_shift; /* Index into bundle->avail_chans */
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 */
625 RXRPC_CALL_TX_ALL_ACKED, /* Last packet has been hard-acked */
628 RXRPC_CALL_RETRANS_TIMEOUT, /* Retransmission due to timeout occurred */
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
685 RXRPC_CALL_RACKTIMER_TLP_PTO, /* TLP timeout */
686 RXRPC_CALL_RACKTIMER_RTO, /* Retransmission timeout */
691 * - matched by { connection, call_id }
712 u32 next_rx_timo; /* Timeout for next Rx packet (ms) */
713 u32 next_req_timo; /* Timeout for next Rx request packet (ms) */
716 struct work_struct destroyer; /* In-process-context destroyer */
717 rxrpc_notify_rx_t notify_rx; /* kernel service Rx notification function */
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 */
747 u32 security_enctype; /* Security-specific encoding type (or 0) */
764 u16 tx_backoff; /* Delay to insert due to Tx failure (ms) */
781 u8 rx_winsize; /* Size of Rx window */
783 /* TCP-style slow-start congestion control [RFC5681]. Since the SMSS
792 u16 cong_ssthresh; /* Slow-start threshold */
797 /* RACK-TLP [RFC8985] state. */
814 ktime_t tlp_max_ack_delay; /* Sender budget for max delayed ACK interval */
816 /* Receive-phase ACK management (ACKs we send). */
825 /* SACK table for soft-acked packets */
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). */
855 u32 rto_us; /* Retransmission timeout in usec */
856 u8 backoff; /* Backoff timeout (as shift) */
871 bool retrans_timeo:1; /* T if reTx due to timeout happened */
881 * sendmsg() cmsg-specified parameters.
895 u32 idle; /* Max time since last data packet (msec) */
896 u32 normal; /* Max time since last call packet (msec) */
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)
994 serial = conn->tx_serial; in rxrpc_get_next_serial()
997 conn->tx_serial = serial + 1; in rxrpc_get_next_serial()
1009 serial = conn->tx_serial; in rxrpc_get_next_serials()
1012 conn->tx_serial = serial + n; in rxrpc_get_next_serials()
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()
1357 void rxrpc_add_pending_oob(struct rxrpc_sock *rx, struct sk_buff *skb);
1358 int rxrpc_sendmsg_oob(struct rxrpc_sock *rx, struct msghdr *msg, size_t len);
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", \