Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
  1. Jul 07, 2018
    • Petr Machata's avatar
      selftests: forwarding: Allow importing dependent libraries · e88bc0f2
      Petr Machata authored
      
      The next patch introduces a new mlxsw-specific test that uses
      mirror_gre_lib.sh and mirror_gre_topo_lib.sh.
      
      However when sourcing their own deps, these libraries assume that the
      test that's running is in the same directory. That's not the case for
      driver-specific tests.
      
      So change the libraries to source their deps through $relative_path.
      That variable is set up by lib.sh, which should be imported by the test
      in question in any case.
      
      Signed-off-by: default avatarPetr Machata <petrm@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e88bc0f2
    • David S. Miller's avatar
      Merge branch 'vxlan-fix-default-fdb-entry-user-space-notify-ordering-race' · a2f1483b
      David S. Miller authored
      Roopa Prabhu says:
      
      ====================
      vxlan: fix default fdb entry user-space notify ordering/race
      
      Problem:
      In vxlan_newlink, a default fdb entry is added before register_netdev.
      The default fdb creation function notifies user-space of the
      fdb entry on the vxlan device which user-space does not know about yet.
      (RTM_NEWNEIGH goes before RTM_NEWLINK for the same ifindex).
      
      This series fixes the user-space netlink notification ordering issue
      with the following changes:
      - decouple fdb notify from fdb create.
      - Move fdb notify after register_netdev.
      - modify rtnl_configure_link to allow configuring a link early.
      - Call rtnl_configure_link in vxlan newlink handler to notify
      userspace about the newlink before fdb notify and
      hence avoiding the user-space race.
      ====================
      
      Fixes: afbd8bae
      
       ("vxlan: add implicit fdb entry for default destination")
      Signed-off-by: default avatarRoopa Prabhu <roopa@cumulusnetworks.com>
      a2f1483b
    • Roopa Prabhu's avatar
      vxlan: fix default fdb entry netlink notify ordering during netdev create · 0241b836
      Roopa Prabhu authored
      Problem:
      In vxlan_newlink, a default fdb entry is added before register_netdev.
      The default fdb creation function also notifies user-space of the
      fdb entry on the vxlan device which user-space does not know about yet.
      (RTM_NEWNEIGH goes before RTM_NEWLINK for the same ifindex).
      
      This patch fixes the user-space netlink notification ordering issue
      with the following changes:
      - decouple fdb notify from fdb create.
      - Move fdb notify after register_netdev.
      - Call rtnl_configure_link in vxlan newlink handler to notify
      userspace about the newlink before fdb notify and
      hence avoiding the user-space race.
      
      Fixes: afbd8bae
      
       ("vxlan: add implicit fdb entry for default destination")
      Signed-off-by: default avatarRoopa Prabhu <roopa@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0241b836
    • Roopa Prabhu's avatar
      vxlan: make netlink notify in vxlan_fdb_destroy optional · 4c2438ba
      Roopa Prabhu authored
      
      Add a new option do_notify to vxlan_fdb_destroy to make
      sending netlink notify optional. Used by a later patch.
      
      Signed-off-by: default avatarRoopa Prabhu <roopa@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4c2438ba
    • Roopa Prabhu's avatar
      vxlan: add new fdb alloc and create helpers · 25e20e73
      Roopa Prabhu authored
      
      - Add new vxlan_fdb_alloc helper
      - rename existing vxlan_fdb_create into vxlan_fdb_update:
              because it really creates or updates an existing
              fdb entry
      - move new fdb creation into a separate vxlan_fdb_create
      
      Main motivation for this change is to introduce the ability
      to decouple vxlan fdb creation and notify, used in a later patch.
      
      Signed-off-by: default avatarRoopa Prabhu <roopa@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      25e20e73
    • Roopa Prabhu's avatar
      rtnetlink: add rtnl_link_state check in rtnl_configure_link · 8d356b89
      Roopa Prabhu authored
      
      rtnl_configure_link sets dev->rtnl_link_state to
      RTNL_LINK_INITIALIZED and unconditionally calls
      __dev_notify_flags to notify user-space of dev flags.
      
      current call sequence for rtnl_configure_link
      rtnetlink_newlink
          rtnl_link_ops->newlink
          rtnl_configure_link (unconditionally notifies userspace of
                               default and new dev flags)
      
      If a newlink handler wants to call rtnl_configure_link
      early, we will end up with duplicate notifications to
      user-space.
      
      This patch fixes rtnl_configure_link to check rtnl_link_state
      and call __dev_notify_flags with gchanges = 0 if already
      RTNL_LINK_INITIALIZED.
      
      Later in the series, this patch will help the following sequence
      where a driver implementing newlink can call rtnl_configure_link
      to initialize the link early.
      
      makes the following call sequence work:
      rtnetlink_newlink
          rtnl_link_ops->newlink (vxlan) -> rtnl_configure_link (initializes
                                                      link and notifies
                                                      user-space of default
                                                      dev flags)
          rtnl_configure_link (updates dev flags if requested by user ifm
                               and notifies user-space of new dev flags)
      
      Signed-off-by: default avatarRoopa Prabhu <roopa@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8d356b89
    • Arnd Bergmann's avatar
      devlink: fix incorrect return statement · 22dd1491
      Arnd Bergmann authored
      A newly added dummy helper function tries to return a failure from a "void"
      function:
      
      In file included from include/net/dsa.h:24,
                       from arch/arm/plat-orion/common.c:21:
      include/net/devlink.h: In function 'devlink_param_value_changed':
      include/net/devlink.h:771:9: error: 'return' with a value, in function returning void [-Werror]
        return -EOPNOTSUPP;
      
      This fixes it by removing the bogus statement.
      
      Fixes: ea601e17
      
       ("devlink: Add devlink notifications support for params")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      22dd1491
    • Arnd Bergmann's avatar
      mlxsw: spectrum_router: avoid uninitialized variable access · be9c64b1
      Arnd Bergmann authored
      When CONFIG_BRIDGE_VLAN_FILTERING is disabled, gcc correctly points out
      that the 'vid' variable is uninitialized whenever br_vlan_get_pvid
      returns an error:
      
      drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c: In function 'mlxsw_sp_rif_vlan_fid_get':
      drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c:6881:6: error: 'vid' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      
      This changes the condition check to always return -EINVAL here,
      which I guess is what the author intended here.
      
      Fixes: e6f1960a
      
       ("mlxsw: spectrum_router: Allocate FID according to PVID")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Reviewed-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      be9c64b1
  2. Jul 06, 2018
  3. Jul 05, 2018