Lines Matching +full:1 +full:- +full:wire

1 // SPDX-License-Identifier: GPL-2.0-or-later
11 #include "ar-internal.h"
26 INIT_LIST_HEAD(&txb->call_link); in rxrpc_alloc_txbuf()
27 INIT_LIST_HEAD(&txb->tx_link); in rxrpc_alloc_txbuf()
28 refcount_set(&txb->ref, 1); in rxrpc_alloc_txbuf()
29 txb->call_debug_id = call->debug_id; in rxrpc_alloc_txbuf()
30 txb->debug_id = atomic_inc_return(&rxrpc_txbuf_debug_ids); in rxrpc_alloc_txbuf()
31 txb->space = sizeof(txb->data); in rxrpc_alloc_txbuf()
32 txb->len = 0; in rxrpc_alloc_txbuf()
33 txb->offset = 0; in rxrpc_alloc_txbuf()
34 txb->flags = 0; in rxrpc_alloc_txbuf()
35 txb->ack_why = 0; in rxrpc_alloc_txbuf()
36 txb->seq = call->tx_prepared + 1; in rxrpc_alloc_txbuf()
37 txb->wire.epoch = htonl(call->conn->proto.epoch); in rxrpc_alloc_txbuf()
38 txb->wire.cid = htonl(call->cid); in rxrpc_alloc_txbuf()
39 txb->wire.callNumber = htonl(call->call_id); in rxrpc_alloc_txbuf()
40 txb->wire.seq = htonl(txb->seq); in rxrpc_alloc_txbuf()
41 txb->wire.type = packet_type; in rxrpc_alloc_txbuf()
42 txb->wire.flags = call->conn->out_clientflag; in rxrpc_alloc_txbuf()
43 txb->wire.userStatus = 0; in rxrpc_alloc_txbuf()
44 txb->wire.securityIndex = call->security_ix; in rxrpc_alloc_txbuf()
45 txb->wire._rsvd = 0; in rxrpc_alloc_txbuf()
46 txb->wire.serviceId = htons(call->dest_srx.srx_service); in rxrpc_alloc_txbuf()
48 trace_rxrpc_txbuf(txb->debug_id, in rxrpc_alloc_txbuf()
49 txb->call_debug_id, txb->seq, 1, in rxrpc_alloc_txbuf()
63 __refcount_inc(&txb->ref, &r); in rxrpc_get_txbuf()
64 trace_rxrpc_txbuf(txb->debug_id, txb->call_debug_id, txb->seq, r + 1, what); in rxrpc_get_txbuf()
69 int r = refcount_read(&txb->ref); in rxrpc_see_txbuf()
71 trace_rxrpc_txbuf(txb->debug_id, txb->call_debug_id, txb->seq, r, what); in rxrpc_see_txbuf()
78 trace_rxrpc_txbuf(txb->debug_id, txb->call_debug_id, txb->seq, 0, in rxrpc_free_txbuf()
92 debug_id = txb->debug_id; in rxrpc_put_txbuf()
93 call_debug_id = txb->call_debug_id; in rxrpc_put_txbuf()
94 seq = txb->seq; in rxrpc_put_txbuf()
95 dead = __refcount_dec_and_test(&txb->ref, &r); in rxrpc_put_txbuf()
96 trace_rxrpc_txbuf(debug_id, call_debug_id, seq, r - 1, what); in rxrpc_put_txbuf()
98 call_rcu(&txb->rcu, rxrpc_free_txbuf); in rxrpc_put_txbuf()
108 rxrpc_seq_t hard_ack = smp_load_acquire(&call->acks_hard_ack); in rxrpc_shrink_call_tx_buffer()
111 _enter("%x/%x/%x", call->tx_bottom, call->acks_hard_ack, call->tx_top); in rxrpc_shrink_call_tx_buffer()
113 while ((txb = list_first_entry_or_null(&call->tx_buffer, in rxrpc_shrink_call_tx_buffer()
115 hard_ack = smp_load_acquire(&call->acks_hard_ack); in rxrpc_shrink_call_tx_buffer()
116 if (before(hard_ack, txb->seq)) in rxrpc_shrink_call_tx_buffer()
119 if (txb->seq != call->tx_bottom + 1) in rxrpc_shrink_call_tx_buffer()
121 ASSERTCMP(txb->seq, ==, call->tx_bottom + 1); in rxrpc_shrink_call_tx_buffer()
122 smp_store_release(&call->tx_bottom, call->tx_bottom + 1); in rxrpc_shrink_call_tx_buffer()
123 list_del_rcu(&txb->call_link); in rxrpc_shrink_call_tx_buffer()
128 if (after(call->acks_hard_ack, call->tx_bottom + 128)) in rxrpc_shrink_call_tx_buffer()
133 wake_up(&call->waitq); in rxrpc_shrink_call_tx_buffer()