Skip to content
  1. Apr 27, 2019
  2. Apr 26, 2019
    • Heiner Kallweit's avatar
      net: phy: improve genphy_soft_reset · 8c90b795
      Heiner Kallweit authored
      
      
      PHY's behave differently when being reset. Some reset registers to
      defaults, some don't. Some trigger an autoneg restart, some don't.
      
      So let's also set the autoneg restart bit when resetting. Then PHY
      behavior should be more consistent. Clearing BMCR_ISOLATE serves the
      same purpose and is borrowed from genphy_restart_aneg.
      
      BMCR holds the speed / duplex settings in fixed mode. Therefore
      we may have an issue if a soft reset resets BMCR to its default.
      So better call genphy_setup_forced() afterwards in fixed mode.
      We've seen no related complaint in the last >10 yrs, so let's
      treat it as an improvement.
      
      Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8c90b795
    • Guenter Roeck's avatar
      usbnet: ipheth: Simplify device detection · f7abc061
      Guenter Roeck authored
      
      
      All Apple products use the same protocol for tethering over USB.
      To simplify the code and make it future proof, use
      USB_VENDOR_AND_INTERFACE_INFO() instead of
      USB_DEVICE_AND_INTERFACE_INFO() to automatically detect and support
      all existing and future Apple products using the same interface.
      
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f7abc061
    • David Ahern's avatar
      ipv6: Initialize fib6_result in bpf_ipv6_fib_lookup · e55449e7
      David Ahern authored
      fib6_result is not initialized in bpf_ipv6_fib_lookup and potentially
      passses garbage to the fib lookup which triggers a KASAN warning:
      
      [  262.055450] ==================================================================
      [  262.057640] BUG: KASAN: user-memory-access in fib6_rule_suppress+0x4b/0xce
      [  262.059488] Read of size 8 at addr 00000a20000000b0 by task swapper/1/0
      [  262.061238]
      [  262.061673] CPU: 1 PID: 0 Comm: swapper/1 Not tainted 5.1.0-rc5+ #56
      [  262.063493] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.11.1-1 04/01/2014
      [  262.065593] Call Trace:
      [  262.066277]  <IRQ>
      [  262.066848]  dump_stack+0x7e/0xbb
      [  262.067764]  kasan_report+0x18b/0x1b5
      [  262.069921]  __asan_load8+0x7f/0x81
      [  262.070879]  fib6_rule_suppress+0x4b/0xce
      [  262.071980]  fib_rules_lookup+0x275/0x2cd
      [  262.073090]  fib6_lookup+0x119/0x218
      [  262.076457]  bpf_ipv6_fib_lookup+0x39d/0x664
      ...
      
      Initialize fib6_result to 0.
      
      Fixes: b1d40991
      
       ("ipv6: Rename fib6_multipath_select and pass fib6_result")
      Signed-off-by: default avatarDavid Ahern <dsahern@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e55449e7
    • Gustavo A. R. Silva's avatar
      cnic: Refactor code and mark expected switch fall-through · 950347f5
      Gustavo A. R. Silva authored
      
      
      In preparation to enabling -Wimplicit-fallthrough, refactor code a
      bit and mark switch cases where we are expecting to fall through.
      
      This patch fixes the following warning:
      
      drivers/net/ethernet/broadcom/cnic.c: In function ‘cnic_cm_process_kcqe’:
      drivers/net/ethernet/broadcom/cnic.c:4044:11: warning: this statement may fall through [-Wimplicit-fallthrough=]
          opcode = L4_KCQE_OPCODE_VALUE_CLOSE_COMP;
      drivers/net/ethernet/broadcom/cnic.c:4050:2: note: here
        case L4_KCQE_OPCODE_VALUE_RESET_RECEIVED:
        ^~~~
      
      Warning level 3 was used: -Wimplicit-fallthrough=3
      
      Notice that, in this particular case, the code comment is modified
      in accordance with what GCC is expecting to find.
      
      This patch is part of the ongoing efforts to enable
      -Wimplicit-fallthrough.
      
      Signed-off-by: default avatarGustavo A. R. Silva <gustavo@embeddedor.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      950347f5
    • Gustavo A. R. Silva's avatar
      cxgb4/cxgb4vf_main: Mark expected switch fall-through · 05dd2645
      Gustavo A. R. Silva authored
      
      
      In preparation to enabling -Wimplicit-fallthrough, mark switch
      cases where we are expecting to fall through.
      
      This patch fixes the following warning:
      
      drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c: In function ‘fwevtq_handler’:
      drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c:520:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
         cpl = (void *)p;
         ~~~~^~~~~~~~~~~
      drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c:524:2: note: here
        case CPL_SGE_EGR_UPDATE: {
        ^~~~
      
      Warning level 3 was used: -Wimplicit-fallthrough=3
      
      Notice that, in this particular case, the code comment is modified
      in accordance with what GCC is expecting to find.
      
      This patch is part of the ongoing efforts to enable
      -Wimplicit-fallthrough.
      
      Signed-off-by: default avatarGustavo A. R. Silva <gustavo@embeddedor.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      05dd2645
    • Gustavo A. R. Silva's avatar
      wimax/i2400m/control: Mark expected switch fall-through · 9b8221d4
      Gustavo A. R. Silva authored
      
      
      In preparation to enabling -Wimplicit-fallthrough, mark switch
      cases where we are expecting to fall through.
      
      This patch fixes the following warning:
      
      In file included from drivers/net/wimax/i2400m/debug-levels.h:30,
                       from drivers/net/wimax/i2400m/control.c:86:
      drivers/net/wimax/i2400m/control.c: In function ‘i2400m_report_tlv_system_state’:
      ./include/linux/wimax/debug.h:200:4: warning: this statement may fall through [-Wimplicit-fallthrough=]
       do {         \
          ^
      ./include/linux/wimax/debug.h:404:36: note: in expansion of macro ‘_d_printf’
       #define d_printf(l, _dev, f, a...) _d_printf(l, "", _dev, f, ## a)
                                          ^~~~~~~~~
      drivers/net/wimax/i2400m/control.c:354:3: note: in expansion of macro ‘d_printf’
         d_printf(1, dev, "entering BS-negotiated idle mode\n");
         ^~~~~~~~
      drivers/net/wimax/i2400m/control.c:355:2: note: here
        case I2400M_SS_DISCONNECTING:
        ^~~~
      
      Warning level 3 was used: -Wimplicit-fallthrough=3
      
      This patch is part of the ongoing efforts to enable
      -Wimplicit-fallthrough.
      
      Signed-off-by: default avatarGustavo A. R. Silva <gustavo@embeddedor.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9b8221d4
    • Gustavo A. R. Silva's avatar
      amd-xgbe: Mark expected switch fall-throughs · a36de5b7
      Gustavo A. R. Silva authored
      
      
      In preparation to enabling -Wimplicit-fallthrough, mark switch
      cases where we are expecting to fall through.
      
      This patch fixes the following warnings:
      
      In file included from drivers/net/ethernet/amd/xgbe/xgbe-drv.c:129:
      drivers/net/ethernet/amd/xgbe/xgbe-drv.c: In function ‘xgbe_set_hwtstamp_settings’:
      drivers/net/ethernet/amd/xgbe/xgbe-common.h:1392:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
        (_var) |= (((_val) & ((0x1 << (_width)) - 1)) << (_index)); \
        ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      drivers/net/ethernet/amd/xgbe/xgbe-common.h:1419:2: note: in expansion of macro ‘SET_BITS’
        SET_BITS((_var),      \
        ^~~~~~~~
      drivers/net/ethernet/amd/xgbe/xgbe-drv.c:1614:3: note: in expansion of macro ‘XGMAC_SET_BITS’
         XGMAC_SET_BITS(mac_tscr, MAC_TSCR, TSVER2ENA, 1);
         ^~~~~~~~~~~~~~
      drivers/net/ethernet/amd/xgbe/xgbe-drv.c:1616:2: note: here
        case HWTSTAMP_FILTER_PTP_V1_L4_EVENT:
        ^~~~
      In file included from drivers/net/ethernet/amd/xgbe/xgbe-drv.c:129:
      drivers/net/ethernet/amd/xgbe/xgbe-common.h:1392:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
        (_var) |= (((_val) & ((0x1 << (_width)) - 1)) << (_index)); \
        ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      drivers/net/ethernet/amd/xgbe/xgbe-common.h:1419:2: note: in expansion of macro ‘SET_BITS’
        SET_BITS((_var),      \
        ^~~~~~~~
      drivers/net/ethernet/amd/xgbe/xgbe-drv.c:1625:3: note: in expansion of macro ‘XGMAC_SET_BITS’
         XGMAC_SET_BITS(mac_tscr, MAC_TSCR, TSVER2ENA, 1);
         ^~~~~~~~~~~~~~
      drivers/net/ethernet/amd/xgbe/xgbe-drv.c:1627:2: note: here
        case HWTSTAMP_FILTER_PTP_V1_L4_SYNC:
        ^~~~
      In file included from drivers/net/ethernet/amd/xgbe/xgbe-drv.c:129:
      drivers/net/ethernet/amd/xgbe/xgbe-common.h:1392:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
        (_var) |= (((_val) & ((0x1 << (_width)) - 1)) << (_index)); \
        ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      drivers/net/ethernet/amd/xgbe/xgbe-common.h:1419:2: note: in expansion of macro ‘SET_BITS’
        SET_BITS((_var),      \
        ^~~~~~~~
      drivers/net/ethernet/amd/xgbe/xgbe-drv.c:1636:3: note: in expansion of macro ‘XGMAC_SET_BITS’
         XGMAC_SET_BITS(mac_tscr, MAC_TSCR, TSVER2ENA, 1);
         ^~~~~~~~~~~~~~
      drivers/net/ethernet/amd/xgbe/xgbe-drv.c:1638:2: note: here
        case HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ:
        ^~~~
      
      Warning level 3 was used: -Wimplicit-fallthrough=3
      
      Notice that, in this particular case, the code comments are modified
      in accordance with what GCC is expecting to find.
      
      This patch is part of the ongoing efforts to enable
      -Wimplicit-fallthrough.
      
      Signed-off-by: default avatarGustavo A. R. Silva <gustavo@embeddedor.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a36de5b7
    • Gustavo A. R. Silva's avatar
      net: socket: Fix missing break in switch statement · 60747828
      Gustavo A. R. Silva authored
      Add missing break statement in order to prevent the code from falling
      through to cases SIOCGSTAMP_NEW and SIOCGSTAMPNS_NEW.
      
      This bug was found thanks to the ongoing efforts to enable
      -Wimplicit-fallthrough.
      
      Fixes: 0768e170
      
       ("net: socket: implement 64-bit timestamps")
      Signed-off-by: default avatarGustavo A. R. Silva <gustavo@embeddedor.com>
      Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      60747828
    • David S. Miller's avatar
      Merge branch 's390-qeth-cleanups' · 0ff85d6d
      David S. Miller authored
      
      
      Julian Wiedmann says:
      
      ====================
      s390/qeth: updates 2019-04-25
      
      please apply one more patch series for qeth to net-next. Nothing special,
      just a bunch of cleanups.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0ff85d6d
    • Julian Wiedmann's avatar
      s390/qeth: trust non-IP cast type in qeth_l3_fill_header() · 14a1b047
      Julian Wiedmann authored
      
      
      When building the L3 HW header for non-IP packets, trust the cast type
      that was passed as parameter. qeth_l3_get_cast_type() has most likely
      also used h_dest to determine the cast type, so we get the same
      result, and can remove that duplicated code.
      In the unlikely case that we would get a _different_ cast type, then
      that's based off a route lookup and should be considered authoritative.
      
      Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      14a1b047
    • Julian Wiedmann's avatar
      s390/qeth: extract helper to determine L2 cast type · 58aa2491
      Julian Wiedmann authored
      
      
      This de-duplicates the L2 and L3 cast-type code, and makes the L2 code
      a bit more robust by removing the fragile assumption that skb->data
      always points to the Ethernet Header. This would break in code paths
      where we pushed the HW header onto the skb.
      
      Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      58aa2491
    • Julian Wiedmann's avatar
      s390/qeth: cache max number of available buffer elements · 4e26c5fe
      Julian Wiedmann authored
      
      
      The QETH_MAX_BUFFER_ELEMENTS() macro effectively returns a constant
      value. To avoid some redundant pointer chasing and computations in the
      xmit hot path, cache this value in the queue struct.
      
      Take this as opportunity to shrink some of the queue struct's fields to
      their appropriate value range, slightly reducing its total size.
      
      Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4e26c5fe
    • Julian Wiedmann's avatar
      s390/qeth: don't clear Output buffers on every queue init · 7b579ce5
      Julian Wiedmann authored
      
      
      On the first initialization of a queue, its Output Buffers are in a
      clean state with no attached resources. On every subsequent
      initialization, qeth_l?_stop_card() has previously put them in a clean
      state via qeth_drain_output_queues(). So the call to
      qeth_clear_output_buffer() is redundant and can be removed.
      
      While at it, move the initialization of the queue's card pointer into
      the queue allocation. It never changes afterwards.
      
      Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7b579ce5
    • Julian Wiedmann's avatar
      s390/qeth: use IS_* helpers for checking device type · 379ac99e
      Julian Wiedmann authored
      
      
      We have helper macros for all possible device types, replace all
      remaining open-coded accesses to the type fields.
      
      Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      379ac99e
    • Julian Wiedmann's avatar
      s390/qeth: clean up stale buffer state documentation · 5c0bfba7
      Julian Wiedmann authored
      
      
      We don't keep track of Input Buffer states, so remove the comments that
      make it sound like the qeth_qdio_buffer_states enum applies to
      Input Buffers.
      
      Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5c0bfba7
    • Julian Wiedmann's avatar
      s390/qeth: remove RX seqno in skb->cb · ddb0ac51
      Julian Wiedmann authored
      
      
      It's unclear what exact purpose this seqno may have served in the past.
      But it's certainly no longer used anymore, as the following
      napi_gro_receive() will straight away clear this part of the cb again.
      
      Suggested-by: default avatarKarsten Graul <kgraul@linux.ibm.com>
      Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ddb0ac51
    • Arnd Bergmann's avatar
      s390: qeth: address type mismatch warning · 46b83629
      Arnd Bergmann authored
      
      
      clang produces a harmless warning for each use for the qeth_adp_supported
      macro:
      
      drivers/s390/net/qeth_l2_main.c:559:31: warning: implicit conversion from enumeration type 'enum qeth_ipa_setadp_cmd' to
            different enumeration type 'enum qeth_ipa_funcs' [-Wenum-conversion]
              if (qeth_adp_supported(card, IPA_SETADP_SET_PROMISC_MODE))
                  ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      drivers/s390/net/qeth_core.h:179:41: note: expanded from macro 'qeth_adp_supported'
              qeth_is_ipa_supported(&c->options.adp, f)
              ~~~~~~~~~~~~~~~~~~~~~                  ^
      
      Add a version of this macro that uses the correct types, and
      remove the unused qeth_adp_enabled() macro that has the same
      problem.
      
      Reviewed-by: default avatarNathan Chancellor <natechancellor@gmail.com>
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      46b83629
    • David S. Miller's avatar
      Merge branch 'netdevsim-implement-proper-device-model' · 9157bc2a
      David S. Miller authored
      Jiri Pirko says:
      
      ====================
      netdevsim: implement proper device model
      
      Currently the model of netdevsim is a bit odd in multiple ways.
      1) devlink instance is not in any way related with actual netdevsim
         netdevices. Instead, it is created per-namespace.
      2) multi-port netdevsim device is done using "link" attribute.
      3) netdevsim bus is there only to have something to bind the netdev to,
         it really does not act as a bus.
      4) netdevsim instances are created by "ip link add" which is great for
         soft devices with no hw backend. The rtnl core allocates netdev and
         calls into driver holding rtnl mutex. For hw-backed devices, this
         flow is wrong as it breaks order in which things are done.
      
      This patchset adjust netdevsim to fix all above.
      
      In order to support proper devlink and devlink port instances and to be
      able to emulate real devices, there is need to implement bus probe and
      instantiate everything from there. User can specify device id and port
      count to be instantianted. For example:
      
      $ echo "10 4" > /sys/bus/netdevsim/new_device
      
      Then devlink shows this:
      
      $ devlink dev
      netdevsim/netdevsim10
      
      $ devlink port
      netdevsim/netdevsim10/0: type eth netdev eni0np1 flavour physical
      netdevsim/netdevsim10/1: type eth netdev eni0np2 flavour physical
      netdevsim/netdevsim10/2: type eth netdev eni0np3 flavour physical
      netdevsim/netdevsim10/3: type eth netdev eni0np4 flavour physical
      
      There is possible to add and delete ports using their indexes
      during netdevsim device lifetime like this:
      
      Then devlink shows this:
      
      $ devlink port
      netdevsim/netdevsim10/1: type eth netdev eni10np2 flavour physical
      netdevsim/netdevsim10/2: type eth netdev eni10np3 flavour physical
      netdevsim/netdevsim10/3: type eth netdev eni10np4 flavour physical
      netdevsim/netdevsim10/43: type eth netdev eni10np44 flavour physical
      
      Debugfs topology is also adjusted a bit. The rest stays the same as
      before.
      
      Udev bits are merged un systemd upstream git:
      https://github.com/systemd/systemd/commit/eaa9d507d85509c8bf727356e3884ec54b0fc646
      
      
      
      See individual patches for changelog.
      ====================
      
      Acked-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9157bc2a
    • Jiri Pirko's avatar
      netdevsim: implement ndo_get_devlink_port · a62fdbbe
      Jiri Pirko authored
      
      
      Implement ndo_get_devlink_port and allow switch_id and port_name to be
      handled by devlink.
      
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a62fdbbe
    • Jiri Pirko's avatar
      netdevsim: move netdev creation/destruction to dev probe · e05b2d14
      Jiri Pirko authored
      
      
      Remove the existing way to create netdevsim over rtnetlink and move the
      netdev creation/destruction to dev probe, so for every probed port,
      a netdevsim-netdev instance is created.
      
      Adjust selftests to work with new interface.
      
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e05b2d14
    • Jiri Pirko's avatar
      netdevsim: extend device attrs to support port addition and deletion · 794b2c05
      Jiri Pirko authored
      
      
      In order to test flows in core, it is beneficial to maintain previously
      supported possibility to add and delete ports during netdevsim lifetime.
      Do it by extending device sysfs attrs by "new_port" and "del_port".
      
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      794b2c05
    • Jiri Pirko's avatar
      netdevsim: implement dev probe/remove skeleton with port initialization · 8320d145
      Jiri Pirko authored
      
      
      Implement netdevsim bus probing of netdevsim devices. For every probed
      device create a devlink instance. According to the user-passed value,
      create a number of ports represented by devlink port instances.
      
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8320d145
    • Jiri Pirko's avatar
      netdevsim: change debugfs tree topology · ab1d0cc0
      Jiri Pirko authored
      
      
      With the model where dev is represented by devlink and ports are
      represented by devlink ports, make debugfs file names independent
      on netdev names. Change the topology to the one illustrated
      by the following example:
      
      $ ls /sys/kernel/debug/netdevsim/
      netdevsim1
      $ ls /sys/kernel/debug/netdevsim/netdevsim1/
      bpf_bind_accept  bpf_bind_verifier_delay  bpf_bound_progs  ports
      $ ls /sys/kernel/debug/netdevsim/netdevsim1/ports/
      0  1
      $ ls /sys/kernel/debug/netdevsim/netdevsim1/ports/0/
      bpf_map_accept  bpf_offloaded_id  bpf_tc_accept  bpf_tc_non_bound_accept  bpf_xdpdrv_accept  bpf_xdpoffload_accept  dev  ipsec
      $ ls /sys/kernel/debug/netdevsim/netdevsim1/ports/0/dev -l
      lrwxrwxrwx 1 root root 0 Apr 13 15:58 /sys/kernel/debug/netdevsim/netdevsim1/ports/0/dev -> ../../../netdevsim1
      
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ab1d0cc0
    • Jiri Pirko's avatar
      netdevsim: generate random switch id instead of using dev id · 514cf64c
      Jiri Pirko authored
      
      
      Current implementation of parent_id/switch_id does not follow the
      original idea of being unique. The values are "0", "1", etc. Instead of
      that, generate 32 random bytes.
      
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      514cf64c
    • Jiri Pirko's avatar
      netdevsim: merge sdev into dev · d514f41e
      Jiri Pirko authored
      
      
      As previously introduce dev which is mapped 1:1 to a bus device covers
      the purpose of the original shared device, merge the sdev code into dev.
      
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d514f41e
    • Jiri Pirko's avatar
      netdevsim: rename dev_init/exit() functions and make them independent on ns · a60f9e48
      Jiri Pirko authored
      
      
      These functions are going to be called from bus probe/release(),
      therefore make them independent on ns struct and rename accordingly.
      
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a60f9e48
    • Jiri Pirko's avatar
      netdevsim: add bus attributes to add new and delete devices · f9d9db47
      Jiri Pirko authored
      
      
      Add a way to add new netdevsim device on netdevsim bus and also to
      delete existing netdevsim device from the bus. Track the bus devices
      in using a list.
      
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f9d9db47
    • Jiri Pirko's avatar
      netdevsim: use ida for bus device ids · 57ce9774
      Jiri Pirko authored
      
      
      Instead of increments of u32 value, use ida to manage bus device ids.
      
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      57ce9774
    • Jiri Pirko's avatar
      netdevsim: add stub netdevsim driver implementation · 23d415da
      Jiri Pirko authored
      
      
      In order to bus probing to work correctly, register a simple  netdevsim
      driver implementation.
      
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      23d415da
    • Jiri Pirko's avatar
      netdevsim: move device registration and related code to bus.c · 40e4fe4c
      Jiri Pirko authored
      
      
      Move netdevsim device registration into bus.c and alongside with that
      the related sysfs attributes. Introduce new struct nsim_bus_dev to
      represent a netdevsim device on netdevsim bus.
      
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      40e4fe4c