Skip to content
  1. Mar 17, 2017
    • Ido Schimmel's avatar
      mlxsw: spectrum_router: Associate RIFs with correct VR · 57837885
      Ido Schimmel authored
      
      
      When a router interface (RIF) is created due to a netdev being enslaved
      to a VRF master, then it should be associated with the appropriate
      virtual router (VR) and not the default one.
      
      If netdev is a VRF slave, lookup the VR based on the VRF's table ID.
      Otherwise default to the MAIN table.
      
      Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      57837885
    • Ido Schimmel's avatar
      net: vrf: Set slave's private flag before linking · fdeea7be
      Ido Schimmel authored
      
      
      Allow listeners of the subsequent CHANGEUPPER notification to retrieve
      the VRF's table ID by calling l3mdev_fib_table() with the slave netdev.
      Without this change, the netdev won't be considered an L3 slave and the
      function would return 0.
      
      This is consistent with other master device such as bridge and bond that
      set the slave's private flag before linking. It also makes
      do_vrf_{add,del}_slave() symmetric.
      
      Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Acked-by: default avatarDavid Ahern <dsa@cumulusnetworks.com>
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fdeea7be
    • Ido Schimmel's avatar
      ipv4: fib_rules: Dump FIB rules when registering FIB notifier · 5d7bfd14
      Ido Schimmel authored
      In commit c3852ef7
      
       ("ipv4: fib: Replay events when registering FIB
      notifier") we dumped the FIB tables and replayed the events to the
      passed notification block.
      
      However, we merely sent a RULE_ADD notification in case custom rules
      were in use. As explained in previous patches, this approach won't work
      anymore. Instead, we should notify the caller about all the FIB rules
      and let it act accordingly.
      
      Upon registration to the FIB notification chain, replay a RULE_ADD
      notification for each programmed FIB rule, custom or not. The integrity
      of the dump is ensured by the mechanism introduced in the above
      mentioned commit.
      
      Prevent regressions by making sure current listeners correctly sanitize
      the notified rules.
      
      Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Acked-by: default avatarDavid Ahern <dsa@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5d7bfd14
    • Ido Schimmel's avatar
      ipv4: fib_rules: Add notifier info to FIB rules notifications · 6a003a5f
      Ido Schimmel authored
      
      
      Whenever a FIB rule is added or removed, a notification is sent in the
      FIB notification chain. However, listeners don't have a way to tell
      which rule was added or removed.
      
      This is problematic as we would like to give listeners the ability to
      decide which action to execute based on the notified rule. Specifically,
      offloading drivers should be able to determine if they support the
      reflection of the notified FIB rule and flush their LPM tables in case
      they don't.
      
      Do that by adding a notifier info to these notifications and embed the
      common FIB rule struct in it.
      
      Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Acked-by: default avatarDavid Ahern <dsa@cumulusnetworks.com>
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6a003a5f
    • Ido Schimmel's avatar
      ipv4: fib_rules: Check if rule is a default rule · 3c71006d
      Ido Schimmel authored
      
      
      Currently, when non-default (custom) FIB rules are used, devices capable
      of layer 3 offloading flush their tables and let the kernel do the
      forwarding instead.
      
      When these devices' drivers are loaded they register to the FIB
      notification chain, which lets them know about the existence of any
      custom FIB rules. This is done by sending a RULE_ADD notification based
      on the value of 'net->ipv4.fib_has_custom_rules'.
      
      This approach is problematic when VRF offload is taken into account, as
      upon the creation of the first VRF netdev, a l3mdev rule is programmed
      to direct skbs to the VRF's table.
      
      Instead of merely reading the above value and sending a single RULE_ADD
      notification, we should iterate over all the FIB rules and send a
      detailed notification for each, thereby allowing offloading drivers to
      sanitize the rules they don't support and potentially flush their
      tables.
      
      While l3mdev rules are uniquely marked, the default rules are not.
      Therefore, when they are being notified they might invoke offloading
      drivers to unnecessarily flush their tables.
      
      Solve this by adding an helper to check if a FIB rule is a default rule.
      Namely, its selector should match all packets and its action should
      point to the local, main or default tables.
      
      As noted by David Ahern, uniquely marking the default rules is
      insufficient. When using VRFs, it's common to avoid false hits by moving
      the rule for the local table to just before the main table:
      
      Default configuration:
      $ ip rule show
      0:      from all lookup local
      32766:  from all lookup main
      32767:  from all lookup default
      
      Common configuration with VRFs:
      $ ip rule show
      1000:   from all lookup [l3mdev-table]
      32765:  from all lookup local
      32766:  from all lookup main
      32767:  from all lookup default
      
      Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Acked-by: default avatarDavid Ahern <dsa@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3c71006d
    • hayeswang's avatar
      r8152: simply the arguments · ce594e98
      hayeswang authored
      
      
      Replace &tp->napi with napi and tp->netdev with netdev.
      
      Signed-off-by: default avatarHayes Wang <hayeswang@realtek.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ce594e98
  2. Mar 16, 2017
  3. Mar 15, 2017