1. 08 12月, 2021 1 次提交
  2. 25 10月, 2021 3 次提交
  3. 22 9月, 2021 1 次提交
    • A
      s390/qeth: Fix deadlock in remove_discipline · ee909d0b
      Alexandra Winter 提交于
      Problem: qeth_close_dev_handler is a worker that tries to acquire
      card->discipline_mutex via drv->set_offline() in ccwgroup_set_offline().
      Since commit b41b554c
      ("s390/qeth: fix locking for discipline setup / removal")
      qeth_remove_discipline() is called under card->discipline_mutex and
      cancels the work and waits for it to finish.
      
      STOPLAN reception with reason code IPA_RC_VEPA_TO_VEB_TRANSITION is the
      only situation that schedules close_dev_work. In that situation scheduling
      qeth recovery will also result in an offline interface, when resetting the
      isolation mode fails, if the external switch is still set to VEB.
      And since commit 0b9902c1 ("s390/qeth: fix deadlock during recovery")
      qeth recovery does not aquire card->discipline_mutex anymore.
      
      So we accept the longer pathlength of qeth_schedule_recovery in this
      error situation and re-use the existing function.
      
      As a side-benefit this changes the hwtrap to behave like during recovery
      instead of like during a user-triggered set_offline.
      
      Fixes: b41b554c ("s390/qeth: fix locking for discipline setup / removal")
      Signed-off-by: NAlexandra Winter <wintera@linux.ibm.com>
      Acked-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      ee909d0b
  4. 28 7月, 2021 1 次提交
    • A
      qeth: use ndo_siocdevprivate · 18787eee
      Arnd Bergmann 提交于
      qeth has both standard MII ioctls and custom SIOCDEVPRIVATE ones,
      all of which work correctly with compat user space.
      
      Move the private ones over to the new ndo_siocdevprivate callback.
      
      Cc: Julian Wiedmann <jwi@linux.ibm.com>
      Cc: Karsten Graul <kgraul@linux.ibm.com>
      Cc: Heiko Carstens <hca@linux.ibm.com>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: linux-s390@vger.kernel.org
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      18787eee
  5. 20 7月, 2021 2 次提交
  6. 12 6月, 2021 7 次提交
  7. 22 3月, 2021 1 次提交
    • J
      s390/qdio: let driver manage the QAOB · 396c1004
      Julian Wiedmann 提交于
      We are spending way too much effort on qdio-internal bookkeeping for
      QAOB management & caching, and it's still not robust. Once qdio's
      TX path has detached the QAOB from a PENDING buffer, we lost all
      track of it until it shows up in a CQ notification again. So if the
      device is torn down before that notification arrives, we leak the QAOB.
      
      Just have the driver take care of it, and simply pass down a QAOB if
      they want a TX with async-completion capability. For a buffer in PENDING
      state that requires the QAOB for final completion, qeth can now also try
      to recycle the buffer's QAOB rather than unconditionally freeing it.
      
      This also eliminates the qdio_outbuf_state array, which was only needed
      to transfer the aob->user1 tag from the driver to the qdio layer.
      Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Acked-by: NBenjamin Block <bblock@linux.ibm.com>
      Signed-off-by: NHeiko Carstens <hca@linux.ibm.com>
      396c1004
  8. 10 3月, 2021 1 次提交
    • J
      s390/qeth: improve completion of pending TX buffers · c20383ad
      Julian Wiedmann 提交于
      The current design attaches a pending TX buffer to a custom
      single-linked list, which is anchored at the buffer's slot on the
      TX ring. The buffer is then checked for final completion whenever
      this slot is processed during a subsequent TX NAPI poll cycle.
      
      But if there's insufficient traffic on the ring, we might never make
      enough progress to get back to this ring slot and discover the pending
      buffer's final TX completion. In particular if this missing TX
      completion blocks the application from sending further traffic.
      
      So convert the custom single-linked list code to a per-queue list_head,
      and scan this list on every TX NAPI cycle.
      
      Fixes: 0da9581d ("qeth: exploit asynchronous delivery of storage blocks")
      Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c20383ad
  9. 29 1月, 2021 2 次提交
  10. 08 1月, 2021 1 次提交
    • J
      s390/qeth: fix deadlock during recovery · 0b9902c1
      Julian Wiedmann 提交于
      When qeth_dev_layer2_store() - holding the discipline_mutex - waits
      inside qeth_l*_remove_device() for a qeth_do_reset() thread to complete,
      we can hit a deadlock if qeth_do_reset() concurrently calls
      qeth_set_online() and thus tries to aquire the discipline_mutex.
      
      Move the discipline_mutex locking outside of qeth_set_online() and
      qeth_set_offline(), and turn the discipline into a parameter so that
      callers understand the dependency.
      
      To fix the deadlock, we can now relax the locking:
      As already established, qeth_l*_remove_device() waits for
      qeth_do_reset() to complete. So qeth_do_reset() itself is under no risk
      of having card->discipline ripped out while it's running, and thus
      doesn't need to take the discipline_mutex.
      
      Fixes: 9dc48ccc ("qeth: serialize sysfs-triggered device configurations")
      Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Reviewed-by: NAlexandra Winter <wintera@linux.ibm.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      0b9902c1
  11. 07 12月, 2020 3 次提交
  12. 21 11月, 2020 1 次提交
    • J
      s390/qeth: fix af_iucv notification race · 8908f36d
      Julian Wiedmann 提交于
      The two expected notification sequences are
      1. TX_NOTIFY_PENDING with a subsequent TX_NOTIFY_DELAYED_*, when
         our TX completion code first observed the pending TX and the QAOB
         then completes at a later time; or
      2. TX_NOTIFY_OK, when qeth_qdio_handle_aob() picked up the QAOB
         completion before our TX completion code even noticed that the TX
         was pending.
      
      But as qeth_iqd_tx_complete() and qeth_qdio_handle_aob() can run
      concurrently, we may end up with a race that results in a sequence of
      TX_NOTIFY_DELAYED_* followed by TX_NOTIFY_PENDING. Which would confuse
      the af_iucv code in its tracking of pending transmits.
      
      Rework the notification code, so that qeth_qdio_handle_aob() defers its
      notification if the TX completion code is still active.
      
      Fixes: b3332930 ("qeth: add support for af_iucv HiperSockets transport")
      Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      8908f36d
  13. 19 11月, 2020 3 次提交
    • J
      s390/qeth: improve selection of ethtool link modes · 235db527
      Julian Wiedmann 提交于
      The link mode is a combination of port speed and port mode. But we
      currently only consider the speed, and then typically select the
      corresponding TP-based link mode. For 1G and 10G Fibre links this means
      we display the wrong link modes.
      
      Move the SPEED_* switch statements inside the PORT_* cases, and only
      consider valid combinations where we can select the corresponding
      link mode. Add the relevant link modes (1000baseX, 10000baseSR and
      1000baseLR) that were introduced back with
      commit 5711a982 ("net: ethtool: add support for 1000BaseX and missing 10G link modes").
      
      To differentiate between 10000baseSR and 10000baseLR, use the detailed
      media_type information that QUERY OAT provides.
      Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      235db527
    • J
      s390/qeth: set static link info during initialization · baf7998d
      Julian Wiedmann 提交于
      Hard-code the minimal link info at initialization time, after we
      obtained the link_type. qeth_get_link_ksettings() can still override
      this with more accurate data from QUERY CARD INFO later on.
      
      Don't set arbitrary defaults for unknown OSA link types, they
      certainly won't match any future type.
      Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      baf7998d
    • J
      s390/qeth: improve QUERY CARD INFO processing · 4139b2b1
      Julian Wiedmann 提交于
      Move all the HW reply data parsing into qeth_query_card_info_cb(), and
      use common ethtool enums for transporting the information back to the
      caller.
      
      Also only look at the .port_speed field when we couldn't determine the
      speed from the .card_type field, and introduce some 'default' cases for
      SPEED_UNKNOWN, PORT_OTHER and DUPLEX_UNKNOWN.
      Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      4139b2b1
  14. 03 10月, 2020 6 次提交
  15. 24 9月, 2020 5 次提交
  16. 16 9月, 2020 2 次提交
    • A
      s390/qeth: Reset address notification in case of buffer overflow · 817741a8
      Alexandra Winter 提交于
      In case hardware sends more device-to-bridge-address-change notfications
      than the qeth-l2 driver can handle, the hardware will send an overflow
      event and then stop sending any events. It expects software to flush its
      FDB and start over again. Re-enabling address-change-notification will
      report all current addresses.
      
      In order to re-enable address-change-notification this patch defines
      the functions qeth_l2_dev2br_an_set() and qeth_l2_dev2br_an_set_cb
      to enable or disable dev-to-bridge-address-notification.
      
      A following patch will use the learning_sync bridgeport flag to trigger
      enabling or disabling of address-change-notification, so we define
      priv->brport_features to store the current setting. BRIDGE_INFO and
      ADDR_INFO functionality are mutually exclusive, whereas ADDR_INFO and
      qeth_l2_vnicc* can be used together.
      
      Alternative implementations to handle buffer overflow:
      Just re-enabling notification and adding all newly reported addresses
      would cover any lost 'add' events, but not the lost 'delete' events.
      Then these invalid addresses would stay in the bridge FDB as long as the
      device exists.
      Setting the net device down and up, would be an alternative, but is a bit
      drastic. If the net device has many secondary addresses this will create
      many delete/add events at its peers which could de-stabilize the
      network segment.
      Signed-off-by: NAlexandra Winter <wintera@linux.ibm.com>
      Reviewed-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      817741a8
    • A
      s390/qeth: Translate address events into switchdev notifiers · 10a6cfc0
      Alexandra Winter 提交于
      A qeth-l2 HiperSockets card can show switch-ish behaviour in the sense,
      that it can report all MACs that are reachable via this interface. Just
      like a switch device, it can notify the software bridge about changes
      to its fdb. This patch exploits this device-to-bridge-notification and
      extracts the relevant information from the hardware events to generate
      notifications to an attached software bridge.
      
      There are 2 sources for this information:
      1) The reply message of Perform-Network-Subchannel-Operations (PNSO)
      (operation code ADDR_INFO) reports all addresses that are currently
      reachable (implemented in a later patch).
      2) As long as device-to-bridge-notification is enabled, hardware will
      generate address change notification events, whenever the content of
      the hardware fdb changes (this patch).
      
      The bridge_hostnotify feature (PNSO operation code BRIDGE_INFO) uses
      the same address change notification events. We need to distinguish
      between qeth_pnso_mode QETH_PNSO_BRIDGEPORT and QETH_PNSO_ADDR_INFO
      and call a different handler. In both cases deadlocks must be
      prevented, if the workqueue is drained under lock and QETH_PNSO_NONE,
      when notification is disabled.
      
      bridge_hostnotify generates udev events, there is no intend to do the same
      for dev2br. Instead this patch will generate SWITCHDEV_FDB_ADD_TO_BRIDGE
      and SWITCHDEV_FDB_DEL_TO_BRIDGE notifications, that will cause the
      software bridge to add (or delete) entries to its fdb as 'extern_learn
      offload'.
      
      Documentation/networking/switchdev.txt proposes to add
      "depends NET_SWITCHDEV" to driver's Kconfig. This is not done here,
      so even in absence of the NET_SWITCHDEV module, the QETH_L2 module will
      still be built, but then the switchdev notifiers will have no effect.
      
      No VLAN filtering is done on the entries and VLAN information is not
      passed on to the bridge fdb entries. This could be added later.
      For now VLAN interfaces can be defined on the upper bridge interface.
      
      Multicast entries are not passed on to the bridge fdb.
      This could be added later. For now mcast flooding can be used in the
      bridge.
      
      The card reports all MACs that are in its FDB, but we must not pass on
      MACs that are registered for this interface.
      Signed-off-by: NAlexandra Winter <wintera@linux.ibm.com>
      Reviewed-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      10a6cfc0