1. Apr 07, 2021
    • David S. Miller's avatar
      Merge branch 'usbnet-speed' · b3feb439
      David S. Miller authored
      Grant Grundler says:
      
      ====================
      usbnet: speed reporting for devices without MDIO
      
      This series introduces support for USB network devices that report
      speed as a part of their protocol, not emulating an MII to be accessed
      over MDIO.
      
      v2: rebased on recent upstream changes
      v3: incorporated hints on naming and comments
      v4: fix misplaced hunks; reword some commit messages;
          add same change for cdc_ether
      v4-repost: added "net-next" to subject and Andrew Lunn's Reviewed-by
      
      I'm reposting Oliver Neukum's <oneukum@suse.com> patch series with
      fix ups for "misplaced hunks" (landed in the wrong patches).
      Please fixup the "author" if "git am" fails to attribute the
      patches 1-3 (of 4) to Oliver.
      
      I've tested v4 series with "5.12-rc3+" kernel on Intel NUC6i5SYB
      and + Sabrent NT-S25G. Google Pixelbook Go (chromeos-4.4 kernel)
      + Alpha Network AUE2500C were connected directly to the NT-S25G
      to get 2.5Gbps link rate:
      Settings for enx002427880815:
              Supported ports: [  ]
              Supported link modes:   Not reported
              Supported pause frame use: No
              Supports auto-negotiation: No
              Supported FEC modes: Not reported
              Advertised link modes:  Not reported
              Advertised pause frame use: No
              Advertised auto-negotiation: No
              Advertised FEC modes: Not reported
              Speed: 2500Mb/s
              Duplex: Half
              Auto-negotiation: off
              Port: Twisted Pair
              PHYAD: 0
              Transceiver: internal
              MDI-X: Unknown
              Current message level: 0x00000007 (7)
                                     drv probe link
              Link detected: yes
      
      "Duplex" is a lie since we get no information about it.
      
      I expect "Auto-Negotiation" is always true for cdc_ncm and
      cdc_ether devices and perhaps someone knows offhand how
      to have ethtool report "true" instead.
      
      But this is good step in the right direction.
      
      base-commit: 1c273e10
      
      
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b3feb439
    • Grant Grundler's avatar
      net: cdc_ether: record speed in status method · d42ebcbb
      Grant Grundler authored
      
      
      Until very recently, the usbnet framework only had support functions
      for devices which reported the link speed by explicitly querying the
      PHY over a MDIO interface. However, the cdc_ether devices send
      notifications when the link state or link speeds change and do not
      expose the PHY (or modem) directly.
      
      Support funtions (e.g. usbnet_get_link_ksettings_internal()) to directly
      query state recorded by the cdc_ether driver were added in a previous patch.
      
      Instead of cdc_ether spewing the link speed into the dmesg buffer,
      record the link speed encoded in these notifications and tell the
      usbnet framework to use the new functions to get link speed/state.
      
      User space can now get the most recent link speed/state using ethtool.
      
      v4: added to series since cdc_ether uses same notifications
          as cdc_ncm driver.
      
      Signed-off-by: default avatarGrant Grundler <grundler@chromium.org>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d42ebcbb
    • Oliver Neukum's avatar
      net: cdc_ncm: record speed in status method · eb47c274
      Oliver Neukum authored
      Until very recently, the usbnet framework only had support functions
      for devices which reported the link speed by explicitly querying the
      PHY over a MDIO interface. However, the cdc_ncm devices send
      notifications when the link state or link speeds change and do not
      expose the PHY (or modem) directly.
      
      Support funtions (e.g. usbnet_get_link_ksettings_internal()) to directly
      query state recorded by the cdc_ncm driver were added in a previous patch.
      
      So instead of cdc_ncm spewing the link speed into the dmesg buffer,
      record the link speed encoded in these notifications and tell the
      usbnet framework to use the new functions to get link speed/state.
      Link speed/state is now available via ethtool.
      
      This is especially useful given all current RTL8156 devices emit
      a connection/speed status notification every 32ms and this would
      fill the dmesg buffer. This implementation replaces the one
      recently submitted in de658a19
      
       :
         "net: usb: cdc_ncm: don't spew notifications"
      
      v2: rebased on upstream
      v3: changed variable names
      v4: rewrote commit message
      
      Signed-off-by: default avatarOliver Neukum <oneukum@suse.com>
      Tested-by: default avatarRoland Dreier <roland@kernel.org>
      Signed-off-by: default avatarGrant Grundler <grundler@chromium.org>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      eb47c274
    • Oliver Neukum's avatar
      usbnet: add method for reporting speed without MII · 956baa99
      Oliver Neukum authored
      
      
      The old method for reporting link speed assumed a driver uses the
      generic phy (mii) MDIO read/write functions. CDC devices don't
      expose the phy.
      
      Add a primitive internal version reporting back directly what
      the CDC notification/status operations recorded.
      
      v2: rebased on upstream
      v3: changed names and made clear which units are used
      v4: moved hunks to correct patch; rewrote commmit messages
      
      Signed-off-by: default avatarOliver Neukum <oneukum@suse.com>
      Tested-by: default avatarRoland Dreier <roland@kernel.org>
      Reviewed-by: default avatarGrant Grundler <grundler@chromium.org>
      Tested-by: default avatarGrant Grundler <grundler@chromium.org>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      956baa99
    • Oliver Neukum's avatar
      usbnet: add _mii suffix to usbnet_set/get_link_ksettings · 77651900
      Oliver Neukum authored
      
      
      The generic functions assumed devices provided an MDIO interface (accessed
      via older mii code, not phylib). This is true only for genuine ethernet.
      
      Devices with a higher level of abstraction or based on different
      technologies do not have MDIO. To support this case, first rename
      the existing functions with _mii suffix.
      
      v2: rebased on changed upstream
      v3: changed names to clearly say that this does NOT use phylib
      v4: moved hunks to correct patch; reworded commmit messages
      
      Signed-off-by : Oliver Neukum <oneukum@suse.com>
      Tested-by: default avatarRoland Dreier <roland@kernel.org>
      Reviewed-by: default avatarGrant Grundler <grundler@chromium.org>
      Tested-by: default avatarGrant Grundler <grundler@chromium.org>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      77651900
    • Manoj Basapathi's avatar
      tcp: Reset tcp connections in SYN-SENT state · e880f8b3
      Manoj Basapathi authored
      
      
      Userspace sends tcp connection (sock) destroy on network switch
      i.e switching the default network of the device between multiple
      networks(Cellular/Wifi/Ethernet).
      
      Kernel though doesn't send reset for the connections in SYN-SENT state
      and these connections continue to remain.
      Even as per RFC 793, there is no hard rule to not send RST on ABORT in
      this state.
      
      Modify tcp_abort and tcp_disconnect behavior to send RST for connections
      in syn-sent state to avoid lingering connections on network switch.
      
      Signed-off-by: default avatarManoj Basapathi <manojbm@codeaurora.org>
      Signed-off-by: default avatarSauvik Saha <ssaha@codeaurora.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e880f8b3
  2. Apr 06, 2021
  3. Apr 04, 2021
  4. Apr 03, 2021