1. 06 Apr, 2021 8 commits
    • Qiheng Lin's avatar
      net: ethernet: mtk_eth_soc: remove unneeded semicolon · 3b2c32f9
      Qiheng Lin authored
      Eliminate the following coccicheck warning:
       drivers/net/ethernet/mediatek/mtk_ppe.c:270:2-3: Unneeded semicolon
      Signed-off-by: default avatarQiheng Lin <linqiheng@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3b2c32f9
    • wengjianfeng's avatar
      nfc: s3fwrn5: remove unnecessary label · b58c4649
      wengjianfeng authored
      In function s3fwrn5_nci_post_setup, the variable ret is assigned then
      goto out label, which just return ret, so we use return to replace it.
      Other goto sentences are similar, we use return sentences to replace
      goto sentences and delete out label.
      Signed-off-by: default avatarwengjianfeng <wengjianfeng@yulong.com>
      Reviewed-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b58c4649
    • 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. 05 Apr, 2021 12 commits
  3. 04 Apr, 2021 2 commits
  4. 03 Apr, 2021 7 commits
    • David S. Miller's avatar
      Merge branch 'stmmac-xdp' · 428e68e1
      David S. Miller authored
      Ong Boon Leong says:
      
      ====================
      stmmac: Add XDP support
      
      This is the v4 patch series for adding XDP native support to stmmac.
      
      Changes in v4:
      5/6: Move TX clean timer setup to the end of NAPI RX process and
           group it under stmmac_finalize_xdp_rx().
           Also, fixed stmmac_xdp_xmit_back() returns STMMAC_XDP_CONSUMED
           if XDP buffer conversion to XDP frame fails.
      
      6/6: Move xdp_do_flush(0 into stmmac_finalize_xdp_rx() and combine
           the XDP verdict of XDP TX and XDP REDIRECT together.
      
      I retested the patch series on the 'xdp2' and 'xdp_redirect' related to
      changes above and found the result to be satisfactory.
      
      History of previous patch series:
      v3: https://patchwork.kernel.org/project/netdevbpf/cover/20210331154135.8507-1-boon.leong.ong@intel.com/
      v2: https://patchwork.kernel.org/project/netdevbpf/list/?series=457757
      v1: https://patchwork.kernel.org/project/netdevbpf/list/?series=457139
      
      It will be great if community can help to test or review the v4 series
      and provide me any input if any.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      428e68e1
    • Ong Boon Leong's avatar
      net: stmmac: Add support for XDP_REDIRECT action · 8b278a5b
      Ong Boon Leong authored
      This patch adds the support of XDP_REDIRECT to another remote cpu for
      further action. It also implements ndo_xdp_xmit ops, enabling the driver
      to transmit packets forwarded to it by XDP program running on another
      interface.
      
      This patch has been tested using "xdp_redirect_cpu" for XDP_REDIRECT
      + drop testing. It also been tested with "xdp_redirect" sample app
      which can be used to exercise ndo_xdp_xmit ops. The burst traffics are
      generated using pktgen_sample03_burst_single_flow.sh in samples/pktgen
      directory.
      
      v4: Move xdp_do_flush() processing into stmmac_finalize_xdp_rx() and
          combined the XDP verdict of XDP TX and REDIRECT together.
      
      v3: Added 'nq->trans_start = jiffies' to avoid TX time-out as we are
          sharing TX queue between slow path and XDP. Thanks to Jakub Kicinski
          for point out.
      Signed-off-by: default avatarOng Boon Leong <boon.leong.ong@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8b278a5b
    • Ong Boon Leong's avatar
      net: stmmac: Add support for XDP_TX action · be8b38a7
      Ong Boon Leong authored
      This patch adds support for XDP_TX action which enables XDP program to
      transmit back received frames.
      
      This patch has been tested with the "xdp2" app located in samples/bpf
      dir. The DUT receives burst traffic packet generated using pktgen script
      'pktgen_sample03_burst_single_flow.sh'.
      
      v4: Moved stmmac_tx_timer_arm() to be done once at the end of NAPI RX.
          Fixed stmmac_xdp_xmit_back() to return STMMAC_XDP_CONSUMED if
          XDP buffer to frame conversion fails. Thanks to Jakub's input.
      
      v3: Added 'nq->trans_start = jiffies' to avoid TX time-out as we are
          sharing TX queue between slow path and XDP. Thanks to Jakub Kicinski
          for pointing out.
      Signed-off-by: default avatarOng Boon Leong <boon.leong.ong@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      be8b38a7
    • Ong Boon Leong's avatar
      net: stmmac: Add initial XDP support · 5fabb012
      Ong Boon Leong authored
      This patch adds the initial XDP support to stmmac driver. It supports
      XDP_PASS, XDP_DROP and XDP_ABORTED actions. Upcoming patches will add
      support for XDP_TX and XDP_REDIRECT.
      
      To support XDP headroom, this patch adds page_offset into RX buffer and
      change the dma_sync_single_for_device|cpu(). The DMA address used for
      RX operation are changed to take into page_offset too. As page_pool
      can handle dma_sync_single_for_device() on behalf of driver with
      PP_FLAG_DMA_SYNC_DEV flag, we skip doing that in stmmac driver.
      
      Current stmmac driver supports split header support (SPH) in RX but
      the flexibility of splitting header and payload at different position
      makes it very complex to be supported for XDP processing. In addition,
      jumbo frame is not supported in XDP to keep the initial codes simple.
      
      This patch has been tested with the sample app "xdp1" located in
      samples/bpf directory for both SKB and Native (XDP) mode. The burst
      traffic generated using pktgen_sample03_burst_single_flow.sh in
      samples/pktgen directory.
      
      Changes in v3:
       - factor in xdp header and tail adjustment done by XDP program.
         Thanks to Jakub Kicinski for pointing out the gap in v2.
      
      Changes in v2:
       - fix for "warning: variable 'len' set but not used" reported by lkp.
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Signed-off-by: default avatarOng Boon Leong <boon.leong.ong@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5fabb012
    • Ong Boon Leong's avatar
      net: stmmac: arrange Tx tail pointer update to stmmac_flush_tx_descriptors · d96febed
      Ong Boon Leong authored
      This patch organizes TX tail pointer update into a new function called
      stmmac_flush_tx_descriptors() so that we can reuse it in stmmac_xmit(),
      stmmac_tso_xmit() and up-coming XDP implementation.
      
      Changes to v2:
       - Fix for warning: unused variable ‘desc_size’
         https://patchwork.hopto.org/static/nipa/457321/12170149/build_32bit/stderrSigned-off-by: default avatarOng Boon Leong <boon.leong.ong@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d96febed
    • Ong Boon Leong's avatar
      net: stmmac: make SPH enable/disable to be configurable · d08d32d1
      Ong Boon Leong authored
      SPH functionality splits header and payload according to split mode and
      offsef fields (SPLM and SPLOFST). It is beneficials for Linux network
      stack RX processing however it adds a lot of complexity in XDP
      processing.
      
      So, this patch makes the split-header (SPH) capability of the controller
      is stored in "priv->sph_cap" and the enabling/disabling of SPH is decided
      by "priv->sph".
      
      This is to prepare initial XDP enabling for stmmac to disable the use of
      SPH whenever XDP is enabled.
      Signed-off-by: default avatarOng Boon Leong <boon.leong.ong@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d08d32d1
    • Ong Boon Leong's avatar
      net: stmmac: set IRQ affinity hint for multi MSI vectors · 8deec94c
      Ong Boon Leong authored
      Certain platform likes Intel mGBE has independent hardware IRQ resources
      for TX and RX DMA operation. In preparation to support XDP TX, we add IRQ
      affinity hint to group both RX and TX queue of the same queue ID to the
      same CPU.
      
      Changes in v2:
       - IRQ affinity hint need to set to null before IRQ is released.
         Thanks to issue reported by Song, Yoong Siang.
      Reported-by: default avatarSong, Yoong Siang <yoong.siang.song@intel.com>
      Signed-off-by: default avatarOng Boon Leong <boon.leong.ong@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8deec94c
  5. 02 Apr, 2021 11 commits