net/tipc/group.c
Source file repositories/reference/linux-study-clean/net/tipc/group.c
File Facts
- System
- Linux kernel
- Corpus path
net/tipc/group.c- Extension
.c- Size
- 24462 bytes
- Lines
- 964
- 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.
- 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.haddr.hgroup.hbcast.htopsrv.hmsg.hsocket.hnode.hname_table.hsubscr.h
Detected Declarations
struct tipc_memberstruct tipc_groupenum mbr_statefunction tipc_group_openfunction tipc_group_decr_activefunction tipc_group_rcvbuf_limitfunction tipc_group_bc_snd_nxtfunction tipc_group_is_receiverfunction tipc_group_is_senderfunction tipc_group_excludefunction tipc_group_joinfunction tipc_group_deletefunction rbtree_postorder_for_each_entry_safefunction tipc_group_add_to_treefunction tipc_group_add_memberfunction tipc_group_delete_memberfunction tipc_group_selffunction tipc_group_update_memberfunction tipc_group_update_bc_membersfunction tipc_group_congfunction tipc_group_bc_congfunction tipc_group_sort_msgfunction skb_queue_walk_safefunction tipc_group_filter_msgfunction tipc_group_update_rcv_winfunction tipc_group_create_eventfunction tipc_group_proto_xmitfunction tipc_group_proto_rcvfunction tipc_group_member_evtfunction tipc_group_fill_sock_diag
Annotated Snippet
struct tipc_member {
struct rb_node tree_node;
struct list_head list;
struct list_head small_win;
struct sk_buff_head deferredq;
struct tipc_group *group;
u32 node;
u32 port;
u32 instance;
enum mbr_state state;
u16 advertised;
u16 window;
u16 bc_rcv_nxt;
u16 bc_syncpt;
u16 bc_acked;
};
struct tipc_group {
struct rb_root members;
struct list_head small_win;
struct list_head pending;
struct list_head active;
struct tipc_nlist dests;
struct net *net;
int subid;
u32 type;
u32 instance;
u32 scope;
u32 portid;
u16 member_cnt;
u16 active_cnt;
u16 max_active;
u16 bc_snd_nxt;
u16 bc_ackers;
bool *open;
bool loopback;
bool events;
};
static void tipc_group_proto_xmit(struct tipc_group *grp, struct tipc_member *m,
int mtyp, struct sk_buff_head *xmitq);
static void tipc_group_open(struct tipc_member *m, bool *wakeup)
{
*wakeup = false;
if (list_empty(&m->small_win))
return;
list_del_init(&m->small_win);
*m->group->open = true;
*wakeup = true;
}
static void tipc_group_decr_active(struct tipc_group *grp,
struct tipc_member *m)
{
if (m->state == MBR_ACTIVE || m->state == MBR_RECLAIMING ||
m->state == MBR_REMITTED)
grp->active_cnt--;
}
static int tipc_group_rcvbuf_limit(struct tipc_group *grp)
{
int max_active, active_pool, idle_pool;
int mcnt = grp->member_cnt + 1;
/* Limit simultaneous reception from other members */
max_active = min(mcnt / 8, 64);
max_active = max(max_active, 16);
grp->max_active = max_active;
/* Reserve blocks for active and idle members */
active_pool = max_active * ADV_ACTIVE;
idle_pool = (mcnt - max_active) * ADV_IDLE;
/* Scale to bytes, considering worst-case truesize/msgsize ratio */
return (active_pool + idle_pool) * FLOWCTL_BLK_SZ * 4;
}
u16 tipc_group_bc_snd_nxt(struct tipc_group *grp)
{
return grp->bc_snd_nxt;
}
static bool tipc_group_is_receiver(struct tipc_member *m)
{
return m && m->state != MBR_JOINING && m->state != MBR_LEAVING;
}
static bool tipc_group_is_sender(struct tipc_member *m)
{
Annotation
- Immediate include surface: `core.h`, `addr.h`, `group.h`, `bcast.h`, `topsrv.h`, `msg.h`, `socket.h`, `node.h`.
- Detected declarations: `struct tipc_member`, `struct tipc_group`, `enum mbr_state`, `function tipc_group_open`, `function tipc_group_decr_active`, `function tipc_group_rcvbuf_limit`, `function tipc_group_bc_snd_nxt`, `function tipc_group_is_receiver`, `function tipc_group_is_sender`, `function tipc_group_exclude`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- Implementation status: source implementation candidate.
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.