1. 04 Jun, 2024 3 commits
    • Jakub Kicinski's avatar
      net: count drops due to missing qdisc as dev->tx_drops · 4fdb6b60
      Jakub Kicinski authored
      Catching and debugging missing qdiscs is pretty tricky. When qdisc
      is deleted we replace it with a noop qdisc, which silently drops
      all the packets. Since the noop qdisc has a single static instance
      we can't count drops at the qdisc level. Count them as dev->tx_drops.
      
        ip netns add red
        ip link add type veth peer netns red
        ip            link set dev veth0 up
        ip -netns red link set dev veth0 up
        ip            a a dev veth0 10.0.0.1/24
        ip -netns red a a dev veth0 10.0.0.2/24
        ping -c 2 10.0.0.2
        #  2 packets transmitted, 2 received, 0% packet loss, time 1031ms
        ip -s link show dev veth0
        #  TX:  bytes packets errors dropped carrier collsns
        #        1314      17      0       0       0       0
      
        tc qdisc replace dev veth0 root handle 1234: mq
        tc qdisc replace dev veth0 parent 1234:1 pfifo
        tc qdisc del dev veth0 parent 1234:1
        ping -c 2 10.0.0.2
        #  2 packets transmitted, 0 received, 100% packet loss, time 1034ms
        ip -s link show dev veth0
        #  TX:  bytes packets errors dropped carrier collsns
        #        1314      17      0       3       0       0
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Link: https://lore.kernel.org/r/20240529162527.3688979-1-kuba@kernel.orgSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      4fdb6b60
    • Douglas Anderson's avatar
      r8152: Wake up the system if the we need a reset · 8c1d92a7
      Douglas Anderson authored
      If we get to the end of the r8152's suspend() routine and we find that
      the USB device is INACCESSIBLE then it means that some of our
      preparation for suspend didn't take place. We need a USB reset to get
      ourselves back in a consistent state so we can try again and that
      can't happen during system suspend. Call pm_wakeup_event() to wake the
      system up in this case.
      Signed-off-by: default avatarDouglas Anderson <dianders@chromium.org>
      Acked-by: default avatarHayes Wang <hayeswang@realtek.com>
      Link: https://lore.kernel.org/r/66590f25.170a0220.8b5ad.1752@mx.google.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      8c1d92a7
    • Douglas Anderson's avatar
      r8152: If inaccessible at resume time, issue a reset · 4933b066
      Douglas Anderson authored
      If we happened to get a USB transfer error during the transition to
      suspend then the usb_queue_reset_device() that r8152_control_msg()
      calls will get dropped on the floor. This is because
      usb_lock_device_for_reset() (which usb_queue_reset_device() uses)
      silently fails if it's called when a device is suspended or if too
      much time passes.
      
      Let's resolve this by resetting the device ourselves in r8152's
      resume() function.
      
      NOTE: due to timing, it's _possible_ that we could end up with two USB
      resets: the one queued previously and the one called from the resume()
      patch. This didn't happen in test cases I ran, though it's conceivably
      possible. We can't easily know if this happened since
      usb_queue_reset_device() can just silently drop the reset request. In
      any case, it's not expected that this is a problem since the two
      resets can't run at the same time (because of the device lock) and it
      should be OK to reset the device twice. If somehow the double-reset
      causes problems we could prevent resets from being queued up while
      suspend is running.
      Signed-off-by: default avatarDouglas Anderson <dianders@chromium.org>
      Acked-by: default avatarHayes Wang <hayeswang@realtek.com>
      Link: https://lore.kernel.org/r/66590f22.170a0220.8b5ad.1750@mx.google.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      4933b066
  2. 03 Jun, 2024 12 commits
  3. 01 Jun, 2024 25 commits