1. 19 12月, 2019 2 次提交
    • J
      s390/qeth: clean up L3 sysfs code · 2390166a
      Julian Wiedmann 提交于
      Consolidate some duplicated code for adding RXIP/VIPA addresses, and
      move the locking to where it's actually needed.
      Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2390166a
    • J
      s390/qeth: overhaul L3 IP address dump code · e6b1b7da
      Julian Wiedmann 提交于
      The current code that dumps the RXIP/VIPA/IPATO addresses via sysfs
      first checks whether the buffer still provides sufficient space to hold
      another formatted address.
      But the maximum length of an formatted IPv4 address is 15 characters,
      not 12. So we underestimate the max required length and if the buffer
      was previously filled to _just_ the right level, a formatted address can
      end up being truncated.
      
      Revamp these code paths to use the _actually_ required length of the
      formatted IP address, and while at it suppress a gratuitous newline.
      
      Also use scnprintf() to format the output. In case of a truncation, this
      would allow us to return the number of characters that were actually
      written.
      Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e6b1b7da
  2. 06 12月, 2019 1 次提交
    • J
      s390/qeth: fix dangling IO buffers after halt/clear · f9e50b02
      Julian Wiedmann 提交于
      The cio layer's intparm logic does not align itself well with how qeth
      manages cmd IOs. When an active IO gets terminated via halt/clear, the
      corresponding IRQ's intparm does not reflect the cmd buffer but rather
      the intparm that was passed to ccw_device_halt() / ccw_device_clear().
      This behaviour was recently clarified in
      commit b91d9e67 ("s390/cio: fix intparm documentation").
      
      As a result, qeth_irq() currently doesn't cancel a cmd that was
      terminated via halt/clear. This primarily causes us to leak
      card->read_cmd after the qeth device is removed, since our IO path still
      holds a refcount for this cmd.
      
      For qeth this means that we need to keep track of which IO is pending on
      a device ('active_cmd'), and use this as the intparm when calling
      halt/clear. Otherwise qeth_irq() can't match the subsequent IRQ to its
      cmd buffer.
      Since we now keep track of the _expected_ intparm, we can also detect
      any mismatch; this would constitute a bug somewhere in the lower layers.
      In this case cancel the active cmd - we effectively "lost" the IRQ and
      should not expect any further notification for this IO.
      
      Fixes: 40554895 ("s390/qeth: add support for dynamically allocated cmds")
      Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f9e50b02
  3. 15 11月, 2019 7 次提交
  4. 01 11月, 2019 3 次提交
  5. 25 8月, 2019 1 次提交
  6. 21 8月, 2019 1 次提交
  7. 28 6月, 2019 9 次提交
  8. 14 6月, 2019 3 次提交
  9. 06 6月, 2019 2 次提交
    • J
      s390/qeth: check dst entry before use · 0cd6783d
      Julian Wiedmann 提交于
      While qeth_l3 uses netif_keep_dst() to hold onto the dst, a skb's dst
      may still have been obsoleted (via dst_dev_put()) by the time that we
      end up using it. The dst then points to the loopback interface, which
      means the neighbour lookup in qeth_l3_get_cast_type() determines a bogus
      cast type of RTN_BROADCAST.
      For IQD interfaces this causes us to place such skbs on the wrong
      HW queue, resulting in TX errors.
      
      Fix-up the various call sites to first validate the dst entry with
      dst_check(), and fall back accordingly.
      Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0cd6783d
    • J
      s390/qeth: handle limited IPv4 broadcast in L3 TX path · 72c87976
      Julian Wiedmann 提交于
      When selecting the cast type of a neighbourless IPv4 skb (eg. on a raw
      socket), qeth_l3 falls back to the packet's destination IP address.
      For this case we should classify traffic sent to 255.255.255.255 as
      broadcast.
      This fixes DHCP requests, which were misclassified as unicast
      (and for IQD interfaces thus ended up on the wrong HW queue).
      Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      72c87976
  10. 26 4月, 2019 3 次提交
  11. 18 4月, 2019 4 次提交
    • 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: 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: 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
  12. 29 3月, 2019 4 次提交