net/rxrpc/conn_object.c
Source file repositories/reference/linux-study-clean/net/rxrpc/conn_object.c
File Facts
- System
- Linux kernel
- Corpus path
net/rxrpc/conn_object.c- Extension
.c- Size
- 12865 bytes
- Lines
- 496
- Domain
- Networking Core
- Bucket
- Sockets, Protocols, Packet Path, And Network Policy
- Inferred role
- Networking Core: implementation source
- Status
- source implementation candidate
Why This File Exists
Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/slab.hlinux/net.hlinux/skbuff.har-internal.h
Detected Declarations
function rxrpc_poke_connfunction rxrpc_connection_timerfunction __rxrpc_disconnect_callfunction rxrpc_disconnect_callfunction rxrpc_queue_connfunction rxrpc_see_connectionfunction rxrpc_get_connection_maybefunction rxrpc_set_service_reap_timerfunction rxrpc_rcu_free_connectionfunction rxrpc_clean_up_connectionfunction rxrpc_put_connectionfunction rxrpc_service_connection_reaperfunction rxrpc_destroy_all_connections
Annotated Snippet
switch (call->completion) {
case RXRPC_CALL_SUCCEEDED:
chan->last_seq = call->rx_highest_seq;
chan->last_type = RXRPC_PACKET_TYPE_ACK;
break;
case RXRPC_CALL_LOCALLY_ABORTED:
chan->last_abort = call->abort_code;
chan->last_type = RXRPC_PACKET_TYPE_ABORT;
break;
default:
chan->last_abort = RX_CALL_DEAD;
chan->last_type = RXRPC_PACKET_TYPE_ABORT;
break;
}
chan->last_call = chan->call_id;
chan->call_id = chan->call_counter;
chan->call = NULL;
}
_leave("");
}
/*
* Disconnect a call and clear any channel it occupies when that call
* terminates.
*/
void rxrpc_disconnect_call(struct rxrpc_call *call)
{
struct rxrpc_connection *conn = call->conn;
set_bit(RXRPC_CALL_DISCONNECTED, &call->flags);
rxrpc_see_call(call, rxrpc_call_see_disconnected);
call->peer->cong_ssthresh = call->cong_ssthresh;
if (!hlist_unhashed(&call->error_link)) {
spin_lock_irq(&call->peer->lock);
hlist_del_init(&call->error_link);
spin_unlock_irq(&call->peer->lock);
}
if (rxrpc_is_client_call(call)) {
rxrpc_disconnect_client_call(call->bundle, call);
} else {
__rxrpc_disconnect_call(conn, call);
conn->idle_timestamp = jiffies;
if (atomic_dec_and_test(&conn->active))
rxrpc_set_service_reap_timer(conn->rxnet,
jiffies + rxrpc_connection_expiry * HZ);
}
rxrpc_put_call(call, rxrpc_call_put_io_thread);
}
/*
* Queue a connection's work processor, getting a ref to pass to the work
* queue.
*/
void rxrpc_queue_conn(struct rxrpc_connection *conn, enum rxrpc_conn_trace why)
{
if (atomic_read(&conn->active) >= 0 &&
rxrpc_queue_work(&conn->processor))
rxrpc_see_connection(conn, why);
}
/*
* Note the re-emergence of a connection.
*/
void rxrpc_see_connection(struct rxrpc_connection *conn,
enum rxrpc_conn_trace why)
{
if (conn) {
int r = refcount_read(&conn->ref);
trace_rxrpc_conn(conn->debug_id, r, why);
}
}
/*
* Get a ref on a connection.
*/
struct rxrpc_connection *rxrpc_get_connection(struct rxrpc_connection *conn,
enum rxrpc_conn_trace why)
{
int r;
__refcount_inc(&conn->ref, &r);
trace_rxrpc_conn(conn->debug_id, r + 1, why);
return conn;
Annotation
- Immediate include surface: `linux/module.h`, `linux/slab.h`, `linux/net.h`, `linux/skbuff.h`, `ar-internal.h`.
- Detected declarations: `function rxrpc_poke_conn`, `function rxrpc_connection_timer`, `function __rxrpc_disconnect_call`, `function rxrpc_disconnect_call`, `function rxrpc_queue_conn`, `function rxrpc_see_connection`, `function rxrpc_get_connection_maybe`, `function rxrpc_set_service_reap_timer`, `function rxrpc_rcu_free_connection`, `function rxrpc_clean_up_connection`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.