sctp: add weighted fair queueing stream scheduler
authorXin Long <lucien.xin@gmail.com>
Tue, 7 Mar 2023 21:23:27 +0000 (16:23 -0500)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 9 Mar 2023 10:31:44 +0000 (11:31 +0100)
commit42d452e7709fdb4d42376d2a97369e22cc80a5d2
tree7d49fc099ea487d0b8e74a338822d47143439951
parent4821a076eb602a6238528e9ebafeac853c833415
sctp: add weighted fair queueing stream scheduler

As it says in rfc8260#section-3.6 about the weighted fair queueing
scheduler:

   A Weighted Fair Queueing scheduler between the streams is used.  The
   weight is configurable per outgoing SCTP stream.  This scheduler
   considers the lengths of the messages of each stream and schedules
   them in a specific way to use the capacity according to the given
   weights.  If the weight of stream S1 is n times the weight of stream
   S2, the scheduler should assign to stream S1 n times the capacity it
   assigns to stream S2.  The details are implementation dependent.
   Interleaving user messages allows for a better realization of the
   capacity usage according to the given weights.

This patch adds Weighted Fair Queueing Scheduler actually based on
the code of Fair Capacity Scheduler by adding fc_weight into struct
sctp_stream_out_ext and taking it into account when sorting stream->
fc_list in sctp_sched_fc_sched() and sctp_sched_fc_dequeue_done().

Signed-off-by: Xin Long <lucien.xin@gmail.com>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
include/net/sctp/stream_sched.h
include/net/sctp/structs.h
include/uapi/linux/sctp.h
net/sctp/stream_sched.c
net/sctp/stream_sched_fc.c