1. 15 Mar, 2020 14 commits
    • David S. Miller's avatar
      Merge branch 'RED-Introduce-an-ECN-tail-dropping-mode' · 3d572b23
      David S. Miller authored
      Petr Machata says:
      
      ====================
      RED: Introduce an ECN tail-dropping mode
      
      When the RED qdisc is currently configured to enable ECN, the RED algorithm
      is used to decide whether a certain SKB should be marked. If that SKB is
      not ECN-capable, it is early-dropped.
      
      It is also possible to keep all traffic in the queue, and just mark the
      ECN-capable subset of it, as appropriate under the RED algorithm. Some
      switches support this mode, and some installations make use of it.
      There is currently no way to put the RED qdiscs to this mode.
      
      Therefore this patchset adds a new RED flag, TC_RED_TAILDROP. When the
      qdisc is configured with this flag, non-ECT traffic is enqueued (and
      tail-dropped when the queue size is exhausted) instead of being
      early-dropped.
      
      Unfortunately, adding a new RED flag is not as simple as it sounds. RED
      flags are passed in tc_red_qopt.flags. However RED neglects to validate the
      flag field, and just copies it over wholesale to its internal structure,
      and later dumps it back.
      
      A broken userspace can therefore configure a RED qdisc with arbitrary
      unsupported flags, and later expect to see the flags on qdisc dump. The
      current ABI thus allows storage of 5 bits of custom data along with the
      qdisc instance.
      
      GRED, SFQ and CHOKE qdiscs are in the same situation. (GRED validates VQ
      flags, but not the flags for the main queue.) E.g. if SFQ ever needs to
      support TC_RED_ADAPTATIVE, it needs another way of doing it, and at the
      same time it needs to retain the possibility to store 6 bits of
      uninterpreted data.
      
      For RED, this problem is resolved in patch #2, which adds a new attribute,
      and a way to separate flags from userbits that can be reused by other
      qdiscs. The flag itself and related behavioral changes are added in patch
      
      To test the new feature, patch #1 first introduces a TDC testsuite that
      covers the existing RED flags. Patch #5 later extends it with taildrop
      coverage. Patch #6 contains a forwarding selftest for the offloaded
      datapath.
      
      To test the SW datapath, I took the mlxsw selftest and adapted it in mostly
      obvious ways. The test is stable enough to verify that RED, ECN and ECN
      taildrop actually work. However, I have no confidence in its portability to
      other people's machines or mildly different configurations. I therefore do
      not find it suitable for upstreaming.
      
      GRED and CHOKE can use the same method as RED if they ever need to support
      extra flags. SFQ uses the length of TCA_OPTIONS to dispatch on binary
      control structure version, and would therefore need a different approach.
      
      v2:
      - Patch #1
          - Require nsPlugin in each RED test
          - Match end-of-line to catch cases of more flags reported than
            requested
      - Patch #2:
          - Replaced with another patch.
      - Patch #3:
          - Fix red_use_taildrop() condition in red_enqueue switch for
            probabilistic case.
      - Patch #5:
          - Require nsPlugin in each RED test
          - Match end-of-line to catch cases of more flags reported than
            requested
          - Add a test for creation of non-ECN taildrop, which should fail
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3d572b23
    • Petr Machata's avatar
      selftests: mlxsw: RED: Test RED ECN nodrop offload · 63f3c1d0
      Petr Machata authored
      Extend RED testsuite to cover the new nodrop mode of RED-ECN. This test is
      really similar to ECN test, diverging only in the last step, where UDP
      traffic should go to backlog instead of being dropped. Thus extract a
      common helper, ecn_test_common(), make do_ecn_test() into a relatively
      simple wrapper, and add another one, do_ecn_nodrop_test().
      Signed-off-by: default avatarPetr Machata <petrm@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      63f3c1d0
    • Petr Machata's avatar
      selftests: qdiscs: RED: Add nodrop tests · 058e56ac
      Petr Machata authored
      Add tests for the new "nodrop" flag.
      Signed-off-by: default avatarPetr Machata <petrm@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      058e56ac
    • Petr Machata's avatar
      mlxsw: spectrum_qdisc: Offload RED ECN nodrop mode · 8040c96b
      Petr Machata authored
      RED ECN nodrop mode means that non-ECT traffic should not be early-dropped,
      but enqueued normally instead. In Spectrum systems, this is achieved by
      disabling CWTPM.ew (enable WRED) for a given traffic class.
      
      So far CWTPM.ew was unconditionally enabled. Instead disable it when the
      RED qdisc is in nodrop mode.
      Signed-off-by: default avatarPetr Machata <petrm@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8040c96b
    • Petr Machata's avatar
      net: sched: RED: Introduce an ECN nodrop mode · 0a7fad23
      Petr Machata authored
      When the RED Qdisc is currently configured to enable ECN, the RED algorithm
      is used to decide whether a certain SKB should be marked. If that SKB is
      not ECN-capable, it is early-dropped.
      
      It is also possible to keep all traffic in the queue, and just mark the
      ECN-capable subset of it, as appropriate under the RED algorithm. Some
      switches support this mode, and some installations make use of it.
      
      To that end, add a new RED flag, TC_RED_NODROP. When the Qdisc is
      configured with this flag, non-ECT traffic is enqueued instead of being
      early-dropped.
      Signed-off-by: default avatarPetr Machata <petrm@mellanox.com>
      Reviewed-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0a7fad23
    • Petr Machata's avatar
      net: sched: Allow extending set of supported RED flags · 14bc175d
      Petr Machata authored
      The qdiscs RED, GRED, SFQ and CHOKE use different subsets of the same pool
      of global RED flags. These are passed in tc_red_qopt.flags. However none of
      these qdiscs validate the flag field, and just copy it over wholesale to
      internal structures, and later dump it back. (An exception is GRED, which
      does validate for VQs -- however not for the main setup.)
      
      A broken userspace can therefore configure a qdisc with arbitrary
      unsupported flags, and later expect to see the flags on qdisc dump. The
      current ABI therefore allows storage of several bits of custom data to
      qdisc instances of the types mentioned above. How many bits, depends on
      which flags are meaningful for the qdisc in question. E.g. SFQ recognizes
      flags ECN and HARDDROP, and the rest is not interpreted.
      
      If SFQ ever needs to support ADAPTATIVE, it needs another way of doing it,
      and at the same time it needs to retain the possibility to store 6 bits of
      uninterpreted data. Likewise RED, which adds a new flag later in this
      patchset.
      
      To that end, this patch adds a new function, red_get_flags(), to split the
      passed flags of RED-like qdiscs to flags and user bits, and
      red_validate_flags() to validate the resulting configuration. It further
      adds a new attribute, TCA_RED_FLAGS, to pass arbitrary flags.
      Signed-off-by: default avatarPetr Machata <petrm@mellanox.com>
      Reviewed-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      14bc175d
    • Petr Machata's avatar
      selftests: qdiscs: Add TDC test for RED · 10ef49bd
      Petr Machata authored
      Add a handful of tests for creating RED with different flags.
      Signed-off-by: default avatarPetr Machata <petrm@mellanox.com>
      Reviewed-by: default avatarRoman Mashak <mrv@mojatatu.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      10ef49bd
    • Edward Cree's avatar
      sfc: support configuring vf spoofchk on EF10 VFs · 085793f0
      Edward Cree authored
      Corresponds to the MAC_SPOOFING_TX privilege in the hardware.
      Some firmware versions on some cards don't support the feature, so check
       the TX_MAC_SECURITY capability and fail EOPNOTSUPP if trying to enable
       spoofchk on a NIC that doesn't support it.
      Signed-off-by: default avatarEdward Cree <ecree@solarflare.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      085793f0
    • David S. Miller's avatar
      Merge branch 'net-phy-XLGMII-define-and-usage-in-PHYLINK' · fa83820e
      David S. Miller authored
      Jose Abreu says:
      
      ====================
      net: phy: XLGMII define and usage in PHYLINK
      
      Adds XLGMII defines and usage in PHYLINK.
      
      Patch 1/2, adds the define for it, whilst 2/2 adds the usage of it in
      PHYLINK.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fa83820e
    • Jose Abreu's avatar
      net: phylink: Add XLGMII support · 1671c42d
      Jose Abreu authored
      Add XLGMII interface and the list of XLGMII speeds to PHYLINK.
      Signed-off-by: default avatarJose Abreu <Jose.Abreu@synopsys.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1671c42d
    • Jose Abreu's avatar
      net: phy: Add XLGMII interface define · 58b05e58
      Jose Abreu authored
      Add a define for XLGMII interface.
      Signed-off-by: default avatarJose Abreu <Jose.Abreu@synopsys.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      58b05e58
    • Colin Ian King's avatar
      net: ena: ethtool: clean up minor indentation issue · f1dc7460
      Colin Ian King authored
      There is a statement that is indented incorrectly, remove a space.
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f1dc7460
    • Vladimir Oltean's avatar
      net: dsa: sja1105: move MAC configuration to .phylink_mac_link_up · ec8582d1
      Vladimir Oltean authored
      The switches supported so far by the driver only have non-SerDes ports,
      so they should be configured in the PHYLINK callback that provides the
      resolved PHY link parameters.
      Signed-off-by: default avatarVladimir Oltean <olteanv@gmail.com>
      Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ec8582d1
    • Shahjada Abul Husain's avatar
      cxgb4: update T5/T6 adapter register ranges · 724d0215
      Shahjada Abul Husain authored
      Add more T5/T6 registers to be collected in register dump:
      
      1. MPS register range 0x9810 to 0x9864 and 0xd000 to 0xd004.
      2. NCSI register range 0x1a114 to 0x1a130 and 0x1a138 to 0x1a1c4.
      Signed-off-by: default avatarShahjada Abul Husain <shahjada@chelsio.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      724d0215
  2. 14 Mar, 2020 2 commits
    • David S. Miller's avatar
      Merge tag 'mlx5-updates-2020-03-13' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux · 94229d45
      David S. Miller authored
      Saeed Mahameed says:
      
      ====================
      mlx5-updates-2020-03-13
      
      Misc update to mlx5 core and E-Switch driver:
      
      1) Blue-Field, Update VF vports config when num of VFs changed
      
      From Bodon, Various misc cleanups and refactoring
      for vport enabling/disabling routines to allow them to be called
      dynamically and not only on E-Switch load.
      
      This will allow ECPF (ConnectX BlueField Smartnic) support for dynamic
      num vf changes and dynamic vport creation and configuration as introduced
      in "Update VF vports config when num of VFs changed" patch.
      
      2) From Parav and Mark, trivial clean-ups.
      
      3) Software steering support for flow table id as destination
      and a clean-up patch to remove unnecessary function stubs, from Alex.
      ====================
      Acked-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      94229d45
    • David S. Miller's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next · 44ef976a
      David S. Miller authored
      Daniel Borkmann says:
      
      ====================
      pull-request: bpf-next 2020-03-13
      
      The following pull-request contains BPF updates for your *net-next* tree.
      
      We've added 86 non-merge commits during the last 12 day(s) which contain
      a total of 107 files changed, 5771 insertions(+), 1700 deletions(-).
      
      The main changes are:
      
      1) Add modify_return attach type which allows to attach to a function via
         BPF trampoline and is run after the fentry and before the fexit programs
         and can pass a return code to the original caller, from KP Singh.
      
      2) Generalize BPF's kallsyms handling and add BPF trampoline and dispatcher
         objects to be visible in /proc/kallsyms so they can be annotated in
         stack traces, from Jiri Olsa.
      
      3) Extend BPF sockmap to allow for UDP next to existing TCP support in order
         in order to enable this for BPF based socket dispatch, from Lorenz Bauer.
      
      4) Introduce a new bpftool 'prog profile' command which attaches to existing
         BPF programs via fentry and fexit hooks and reads out hardware counters
         during that period, from Song Liu. Example usage:
      
         bpftool prog profile id 337 duration 3 cycles instructions llc_misses
      
              4228 run_cnt
           3403698 cycles                                              (84.08%)
           3525294 instructions   #  1.04 insn per cycle               (84.05%)
                13 llc_misses     #  3.69 LLC misses per million isns  (83.50%)
      
      5) Batch of improvements to libbpf, bpftool and BPF selftests. Also addition
         of a new bpf_link abstraction to keep in particular BPF tracing programs
         attached even when the applicaion owning them exits, from Andrii Nakryiko.
      
      6) New bpf_get_current_pid_tgid() helper for tracing to perform PID filtering
         and which returns the PID as seen by the init namespace, from Carlos Neira.
      
      7) Refactor of RISC-V JIT code to move out common pieces and addition of a
         new RV32G BPF JIT compiler, from Luke Nelson.
      
      8) Add gso_size context member to __sk_buff in order to be able to know whether
         a given skb is GSO or not, from Willem de Bruijn.
      
      9) Add a new bpf_xdp_output() helper which reuses XDP's existing perf RB output
         implementation but can be called from tracepoint programs, from Eelco Chaudron.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      44ef976a
  3. 13 Mar, 2020 24 commits