1. 10 2月, 2021 5 次提交
  2. 09 2月, 2021 4 次提交
    • A
      mlxsw: spectrum_router: Set offload_failed flag · a4cb1c02
      Amit Cohen 提交于
      When FIB_EVENT_ENTRY_{REPLACE, APPEND} are triggered and route insertion
      fails, FIB abort is triggered.
      
      After aborting, set the appropriate hardware flag to make the kernel emit
      RTM_NEWROUTE notification with RTM_F_OFFLOAD_FAILED flag.
      Signed-off-by: NAmit Cohen <amcohen@nvidia.com>
      Signed-off-by: NIdo Schimmel <idosch@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a4cb1c02
    • A
      IPv6: Add "offload failed" indication to routes · 0c5fcf9e
      Amit Cohen 提交于
      After installing a route to the kernel, user space receives an
      acknowledgment, which means the route was installed in the kernel, but not
      necessarily in hardware.
      
      The asynchronous nature of route installation in hardware can lead to a
      routing daemon advertising a route before it was actually installed in
      hardware. This can result in packet loss or mis-routed packets until the
      route is installed in hardware.
      
      To avoid such cases, previous patch set added the ability to emit
      RTM_NEWROUTE notifications whenever RTM_F_OFFLOAD/RTM_F_TRAP flags
      are changed, this behavior is controlled by sysctl.
      
      With the above mentioned behavior, it is possible to know from user-space
      if the route was offloaded, but if the offload fails there is no indication
      to user-space. Following a failure, a routing daemon will wait indefinitely
      for a notification that will never come.
      
      This patch adds an "offload_failed" indication to IPv6 routes, so that
      users will have better visibility into the offload process.
      
      'struct fib6_info' is extended with new field that indicates if route
      offload failed. Note that the new field is added using unused bit and
      therefore there is no need to increase struct size.
      Signed-off-by: NAmit Cohen <amcohen@nvidia.com>
      Signed-off-by: NIdo Schimmel <idosch@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0c5fcf9e
    • A
      IPv4: Add "offload failed" indication to routes · 36c5100e
      Amit Cohen 提交于
      After installing a route to the kernel, user space receives an
      acknowledgment, which means the route was installed in the kernel, but not
      necessarily in hardware.
      
      The asynchronous nature of route installation in hardware can lead to a
      routing daemon advertising a route before it was actually installed in
      hardware. This can result in packet loss or mis-routed packets until the
      route is installed in hardware.
      
      To avoid such cases, previous patch set added the ability to emit
      RTM_NEWROUTE notifications whenever RTM_F_OFFLOAD/RTM_F_TRAP flags
      are changed, this behavior is controlled by sysctl.
      
      With the above mentioned behavior, it is possible to know from user-space
      if the route was offloaded, but if the offload fails there is no indication
      to user-space. Following a failure, a routing daemon will wait indefinitely
      for a notification that will never come.
      
      This patch adds an "offload_failed" indication to IPv4 routes, so that
      users will have better visibility into the offload process.
      
      'struct fib_alias', and 'struct fib_rt_info' are extended with new field
      that indicates if route offload failed. Note that the new field is added
      using unused bit and therefore there is no need to increase structs size.
      Signed-off-by: NAmit Cohen <amcohen@nvidia.com>
      Signed-off-by: NIdo Schimmel <idosch@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      36c5100e
    • H
      cxgb4: remove unused vpd_cap_addr · 4429c5fc
      Heiner Kallweit 提交于
      It is likely that this is a leftover from T3 driver heritage. cxgb4 uses
      the PCI core VPD access code that handles detection of VPD capabilities.
      Reviewed-by: NAlexander Duyck <alexanderduyck@fb.com>
      Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4429c5fc
  3. 07 2月, 2021 26 次提交
  4. 06 2月, 2021 5 次提交
    • V
      net/mlx5e: Handle FIB events to update tunnel endpoint device · 8914add2
      Vlad Buslov 提交于
      Process FIB route update events to dynamically update the stack device
      rules when tunnel routing changes. Use rtnl lock to prevent FIB event
      handler from running concurrently with neigh update and neigh stats
      workqueue tasks. Use encap_tbl_lock mutex to synchronize with TC rule
      update path that doesn't use rtnl lock.
      
      FIB event workflow for encap flows:
      
      - Unoffload all flows attached to route encaps from slow or fast path
      depending on encap destination endpoint neigh state.
      
      - Update encap IP header according to new route dev.
      
      - Update flows mod_hdr action that is responsible for overwriting reg_c0
      source port bits to source port of new underlying VF of new route dev. This
      step requires changing flow create/delete code to save flow parse attribute
      mod_hdr_acts structure for whole flow lifetime instead of deallocating it
      after flow creation. Refactor mod_hdr code to allow saving id of individual
      mod_hdr actions and updating them with dedicated helper.
      
      - Offload all flows to either slow or fast path depending on encap
      destination endpoint neigh state.
      
      FIB event workflow for decap flows:
      
      - Unoffload all route flows from hardware. When last route flow is deleted
      all indirect table rules for the route dev will also be deleted.
      
      - Update flow attr decap_vport and destination MAC according to underlying
      VF of new rote dev.
      
      - Offload all route flows back to hardware creating new indirect table
      rules according to updated flow attribute data.
      
      Extract some neigh update code to helper functions to be used by both neigh
      update and route update infrastructure.
      Signed-off-by: NVlad Buslov <vladbu@nvidia.com>
      Signed-off-by: NDmytro Linkin <dlinkin@nvidia.com>
      Reviewed-by: NRoi Dayan <roid@nvidia.com>
      Signed-off-by: NSaeed Mahameed <saeedm@nvidia.com>
      8914add2
    • V
      net/mlx5e: Rename some encap-specific API to generic names · 021905f8
      Vlad Buslov 提交于
      Some of the encap-specific functions and fields will also be used by route
      update infrastructure in following patches. Rename them to generic names.
      Signed-off-by: NVlad Buslov <vladbu@nvidia.com>
      Signed-off-by: NDmytro Linkin <dlinkin@nvidia.com>
      Reviewed-by: NRoi Dayan <roid@nvidia.com>
      Signed-off-by: NSaeed Mahameed <saeedm@nvidia.com>
      021905f8
    • V
      net/mlx5e: TC preparation refactoring for routing update event · c7b9038d
      Vlad Buslov 提交于
      Following patch in series implement routing update event which requires
      ability to modify rule match_to_reg modify header actions dynamically
      during rule lifetime. In order to accommodate such behavior, refactor and
      extend TC infrastructure in following ways:
      
      - Modify mod_hdr infrastructure to preserve its parse attribute for whole
      rule lifetime, instead of deallocating it after rule creation.
      
      - Extend match_to_reg infrastructure with new function
      mlx5e_tc_match_to_reg_set_and_get_id() that returns mod_hdr action id that
      can be used afterwards to update the action, and
      mlx5e_tc_match_to_reg_mod_hdr_change() that can modify existing actions by
      its id.
      
      - Extend tun API with new functions mlx5e_tc_tun_update_header_ipv{4|6}()
      that are used to updated existing encap entry tunnel header.
      Signed-off-by: NVlad Buslov <vladbu@nvidia.com>
      Signed-off-by: NDmytro Linkin <dlinkin@nvidia.com>
      Reviewed-by: NRoi Dayan <roid@nvidia.com>
      Signed-off-by: NSaeed Mahameed <saeedm@nvidia.com>
      c7b9038d
    • V
      net/mlx5e: Refactor neigh update infrastructure · 2221d954
      Vlad Buslov 提交于
      Following patches in series implements route update which can cause encap
      entries to migrate between routing devices. Consecutively, their parent
      nhe's need to be also transferable between devices instead of having neigh
      device as a part of their immutable key. Move neigh device from struct
      mlx5_neigh to struct mlx5e_neigh_hash_entry and check that nhe and neigh
      devices are the same in workqueue neigh update handler.
      
      Save neigh net_device that can change dynamically in dedicated nhe->dev
      field. With FIB event handler that is implemented in following patches
      changing nhe->dev, NETEVENT_DELAY_PROBE_TIME_UPDATE handler can
      concurrently access the nhe entry when traversing neigh list under rcu read
      lock. Processing stale values in that handler doesn't change the handler
      logic, so just wrap all accesses to the dev pointer in {WRITE|READ}_ONCE()
      helpers.
      Signed-off-by: NVlad Buslov <vladbu@nvidia.com>
      Signed-off-by: NDmytro Linkin <dlinkin@nvidia.com>
      Reviewed-by: NRoi Dayan <roid@nvidia.com>
      Signed-off-by: NSaeed Mahameed <saeedm@nvidia.com>
      2221d954
    • V
      net/mlx5e: Create route entry infrastructure · 777bb800
      Vlad Buslov 提交于
      Implement dedicated route entry infrastructure to be used in following
      patch by route update event. Both encap (indirectly through their
      corresponding encap entries) and decap (directly) flows are attached to
      routing entry. Since route update also requires updating encap (route
      device MAC address is a source MAC address of tunnel encapsulation), same
      encap_tbl_lock mutex is used for synchronization.
      
      The new infrastructure looks similar to existing infrastructures for shared
      encap, mod_hdr and hairpin entries:
      
      - Per-eswitch hash table is used for quick entry lookup.
      
      - Flows are attached to per-entry linked list and hold reference to entry
        during their lifetime.
      
      - Atomic reference counting and rcu mechanisms are used as synchronization
        primitives for concurrent access.
      
      The infrastructure also enables connection tracking on stacked devices
      topology by attaching CT chain 0 flow on tunneling dev to decap route
      entry.
      Signed-off-by: NVlad Buslov <vladbu@nvidia.com>
      Signed-off-by: NDmytro Linkin <dlinkin@nvidia.com>
      Reviewed-by: NRoi Dayan <roid@nvidia.com>
      Signed-off-by: NSaeed Mahameed <saeedm@nvidia.com>
      777bb800