1. Jan 08, 2022
  2. Jan 07, 2022
    • David S. Miller's avatar
      Merge branch 'mptcp-next' · ca1a6705
      David S. Miller authored
      
      
      Mat Martineau says:
      
      ====================
      mptcp: New features and cleanup
      
      These patches have been tested in the MPTCP tree for a longer than usual
      time (thanks to holiday schedules), and are ready for the net-next
      branch. Changes include feature updates, small fixes, refactoring, and
      some selftest changes.
      
      Patch 1 fixes an OUTQ ioctl issue with TCP fallback sockets.
      
      Patches 2, 3, and 6 add support of the MPTCP fastclose option (quick
      shutdown of the full MPTCP connection, similar to TCP RST in regular
      TCP), and a related self test.
      
      Patch 4 cleans up some accept and poll code that is no longer needed
      after the fastclose changes.
      
      Patch 5 add userspace disconnect using AF_UNSPEC, which is used when
      testing fastclose and makes the MPTCP socket's handling of AF_UNSPEC in
      connect() more TCP-like.
      
      Patches 7-11 refactor subflow creation to make better use of multiple
      local endpoints and to better handle individual connection failures when
      creating multiple subflows. Includes self test updates.
      
      Patch 12 cleans up the way subflows are added to the MPTCP connection
      list, eliminating the need for calls throughout the MPTCP code that had
      to check the intermediate "join list" for entries to shift over to the
      main "connection list".
      
      Patch 13 refactors the MPTCP release_cb flags to use separate storage
      for values only accessed with the socket lock held (no atomic ops
      needed), and for values that need atomic operations.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ca1a6705
    • Paolo Abeni's avatar
      mptcp: avoid atomic bit manipulation when possible · e9d09bac
      Paolo Abeni authored
      
      
      Currently the msk->flags bitmask carries both state for the
      mptcp_release_cb() - mostly touched under the mptcp data lock
      - and others state info touched even outside such lock scope.
      
      As a consequence, msk->flags is always manipulated with
      atomic operations.
      
      This change splits such bitmask in two separate fields, so
      that we use plain bit operations when touching the
      cb-related info.
      
      The MPTCP_PUSH_PENDING bit needs additional care, as it is the
      only CB related field currently accessed either under the mptcp
      data lock or the mptcp socket lock.
      Let's add another mask just for such bit's sake.
      
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e9d09bac
    • Paolo Abeni's avatar
      mptcp: cleanup MPJ subflow list handling · 3e501490
      Paolo Abeni authored
      
      
      We can simplify the join list handling leveraging the
      mptcp_release_cb(): if we can acquire the msk socket
      lock at mptcp_finish_join time, move the new subflow
      directly into the conn_list, otherwise place it on join_list and
      let the release_cb process such list.
      
      Since pending MPJ connection are now always processed
      in a timely way, we can avoid flushing the join list
      every time we have to process all the current subflows.
      
      Additionally we can now use the mptcp data lock to protect
      the join_list, removing the additional spin lock.
      
      Finally, the MPJ handshake is now always finalized under the
      msk socket lock, we can drop the additional synchronization
      between mptcp_finish_join() and mptcp_close().
      
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3e501490
    • Paolo Abeni's avatar
      selftests: mptcp: add tests for subflow creation failure · 46e967d1
      Paolo Abeni authored
      
      
      Verify that, when multiple endpoints are available, subflows
      creation proceed even when the first additional subflow creation
      fails - due to packet drop on the relevant link
      
      Co-developed-by: default avatarGeliang Tang <geliang.tang@suse.com>
      Signed-off-by: default avatarGeliang Tang <geliang.tang@suse.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      46e967d1
    • Paolo Abeni's avatar
      mptcp: do not block subflows creation on errors · a88c9e49
      Paolo Abeni authored
      
      
      If the MPTCP configuration allows for multiple subflows
      creation, and the first additional subflows never reach
      the fully established status - e.g. due to packets drop or
      reset - the in kernel path manager do not move to the
      next subflow.
      
      This patch introduces a new PM helper to cope with MPJ
      subflow creation failure and delay and hook it where appropriate.
      
      Such helper triggers additional subflow creation, as needed
      and updates the PM subflow counter, if the current one is
      closing.
      
      Additionally start all the needed additional subflows
      as soon as the MPTCP socket is fully established, so we don't
      have to cope with slow MPJ handshake blocking the next subflow
      creation.
      
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a88c9e49
    • Paolo Abeni's avatar
      mptcp: keep track of local endpoint still available for each msk · 86e39e04
      Paolo Abeni authored
      
      
      Include into the path manager status a bitmap tracking the list
      of local endpoints still available - not yet used - for the
      relevant mptcp socket.
      
      Keep such map updated at endpoint creation/deletion time, so
      that we can easily skip already used endpoint at local address
      selection time.
      
      The endpoint used by the initial subflow is lazyly accounted at
      subflow creation time: the usage bitmap is be up2date before
      endpoint selection and we avoid such unneeded task in some relevant
      scenarios - e.g. busy servers accepting incoming subflows but
      not creating any additional ones nor annuncing additional addresses.
      
      Overall this allows for fair local endpoints usage in case of
      subflow failure.
      
      As a side effect, this patch also enforces that each endpoint
      is used at most once for each mptcp connection.
      
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      86e39e04
    • Paolo Abeni's avatar
      mptcp: clean-up MPJ option writing · 71b077e4
      Paolo Abeni authored
      
      
      Check for all MPJ variant at once, this reduces the number
      of conditionals traversed on average and will simplify the
      next patch.
      
      No functional change intended.
      
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      71b077e4
    • Paolo Abeni's avatar
      mptcp: fix per socket endpoint accounting · f7d6a237
      Paolo Abeni authored
      Since full-mesh endpoint support, the reception of a single ADD_ADDR
      option can cause multiple subflows creation. When such option is
      accepted we increment 'add_addr_accepted' by one. When we received
      a paired RM_ADDR option, we deleted all the relevant subflows,
      decrementing 'add_addr_accepted' by one for each of them.
      
      We have a similar issue for 'local_addr_used'
      
      Fix them moving the pm endpoint accounting outside the subflow
      traversal.
      
      Fixes: 1a0d6136
      
       ("mptcp: local addresses fullmesh")
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f7d6a237
    • Paolo Abeni's avatar
      selftests: mptcp: add disconnect tests · 05be5e27
      Paolo Abeni authored
      
      
      Performs several disconnect/reconnect on the same socket,
      ensuring the overall transfer is succesful.
      
      The new test leverages ioctl(SIOCOUTQ) to ensure all the
      pending data is acked before disconnecting.
      
      Additionally order alphabetically the test program arguments list
      for better maintainability.
      
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      05be5e27
    • Paolo Abeni's avatar
      mptcp: implement support for user-space disconnect · 3d1d6d66
      Paolo Abeni authored
      
      
      Handle explicitly AF_UNSPEC in mptcp_stream_connnect() to
      allow user-space to disconnect established MPTCP connections
      
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3d1d6d66
    • Paolo Abeni's avatar
      mptcp: cleanup accept and poll · 71ba088c
      Paolo Abeni authored
      
      
      After the previous patch,  msk->subflow will never be deleted during
      the whole msk lifetime. We don't need anymore to acquire references to
      it in mptcp_stream_accept() and we can use the listener subflow accept
      queue to simplify mptcp_poll() for listener socket.
      
      Overall this removes a lock pair and 4 more atomic operations per
      accept().
      
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      71ba088c
    • Paolo Abeni's avatar
      mptcp: full disconnect implementation · b29fcfb5
      Paolo Abeni authored
      
      
      The current mptcp_disconnect() implementation lacks several
      steps, we additionally need to reset the msk socket state
      and flush the subflow list.
      
      Factor out the needed helper to avoid code duplication.
      
      Additionally ensure that the initial subflow is disposed
      only after mptcp_close(), just reset it at disconnect time.
      
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b29fcfb5
    • Paolo Abeni's avatar
      mptcp: implement fastclose xmit path · f284c0c7
      Paolo Abeni authored
      
      
      Allow the MPTCP xmit path to add MP_FASTCLOSE suboption
      on RST egress packets.
      
      Additionally reorder related options writing to reduce
      the number of conditionals required in the fast path.
      
      Co-developed-by: default avatarGeliang Tang <geliang.tang@suse.com>
      Signed-off-by: default avatarGeliang Tang <geliang.tang@suse.com>
      Co-developed-by: default avatarMatthieu Baerts <matthieu.baerts@tessares.net>
      Signed-off-by: default avatarMatthieu Baerts <matthieu.baerts@tessares.net>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f284c0c7
    • Paolo Abeni's avatar
      mptcp: keep snd_una updated for fallback socket · 58cd405b
      Paolo Abeni authored
      
      
      After shutdown, for fallback MPTCP sockets, we always have
      
      write_seq == snd_una+1
      
      The above will foul OUTQ ioctl(). Keep snd_una in sync with
      write_seq even after shutdown.
      
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      58cd405b
    • David S. Miller's avatar
      Merge tag 'mlx5-updates-2022-01-06' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux · 26abf15c
      David S. Miller authored
      
      
      Saeed Mahameed says:
      
      ====================
      mlx5-updates-2022-01-06
      
      1) Expose FEC per lane block counters via ethtool
      
      2) Trivial fixes/updates/cleanup to mlx5e netdev driver
      
      3) Fix htmldoc build warning
      
      4) Spread mlx5 SFs (sub-functions) to all available CPU cores: Commits 1..5
      
      Shay Drory Says:
      ================
      Before this patchset, mlx5 subfunction shared the same IRQs (MSI-X) with
      their peers subfunctions, causing them to use same CPU cores.
      
      In large scale, this is very undesirable, SFs use small number of cpu
      cores and all of them will be packed on the same CPU cores, not
      utilizing all CPU cores in the system.
      
      In this patchset we want to achieve two things.
       a) Spread IRQs used by SFs to all cpu cores
       b) Pack less SFs in the same IRQ, will result in multiple IRQs per core.
      
      In this patchset, we spread SFs over all online cpus available to mlx5
      irqs in Round-Robin manner. e.g.: Whenever a SF is created, pick the next
      CPU core with least number of SF IRQs bound to it, SFs will share IRQs on
      the same core until a certain limit, when such limit is reached, we
      request a new IRQ and add it to that CPU core IRQ pool, when out of IRQs,
      pick any IRQ with least number of SF users.
      
      This enhancement is done in order to achieve a better distribution of
      the SFs over all the available CPUs, which reduces application latency,
      as shown bellow.
      
      Machine details:
      Intel(R) Xeon(R) CPU E5-2697 v3 @ 2.60GHz with 56 cores.
      PCI Express 3 with BW of 126 Gb/s.
      ConnectX-5 Ex; EDR IB (100Gb/s) and 100GbE; dual-port QSFP28; PCIe4.0
      x16.
      
      Base line test description:
      Single SF on the system. One instance of netperf is running on-top the
      SF.
      Numbers: latency = 15.136 usec, CPU Util = 35%
      
      Test description:
      There are 250 SFs on the system. There are 3 instances of netperf
      running, on-top three different SFs, in parallel.
      
      Perf numbers:
       # netperf     SFs         latency(usec)     latency    CPU utilization
         affinity    affinity    (lower is better) increase %
       1 cpu=0       cpu={0}     ~23 (app 1-3)     35%        75%
       2 cpu=0,2,4   cpu={0}     app 1: 21.625     30%        68% (CPU 0)
                                 app 2-3: 16.5     9%         15% (CPU 2,4)
       3 cpu=0       cpu={0,2,4} app 1: ~16        7%         84% (CPU 0)
                                 app 2-3: ~17.9    14%        22% (CPU 2,4)
       4 cpu=0,2,4   cpu={0,2,4} 15.2 (app 1-3)    0%         33% (CPU 0,2,4)
      
       - The first two entries (#1 and #2) show current state. e.g.: SFs are
         using the same CPU. The last two entries (#3 and #4) shows the latency
         reduction improvement of this patch. e.g.: SFs are on different CPUs.
       - Whenever we use several CPUs, in case there is a different CPU
         utilization, write the utilization of each CPU separately.
       - Whenever the latency result of the netperf instances were different,
         write the latency of each netperf instances separately.
      
      Commands:
       - for netperf CPU=0:
      $ for i in {1..3}; do taskset -c 0 netperf -H 1${i}.1.1.1 -t TCP_RR  -- \
        -o RT_LATENCY -r8 & done
      
       - for netperf CPU=0,2,4
      $ for i in {1..3}; do taskset -c $(( ($i - 1) * 2  )) netperf -H \
        1${i}.1.1.1 -t TCP_RR  -- -o RT_LATENCY -r8 & done
      
      ================
      
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      26abf15c
    • Jakub Kicinski's avatar
      Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue · e4a3d6a6
      Jakub Kicinski authored
      Tony Nguyen says:
      
      ====================
      100GbE Intel Wired LAN Driver Updates 2022-01-06
      
      Victor adds restoring of advanced rules after reset.
      
      Wojciech improves usage of switchdev control VSI by utilizing the
      device's advanced rules for forwarding.
      
      Christophe Jaillet removes some unneeded calls to zero bitmaps, changes
      some bitmap operations that don't need to be atomic, and converts a
      kfree() to a more appropriate bitmap_free().
      
      * '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue:
        ice: Use bitmap_free() to free bitmap
        ice: Optimize a few bitmap operations
        ice: Slightly simply ice_find_free_recp_res_idx
        ice: improve switchdev's slow-path
        ice: replay advanced rules after reset
      ====================
      
      Link: https://lore.kernel.org/r/20220106183013.3777622-1-anthony.l.nguyen@intel.com
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      e4a3d6a6
    • Jakub Kicinski's avatar
      Merge branch 'mlxsw-add-spectrum-4-support' · 8947c390
      Jakub Kicinski authored
      Ido Schimmel says:
      
      ====================
      mlxsw: Add Spectrum-4 support
      
      This patchset adds Spectrum-4 support in mlxsw. It builds on top of a
      previous patchset merged in commit 10184da9 ("Merge branch
      'mlxsw-Spectrum-4-prep'") and makes two additional changes before adding
      Spectrum-4 support.
      
      Patchset overview:
      
      Patches #1-#2 add a few Spectrum-4 specific variants of existing ACL
      keys. The new variants are needed because the size of certain key
      elements (e.g., local port) was increased in Spectrum-4.
      
      Patches #3-#6 are preparations.
      
      Patch #7 implements the Spectrum-4 variant of the Bloom filter hash
      function. The Bloom filter is used to optimize ACL lookups by
      potentially skipping certain lookups if they are guaranteed not to
      match. See additional info in merge commit ae6750e0 ("Merge branch
      'mlxsw-spectrum_acl-Add-Bloom-filter-support'").
      
      Patch #8 finally adds Spectrum-4 support.
      ====================
      
      Link: https://lore.kernel.org/r/20220106160652.821176-1-idosch@nvidia.com
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      8947c390