Lines Matching full:peer

2 /* Peer event handling, typically ICMP messages.
26 * Find the peer associated with a local error.
103 static void rxrpc_adjust_mtu(struct rxrpc_peer *peer, unsigned int mtu) in rxrpc_adjust_mtu() argument
108 if (mtu > 0 && peer->if_mtu == 65535 && mtu < peer->if_mtu) in rxrpc_adjust_mtu()
109 peer->if_mtu = mtu; in rxrpc_adjust_mtu()
113 mtu = peer->if_mtu; in rxrpc_adjust_mtu()
120 if (mtu < peer->hdrsize) in rxrpc_adjust_mtu()
121 mtu = peer->hdrsize + 4; in rxrpc_adjust_mtu()
125 max_data = max_t(int, mtu - peer->hdrsize, 500); in rxrpc_adjust_mtu()
126 if (max_data < peer->max_data) { in rxrpc_adjust_mtu()
127 if (peer->pmtud_good > max_data) in rxrpc_adjust_mtu()
128 peer->pmtud_good = max_data; in rxrpc_adjust_mtu()
129 if (peer->pmtud_bad > max_data + 1) in rxrpc_adjust_mtu()
130 peer->pmtud_bad = max_data + 1; in rxrpc_adjust_mtu()
132 trace_rxrpc_pmtud_reduce(peer, 0, max_data, rxrpc_pmtud_reduce_icmp); in rxrpc_adjust_mtu()
133 peer->max_data = max_data; in rxrpc_adjust_mtu()
144 struct rxrpc_peer *peer = NULL; in rxrpc_input_error() local
154 peer = rxrpc_lookup_peer_local_rcu(local, skb, &srx); in rxrpc_input_error()
155 if (peer && !rxrpc_get_peer_maybe(peer, rxrpc_peer_get_input_error)) in rxrpc_input_error()
156 peer = NULL; in rxrpc_input_error()
158 if (!peer) in rxrpc_input_error()
161 trace_rxrpc_rx_icmp(peer, &serr->ee, &srx); in rxrpc_input_error()
166 rxrpc_adjust_mtu(peer, serr->ee.ee_info); in rxrpc_input_error()
173 rxrpc_adjust_mtu(peer, serr->ee.ee_info); in rxrpc_input_error()
177 rxrpc_store_error(peer, skb); in rxrpc_input_error()
179 rxrpc_put_peer(peer, rxrpc_peer_put_input_error); in rxrpc_input_error()
183 * Map an error report to error codes on the peer record.
185 static void rxrpc_store_error(struct rxrpc_peer *peer, struct sk_buff *skb) in rxrpc_store_error() argument
209 rxrpc_distribute_error(peer, skb, compl, err); in rxrpc_store_error()
213 * Distribute an error that occurred on a peer.
215 static void rxrpc_distribute_error(struct rxrpc_peer *peer, struct sk_buff *skb, in rxrpc_distribute_error() argument
221 spin_lock_irq(&peer->lock); in rxrpc_distribute_error()
222 hlist_move_list(&peer->error_targets, &error_targets); in rxrpc_distribute_error()
228 spin_unlock_irq(&peer->lock); in rxrpc_distribute_error()
234 spin_lock_irq(&peer->lock); in rxrpc_distribute_error()
237 spin_unlock_irq(&peer->lock); in rxrpc_distribute_error()
248 struct rxrpc_peer *peer; in rxrpc_peer_keepalive_dispatch() local
257 peer = list_entry(collector->next, in rxrpc_peer_keepalive_dispatch()
260 list_del_init(&peer->keepalive_link); in rxrpc_peer_keepalive_dispatch()
261 if (!rxrpc_get_peer_maybe(peer, rxrpc_peer_get_keepalive)) in rxrpc_peer_keepalive_dispatch()
264 use = __rxrpc_use_local(peer->local, rxrpc_local_use_peer_keepalive); in rxrpc_peer_keepalive_dispatch()
268 keepalive_at = peer->last_tx_at + RXRPC_KEEPALIVE_TIME; in rxrpc_peer_keepalive_dispatch()
270 _debug("%02x peer %u t=%d {%pISp}", in rxrpc_peer_keepalive_dispatch()
271 cursor, peer->debug_id, slot, &peer->srx.transport); in rxrpc_peer_keepalive_dispatch()
275 rxrpc_send_keepalive(peer); in rxrpc_peer_keepalive_dispatch()
279 /* A transmission to this peer occurred since last we in rxrpc_peer_keepalive_dispatch()
286 list_add_tail(&peer->keepalive_link, in rxrpc_peer_keepalive_dispatch()
289 rxrpc_unuse_local(peer->local, rxrpc_local_unuse_peer_keepalive); in rxrpc_peer_keepalive_dispatch()
291 rxrpc_put_peer(peer, rxrpc_peer_put_keepalive); in rxrpc_peer_keepalive_dispatch()
370 struct rxrpc_peer *peer = conn->peer; in rxrpc_input_probe_for_pmtud() local
371 unsigned int max_data = peer->max_data; in rxrpc_input_probe_for_pmtud()
374 good = peer->pmtud_good; in rxrpc_input_probe_for_pmtud()
375 trial = peer->pmtud_trial; in rxrpc_input_probe_for_pmtud()
376 bad = peer->pmtud_bad; in rxrpc_input_probe_for_pmtud()
379 peer->pmtud_lost = false; in rxrpc_input_probe_for_pmtud()
383 if (!peer->pmtud_probing) in rxrpc_input_probe_for_pmtud()
388 if (!peer->pmtud_lost) { in rxrpc_input_probe_for_pmtud()
391 peer->pmtud_lost = true; in rxrpc_input_probe_for_pmtud()
397 peer->pmtud_bad = bad; in rxrpc_input_probe_for_pmtud()
403 peer->pmtud_good = good; in rxrpc_input_probe_for_pmtud()
408 max_data = umin(max_data, peer->ackr_max_data); in rxrpc_input_probe_for_pmtud()
409 if (max_data != peer->max_data) in rxrpc_input_probe_for_pmtud()
410 peer->max_data = max_data; in rxrpc_input_probe_for_pmtud()
414 peer->pmtud_jumbo = jumbo; in rxrpc_input_probe_for_pmtud()
418 peer->pmtud_lost = false; in rxrpc_input_probe_for_pmtud()
436 peer->pmtud_trial = trial; in rxrpc_input_probe_for_pmtud()
442 peer->pmtud_pending = true; in rxrpc_input_probe_for_pmtud()