1. 03 May, 2022 9 commits
    • Paolo Abeni's avatar
      Merge branch 'mlxsw-remove-size-limitations-on-egress-descriptor-buffer' · f4f1fd76
      Paolo Abeni authored
      Ido Schimmel says:
      
      ====================
      mlxsw: Remove size limitations on egress descriptor buffer
      
      Petr says:
      
      Spectrum machines have two resources related to keeping packets in an
      internal buffer: bytes (allocated in cell-sized units) for packet payload,
      and descriptors, for keeping headers. Currently, mlxsw only configures the
      bytes part of the resource management.
      
      Spectrum switches permit a full parallel configuration for the descriptor
      resources, including port-pool and port-TC-pool quotas. By default, these
      are all configured to use pool 14, with an infinite quota. The ingress pool
      14 is then infinite in size.
      
      However, egress pool 14 has finite size by default. The size is chip
      dependent, but always much lower than what the chip actually permits. As a
      result, we can easily construct workloads that exhaust the configured
      descriptor limit.
      
      Going forward, mlxsw will have to fix this issue properly by maintaining
      descriptor buffer sizes, TC bindings, and quotas that match the
      architecture recommendation. Short term, fix the issue by configuring the
      egress descriptor pool to be infinite in size as well. This will maintain
      the same configuration philosophy, but will unlock all chip resources to be
      usable.
      
      In this patchset, patch #1 first adds the "desc" field into the pool
      configuration register. Then in patch #2, the new field is used to
      configure both ingress and egress pool 14 as infinite.
      
      In patches #3 and #4, add a selftest that verifies that a large burst
      can be absorbed by the shared buffer. This test specifically exercises a
      scenario where descriptor buffer is the limiting factor and the test
      fails without the above patches.
      ====================
      
      Link: https://lore.kernel.org/r/20220502084926.365268-1-idosch@nvidia.comSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      f4f1fd76
    • Petr Machata's avatar
      selftests: mlxsw: Add a test for soaking up a burst of traffic · 1d267aa8
      Petr Machata authored
      Add a test that sends 1Gbps of traffic through the switch, into which it
      then injects a burst of traffic and tests that there are no drops.
      Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      1d267aa8
    • Petr Machata's avatar
      selftests: forwarding: lib: Add start_traffic_pktsize() helpers · 1531cc63
      Petr Machata authored
      Add two helpers, start_traffic_pktsize() and start_tcp_traffic_pktsize(),
      that allow explicit overriding of packet size. Change start_traffic() and
      start_tcp_traffic() to dispatch through these helpers with the default
      packet size.
      Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      1531cc63
    • Petr Machata's avatar
      mlxsw: Configure descriptor buffers · c864769a
      Petr Machata authored
      Spectrum machines have two resources related to keeping packets in an
      internal buffer: bytes (allocated in cell-sized units) for packet payload,
      and descriptors, for keeping metadata. Currently, mlxsw only configures the
      bytes part of the resource management.
      
      Spectrum switches permit a full parallel configuration for the descriptor
      resources, including port-pool and port-TC-pool quotas. By default, these
      are all configured to use pool 14, with an infinite quota. The ingress pool
      14 is then infinite in size.
      
      However, egress pool 14 has finite size by default. The size is chip
      dependent, but always much lower than what the chip actually permits. As a
      result, we can easily construct workloads that exhaust the configured
      descriptor limit.
      
      Fix the issue by configuring the egress descriptor pool to be infinite in
      size as well. This will maintain the configuration philosophy of the
      default configuration, but will unlock all chip resources to be usable.
      
      In the code, include both the configuration of ingress and ingress, mostly
      for clarity.
      Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      c864769a
    • Petr Machata's avatar
      mlxsw: reg: Add "desc" field to SBPR · 135433b3
      Petr Machata authored
      SBPR, or Shared Buffer Pools Register, configures and retrieves the shared
      buffer pools and configuration. The desc field determines whether the
      configuration relates to the byte pool or the descriptor pool.
      Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      135433b3
    • Paolo Abeni's avatar
      Merge branch 'use-standard-sysctl-macro' · cb636b3e
      Paolo Abeni authored
      Tonghao Zhang says:
      
      ====================
      use standard sysctl macro
      
      From: Tonghao Zhang <xiangxia.m.yue@gmail.com>
      
      This patchset introduce sysctl macro or replace var
      with macro.
      ====================
      
      Link: https://lore.kernel.org/r/20220501035524.91205-1-xiangxia.m.yue@gmail.comSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      cb636b3e
    • Tonghao Zhang's avatar
      selftests/sysctl: add sysctl macro test · 57b19468
      Tonghao Zhang authored
      Cc: Luis Chamberlain <mcgrof@kernel.org>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Iurii Zaikin <yzaikin@google.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Jakub Kicinski <kuba@kernel.org>
      Cc: Paolo Abeni <pabeni@redhat.com>
      Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
      Cc: David Ahern <dsahern@kernel.org>
      Cc: Simon Horman <horms@verge.net.au>
      Cc: Julian Anastasov <ja@ssi.bg>
      Cc: Pablo Neira Ayuso <pablo@netfilter.org>
      Cc: Jozsef Kadlecsik <kadlec@netfilter.org>
      Cc: Florian Westphal <fw@strlen.de>
      Cc: Shuah Khan <shuah@kernel.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Eric Dumazet <edumazet@google.com>
      Cc: Lorenz Bauer <lmb@cloudflare.com>
      Cc: Akhmat Karakotov <hmukos@yandex-team.ru>
      Signed-off-by: default avatarTonghao Zhang <xiangxia.m.yue@gmail.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      57b19468
    • Tonghao Zhang's avatar
      net: sysctl: introduce sysctl SYSCTL_THREE · 4c7f24f8
      Tonghao Zhang authored
      This patch introdues the SYSCTL_THREE.
      
      KUnit:
      [00:10:14] ================ sysctl_test (10 subtests) =================
      [00:10:14] [PASSED] sysctl_test_api_dointvec_null_tbl_data
      [00:10:14] [PASSED] sysctl_test_api_dointvec_table_maxlen_unset
      [00:10:14] [PASSED] sysctl_test_api_dointvec_table_len_is_zero
      [00:10:14] [PASSED] sysctl_test_api_dointvec_table_read_but_position_set
      [00:10:14] [PASSED] sysctl_test_dointvec_read_happy_single_positive
      [00:10:14] [PASSED] sysctl_test_dointvec_read_happy_single_negative
      [00:10:14] [PASSED] sysctl_test_dointvec_write_happy_single_positive
      [00:10:14] [PASSED] sysctl_test_dointvec_write_happy_single_negative
      [00:10:14] [PASSED] sysctl_test_api_dointvec_write_single_less_int_min
      [00:10:14] [PASSED] sysctl_test_api_dointvec_write_single_greater_int_max
      [00:10:14] =================== [PASSED] sysctl_test ===================
      
      ./run_kselftest.sh -c sysctl
      ...
      ok 1 selftests: sysctl: sysctl.sh
      
      Cc: Luis Chamberlain <mcgrof@kernel.org>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Iurii Zaikin <yzaikin@google.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Jakub Kicinski <kuba@kernel.org>
      Cc: Paolo Abeni <pabeni@redhat.com>
      Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
      Cc: David Ahern <dsahern@kernel.org>
      Cc: Simon Horman <horms@verge.net.au>
      Cc: Julian Anastasov <ja@ssi.bg>
      Cc: Pablo Neira Ayuso <pablo@netfilter.org>
      Cc: Jozsef Kadlecsik <kadlec@netfilter.org>
      Cc: Florian Westphal <fw@strlen.de>
      Cc: Shuah Khan <shuah@kernel.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Eric Dumazet <edumazet@google.com>
      Cc: Lorenz Bauer <lmb@cloudflare.com>
      Cc: Akhmat Karakotov <hmukos@yandex-team.ru>
      Signed-off-by: default avatarTonghao Zhang <xiangxia.m.yue@gmail.com>
      Reviewed-by: default avatarSimon Horman <horms@verge.net.au>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      4c7f24f8
    • Tonghao Zhang's avatar
      net: sysctl: use shared sysctl macro · bd8a5367
      Tonghao Zhang authored
      This patch replace two, four and long_one to SYSCTL_XXX.
      
      Cc: Luis Chamberlain <mcgrof@kernel.org>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Iurii Zaikin <yzaikin@google.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Jakub Kicinski <kuba@kernel.org>
      Cc: Paolo Abeni <pabeni@redhat.com>
      Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
      Cc: David Ahern <dsahern@kernel.org>
      Cc: Simon Horman <horms@verge.net.au>
      Cc: Julian Anastasov <ja@ssi.bg>
      Cc: Pablo Neira Ayuso <pablo@netfilter.org>
      Cc: Jozsef Kadlecsik <kadlec@netfilter.org>
      Cc: Florian Westphal <fw@strlen.de>
      Cc: Shuah Khan <shuah@kernel.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Eric Dumazet <edumazet@google.com>
      Cc: Lorenz Bauer <lmb@cloudflare.com>
      Cc: Akhmat Karakotov <hmukos@yandex-team.ru>
      Signed-off-by: default avatarTonghao Zhang <xiangxia.m.yue@gmail.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      bd8a5367
  2. 02 May, 2022 31 commits