1. Feb 10, 2023
  2. Feb 09, 2023
  3. Feb 08, 2023
    • David S. Miller's avatar
      Merge branch 'taprio-auto-qmaxsdu-new-tx' · e6ebe6c1
      David S. Miller authored
      Vladimir Oltean says:
      
      ====================
      taprio automatic queueMaxSDU and new TXQ selection procedure
      
      This patch set addresses 2 design limitations in the taprio software scheduler:
      
      1. Software scheduling fundamentally prioritizes traffic incorrectly,
         in a way which was inspired from Intel igb/igc drivers and does not
         follow the inputs user space gives (traffic classes and TC to TXQ
         mapping). Patch 05/15 handles this, 01/15 - 04/15 are preparations
         for this work.
      
      2. Software scheduling assumes that the gate for a traffic class closes
         as soon as the next interval begins. But this isn't true.
         If consecutive schedule entries have that traffic class gate open,
         there is no "gate close" event and taprio should keep dequeuing from
         that TC without interruptions. Patches 06/15 - 15/15 handle this.
         Patch 10/15 is a generic Qdisc change required for this to work.
      
      Future development directions which depend on this patch set are:
      
      - Propagating the automatic queueMaxSDU calculation down to offloading
        device drivers, instead of letting them calculate this, as
        vsc9959_tas_guard_bands_update() does today.
      
      - A software data path for tc-taprio with preemptible traffic and
        Hold/Release events.
      
      v1 at:
      https://patchwork.kernel.org/project/netdevbpf/cover/20230128010719.2182346-1-vladimir.oltean@nxp.com/
      
      
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e6ebe6c1
    • Vladimir Oltean's avatar
      net/sched: taprio: don't segment unnecessarily · 39b02d6d
      Vladimir Oltean authored
      Improve commit 497cc002
      
       ("taprio: Handle short intervals and large
      packets") to only perform segmentation when skb->len exceeds what
      taprio_dequeue() expects.
      
      In practice, this will make the biggest difference when a traffic class
      gate is always open in the schedule. This is because the max_frm_len
      will be U32_MAX, and such large skb->len values as Kurt reported will be
      sent just fine unsegmented.
      
      What I don't seem to know how to handle is how to make sure that the
      segmented skbs themselves are smaller than the maximum frame size given
      by the current queueMaxSDU[tc]. Nonetheless, we still need to drop
      those, otherwise the Qdisc will hang.
      
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: default avatarKurt Kanzenbach <kurt@linutronix.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      39b02d6d
    • Vladimir Oltean's avatar
      net/sched: taprio: split segmentation logic from qdisc_enqueue() · 2d5e8071
      Vladimir Oltean authored
      
      
      The majority of the taprio_enqueue()'s function is spent doing TCP
      segmentation, which doesn't look right to me. Compilers shouldn't have a
      problem in inlining code no matter how we write it, so move the
      segmentation logic to a separate function.
      
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: default avatarKurt Kanzenbach <kurt@linutronix.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2d5e8071
    • Vladimir Oltean's avatar
      net/sched: taprio: automatically calculate queueMaxSDU based on TC gate durations · fed87cc6
      Vladimir Oltean authored
      taprio today has a huge problem with small TC gate durations, because it
      might accept packets in taprio_enqueue() which will never be sent by
      taprio_dequeue().
      
      Since not much infrastructure was available, a kludge was added in
      commit 497cc002 ("taprio: Handle short intervals and large
      packets"), which segmented large TCP segments, but the fact of the
      matter is that the issue isn't specific to large TCP segments (and even
      worse, the performance penalty in segmenting those is absolutely huge).
      
      In commit a54fc09e
      
       ("net/sched: taprio: allow user input of per-tc
      max SDU"), taprio gained support for queueMaxSDU, which is precisely the
      mechanism through which packets should be dropped at qdisc_enqueue() if
      they cannot be sent.
      
      After that patch, it was necessary for the user to manually limit the
      maximum MTU per TC. This change adds the necessary logic for taprio to
      further limit the values specified (or not specified) by the user to
      some minimum values which never allow oversized packets to be sent.
      
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: default avatarKurt Kanzenbach <kurt@linutronix.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fed87cc6
    • Vladimir Oltean's avatar
      net/sched: keep the max_frm_len information inside struct sched_gate_list · a878fd46
      Vladimir Oltean authored
      
      
      I have one practical reason for doing this and one concerning correctness.
      
      The practical reason has to do with a follow-up patch, which aims to mix
      2 sources of max_sdu (one coming from the user and the other automatically
      calculated based on TC gate durations @current link speed). Among those
      2 sources of input, we must always select the smaller max_sdu value, but
      this can change at various link speeds. So the max_sdu coming from the
      user must be kept separated from the value that is operationally used
      (the minimum of the 2), because otherwise we overwrite it and forget
      what the user asked us to do.
      
      To solve that, this patch proposes that struct sched_gate_list contains
      the operationally active max_frm_len, and q->max_sdu contains just what
      was requested by the user.
      
      The reason having to do with correctness is based on the following
      observation: the admin sched_gate_list becomes operational at a given
      base_time in the future. Until then, it is inactive and applies no
      shaping, all gates are open, etc. So the queueMaxSDU dropping shouldn't
      apply either (this is a mechanism to ensure that packets smaller than
      the largest gate duration for that TC don't hang the port; clearly it
      makes little sense if the gates are always open).
      
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: default avatarKurt Kanzenbach <kurt@linutronix.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a878fd46