net/sctp/stream_sched_fc.c
Source file repositories/reference/linux-study-clean/net/sctp/stream_sched_fc.c
File Facts
- System
- Linux kernel
- Corpus path
net/sctp/stream_sched_fc.c- Extension
.c- Size
- 5729 bytes
- Lines
- 226
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/list.hnet/sctp/sctp.hnet/sctp/sm.hnet/sctp/stream_sched.h
Detected Declarations
function sctp_sched_wfq_setfunction sctp_sched_wfq_getfunction sctp_sched_fc_setfunction sctp_sched_fc_getfunction sctp_sched_fc_initfunction sctp_sched_fc_init_sidfunction sctp_sched_fc_free_sidfunction sctp_sched_fc_enqueuefunction sctp_sched_fc_dequeue_donefunction sctp_sched_fc_sched_allfunction sctp_sched_fc_unsched_allfunction sctp_sched_ops_fc_initfunction sctp_sched_ops_wfq_init
Annotated Snippet
if (pos->fc_length <= (U32_MAX >> 2)) {
pos->fc_length = 0;
continue;
}
pos->fc_length -= (U32_MAX >> 2);
}
}
soute->fc_length += ch->skb->len;
if (list_empty(&soute->outq)) {
list_del_init(&soute->fc_list);
return;
}
pos = soute;
list_for_each_entry_continue(pos, &stream->fc_list, fc_list)
if ((__u64)pos->fc_length * soute->fc_weight >=
(__u64)soute->fc_length * pos->fc_weight)
break;
list_move_tail(&soute->fc_list, &pos->fc_list);
}
static void sctp_sched_fc_sched_all(struct sctp_stream *stream)
{
struct sctp_association *asoc;
struct sctp_chunk *ch;
asoc = container_of(stream, struct sctp_association, stream);
list_for_each_entry(ch, &asoc->outqueue.out_chunk_list, list) {
__u16 sid = sctp_chunk_stream_no(ch);
if (SCTP_SO(stream, sid)->ext)
sctp_sched_fc_sched(stream, SCTP_SO(stream, sid)->ext);
}
}
static void sctp_sched_fc_unsched_all(struct sctp_stream *stream)
{
struct sctp_stream_out_ext *soute, *tmp;
list_for_each_entry_safe(soute, tmp, &stream->fc_list, fc_list)
list_del_init(&soute->fc_list);
}
static const struct sctp_sched_ops sctp_sched_fc = {
.set = sctp_sched_fc_set,
.get = sctp_sched_fc_get,
.init = sctp_sched_fc_init,
.init_sid = sctp_sched_fc_init_sid,
.free_sid = sctp_sched_fc_free_sid,
.enqueue = sctp_sched_fc_enqueue,
.dequeue = sctp_sched_fc_dequeue,
.dequeue_done = sctp_sched_fc_dequeue_done,
.sched_all = sctp_sched_fc_sched_all,
.unsched_all = sctp_sched_fc_unsched_all,
};
void sctp_sched_ops_fc_init(void)
{
sctp_sched_ops_register(SCTP_SS_FC, &sctp_sched_fc);
}
static const struct sctp_sched_ops sctp_sched_wfq = {
.set = sctp_sched_wfq_set,
.get = sctp_sched_wfq_get,
.init = sctp_sched_fc_init,
.init_sid = sctp_sched_fc_init_sid,
.free_sid = sctp_sched_fc_free_sid,
.enqueue = sctp_sched_fc_enqueue,
.dequeue = sctp_sched_fc_dequeue,
.dequeue_done = sctp_sched_fc_dequeue_done,
.sched_all = sctp_sched_fc_sched_all,
.unsched_all = sctp_sched_fc_unsched_all,
};
void sctp_sched_ops_wfq_init(void)
{
sctp_sched_ops_register(SCTP_SS_WFQ, &sctp_sched_wfq);
}
Annotation
- Immediate include surface: `linux/list.h`, `net/sctp/sctp.h`, `net/sctp/sm.h`, `net/sctp/stream_sched.h`.
- Detected declarations: `function sctp_sched_wfq_set`, `function sctp_sched_wfq_get`, `function sctp_sched_fc_set`, `function sctp_sched_fc_get`, `function sctp_sched_fc_init`, `function sctp_sched_fc_init_sid`, `function sctp_sched_fc_free_sid`, `function sctp_sched_fc_enqueue`, `function sctp_sched_fc_dequeue_done`, `function sctp_sched_fc_sched_all`.
- 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.