1. 26 4月, 2019 2 次提交
  2. 18 4月, 2019 8 次提交
    • J
      s390/qeth: stop/wake TX queues based on their fill level · 54a50941
      Julian Wiedmann 提交于
      Current xmit code only stops the txq after attempting to fill an
      IO buffer that hasn't been TX-completed yet. In many-connection
      scenarios, this can result in frequent rejected TX attempts, requeuing
      of skbs with NETDEV_TX_BUSY and extra overhead.
      
      Now that we have a proper 1-to-1 relation between stack-side txqs and
      our HW Queues, overhaul the stop/wake logic so that the xmit code
      stops the txq as needed.
      Given that we might map multiple skbs into a single buffer, it's crucial
      to ensure that the queue always provides an _entirely_ empty IO buffer.
      Otherwise large skbs (eg TSO) might not fit into the last available
      buffer. So whenever qeth_do_send_packet() first utilizes an _empty_
      buffer, it updates & checks the used_buffers count.
      
      This now ensures that an skb passed to qeth_xmit() can always be mapped
      into an IO buffer, so remove all of the -EBUSY roll-back handling in the
      TX path. We preserve the minimal safety-checks ("Is this IO buffer
      really available?"), just in case some nasty future bug ever attempts to
      corrupt an in-use buffer.
      Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      54a50941
    • J
      s390/qeth: simplify QoS code · e6c15b5f
      Julian Wiedmann 提交于
      qeth_get_priority_queue() is no longer used for IQD devices, remove the
      special-casing of their mcast queue.
      
      This effectively reverts
      commit 70deb016 ("qeth: omit outbound queue 3 for unicast packets in Priority Queuing on HiperSockets").
      Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e6c15b5f
    • J
      s390/qeth: add TX multiqueue support for OSA devices · 73dc2daf
      Julian Wiedmann 提交于
      This adds trivial support for multiple TX queues on OSA-style devices
      (both real HW and z/VM NICs). For now we expose the driver's existing
      QoS mechanism via .ndo_select_queue, and adjust the number of available
      TX queues when qeth_update_from_chp_desc() detects that the
      HW configuration has changed.
      Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      73dc2daf
    • J
      s390/qeth: add TX multiqueue support for IQD devices · 3a18d754
      Julian Wiedmann 提交于
      qeth has been supporting multiple HW Output Queues for a long time. But
      rather than exposing those queues to the stack, it uses its own queue
      selection logic in .ndo_start_xmit... with all the drawbacks that
      entails.
      Start off by switching IQD devices over to a proper mqs net_device,
      and converting all the netdev_queue management code.
      
      One oddity with IQD devices is the requirement to place all mcast
      traffic on the _highest_ established HW queue. Doing so via
      .ndo_select_queue seems straight-forward - but that won't work if only
      some of the HW queues are active
      (ie. when dev->real_num_tx_queues < dev->num_tx_queues), since
      netdev_cap_txqueue() will not allow us to put skbs on the higher queues.
      
      To make this work, we
      1. let .ndo_select_queue() map all mcast traffic to netdev_queue 0, and
      2. later re-map the netdev_queue and HW queue indices in
         .ndo_start_xmit and the TX completion handler.
      
      With this patch we default to a fixed set of 1 ucast and 1 mcast queue.
      Support for dynamic reconfiguration is added at a later time.
      Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3a18d754
    • J
      s390/qeth: don't keep statistics for tx timeout · 333ef9d1
      Julian Wiedmann 提交于
      struct netdev_queue contains a counter for tx timeouts, which gets
      updated by dev_watchdog(). So let's not attempt to maintain our own
      statistics, in particular not by overloading the skb-error counter.
      Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      333ef9d1
    • J
      s390/qeth: don't bother updating the last-tx time · fdd1a530
      Julian Wiedmann 提交于
      As the documentation for netif_trans_update() says, netdev_start_xmit()
      already updates the last-tx time after every good xmit. So don't
      duplicate that effort.
      
      One odd case is that qeth_flush_buffers() also gets called from our
      TX completion handler, to flush out any partially filled buffer when
      we switch the queue to non-packing mode. But as the TX completion
      handler will _always_ wake the txq, we don't have to worry about
      the TX watchdog there.
      Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fdd1a530
    • J
      s390/qeth: handle error from qeth_update_from_chp_desc() · a4cdc9ba
      Julian Wiedmann 提交于
      Subsequent code relies on the values that qeth_update_from_chp_desc()
      reads from the CHP descriptor. Rather than dealing with weird errors
      later on, just handle it properly here.
      Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a4cdc9ba
    • J
      s390/qeth: clarify naming for some QDIO helpers · 41c47da3
      Julian Wiedmann 提交于
      The naming of several QDIO helpers doesn't match their actual
      functionality, or the structures they operate on. Clean this up.
      
      s/qeth_alloc_qdio_buffers/qeth_alloc_qdio_queues
      s/qeth_free_qdio_buffers/qeth_free_qdio_queues
      s/qeth_alloc_qdio_out_buf/qeth_alloc_output_queue
      s/qeth_clear_outq_buffers/qeth_drain_output_queue
      s/qeth_clear_qdio_buffers/qeth_drain_output_queues
      Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      41c47da3
  3. 29 3月, 2019 8 次提交
  4. 19 3月, 2019 1 次提交
    • J
      s390/qeth: be drop monitor friendly · 104b4859
      Julian Wiedmann 提交于
      As part of the TX completion path, qeth_release_skbs() frees the completed
      skbs with __skb_queue_purge(). This ends in kfree_skb(), reporting every
      completed skb as dropped.
      On the other hand when dropping an skb in .ndo_start_xmit, we end up
      calling consume_skb()... where we should be using kfree_skb() so that
      drop monitors get notified.
      
      Switch the drop/consume logic around, and also don't accumulate dropped
      packets in the tx_errors statistics.
      
      Fixes: dc149e37 ("s390/qeth: replace open-coded skb_queue_walk()")
      Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      104b4859
  5. 01 3月, 2019 5 次提交
    • 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: remove driver-wide workqueue · dcef5cad
      Julian Wiedmann 提交于
      The qeth-wide workqueue is now only used by a single caller to schedule
      close_dev work. Just put it on a system queue instead.
      Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      dcef5cad
    • 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: 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
  6. 16 2月, 2019 5 次提交
  7. 13 2月, 2019 9 次提交
    • 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: 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: cancel cmd on early error · 54daaca7
      Julian Wiedmann 提交于
      When sending cmds via qeth_send_control_data(), qeth puts the request
      on the IO channel and then blocks on the reply object until the response
      has been received.
      
      If the IO completes with error, there will never be a response and we
      block until the reply-wait hits its timeout. For this case, connect the
      request buffer to its reply object, so that we can immediately cancel
      the wait.
      Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      54daaca7
    • J
      s390/qeth: simplify reply object handling · 0951c6ba
      Julian Wiedmann 提交于
      Current code enqueues & dequeues a reply object from the waiter list
      in various places. In particular, the dequeue & enqueue in
      qeth_send_control_data_cb() looks fragile - this can cause
      qeth_clear_ipacmd_list() to skip the active object.
      Add some helpers, and boil the logic down by giving
      qeth_send_control_data() the sole responsibility to add and remove
      objects.
      
      qeth_send_control_data_cb() and qeth_clear_ipacmd_list() will now only
      notify the reply object to interrupt its wait cycle. This can cause
      a slight delay in the removal, but that's no concern.
      Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0951c6ba
    • J
      s390/qeth: limit trace to valid data of command request · 51581fd0
      Julian Wiedmann 提交于
      'len' specifies how much data we send to the HW, don't dump beyond this
      boundary.
      As of today this is no big concern - commands are built in full, zeroed
      pages.
      Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      51581fd0
    • J
      s390/qeth: align csum offload with TSO control logic · 4386e34f
      Julian Wiedmann 提交于
      csum offload and TSO have similar programming requirements. The TSO code
      was reworked with commit "s390/qeth: enhance TSO control sequence",
      adjust the csum control flow accordingly. Primarily this means replacing
      custom helpers with more generic infrastructure.
      
      Also, change the LP2LP check so that it warns on TX offload (not RX).
      This is where reduced csum capability actually matters.
      Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4386e34f
    • J
      s390/qeth: enable only required csum offload features · 7e83747d
      Julian Wiedmann 提交于
      Current code attempts to enable all advertised HW csum offload features.
      Future-proof this by enabling only those features that we actually use.
      
      Also, the IPv4 header csum feature is only needed for TX on L3 devices.
      Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7e83747d
    • 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
    • J
      s390/qeth: reduce data length for ARP cache query · 84dbea46
      Julian Wiedmann 提交于
      qeth_l3_query_arp_cache_info() indicates a data length that's much
      larger than the actual length of its request (ie. the value passed to
      qeth_get_setassparms_cmd()). The confusion presumably comes from the
      fact that the cmd _response_ can be quite large - but that's no concern
      for the initial request IO.
      
      Fixing this up allows us to use the generic qeth_send_ipa_cmd()
      infrastructure.
      Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      84dbea46
  8. 07 2月, 2019 1 次提交
  9. 05 2月, 2019 1 次提交