stream_sched.c (2db57789e6612ce0cf2fcbb577a1c8307b708566) stream_sched.c (1ba896f6f52bfafac6dec4ca583cdd9a073858e8)
1/* SCTP kernel implementation
2 * (C) Copyright Red Hat Inc. 2017
3 *
4 * This file is part of the SCTP kernel implementation
5 *
6 * These functions manipulate sctp stream queue/scheduling.
7 *
8 * This SCTP implementation is free software;

--- 105 unchanged lines hidden (view full) ---

114 .free = sctp_sched_fcfs_free,
115 .enqueue = sctp_sched_fcfs_enqueue,
116 .dequeue = sctp_sched_fcfs_dequeue,
117 .dequeue_done = sctp_sched_fcfs_dequeue_done,
118 .sched_all = sctp_sched_fcfs_sched_all,
119 .unsched_all = sctp_sched_fcfs_unsched_all,
120};
121
1/* SCTP kernel implementation
2 * (C) Copyright Red Hat Inc. 2017
3 *
4 * This file is part of the SCTP kernel implementation
5 *
6 * These functions manipulate sctp stream queue/scheduling.
7 *
8 * This SCTP implementation is free software;

--- 105 unchanged lines hidden (view full) ---

114 .free = sctp_sched_fcfs_free,
115 .enqueue = sctp_sched_fcfs_enqueue,
116 .dequeue = sctp_sched_fcfs_dequeue,
117 .dequeue_done = sctp_sched_fcfs_dequeue_done,
118 .sched_all = sctp_sched_fcfs_sched_all,
119 .unsched_all = sctp_sched_fcfs_unsched_all,
120};
121
122static void sctp_sched_ops_fcfs_init(void)
123{
124 sctp_sched_ops_register(SCTP_SS_FCFS, &sctp_sched_fcfs);
125}
126
122/* API to other parts of the stack */
123
127/* API to other parts of the stack */
128
124extern struct sctp_sched_ops sctp_sched_prio;
125extern struct sctp_sched_ops sctp_sched_rr;
129static struct sctp_sched_ops *sctp_sched_ops[SCTP_SS_MAX + 1];
126
130
127static struct sctp_sched_ops *sctp_sched_ops[] = {
128 &sctp_sched_fcfs,
129 &sctp_sched_prio,
130 &sctp_sched_rr,
131};
131void sctp_sched_ops_register(enum sctp_sched_type sched,
132 struct sctp_sched_ops *sched_ops)
133{
134 sctp_sched_ops[sched] = sched_ops;
135}
132
136
137void sctp_sched_ops_init(void)
138{
139 sctp_sched_ops_fcfs_init();
140 sctp_sched_ops_prio_init();
141 sctp_sched_ops_rr_init();
142}
143
133int sctp_sched_set_sched(struct sctp_association *asoc,
134 enum sctp_sched_type sched)
135{
136 struct sctp_sched_ops *n = sctp_sched_ops[sched];
137 struct sctp_sched_ops *old = asoc->outqueue.sched;
138 struct sctp_datamsg *msg = NULL;
139 struct sctp_chunk *ch;
140 int i, ret = 0;

--- 135 unchanged lines hidden ---
144int sctp_sched_set_sched(struct sctp_association *asoc,
145 enum sctp_sched_type sched)
146{
147 struct sctp_sched_ops *n = sctp_sched_ops[sched];
148 struct sctp_sched_ops *old = asoc->outqueue.sched;
149 struct sctp_datamsg *msg = NULL;
150 struct sctp_chunk *ch;
151 int i, ret = 0;

--- 135 unchanged lines hidden ---