• Eric Dumazet's avatar
    net_sched: sch_fq: add 3 bands and WRR scheduling · 29f834aa
    Eric Dumazet authored
    Before Google adopted FQ for its production servers,
    we had to ensure AF4 packets would get a higher share
    than BE1 ones.
    
    As discussed this week in Netconf 2023 in Paris, it is time
    to upstream this for public use.
    
    After this patch FQ can replace pfifo_fast, with the following
    differences :
    
    - FQ uses WRR instead of strict prio, to avoid starvation of
      low priority packets.
    
    - We make sure each band/prio tracks its own usage against sch->limit.
      This was done to make sure flood of low priority packets would not
      prevent AF4 packets to be queued. Contributed by Willem.
    
    - priomap can be changed, if needed (default value are the ones
      coming from pfifo_fast).
    
    In this patch, we set default band weights so that :
    
    - high prio (band=0) packets get 90% of the bandwidth
      if they compete with low prio (band=2) packets.
    
    - high prio packets get 75% of the bandwidth
      if they compete with medium prio (band=1) packets.
    
    Following patch in this series adds the possibility to tune
    the per-band weights.
    
    As we added many fields in 'struct fq_sched_data', we had
    to make sure to have the first cache line read-mostly, and
    avoid wasting precious cache lines.
    
    More optimizations are possible but will be sent separately.
    Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
    Acked-by: default avatarDave Taht <dave.taht@gmail.com>
    Reviewed-by: default avatarWillem de Bruijn <willemb@google.com>
    Acked-by: default avatarSoheil Hassas Yeganeh <soheil@google.com>
    Reviewed-by: default avatarToke Høiland-Jørgensen <toke@redhat.com>
    Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
    29f834aa
sch_fq.c 31.1 KB