1. 14 3月, 2021 18 次提交
  2. 13 3月, 2021 22 次提交
    • D
      Merge branch 'sh_eth-reg-defs' · 5ab6f96a
      David S. Miller 提交于
      Sergey Shtylyov says:
      
      ====================
      sh_eth: Improve the register/bit definitions in the Ether driver
      
      Here are 4 patches against DaveM's 'net-next' repo. Mainly I'm renaming the register *enum*
      tags/entries to match the SoC manuals,and also moving the RX-TX descriptor *enum*s closer to
      the corresponding *struct*s...
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5ab6f96a
    • S
      sh_eth: place RX/TX descriptor *enum*s after their *struct*s · 0deaeabf
      Sergey Shtylyov 提交于
      Place the RX/TX descriptor bit *enum*s where they belong -- after the
      corresponding RX/TX descriptor *struct*s and, while at it, switch to
      declaring one *enum* entry per line...
      Signed-off-by: NSergey Shtylyov <s.shtylyov@omprussia.ru>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0deaeabf
    • S
      sh_eth: rename *enum*s still not matching register names · e2dccaf1
      Sergey Shtylyov 提交于
      Finally, rename the rest of the *enum* tags still not (exactly) matching
      the abbreviated register names from the manuals...
      Signed-off-by: NSergey Shtylyov <s.shtylyov@omprussia.ru>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e2dccaf1
    • S
      sh_eth: rename PSR bits · 4585b72d
      Sergey Shtylyov 提交于
      In all the SoC manuals (except R-Car gen2) the PHY status register's name
      is abbreviated to  PSR with the only valid bit 0 named LMON.  Follow the
      suit and rename the corresponding *enum* tag/entry.
      Signed-off-by: NSergey Shtylyov <s.shtylyov@omprussia.ru>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4585b72d
    • S
      sh_eth: rename TRSCER bits · bc9d992c
      Sergey Shtylyov 提交于
      In all the SoC manuals the TRSCER register bits match the corresponding
      EESR registers's bits, but only on the R-Car gen2 SoC those are named
      RINT<n> and TINT<n>.  Follow the suit and rename the *enum* tag/entries
      from DESC_I_* to TRSCER_*.
      Signed-off-by: NSergey Shtylyov <s.shtylyov@omprussia.ru>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bc9d992c
    • D
      Merge branch 'mptcp-Include-multiple-address-ids-in-RM_ADDR' · 7c678829
      David S. Miller 提交于
      Mat Martineau says:
      
      ====================
      mptcp: Include multiple address ids in RM_ADDR
      
      Here's a patch series from the MPTCP tree that extends the capabilities
      of the MPTCP RM_ADDR header.
      
      MPTCP peers can exchange information about their IP addresses that are
      available for additional MPTCP subflows. IP addresses are advertised
      with an ADD_ADDR header type, and those advertisements are revoked with
      the RM_ADDR header type. RFC 8684 allows the RM_ADDR header to include
      more than one address ID, so multiple advertisements can be revoked in a
      single header. Previous kernel versions have only used RM_ADDR with a
      single address ID, so multiple removals required multiple packets.
      
      Patches 1-4 plumb address id list structures around the MPTCP code,
      where before only a single address ID was passed.
      
      Patches 5-8 make use of the address lists at the path manager layer that
      tracks available addresses for both peers.
      
      Patches 9-11 update the selftests to cover the new use of RM_ADDR with
      multiple address IDs.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7c678829
    • G
      selftests: mptcp: add testcases for removing addrs · d2c4333a
      Geliang Tang 提交于
      This patch added the testcases for removing a list of addresses. Used
      the netlink to flush the addresses in the testcases.
      Signed-off-by: NGeliang Tang <geliangtang@gmail.com>
      Signed-off-by: NMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d2c4333a
    • G
      selftests: mptcp: set addr id for removing testcases · f87744ad
      Geliang Tang 提交于
      The removing testcases can only delete the addresses from id 1, this
      patch added the support for deleting the addresses from any id that user
      set.
      Signed-off-by: NGeliang Tang <geliangtang@gmail.com>
      Signed-off-by: NMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f87744ad
    • G
      selftests: mptcp: add invert argument for chk_rm_nr · 7028ba8a
      Geliang Tang 提交于
      Some of the removing testcases used two zeros as arguments for chk_rm_nr
      like this: chk_rm_nr 0 0. This doesn't mean that no RM_ADDR has been sent.
      It only means that RM_ADDR had been sent in the opposite direction that
      chk_rm_nr is checking.
      
      This patch added a new argument invert for chk_rm_nr to allow it can
      check the RM_ADDR from the opposite direction.
      Signed-off-by: NGeliang Tang <geliangtang@gmail.com>
      Signed-off-by: NMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7028ba8a
    • G
      mptcp: remove a list of addrs when flushing · 0e4a3e68
      Geliang Tang 提交于
      This patch invoked mptcp_nl_remove_addrs_list to remove a list of addresses
      when the netlink flushes addresses, instead of using
      mptcp_nl_remove_subflow_and_signal_addr to remove them one by one.
      
      And dropped the unused parameter net in __flush_addrs too.
      Signed-off-by: NGeliang Tang <geliangtang@gmail.com>
      Signed-off-by: NMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0e4a3e68
    • G
      mptcp: remove multi addresses and subflows in PM · 06faa227
      Geliang Tang 提交于
      This patch implemented the function to remove a list of addresses and
      subflows, named mptcp_nl_remove_addrs_list, which had a input parameter
      rm_list as the removing addresses list.
      
      In mptcp_nl_remove_addrs_list, traverse all the existing msk sockets to
      invoke mptcp_pm_remove_addrs_and_subflows to remove a list of addresses
      for each msk socket.
      
      In mptcp_pm_remove_addrs_and_subflows, traverse all the addresses in the
      removing addresses list, to find whether this address is in the conn_list
      or anno_list. If it is, put the address ID into the removing address list
      or the removing subflow list, and pass the two lists to
      mptcp_pm_remove_addr and mptcp_pm_remove_subflow.
      Signed-off-by: NGeliang Tang <geliangtang@gmail.com>
      Signed-off-by: NMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      06faa227
    • G
      mptcp: remove multi subflows in PM · ddd14bb8
      Geliang Tang 提交于
      This patch dealt with removing multi subflows in PM:
      
      In mptcp_pm_remove_subflow, changed the input parameter local_id as an
      list of removing address ids, and passed the list to
      mptcp_pm_nl_rm_subflow_received.
      
      In mptcp_pm_nl_rm_subflow_received, iterated each address id from the
      received ids list. Then shut down and closed each address id's subsocket.
      
      In mptcp_nl_remove_subflow_and_signal_addr, put the single address id into
      an ids list, and passed it to mptcp_pm_remove_subflow.
      Signed-off-by: NGeliang Tang <geliangtang@gmail.com>
      Signed-off-by: NMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ddd14bb8
    • G
      mptcp: remove multi addresses in PM · d0b698ca
      Geliang Tang 提交于
      This patch dropped the member rm_id of struct mptcp_pm_data. Use
      rm_list_rx in mptcp_pm_nl_rm_addr_received instead of using rm_id.
      
      In mptcp_pm_nl_rm_addr_received, iterated each address id from
      pm.rm_list_rx, then shut down and closed each address id's subsocket.
      Signed-off-by: NGeliang Tang <geliangtang@gmail.com>
      Signed-off-by: NMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d0b698ca
    • G
      mptcp: add rm_list_rx in mptcp_pm_data · b5c55f33
      Geliang Tang 提交于
      This patch added a new member rm_list_rx for struct mptcp_pm_data as an
      list of the removing address ids on the incoming direction. Initialized
      its nr field to zero in mptcp_pm_data_init.
      
      In mptcp_pm_rm_addr_received, set it as the input rm_list.
      Signed-off-by: NGeliang Tang <geliangtang@gmail.com>
      Signed-off-by: NMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b5c55f33
    • G
      mptcp: add rm_list in mptcp_options_received · 5c4a824d
      Geliang Tang 提交于
      This patch changed the member rm_id in struct mptcp_options_received as a
      list of the removing address ids, and renamed it to rm_list.
      
      In mptcp_parse_option, parsed the RM_ADDR suboption and filled them into
      the rm_list in struct mptcp_options_received.
      
      In mptcp_incoming_options, passed this rm_list to the function
      mptcp_pm_rm_addr_received.
      
      It also changed the parameter type of mptcp_pm_rm_addr_received.
      Signed-off-by: NGeliang Tang <geliangtang@gmail.com>
      Signed-off-by: NMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5c4a824d
    • G
      mptcp: add rm_list_tx in mptcp_pm_data · cbde2787
      Geliang Tang 提交于
      This patch added a new member rm_list_tx for struct mptcp_pm_data as the
      removing address list on the outgoing direction. Initialize its nr field
      to zero in mptcp_pm_data_init.
      
      In mptcp_pm_remove_anno_addr, put the single address id into an removing
      list, and passed it to mptcp_pm_remove_addr.
      
      In mptcp_pm_remove_addr, save the input rm_list to rm_list_tx in struct
      mptcp_pm_data.
      Signed-off-by: NGeliang Tang <geliangtang@gmail.com>
      Signed-off-by: NMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      cbde2787
    • G
      mptcp: add rm_list in mptcp_out_options · 6445e17a
      Geliang Tang 提交于
      This patch defined a new struct mptcp_rm_list, the ids field was an
      array of the removing address ids, the nr field was the valid number of
      removing address ids in the array. The array size was definced as a new
      macro MPTCP_RM_IDS_MAX. Changed the member rm_id of struct
      mptcp_out_options to rm_list.
      
      In mptcp_established_options_rm_addr, invoked mptcp_pm_rm_addr_signal to
      get the rm_list. According the number of addresses in it, calculated
      the padded RM_ADDR suboption length. And saved the ids array in struct
      mptcp_out_options's rm_list member.
      
      In mptcp_write_options, iterated each address id from struct
      mptcp_out_options's rm_list member, set the invalid ones as TCPOPT_NOP,
      then filled them into the RM_ADDR suboption.
      
      Changed TCPOLEN_MPTCP_RM_ADDR_BASE from 4 to 3.
      Signed-off-by: NGeliang Tang <geliangtang@gmail.com>
      Signed-off-by: NMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6445e17a
    • D
      Merge branch 'resil-nhgroups-netdevsim-selftests' · e9e90a70
      David S. Miller 提交于
      Petr Machata says:
      
      ====================
      net: Resilient NH groups: netdevsim, selftests
      
      Support for resilient next-hop groups was added in a previous patch set.
      Resilient next hop groups add a layer of indirection between the SKB hash
      and the next hop. Thus the hash is used to reference a hash table bucket,
      which is then used to reference a particular next hop. This allows the
      system more flexibility when assigning SKB hash space to next hops.
      Previously, each next hop had to be assigned a continuous range of SKB hash
      space. With a hash table as an intermediate layer, it is possible to
      reassign next hops with a hash table bucket granularity. In turn, this
      mends issues with traffic flow redirection resulting from next hop removal
      or adjustments in next-hop weights.
      
      This patch set introduces mock offloading of resilient next hop groups by
      the netdevsim driver, and a suite of selftests.
      
      - Patch #1 adds a netdevsim-specific lock to protect next-hop hashtable.
        Previously, netdevsim relied on RTNL to maintain mutual exclusion.
        Patch #2 extracts a helper to make the following patches clearer.
      
      - Patch #3 implements the support for offloading of resilient next-hop
        groups.
      
      - Patch #4 introduces a new debugfs interface to set activity on a selected
        next-hop bucket. This simulates how HW can periodically report bucket
        activity, and buckets thus marked are expected to be exempt from
        migration to new next hops when the group changes.
      
      - Patches #5 and #6 clean up the fib_nexthop selftests.
      
      - Patches #7, #8 and #9 add tests for resilient next hop groups. Patch #7
        adds resilient-hashing counterparts to fib_nexthops.sh. Patch #8 adds a
        new traffic test for resilient next-hop groups. Patch #9 adds a new
        traffic test for tunneling.
      
      - Patch #10 actually leverages the netdevsim offload to implement a suite
        of algorithmic tests that verify how and when buckets are migrated under
        various simulated workload scenarios.
      
      The overall plan is to contribute approximately the following patchsets:
      
      1) Nexthop policy refactoring (already pushed)
      2) Preparations for resilient next hop groups (already pushed)
      3) Implementation of resilient next hop group (already pushed)
      4) Netdevsim offload plus a suite of selftests (this patchset)
      5) Preparations for mlxsw offload of resilient next-hop groups
      6) mlxsw offload including selftests
      
      Interested parties can look at the complete code at [2].
      
      [1] https://tools.ietf.org/html/rfc2992
      [2] https://github.com/idosch/linux/commits/submit/res_integ_v1
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e9e90a70
    • I
      selftests: netdevsim: Add test for resilient nexthop groups offload API · b8a07c4c
      Ido Schimmel 提交于
      Test various aspects of the resilient nexthop group offload API on top
      of the netdevsim implementation. Both good and bad flows are tested.
      Signed-off-by: NIdo Schimmel <idosch@nvidia.com>
      Co-developed-by: NPetr Machata <petrm@nvidia.com>
      Signed-off-by: NPetr Machata <petrm@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b8a07c4c
    • I
      selftests: forwarding: Add resilient multipath tunneling nexthop test · 902280ca
      Ido Schimmel 提交于
      Add a resilient nexthop objects version of gre_multipath_nh.sh. Test
      that both IPv4 and IPv6 overlays work with resilient nexthop groups
      where the nexthops are two GRE tunnels.
      Signed-off-by: NIdo Schimmel <idosch@nvidia.com>
      Reviewed-by: NPetr Machata <petrm@nvidia.com>
      Signed-off-by: NPetr Machata <petrm@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      902280ca
    • I
      selftests: forwarding: Add resilient hashing test · 386e3792
      Ido Schimmel 提交于
      Verify that IPv4 and IPv6 multipath forwarding works correctly with
      resilient nexthop groups and with different weights.
      
      Test that when the idle timer is not zero, the resilient groups are not
      rebalanced - because the nexthop buckets are considered active - and the
      initial weights (1:1) are used.
      Signed-off-by: NIdo Schimmel <idosch@nvidia.com>
      Reviewed-by: NPetr Machata <petrm@nvidia.com>
      Signed-off-by: NPetr Machata <petrm@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      386e3792
    • I
      selftests: fib_nexthops: Test resilient nexthop groups · 557205f4
      Ido Schimmel 提交于
      Add test cases for resilient nexthop groups. Exhaustive forwarding tests
      are added separately under net/forwarding/.
      
      Examples:
      
       # ./fib_nexthops.sh -t basic_res
      
      Basic resilient nexthop group functional tests
      ----------------------------------------------
      TEST: Add a nexthop group with default parameters                   [ OK ]
      TEST: Get a nexthop group with default parameters                   [ OK ]
      TEST: Get a nexthop group with non-default parameters               [ OK ]
      TEST: Add a nexthop group with 0 buckets                            [ OK ]
      TEST: Replace nexthop group parameters                              [ OK ]
      TEST: Get a nexthop group after replacing parameters                [ OK ]
      TEST: Replace idle timer                                            [ OK ]
      TEST: Get a nexthop group after replacing idle timer                [ OK ]
      TEST: Replace unbalanced timer                                      [ OK ]
      TEST: Get a nexthop group after replacing unbalanced timer          [ OK ]
      TEST: Replace with no parameters                                    [ OK ]
      TEST: Get a nexthop group after replacing no parameters             [ OK ]
      TEST: Replace nexthop group type - implicit                         [ OK ]
      TEST: Replace nexthop group type - explicit                         [ OK ]
      TEST: Replace number of nexthop buckets                             [ OK ]
      TEST: Get a nexthop group after replacing with invalid parameters   [ OK ]
      TEST: Dump all nexthop buckets                                      [ OK ]
      TEST: Dump all nexthop buckets in a group                           [ OK ]
      TEST: Dump all nexthop buckets with a specific nexthop device       [ OK ]
      TEST: Dump all nexthop buckets with a specific nexthop identifier   [ OK ]
      TEST: Dump all nexthop buckets in a non-existent group              [ OK ]
      TEST: Dump all nexthop buckets in a non-resilient group             [ OK ]
      TEST: Dump all nexthop buckets using a non-existent device          [ OK ]
      TEST: Dump all nexthop buckets with invalid 'groups' keyword        [ OK ]
      TEST: Dump all nexthop buckets with invalid 'fdb' keyword           [ OK ]
      TEST: Get a valid nexthop bucket                                    [ OK ]
      TEST: Get a nexthop bucket with valid group, but invalid index      [ OK ]
      TEST: Get a nexthop bucket from a non-resilient group               [ OK ]
      TEST: Get a nexthop bucket from a non-existent group                [ OK ]
      
      Tests passed:  29
      Tests failed:   0
      
       # ./fib_nexthops.sh -t ipv4_large_res_grp
      
      IPv4 large resilient group (128k buckets)
      -----------------------------------------
      TEST: Dump large (x131072) nexthop buckets                          [ OK ]
      
      Tests passed:   1
      Tests failed:   0
      
       # ./fib_nexthops.sh -t ipv6_large_res_grp
      
      IPv6 large resilient group (128k buckets)
      -----------------------------------------
      TEST: Dump large (x131072) nexthop buckets                          [ OK ]
      
      Tests passed:   1
      Tests failed:   0
      
       # ./fib_nexthops.sh -t ipv4_res_torture
      
      IPv4 runtime resilient nexthop group torture
      --------------------------------------------
      TEST: IPv4 resilient nexthop group torture test                     [ OK ]
      
      Tests passed:   1
      Tests failed:   0
      
       # ./fib_nexthops.sh -t ipv6_res_torture
      
      IPv6 runtime resilient nexthop group torture
      --------------------------------------------
      TEST: IPv6 resilient nexthop group torture test                     [ OK ]
      
      Tests passed:   1
      Tests failed:   0
      
       # ./fib_nexthops.sh -t ipv4_res_grp_fcnal
      
      IPv4 resilient groups functional
      --------------------------------
      TEST: Nexthop group updated when entry is deleted                   [ OK ]
      TEST: Nexthop buckets updated when entry is deleted                 [ OK ]
      TEST: Nexthop group updated after replace                           [ OK ]
      TEST: Nexthop buckets updated after replace                         [ OK ]
      TEST: Nexthop group updated when entry is deleted - nECMP           [ OK ]
      TEST: Nexthop buckets updated when entry is deleted - nECMP         [ OK ]
      TEST: Nexthop group updated after replace - nECMP                   [ OK ]
      TEST: Nexthop buckets updated after replace - nECMP                 [ OK ]
      
      Tests passed:   8
      Tests failed:   0
      
       # ./fib_nexthops.sh -t ipv6_res_grp_fcnal
      
      IPv6 resilient groups functional
      --------------------------------
      TEST: Nexthop group updated when entry is deleted                   [ OK ]
      TEST: Nexthop buckets updated when entry is deleted                 [ OK ]
      TEST: Nexthop group updated after replace                           [ OK ]
      TEST: Nexthop buckets updated after replace                         [ OK ]
      TEST: Nexthop group updated when entry is deleted - nECMP           [ OK ]
      TEST: Nexthop buckets updated when entry is deleted - nECMP         [ OK ]
      TEST: Nexthop group updated after replace - nECMP                   [ OK ]
      TEST: Nexthop buckets updated after replace - nECMP                 [ OK ]
      
      Tests passed:   8
      Tests failed:   0
      Signed-off-by: NIdo Schimmel <idosch@nvidia.com>
      Co-developed-by: NPetr Machata <petrm@nvidia.com>
      Signed-off-by: NPetr Machata <petrm@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      557205f4