1. 28 Nov, 2020 6 commits
    • Jakub Kicinski's avatar
      Merge branch 'mlxsw-update-adjacency-index-more-efficiently' · f5d709ff
      Jakub Kicinski authored
      Ido Schimmel says:
      
      ====================
      mlxsw: Update adjacency index more efficiently
      
      The device supports an operation that allows the driver to issue one
      request to update the adjacency index for all the routes in a given
      virtual router (VR) from old index and size to new ones. This is useful
      in case the configuration of a certain nexthop group is updated and its
      adjacency index changes.
      
      Currently, the driver does not use this operation in an efficient
      manner. It iterates over all the routes using the nexthop group and
      issues an update request for the VR if it is not the same as the
      previous VR.
      
      Instead, this patch set tracks the VRs in which the nexthop group is
      used and issues one request for each VR.
      
      Example:
      
      8k IPv6 routes were added in an alternating manner to two VRFs. All the
      routes are using the same nexthop object ('nhid 1').
      
      Before:
      
       Performance counter stats for 'ip nexthop replace id 1 via 2001:db8:1::2 dev swp3':
      
                  16,385      devlink:devlink_hwmsg
      
             4.255933213 seconds time elapsed
      
             0.000000000 seconds user
             0.666923000 seconds sys
      
      Number of EMAD transactions corresponds to number of routes using the
      nexthop group.
      
      After:
      
       Performance counter stats for 'ip nexthop replace id 1 via 2001:db8:1::2 dev swp3':
      
                       3      devlink:devlink_hwmsg
      
             0.077655094 seconds time elapsed
      
             0.000000000 seconds user
             0.076698000 seconds sys
      
      Number of EMAD transactions corresponds to number of VRFs / VRs.
      
      Patch set overview:
      
      Patch #1 is a fix for a bug introduced in previous submission. Detected
      by Coverity.
      
      Patches #2 and #3 are preparations.
      
      Patch #4 tracks the VRs a nexthop group is member of.
      
      Patch #5 uses the membership tracking from the previous patch to issue
      one update request per each VR.
      ====================
      
      Link: https://lore.kernel.org/r/20201125193505.1052466-1-idosch@idosch.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      f5d709ff
    • Ido Schimmel's avatar
      mlxsw: spectrum_router: Update adjacency index more efficiently · ff47fa13
      Ido Schimmel authored
      The device supports an operation that allows the driver to issue one
      request to update the adjacency index for all the routes in a given
      virtual router (VR) from old index and size to new ones. This is useful
      in case the configuration of a certain nexthop group is updated and its
      adjacency index changes.
      
      Currently, the driver does not use this operation in an efficient
      manner. It iterates over all the routes using the nexthop group and
      issues an update request for the VR if it is not the same as the
      previous VR.
      
      Instead, use the VR tracking added in the previous patch to update the
      adjacency index once for each VR currently using the nexthop group.
      
      Example:
      
      8k IPv6 routes were added in an alternating manner to two VRFs. All the
      routes are using the same nexthop object ('nhid 1').
      
      Before:
      
      # perf stat -e devlink:devlink_hwmsg --filter='incoming==0' -- ip nexthop replace id 1 via 2001:db8:1::2 dev swp3
      
       Performance counter stats for 'ip nexthop replace id 1 via 2001:db8:1::2 dev swp3':
      
                  16,385      devlink:devlink_hwmsg
      
             4.255933213 seconds time elapsed
      
             0.000000000 seconds user
             0.666923000 seconds sys
      
      Number of EMAD transactions corresponds to number of routes using the
      nexthop group.
      
      After:
      
      # perf stat -e devlink:devlink_hwmsg --filter='incoming==0' -- ip nexthop replace id 1 via 2001:db8:1::2 dev swp3
      
       Performance counter stats for 'ip nexthop replace id 1 via 2001:db8:1::2 dev swp3':
      
                       3      devlink:devlink_hwmsg
      
             0.077655094 seconds time elapsed
      
             0.000000000 seconds user
             0.076698000 seconds sys
      
      Number of EMAD transactions corresponds to number of VRFs / VRs.
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Reviewed-by: default avatarJiri Pirko <jiri@nvidia.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      ff47fa13
    • Ido Schimmel's avatar
      mlxsw: spectrum_router: Track nexthop group virtual router membership · d2141a42
      Ido Schimmel authored
      For each nexthop group, track in which virtual routers (VRs) the group is
      used. This is going to be used by the next patch to perform a more
      efficient adjacency index update whenever the group's adjacency index
      changes.
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Reviewed-by: default avatarJiri Pirko <jiri@nvidia.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      d2141a42
    • Ido Schimmel's avatar
      mlxsw: spectrum_router: Rollback virtual router adjacency pointer update · 9a4ab10c
      Ido Schimmel authored
      In the rare case where the adjacency pointer cannot be updated for a
      given virtual router, rollback the operation so that virtual routers
      that are already using the new index will use the old one again.
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Reviewed-by: default avatarJiri Pirko <jiri@nvidia.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      9a4ab10c
    • Ido Schimmel's avatar
      mlxsw: spectrum_router: Pass virtual router parameters directly instead of pointer · 40e4413d
      Ido Schimmel authored
      mlxsw_sp_adj_index_mass_update_vr() only needs the virtual router's
      identifier and protocol, so pass them directly. In a subsequent patch
      the caller will not have access to the pointer.
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Reviewed-by: default avatarJiri Pirko <jiri@nvidia.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      40e4413d
    • Ido Schimmel's avatar
      mlxsw: spectrum_router: Fix error handling issue · 1c2c5eb6
      Ido Schimmel authored
      Return error to the caller instead of suppressing it.
      
      Fixes: e3ddfb45 ("mlxsw: spectrum_router: Allow returning errors from mlxsw_sp_nexthop_group_refresh()")
      Addresses-Coverity: ("Error handling issues  (CHECKED_RETURN)")
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      1c2c5eb6
  2. 27 Nov, 2020 10 commits
  3. 26 Nov, 2020 11 commits
  4. 25 Nov, 2020 13 commits