net/tipc/link.c
Source file repositories/reference/linux-study-clean/net/tipc/link.c
File Facts
- System
- Linux kernel
- Corpus path
net/tipc/link.c- Extension
.c- Size
- 83799 bytes
- Lines
- 2987
- 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
core.hsubscr.hlink.hbcast.hsocket.hname_distr.hdiscover.hnetlink.hmonitor.htrace.hcrypto.hlinux/pkt_sched.h
Detected Declarations
struct tipc_statsstruct tipc_linkstruct nla_mapstruct nla_mapfunction tipc_link_is_upfunction tipc_link_peer_is_downfunction tipc_link_is_resetfunction tipc_link_is_establishingfunction tipc_link_is_synchingfunction tipc_link_is_failingoverfunction tipc_link_is_blockedfunction link_is_bc_sndlinkfunction link_is_bc_rcvlinkfunction tipc_link_set_activefunction tipc_link_idfunction tipc_link_min_winfunction tipc_link_max_winfunction tipc_link_priofunction tipc_link_tolerancefunction tipc_link_planefunction tipc_link_update_capsfunction tipc_link_add_bc_peerfunction tipc_link_remove_bc_peerfunction tipc_link_bc_peersfunction link_bc_rcv_gapfunction tipc_link_set_mtufunction tipc_link_mtufunction tipc_link_mssfunction tipc_link_rcv_nxtfunction tipc_link_ackedfunction tipc_link_statefunction tipc_link_createfunction tipc_link_bc_createfunction tipc_link_fsm_evtfunction link_profile_statsfunction tipc_link_too_silentfunction tipc_link_timeoutfunction link_schedule_userfunction link_prepare_wakeupfunction skb_queue_walk_safefunction tipc_link_set_skb_retransmit_timefunction tipc_link_resetfunction tipc_link_xmitfunction tipc_link_update_cwinfunction tipc_link_advance_backlogfunction link_retransmit_failurefunction tipc_data_inputfunction tipc_link_input
Annotated Snippet
struct tipc_stats {
u32 sent_pkts;
u32 recv_pkts;
u32 sent_states;
u32 recv_states;
u32 sent_probes;
u32 recv_probes;
u32 sent_nacks;
u32 recv_nacks;
u32 sent_acks;
u32 sent_bundled;
u32 sent_bundles;
u32 recv_bundled;
u32 recv_bundles;
u32 retransmitted;
u32 sent_fragmented;
u32 sent_fragments;
u32 recv_fragmented;
u32 recv_fragments;
u32 link_congs; /* # port sends blocked by congestion */
u32 deferred_recv;
u32 duplicates;
u32 max_queue_sz; /* send queue size high water mark */
u32 accu_queue_sz; /* used for send queue size profiling */
u32 queue_sz_counts; /* used for send queue size profiling */
u32 msg_length_counts; /* used for message length profiling */
u32 msg_lengths_total; /* used for message length profiling */
u32 msg_length_profile[7]; /* used for msg. length profiling */
};
/**
* struct tipc_link - TIPC link data structure
* @addr: network address of link's peer node
* @name: link name character string
* @net: pointer to namespace struct
* @peer_session: link session # being used by peer end of link
* @peer_bearer_id: bearer id used by link's peer endpoint
* @bearer_id: local bearer id used by link
* @tolerance: minimum link continuity loss needed to reset link [in ms]
* @abort_limit: # of unacknowledged continuity probes needed to reset link
* @state: current state of link FSM
* @peer_caps: bitmap describing capabilities of peer node
* @silent_intv_cnt: # of timer intervals without any reception from peer
* @priority: current link priority
* @net_plane: current link network plane ('A' through 'H')
* @mon_state: cookie with information needed by link monitor
* @mtu: current maximum packet size for this link
* @advertised_mtu: advertised own mtu when link is being established
* @backlogq: queue for messages waiting to be sent
* @ackers: # of peers that needs to ack each packet before it can be released
* @acked: # last packet acked by a certain peer. Used for broadcast.
* @rcv_nxt: next sequence number to expect for inbound messages
* @inputq: buffer queue for messages to be delivered upwards
* @namedq: buffer queue for name table messages to be delivered upwards
* @wakeupq: linked list of wakeup msgs waiting for link congestion to abate
* @reasm_buf: head of partially reassembled inbound message fragments
* @stats: collects statistics regarding link activity
* @session: session to be used by link
* @snd_nxt_state: next send seq number
* @rcv_nxt_state: next rcv seq number
* @in_session: have received ACTIVATE_MSG from peer
* @active: link is active
* @if_name: associated interface name
* @rst_cnt: link reset counter
* @drop_point: seq number for failover handling (FIXME)
* @failover_reasm_skb: saved failover msg ptr (FIXME)
* @failover_deferdq: deferred message queue for failover processing (FIXME)
* @transmq: the link's transmit queue
* @backlog: link's backlog by priority (importance)
* @snd_nxt: next sequence number to be used
* @rcv_unacked: # messages read by user, but not yet acked back to peer
* @deferdq: deferred receive queue
* @window: sliding window size for congestion handling
* @min_win: minimal send window to be used by link
* @ssthresh: slow start threshold for congestion handling
* @max_win: maximal send window to be used by link
* @cong_acks: congestion acks for congestion avoidance (FIXME)
* @checkpoint: seq number for congestion window size handling
* @reasm_tnlmsg: fragmentation/reassembly area for tunnel protocol message
* @last_gap: last gap ack blocks for bcast (FIXME)
* @last_ga: ptr to gap ack blocks
* @bc_rcvlink: the peer specific link used for broadcast reception
* @bc_sndlink: the namespace global link used for broadcast sending
* @nack_state: bcast nack state
* @bc_peer_is_up: peer has acked the bcast init msg
*/
struct tipc_link {
u32 addr;
char name[TIPC_MAX_LINK_NAME];
struct net *net;
Annotation
- Immediate include surface: `core.h`, `subscr.h`, `link.h`, `bcast.h`, `socket.h`, `name_distr.h`, `discover.h`, `netlink.h`.
- Detected declarations: `struct tipc_stats`, `struct tipc_link`, `struct nla_map`, `struct nla_map`, `function tipc_link_is_up`, `function tipc_link_peer_is_down`, `function tipc_link_is_reset`, `function tipc_link_is_establishing`, `function tipc_link_is_synching`, `function tipc_link_is_failingover`.
- 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.