1. 18 4月, 2019 1 次提交
  2. 29 3月, 2019 4 次提交
  3. 19 3月, 2019 2 次提交
  4. 01 3月, 2019 7 次提交
    • J
      s390/qeth: drop redundant state checking · 0f7aedbd
      Julian Wiedmann 提交于
      Now that qeth always uses dev_close() to shutdown the interface, we can
      trust the locking and remove some custom state checks.
      qeth_l?_stop_card() is no longer called for a card in UP state, so remove
      the checks there too. This basically makes the UP state obsolete, so rip
      out the whole thing (except for the sysfs-visible string).
      Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0f7aedbd
    • J
      s390/qeth: don't special-case HW trap during suspend · 62ca98d4
      Julian Wiedmann 提交于
      It makes no difference whether we
      1. manually disarm the HW trap and call the offline code with
         recovery_mode == 1, or
      2. call the offline code with recovery_mode == 0, and let it disarm the
         HW trap for us.
      
      So consolidate the two code paths in the suspend callback.
      Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      62ca98d4
    • J
      s390/qeth: don't defer close_dev work during recovery · bf42d40b
      Julian Wiedmann 提交于
      The recovery code already runs in a kthread, we don't have to defer the
      offlining further.
      Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bf42d40b
    • J
      s390/qeth: call dev_close() during recovery · d4560150
      Julian Wiedmann 提交于
      When resetting an interface ("recovery"), qeth currently attempts to
      elide the call to dev_close(). We initially only call .ndo_close to
      quiesce the data path, and then offline & online the ccwgroup device.
      If the reset succeeded, a call to .ndo_open then resumes the data path
      along with some internal setup (dev_addr validation, RX modeset) that
      dev_open() would have usually triggered.
      dev_close() only gets called (via the close_dev worker) if the reset
      action fails.
      
      It's unclear whether this was initially done due to locking concerns, or
      rather to execute the reset transparently. Either way, temporarily
      closing the interface without dev_close() is fragile, and means we're
      susceptible to various races and unexpected behaviour. For instance:
      
      - Bypassing dev_deactivate_many() means that the qdiscs are not set to
      __QDISC_STATE_DEACTIVATED. Consequently any intermittent TX completion
      can wake up the txq, resulting in calls to .ndo_start_xmit while the
      data path is down. We have custom state checking to detect this case
      and drop such packets.
      
      - Because the IFF_UP flag doesn't reflect the interface's actual state
      during a reset, we have custom state checking in .ndo_open and
      .ndo_close to guard against invalid calls.
      
      - Considering that the reset might take a considerable amount of time
      (in particular if an IO fails and we end up waiting for its timeout), we
      _do_ want NETDEV_GOING_DOWN and NETDEV_DOWN events so that components
      like bonding, team, bridge, macvlan, vlan, ... can take appropriate
      action.
      Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d4560150
    • J
      s390/qeth: unconditionally clear MAC_REGISTERED flag · 7bd2275c
      Julian Wiedmann 提交于
      In its attempt to run only the minimal amount of tear down steps,
      qeth_l2_stop_card() fails to reset the "is dev_addr registered?" flag
      in some rare scenarios. But a future change to the tear down sequence
      would cause us to _always_ hit this issue, so patch it up before that
      code lands.
      
      Fix it by unconditionally clearing the flag bit. This also allows us to
      remove the additional cleanup step in qeth_dev_layer2_store().
      Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7bd2275c
    • J
      s390/qeth: enable/disable the HW trap a little earlier · d7ef489f
      Julian Wiedmann 提交于
      When setting a L2 qeth device online, enable the HW trap as soon as the
      control plane is available. This allows us to catch any error that
      occurs during the very first commands.
      
      In the same spirit, the offline code should disable the HW trap as the
      very first step of its processing.
      Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d7ef489f
    • J
      s390/qeth: remove RECOVER state · d7d543f2
      Julian Wiedmann 提交于
      The offline code uses a specific RECOVER state to indicate that the
      interface should be brought up when a qeth device is set online again.
      
      Rather than having a specific card-state for this, just put it in an
      internal flag bit and set the state to DOWN. When working with the
      card's state transitions, this reduces the complexity quite a bit.
      Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d7d543f2
  5. 16 2月, 2019 4 次提交
  6. 13 2月, 2019 4 次提交
    • J
      s390/qeth: convert remaining legacy cmd callbacks · 742d4d40
      Julian Wiedmann 提交于
      This calls the existing errno translation helpers from the callbacks,
      adding trivial wrappers where necessary. For cmds that have no
      sophisticated errno translation, default to -EIO.
      
      For IPA cmds with no callback, fall back to a minimal default. This is
      currently being used by qeth_l3_send_setrouting().
      
      Thus having all converted all callbacks, remove the legacy path in
      qeth_send_control_data_cb().
      Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      742d4d40
    • J
      s390/qeth: convert bridgeport callbacks · 1709ff8d
      Julian Wiedmann 提交于
      By letting the callbacks deal with error translation, we no longer need
      to pass the raw error codes back to the originator. This allows us to
      slim down the callback's private data, and nicely simplifies the code.
      Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1709ff8d
    • J
      s390/qeth: allow cmd callbacks to return errnos · 4b7ae122
      Julian Wiedmann 提交于
      Error propagation from cmd callbacks currently works in a way where
      qeth_send_control_data_cb() picks the raw HW code from the response,
      and the cmd's originator later translates this into an errno.
      The callback itself only returns 0 ("done") or 1 ("expect more data").
      
      This is
      1. limiting, as the only means for the callback to report an internal
      error is to invent pseudo HW codes (such as IPA_RC_ENOMEM), that
      the originator then needs to understand. For non-IPA callbacks, we
      even provide a separate field in the IO buffer metadata (iob->rc) so
      the callback can pass back a return value.
      2. fragile, as the originator must take care to not translate any errno
      that is returned by qeth's own IO code paths (eg -ENOMEM). Also, any
      originator that forgets to translate the HW codes potentially passes
      garbage back to its caller. For instance, see
      commit 2aa48671 ("s390/qeth: translate SETVLAN/DELVLAN errors").
      
      Introduce a new model where all HW error translation is done within the
      callback, and the callback returns
      >  0, if it expects more data (as before)
      == 0, on success
      <  0, with an errno
      
      Start off with converting all callbacks to the new model that either
      a) pass back pseudo HW codes, or b) have a dependency on a specific
      HW error code. Also convert c) the one callback that uses iob->rc, and
      d) qeth_setadpparms_change_macaddr_cb() so that it can pass back an
      error back to qeth_l2_request_initial_mac() even when the cmd itself
      was successful.
      
      The old model remains supported: if the callback returns 0, we still
      propagate the response's HW error code back to the originator.
      Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4b7ae122
    • J
      s390/qeth: consolidate filling of low-level cmd length fields · c2153277
      Julian Wiedmann 提交于
      The code to fill the IPA length fields is duplicated three times across
      the driver:
      1. qeth_send_ipa_cmd() sets IPA_CMD_LENGTH, which matches the defaults
         in the IPA_PDU_HEADER template.
      2. for OSN, qeth_osn_send_ipa_cmd() bypasses this logic and inserts the
         length passed by the caller.
      3. SNMP commands (that can outgrow IPA_CMD_LENGTH) have their own way
         of setting the length fields, via qeth_send_ipa_snmp_cmd().
      
      Consolidate this into qeth_prepare_ipa_cmd(), which all originators of
      IPA cmds already call during setup of their cmd. Let qeth_send_ipa_cmd()
      pull the length from the cmd instead of hard-coding IPA_CMD_LENGTH.
      
      For now, the SNMP code still needs to fix-up its length fields manually.
      Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c2153277
  7. 05 2月, 2019 2 次提交
  8. 26 1月, 2019 6 次提交
  9. 07 12月, 2018 1 次提交
  10. 09 11月, 2018 2 次提交
    • J
      s390/qeth: remove card list · d7d18da1
      Julian Wiedmann 提交于
      Re-implement the card-by-RDEV lookup by using device model concepts, and
      remove the now redundant list of all qeth card instances in the system.
      Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d7d18da1
    • J
      s390/qeth: utilize virtual MAC for Layer2 OSD devices · b144b99f
      Julian Wiedmann 提交于
      By default, READ MAC on a Layer2 OSD device returns the adapter's
      burnt-in MAC address. Given the default scenario of many virtual devices
      on the same adapter, qeth can't make any use of this address and
      therefore skips the READ MAC call for this device type.
      
      But in some configurations, the READ MAC command for a Layer2 OSD device
      actually returns a pre-provisioned, virtual MAC address. So enable the
      READ MAC code to detect this situation, and let the L2 subdriver
      call READ MAC for OSD devices.
      
      This also removes the QETH_LAYER2_MAC_READ flag, which protects L2
      devices against calling READ MAC multiple times. Instead protect the
      whole call to qeth_l2_request_initial_mac().
      Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b144b99f
  11. 04 11月, 2018 3 次提交
  12. 13 10月, 2018 1 次提交
  13. 27 9月, 2018 3 次提交