1. 25 Sep, 2020 40 commits
    • Jesse Brandeburg's avatar
      sfc: fix kdoc warning · add3c86a
      Jesse Brandeburg authored
      kernel-doc script as used by W=1, is confused by the macro
      usage inside the header describing the efx_ptp_data struct.
      
      drivers/net/ethernet/sfc/ptp.c:345: warning: Function parameter or member 'MC_CMD_PTP_IN_TRANSMIT_LENMAX' not described in 'efx_ptp_data'
      
      After some discussion on the list, break this patch out to
      a separate one, and fix the issue through a creative
      macro declaration.
      Signed-off-by: default avatarJesse Brandeburg <jesse.brandeburg@intel.com>
      Acked-by: default avatarEdward Cree <ecree@solarflare.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      add3c86a
    • Jesse Brandeburg's avatar
      drivers/net/ethernet: remove incorrectly formatted doc · 81929a4a
      Jesse Brandeburg authored
      As part of the W=1 series for ethernet, these drivers were
      discovered to be using kdoc style comments but were not actually
      doing kdoc. The kernel uses kdoc style when documenting code, not
      doxygen or other styles.
      
      Fixed Warnings:
      drivers/net/ethernet/amazon/ena/ena_com.c:613: warning: Function parameter or member 'ena_dev' not described in 'ena_com_set_llq'
      drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c:1540: warning: Cannot understand  * @brief Set VLAN filter table
      drivers/net/ethernet/xilinx/ll_temac_main.c:114: warning: Function parameter or member 'lp' not described in 'temac_indirect_busywait'
      drivers/net/ethernet/xilinx/ll_temac_main.c:129: warning: Function parameter or member 'lp' not described in 'temac_indirect_in32'
      drivers/net/ethernet/xilinx/ll_temac_main.c:129: warning: Function parameter or member 'reg' not described in 'temac_indirect_in32'
      drivers/net/ethernet/xilinx/ll_temac_main.c:147: warning: Function parameter or member 'lp' not described in 'temac_indirect_in32_locked'
      drivers/net/ethernet/xilinx/ll_temac_main.c:147: warning: Function parameter or member 'reg' not described in 'temac_indirect_in32_locked'
      drivers/net/ethernet/xilinx/ll_temac_main.c:172: warning: Function parameter or member 'lp' not described in 'temac_indirect_out32'
      drivers/net/ethernet/xilinx/ll_temac_main.c:172: warning: Function parameter or member 'reg' not described in 'temac_indirect_out32'
      drivers/net/ethernet/xilinx/ll_temac_main.c:172: warning: Function parameter or member 'value' not described in 'temac_indirect_out32'
      drivers/net/ethernet/xilinx/ll_temac_main.c:188: warning: Function parameter or member 'lp' not described in 'temac_indirect_out32_locked'
      drivers/net/ethernet/xilinx/ll_temac_main.c:188: warning: Function parameter or member 'reg' not described in 'temac_indirect_out32_locked'
      drivers/net/ethernet/xilinx/ll_temac_main.c:188: warning: Function parameter or member 'value' not described in 'temac_indirect_out32_locked'
      drivers/net/ethernet/xilinx/ll_temac_main.c:212: warning: Function parameter or member 'lp' not described in 'temac_dma_in32_be'
      drivers/net/ethernet/xilinx/ll_temac_main.c:212: warning: Function parameter or member 'reg' not described in 'temac_dma_in32_be'
      drivers/net/ethernet/xilinx/ll_temac_main.c:228: warning: Function parameter or member 'lp' not described in 'temac_dma_out32_be'
      drivers/net/ethernet/xilinx/ll_temac_main.c:228: warning: Function parameter or member 'reg' not described in 'temac_dma_out32_be'
      drivers/net/ethernet/xilinx/ll_temac_main.c:228: warning: Function parameter or member 'value' not described in 'temac_dma_out32_be'
      drivers/net/ethernet/xilinx/ll_temac_main.c:247: warning: Function parameter or member 'lp' not described in 'temac_dma_dcr_in'
      drivers/net/ethernet/xilinx/ll_temac_main.c:247: warning: Function parameter or member 'reg' not described in 'temac_dma_dcr_in'
      drivers/net/ethernet/xilinx/ll_temac_main.c:255: warning: Function parameter or member 'lp' not described in 'temac_dma_dcr_out'
      drivers/net/ethernet/xilinx/ll_temac_main.c:255: warning: Function parameter or member 'reg' not described in 'temac_dma_dcr_out'
      drivers/net/ethernet/xilinx/ll_temac_main.c:255: warning: Function parameter or member 'value' not described in 'temac_dma_dcr_out'
      drivers/net/ethernet/xilinx/ll_temac_main.c:265: warning: Function parameter or member 'lp' not described in 'temac_dcr_setup'
      drivers/net/ethernet/xilinx/ll_temac_main.c:265: warning: Function parameter or member 'op' not described in 'temac_dcr_setup'
      drivers/net/ethernet/xilinx/ll_temac_main.c:265: warning: Function parameter or member 'np' not described in 'temac_dcr_setup'
      drivers/net/ethernet/xilinx/ll_temac_main.c:300: warning: Function parameter or member 'ndev' not described in 'temac_dma_bd_release'
      drivers/net/ethernet/xilinx/ll_temac_main.c:330: warning: Function parameter or member 'ndev' not described in 'temac_dma_bd_init'
      drivers/net/ethernet/xilinx/ll_temac_main.c:600: warning: Function parameter or member 'ndev' not described in 'temac_setoptions'
      drivers/net/ethernet/xilinx/ll_temac_main.c:600: warning: Function parameter or member 'options' not described in 'temac_setoptions'
      Signed-off-by: default avatarJesse Brandeburg <jesse.brandeburg@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      81929a4a
    • Jesse Brandeburg's avatar
      drivers/net/ethernet: add some basic kdoc tags · f410f157
      Jesse Brandeburg authored
      A couple of drivers had a "generic documentation" section that
      would trigger a "can't understand" message from W=1 compiles.
      
      Fix by using correct DOC: tags in the generic sections.
      
      Fixed Warnings:
      drivers/net/ethernet/arc/emac_arc.c:4: info: Scanning doc for c
      drivers/net/ethernet/cadence/macb_pci.c:3: warning: missing initial short description on line:
       * Cadence GEM PCI wrapper.
      drivers/net/ethernet/cadence/macb_pci.c:3: info: Scanning doc for Cadence
      Signed-off-by: default avatarJesse Brandeburg <jesse.brandeburg@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f410f157
    • Jesse Brandeburg's avatar
      drivers/net/ethernet: handle one warning explicitly · 2602ddfe
      Jesse Brandeburg authored
      While fixing the W=1 builds, this warning came up because the
      developers used a very tricky way to get structures initialized
      to a non-zero value, but this causes GCC to warn about an
      override. In this case the override was intentional, so just
      disable the warning for this code with a kernel macro that results
      in disabling the warning for compiles on GCC versions after 8.
      
      It is not appropriate to change the struct to initialize all the
      values as it will just add a lot more code for no value. The code
      is completely correct as is, we just want to acknowledge that
      this code could generate a warning and we're ok with that.
      
      NOTE: the __diag_ignore macro currently only accepts a second
      argument of 8 (version 80000), it's either use this one or
      open code the pragma.
      
      Fixed Warnings example (all the same):
      drivers/net/ethernet/renesas/sh_eth.c:51:12: warning: initialized field overwritten [-Woverride-init]
      drivers/net/ethernet/renesas/sh_eth.c:52:12: warning: initialized field overwritten [-Woverride-init]
      drivers/net/ethernet/renesas/sh_eth.c:53:13: warning: initialized field overwritten [-Woverride-init]
      + 256 more...
      Signed-off-by: default avatarJesse Brandeburg <jesse.brandeburg@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2602ddfe
    • Jesse Brandeburg's avatar
      drivers/net/ethernet: rid ethernet of no-prototype warnings · 553aca1c
      Jesse Brandeburg authored
      The W=1 builds showed a few files exporting functions
      (non-static) that were not prototyped. What actually happened is
      that there were prototypes, but the include file was forgotten in
      the implementation file.
      
      Add the include file and remove the warnings.
      
      Fixed Warnings:
      drivers/net/ethernet/cavium/liquidio/cn68xx_device.c:124:5: warning: no previous prototype for ‘lio_setup_cn68xx_octeon_device’ [-Wmissing-prototypes]
      drivers/net/ethernet/cavium/liquidio/octeon_mem_ops.c:159:1: warning: no previous prototype for ‘octeon_pci_read_core_mem’ [-Wmissing-prototypes]
      drivers/net/ethernet/cavium/liquidio/octeon_mem_ops.c:168:1: warning: no previous prototype for ‘octeon_pci_write_core_mem’ [-Wmissing-prototypes]
      drivers/net/ethernet/cavium/liquidio/octeon_mem_ops.c:176:5: warning: no previous prototype for ‘octeon_read_device_mem64’ [-Wmissing-prototypes]
      drivers/net/ethernet/cavium/liquidio/octeon_mem_ops.c:185:5: warning: no previous prototype for ‘octeon_read_device_mem32’ [-Wmissing-prototypes]
      drivers/net/ethernet/cavium/liquidio/octeon_mem_ops.c:194:6: warning: no previous prototype for ‘octeon_write_device_mem32’ [-Wmissing-prototypes]
      drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c:453:6: warning: no previous prototype for ‘hclge_dcb_ops_set’ [-Wmissing-prototypes]
      Signed-off-by: default avatarJesse Brandeburg <jesse.brandeburg@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      553aca1c
    • Jesse Brandeburg's avatar
      drivers/net/ethernet: clean up unused assignments · 7c8c0291
      Jesse Brandeburg authored
      As part of the W=1 compliation series, these lines all created
      warnings about unused variables that were assigned a value. Most
      of them are from register reads, but some are just picking up
      a return value from a function and never doing anything with it.
      
      Fixed warnings:
      .../ethernet/brocade/bna/bnad.c:3280:6: warning: variable ‘rx_count’ set but not used [-Wunused-but-set-variable]
      .../ethernet/brocade/bna/bnad.c:3280:6: warning: variable ‘rx_count’ set but not used [-Wunused-but-set-variable]
      .../ethernet/cortina/gemini.c:512:6: warning: variable ‘val’ set but not used [-Wunused-but-set-variable]
      .../ethernet/cortina/gemini.c:2110:21: warning: variable ‘config0’ set but not used [-Wunused-but-set-variable]
      .../ethernet/cavium/liquidio/octeon_device.c:1327:6: warning: variable ‘val32’ set but not used [-Wunused-but-set-variable]
      .../ethernet/cavium/liquidio/octeon_device.c:1358:6: warning: variable ‘val32’ set but not used [-Wunused-but-set-variable]
      .../ethernet/dec/tulip/media.c:322:8: warning: variable ‘setup’ set but not used [-Wunused-but-set-variable]
      .../ethernet/dec/tulip/de4x5.c:4928:13: warning: variable ‘r3’ set but not used [-Wunused-but-set-variable]
      .../ethernet/micrel/ksz884x.c:1652:7: warning: variable ‘dummy’ set but not used [-Wunused-but-set-variable]
      .../ethernet/micrel/ksz884x.c:1652:7: warning: variable ‘dummy’ set but not used [-Wunused-but-set-variable]
      .../ethernet/micrel/ksz884x.c:1652:7: warning: variable ‘dummy’ set but not used [-Wunused-but-set-variable]
      .../ethernet/micrel/ksz884x.c:1652:7: warning: variable ‘dummy’ set but not used [-Wunused-but-set-variable]
      .../ethernet/micrel/ksz884x.c:4981:6: warning: variable ‘rx_status’ set but not used [-Wunused-but-set-variable]
      .../ethernet/micrel/ksz884x.c:6510:6: warning: variable ‘rc’ set but not used [-Wunused-but-set-variable]
      .../ethernet/micrel/ksz884x.c:6087: warning: cannot understand function prototype: 'struct hw_regs '
      .../ethernet/microchip/lan743x_main.c:161:6: warning: variable ‘int_en’ set but not used [-Wunused-but-set-variable]
      .../ethernet/microchip/lan743x_main.c:1702:6: warning: variable ‘int_sts’ set but not used [-Wunused-but-set-variable]
      .../ethernet/microchip/lan743x_main.c:3041:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]
      .../ethernet/natsemi/ns83820.c:603:6: warning: variable ‘tbisr’ set but not used [-Wunused-but-set-variable]
      .../ethernet/natsemi/ns83820.c:1207:11: warning: variable ‘tanar’ set but not used [-Wunused-but-set-variable]
      .../ethernet/marvell/mvneta.c:754:6: warning: variable ‘dummy’ set but not used [-Wunused-but-set-variable]
      .../ethernet/neterion/vxge/vxge-traffic.c:33:6: warning: variable ‘val64’ set but not used [-Wunused-but-set-variable]
      .../ethernet/neterion/vxge/vxge-traffic.c:160:6: warning: variable ‘val64’ set but not used [-Wunused-but-set-variable]
      .../ethernet/neterion/vxge/vxge-traffic.c:490:6: warning: variable ‘val32’ set but not used [-Wunused-but-set-variable]
      .../ethernet/neterion/vxge/vxge-traffic.c:2378:6: warning: variable ‘val64’ set but not used [-Wunused-but-set-variable]
      .../ethernet/packetengines/yellowfin.c:1063:18: warning: variable ‘yf_size’ set but not used [-Wunused-but-set-variable]
      .../ethernet/realtek/8139cp.c:1242:6: warning: variable ‘rc’ set but not used [-Wunused-but-set-variable]
      .../ethernet/mellanox/mlx4/en_tx.c:858:6: warning: variable ‘ring_cons’ set but not used [-Wunused-but-set-variable]
      .../ethernet/sis/sis900.c:792:6: warning: variable ‘status’ set but not used [-Wunused-but-set-variable]
      .../ethernet/sfc/falcon/farch.c:878:11: warning: variable ‘rx_ev_pkt_type’ set but not used [-Wunused-but-set-variable]
      .../ethernet/sfc/falcon/farch.c:877:23: warning: variable ‘rx_ev_mcast_pkt’ set but not used [-Wunused-but-set-variable]
      .../ethernet/sfc/falcon/farch.c:877:7: warning: variable ‘rx_ev_hdr_type’ set but not used [-Wunused-but-set-variable]
      .../ethernet/sfc/falcon/farch.c:876:7: warning: variable ‘rx_ev_other_err’ set but not used [-Wunused-but-set-variable]
      .../ethernet/sfc/falcon/farch.c:1646:21: warning: variable ‘buftbl_min’ set but not used [-Wunused-but-set-variable]
      .../ethernet/sfc/falcon/farch.c:2535:32: warning: variable ‘spec’ set but not used [-Wunused-but-set-variable]
      .../ethernet/via/via-velocity.c:880:6: warning: variable ‘curr_status’ set but not used [-Wunused-but-set-variable]
      .../ethernet/ti/tlan.c:656:6: warning: variable ‘rc’ set but not used [-Wunused-but-set-variable]
      .../ethernet/ti/davinci_emac.c:1230:6: warning: variable ‘num_tx_pkts’ set but not used [-Wunused-but-set-variable]
      .../ethernet/synopsys/dwc-xlgmac-common.c:516:8: warning: variable ‘str’ set but not used [-Wunused-but-set-variable]
      .../ethernet/ti/cpsw_new.c:1662:22: warning: variable ‘priv’ set but not used [-Wunused-but-set-variable]
      
      The register reads should be OK, because the current
      implementation of readl and friends will always execute even
      without an lvalue.
      
      When it makes sense, just remove the lvalue assignment and the
      local. Other times, just remove the offending code, and
      occasionally, just mark the variable as maybe unused since it
      could be used in an ifdef or debug scenario.
      
      Only compile tested with W=1.
      Signed-off-by: default avatarJesse Brandeburg <jesse.brandeburg@intel.com>
      Acked-by: default avatarEdward Cree <ecree@solarflare.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7c8c0291
    • Jesse Brandeburg's avatar
      intel: handle unused assignments · 36ec1486
      Jesse Brandeburg authored
      Remove variables that were storing a return value from a register
      read or other read, where the return value wasn't used. Those
      conversions to remove the lvalue of the assignment should be safe
      because the readl memory mapped reads are marked volatile and
      should not be optimized out without an lvalue (I suspect a very
      long time ago this wasn't guaranteed as it is today).
      
      These changes are part of a separate patch to make it easier to review.
      
      Warnings Fixed:
      .../intel/e100.c:2596:9: warning: variable ‘err’ set but not used [-Wunused-but-set-variable]
      .../intel/ixgb/ixgb_hw.c:101:6: warning: variable ‘icr_reg’ set but not used [-Wunused-but-set-variable]
      .../intel/ixgb/ixgb_hw.c:277:6: warning: variable ‘ctrl_reg’ set but not used [-Wunused-but-set-variable]
      .../intel/ixgb/ixgb_hw.c:952:15: warning: variable ‘temp_reg’ set but not used [-Wunused-but-set-variable]
      .../intel/ixgb/ixgb_hw.c:1164:7: warning: variable ‘mdio_reg’ set but not used [-Wunused-but-set-variable]
      .../intel/e1000/e1000_hw.c:132:6: warning: variable ‘ret_val’ set but not used [-Wunused-but-set-variable]
      .../intel/e1000/e1000_hw.c:380:6: warning: variable ‘icr’ set but not used [-Wunused-but-set-variable]
      .../intel/e1000/e1000_hw.c:2378:6: warning: variable ‘signal’ set but not used [-Wunused-but-set-variable]
      .../intel/e1000/e1000_hw.c:2374:6: warning: variable ‘ctrl’ set but not used [-Wunused-but-set-variable]
      .../intel/e1000/e1000_hw.c:2373:6: warning: variable ‘rxcw’ set but not used [-Wunused-but-set-variable]
      .../intel/e1000/e1000_hw.c:4678:15: warning: variable ‘temp’ set but not used [-Wunused-but-set-variable]
      Signed-off-by: default avatarJesse Brandeburg <jesse.brandeburg@intel.com>
      Tested-by: default avatarAaron Brown <aaron.f.brown@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      36ec1486
    • Jesse Brandeburg's avatar
      intel-ethernet: clean up W=1 warnings in kdoc · b50f7bca
      Jesse Brandeburg authored
      This takes care of all of the trivial W=1 fixes in the Intel
      Ethernet drivers, which allows developers and maintainers to
      build more of the networking tree with more complete warning
      checks.
      
      There are three classes of kdoc warnings fixed:
       - cannot understand function prototype: 'x'
       - Excess function parameter 'x' description in 'y'
       - Function parameter or member 'x' not described in 'y'
      
      All of the changes were trivial comment updates on
      function headers.
      
      Inspired by Lee Jones' series of wireless work to do the same.
      Compile tested only, and passes simple test of
      $ git ls-files *.[ch] | egrep drivers/net/ethernet/intel | \
        xargs scripts/kernel-doc -none
      Signed-off-by: default avatarJesse Brandeburg <jesse.brandeburg@intel.com>
      Tested-by: default avatarAaron Brown <aaron.f.brown@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b50f7bca
    • Florian Fainelli's avatar
      net: vlan: Avoid using BUG() in vlan_proto_idx() · d0186842
      Florian Fainelli authored
      While we should always make sure that we specify a valid VLAN protocol
      to vlan_proto_idx(), killing the machine when an invalid value is
      specified is too harsh and not helpful for debugging. All callers are
      capable of dealing with an error returned by vlan_proto_idx() so check
      the index value and propagate it accordingly.
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d0186842
    • David S. Miller's avatar
      Merge tag 'wireless-drivers-next-2020-09-25' of... · 7806f656
      David S. Miller authored
      Merge tag 'wireless-drivers-next-2020-09-25' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next
      
      Kalle Valo says:
      
      ====================
      wireless-drivers-next patches for v5.10
      
      Second set of patches for v5.10. Biggest change here is wcn3680
      support to wcn36xx driver, otherwise smaller features. And naturally
      the usual fixes and cleanups.
      
      Major changes:
      
      brcmfmac
      
      * support 4-way handshake offloading for WPA/WPA2-PSK in AP mode
      
      * support SAE authentication offload in AP mode
      
      mt76
      
      * mt7663 runtime power management improvements
      
      * mt7915 A-MSDU offload
      
      wcn36xx
      
      * add support wcn3680 Wi-Fi 5 devices
      
      ath11k
      
      * spectral scan support for ipq6018
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7806f656
    • Kalle Valo's avatar
      ath11k: fix undefined reference to 'ath11k_debugfs_htt_ext_stats_handler' · bc8befe6
      Kalle Valo authored
      kbuild bot reported than link fails when CONFIG_ATH11K_DEBUGFS is disabled:
      
      drivers/net/wireless/ath/ath11k/dp_rx.c:1662: undefined reference to `ath11k_debugfs_htt_ext_stats_handler'
      
      This was because I had missed to move the static inline version of the function
      (which are used when CONFIG_ATH11K_DEBUGFS is disabled) to debufs_htt_stats.h.
      Also move ath11k_debugfs_htt_stats_req() at the same time. And create a stub
      also for ath11k_debugfs_htt_stats_init() for consistency, even if it's not
      needed.
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Fixes: 568f0603 ("ath11k: debugfs: move some function declarations to correct header files")
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      Link: https://lore.kernel.org/r/1601024241-16594-1-git-send-email-kvalo@codeaurora.org
      bc8befe6
    • David S. Miller's avatar
      Merge branch 'hns3-next' · aafe8853
      David S. Miller authored
      Huazhong Tan says:
      
      ====================
      net: hns3: updates for -next
      
      There are some updates for the HNS3 ethernet driver.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      aafe8853
    • Guangbin Huang's avatar
      net: hns3: rename macro of pci device id of vf · c155e22b
      Guangbin Huang authored
      VF devices do not have speed division, its speed is depended on its PF.
      So macro name of PCI device id of VF is incorrent to have 100G info, it
      should be renamed by removing 100G info.
      Signed-off-by: default avatarGuangbin Huang <huangguangbin2@huawei.com>
      Signed-off-by: default avatarHuazhong Tan <tanhuazhong@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c155e22b
    • Guangbin Huang's avatar
      net: hns3: add support for 200G device · ae6f010c
      Guangbin Huang authored
      The 200G device has a new device id 0xA228, so adds this device id to
      pci table, then the driver can probe it.
      
      As speed_ability queried from firmware has only 8 bits and already be
      used up, so firmware adds extra speed_ability_ext to indicate more
      speed abilities to support 200G and driver needs to parse it.
      Signed-off-by: default avatarGuangbin Huang <huangguangbin2@huawei.com>
      Signed-off-by: default avatarHuazhong Tan <tanhuazhong@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ae6f010c
    • Yufeng Mo's avatar
      net: hns3: add debugfs of dumping pf interrupt resources · 348775eb
      Yufeng Mo authored
      The pf's interrupt resources will be changed with the number of
      enabled pf. Dumping this resource information will be helpful
      for debugging.
      Signed-off-by: default avatarYufeng Mo <moyufeng@huawei.com>
      Signed-off-by: default avatarHuazhong Tan <tanhuazhong@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      348775eb
    • Yufeng Mo's avatar
      net: hns3: add a hardware error detect type · 6cd131dd
      Yufeng Mo authored
      In hns3_process_hw_error(), the hardware error detection of the
      ROCEE AXI RESP error type is added. When this error occurs,
      the client needs to be notified of this error and take
      corresponding operation.
      Signed-off-by: default avatarYufeng Mo <moyufeng@huawei.com>
      Signed-off-by: default avatarHuazhong Tan <tanhuazhong@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6cd131dd
    • Yufeng Mo's avatar
      net: hns3: remove unnecessary variable initialization · 9d8d5a36
      Yufeng Mo authored
      If a variable is assigned a value before it is used, it's no
      need to assign an initial value to the variable. So remove
      these redundant operations.
      Signed-off-by: default avatarYufeng Mo <moyufeng@huawei.com>
      Signed-off-by: default avatarHuazhong Tan <tanhuazhong@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9d8d5a36
    • Yufeng Mo's avatar
      net: hns3: refactor the function for dumping tc information in debugfs · 00577c8b
      Yufeng Mo authored
      Remove some unnecessary parameters of hclge_title_idx_print(),
      and rename this function for readability.
      Signed-off-by: default avatarYufeng Mo <moyufeng@huawei.com>
      Signed-off-by: default avatarHuazhong Tan <tanhuazhong@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      00577c8b
    • Florian Westphal's avatar
      net: tcp: drop unused function argument from mptcp_incoming_options · 77d0cab9
      Florian Westphal authored
      Since commit cfde141e ("mptcp: move option parsing into
      mptcp_incoming_options()"), the 3rd function argument is no longer used.
      Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      77d0cab9
    • David S. Miller's avatar
      Merge branch 'mptcp-RM_ADDR-ADD_ADDR-enhancements' · a1a35529
      David S. Miller authored
      Geliang Tang says:
      
      ====================
      mptcp: RM_ADDR/ADD_ADDR enhancements
      
      This series include two enhancements for the MPTCP path management,
      namely RM_ADDR support and ADD_ADDR echo support, as specified by RFC
      sections 3.4.1 and 3.4.2.
      
      1 RM_ADDR support include 9 patches (1-3 and 8-13):
      
      Patch 1 is the helper for patch 2, these two patches add the RM_ADDR
      outgoing functions, which are derived from ADD_ADDR's corresponding
      functions.
      
      Patch 3 adds the RM_ADDR incoming logic, when RM_ADDR suboption is
      received, close the subflow matching the rm_id, and update PM counter.
      
      Patch 8 is the main remove routine. When the PM netlink removes an address,
      we traverse all the existing msk sockets to find the relevant sockets. Then
      trigger the RM_ADDR signal and remove the subflow which using this local
      address, this subflow removing functions has been implemented in patch 9.
      
      Finally, patches 10-13 are the self-tests for RM_ADDR.
      
      2 ADD_ADDR echo support include 7 patches (4-7 and 14-16).
      
      Patch 4 adds the ADD_ADDR echo logic, when the ADD_ADDR suboption has been
      received, send out the same ADD_ADDR suboption with echo-flag, and no HMAC
      included.
      
      Patches 5 and 6 are the self-tests for ADD_ADDR echo. Patch 7 is a little
      cleaning up.
      
      Patch 14 and 15 are the helpers for patch 16. These three patches add
      the ADD_ADDR retransmition when no ADD_ADDR echo is received.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a1a35529
    • Geliang Tang's avatar
      mptcp: retransmit ADD_ADDR when timeout · 00cfd77b
      Geliang Tang authored
      This patch implemented the retransmition of ADD_ADDR when no ADD_ADDR echo
      is received. It added a timer with the announced address. When timeout
      occurs, ADD_ADDR will be retransmitted.
      Suggested-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
      Suggested-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Acked-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: default avatarGeliang Tang <geliangtang@gmail.com>
      Reviewed-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      00cfd77b
    • Geliang Tang's avatar
      mptcp: add sk_stop_timer_sync helper · 08b81d87
      Geliang Tang authored
      This patch added a new helper sk_stop_timer_sync, it deactivates a timer
      like sk_stop_timer, but waits for the handler to finish.
      Acked-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: default avatarGeliang Tang <geliangtang@gmail.com>
      Reviewed-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      08b81d87
    • Geliang Tang's avatar
      mptcp: add struct mptcp_pm_add_entry · 0abd40f8
      Geliang Tang authored
      Add a new struct mptcp_pm_add_entry to describe add_addr's entry.
      Acked-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: default avatarGeliang Tang <geliangtang@gmail.com>
      Reviewed-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0abd40f8
    • Geliang Tang's avatar
      selftests: mptcp: add remove addr and subflow test cases · dd72b0fe
      Geliang Tang authored
      This patch added the remove addr and subflow test cases and two new
      functions.
      
      The first function run_remove_tests calls do_transfer with two new
      arguments, rm_nr_ns1 and rm_nr_ns2, for the numbers of addresses should be
      removed during the transfer process in namespace 1 and namespace 2.
      
      If both these two arguments are 0, we do the join test cases with
      "mptcp_connect -j" command. Otherwise, do the remove test cases with
      "mptcp_connect -r" command.
      
      The second function chk_rm_nr checks the RM_ADDR related mibs's counters.
      
      The output of the test cases looks like this:
      
      11 remove single subflow           syn[ ok ] - synack[ ok ] - ack[ ok ]
                                         rm [ ok ] - sf    [ ok ]
      12 remove multiple subflows        syn[ ok ] - synack[ ok ] - ack[ ok ]
                                         rm [ ok ] - sf    [ ok ]
      13 remove single address           syn[ ok ] - synack[ ok ] - ack[ ok ]
                                         add[ ok ] - echo  [ ok ]
                                         rm [ ok ] - sf    [ ok ]
      14 remove subflow and signal       syn[ ok ] - synack[ ok ] - ack[ ok ]
                                         add[ ok ] - echo  [ ok ]
                                         rm [ ok ] - sf    [ ok ]
      15 remove subflows and signal      syn[ ok ] - synack[ ok ] - ack[ ok ]
                                         add[ ok ] - echo  [ ok ]
                                         rm [ ok ] - sf    [ ok ]
      Suggested-by: default avatarMatthieu Baerts <matthieu.baerts@tessares.net>
      Suggested-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Suggested-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
      Acked-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: default avatarGeliang Tang <geliangtang@gmail.com>
      Reviewed-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      dd72b0fe
    • Geliang Tang's avatar
      selftests: mptcp: add remove cfg in mptcp_connect · 13153324
      Geliang Tang authored
      This patch added a new cfg, named cfg_remove in mptcp_connect. This new
      cfg_remove is copied from cfg_join. The only difference between them is in
      the do_rnd_write function. Here we slow down the transfer process of all
      data to let the RM_ADDR suboption can be sent and received completely.
      Otherwise the remove address and subflow test cases don't work.
      Suggested-by: default avatarMatthieu Baerts <matthieu.baerts@tessares.net>
      Suggested-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Suggested-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
      Acked-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: default avatarGeliang Tang <geliangtang@gmail.com>
      Reviewed-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      13153324
    • Geliang Tang's avatar
      mptcp: add mptcp_destroy_common helper · 5c8c1640
      Geliang Tang authored
      This patch added a new helper named mptcp_destroy_common containing the
      shared code between mptcp_destroy() and mptcp_sock_destruct().
      Suggested-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: default avatarGeliang Tang <geliangtang@gmail.com>
      Reviewed-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5c8c1640
    • Geliang Tang's avatar
      mptcp: add RM_ADDR related mibs · 7a7e52e3
      Geliang Tang authored
      This patch added two new mibs for RM_ADDR, named MPTCP_MIB_RMADDR and
      MPTCP_MIB_RMSUBFLOW, when the RM_ADDR suboption is received, increase
      the first mib counter, when the local subflow is removed, increase the
      second mib counter.
      Suggested-by: default avatarMatthieu Baerts <matthieu.baerts@tessares.net>
      Suggested-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Suggested-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
      Acked-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: default avatarGeliang Tang <geliangtang@gmail.com>
      Reviewed-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7a7e52e3
    • Geliang Tang's avatar
      mptcp: implement mptcp_pm_remove_subflow · 0ee4261a
      Geliang Tang authored
      This patch implemented the local subflow removing function,
      mptcp_pm_remove_subflow, it simply called mptcp_pm_nl_rm_subflow_received
      under the PM spin lock.
      
      We use mptcp_pm_remove_subflow to remove a local subflow, so change it's
      argument from remote_id to local_id.
      
      We check subflow->local_id in mptcp_pm_nl_rm_subflow_received to remove
      a subflow.
      Suggested-by: default avatarMatthieu Baerts <matthieu.baerts@tessares.net>
      Suggested-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Suggested-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: default avatarGeliang Tang <geliangtang@gmail.com>
      Reviewed-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0ee4261a
    • Geliang Tang's avatar
      mptcp: remove addr and subflow in PM netlink · b6c08380
      Geliang Tang authored
      This patch implements the remove announced addr and subflow logic in PM
      netlink.
      
      When the PM netlink removes an address, we traverse all the existing msk
      sockets to find the relevant sockets.
      
      We add a new list named anno_list in mptcp_pm_data, to record all the
      announced addrs. In the traversing, we check if it has been recorded.
      If it has been, we trigger the RM_ADDR signal.
      
      We also check if this address is in conn_list. If it is, we remove the
      subflow which using this local address.
      
      Since we call mptcp_pm_free_anno_list in mptcp_destroy, we need to move
      __mptcp_init_sock before the mptcp_is_enabled check in mptcp_init_sock.
      Suggested-by: default avatarMatthieu Baerts <matthieu.baerts@tessares.net>
      Suggested-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Suggested-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
      Acked-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: default avatarGeliang Tang <geliangtang@gmail.com>
      Reviewed-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b6c08380
    • Geliang Tang's avatar
      mptcp: add accept_subflow re-check · f58f065a
      Geliang Tang authored
      The re-check of pm->accept_subflow with pm->lock held was missing, this
      patch fixed it.
      Suggested-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
      Reviewed-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: default avatarGeliang Tang <geliangtang@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f58f065a
    • Geliang Tang's avatar
      selftests: mptcp: add ADD_ADDR mibs check function · be613160
      Geliang Tang authored
      This patch added the ADD_ADDR related mibs counter check function
      chk_add_nr(). This function check both ADD_ADDR and ADD_ADDR with
      echo flag.
      
      The output looks like this:
      
       07 unused signal address             syn[ ok ] - synack[ ok ] - ack[ ok ]
                                            add[ ok ] - echo  [ ok ]
       08 signal address                    syn[ ok ] - synack[ ok ] - ack[ ok ]
                                            add[ ok ] - echo  [ ok ]
       09 subflow and signal                syn[ ok ] - synack[ ok ] - ack[ ok ]
                                            add[ ok ] - echo  [ ok ]
       10 multiple subflows and signal      syn[ ok ] - synack[ ok ] - ack[ ok ]
                                            add[ ok ] - echo  [ ok ]
       11 remove subflow and signal         syn[ ok ] - synack[ ok ] - ack[ ok ]
                                            add[ ok ] - echo  [ ok ]
      Reviewed-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: default avatarGeliang Tang <geliangtang@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      be613160
    • Geliang Tang's avatar
      mptcp: add ADD_ADDR related mibs · a877de06
      Geliang Tang authored
      This patch added two mibs for ADD_ADDR, MPTCP_MIB_ADDADDR for receiving
      of the ADD_ADDR suboption with echo-flag=0, and MPTCP_MIB_ECHOADD for
      receiving the ADD_ADDR suboption with echo-flag=1.
      Reviewed-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
      Co-developed-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: default avatarGeliang Tang <geliangtang@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a877de06
    • Geliang Tang's avatar
      mptcp: send out ADD_ADDR with echo flag · 6a6c05a8
      Geliang Tang authored
      When the ADD_ADDR suboption has been received, we need to send out the same
      ADD_ADDR suboption with echo-flag=1, and no HMAC.
      Suggested-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
      Reviewed-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: default avatarGeliang Tang <geliangtang@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6a6c05a8
    • Geliang Tang's avatar
      mptcp: add the incoming RM_ADDR support · d0876b22
      Geliang Tang authored
      This patch added the RM_ADDR option parsing logic:
      
      We parsed the incoming options to find if the rm_addr option is received,
      and called mptcp_pm_rm_addr_received to schedule PM work to a new status,
      named MPTCP_PM_RM_ADDR_RECEIVED.
      
      PM work got this status, and called mptcp_pm_nl_rm_addr_received to handle
      it.
      
      In mptcp_pm_nl_rm_addr_received, we closed the subflow matching the rm_id,
      and updated PM counter.
      Suggested-by: default avatarMatthieu Baerts <matthieu.baerts@tessares.net>
      Suggested-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Suggested-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: default avatarGeliang Tang <geliangtang@gmail.com>
      Reviewed-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d0876b22
    • Geliang Tang's avatar
      mptcp: add the outgoing RM_ADDR support · 5cb104ae
      Geliang Tang authored
      This patch added a new signal named rm_addr_signal in PM. On outgoing path,
      we called mptcp_pm_should_rm_signal to check if rm_addr_signal has been
      set. If it has been, we sent out the RM_ADDR option.
      Suggested-by: default avatarMatthieu Baerts <matthieu.baerts@tessares.net>
      Suggested-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: default avatarGeliang Tang <geliangtang@gmail.com>
      Reviewed-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5cb104ae
    • Geliang Tang's avatar
      mptcp: rename addr_signal and the related functions · f643b803
      Geliang Tang authored
      This patch renamed addr_signal and the related functions with the explicit
      word "add".
      Suggested-by: default avatarMatthieu Baerts <matthieu.baerts@tessares.net>
      Suggested-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: default avatarGeliang Tang <geliangtang@gmail.com>
      Reviewed-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f643b803
    • David S. Miller's avatar
      Merge tag 'mlx5-updates-2020-09-22' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux · 075c1568
      David S. Miller authored
      Saeed Mahameed says:
      
      ====================
      mlx5-updates-2020-09-22
      
      This series includes mlx5 updates
      
      1) Add support for Connection Tracking offload in NIC mode.
         Supporting CT offload in NIC mode on Mellanox cards is useful for
         scenarios where the dual port NIC serves as a gateway between 2
         networks and forwards traffic between these networks.
      
         Since the traffic is not terminated on the host in this case,
         no use of SRIOV VFs and/or switchdev mode is required.
      
         Today Mellanox NIC cards already support offloading of packet forwarding
         between physical ports without going to the host so combining it with CT
         offloading allows users to create a gateway with forwarding and CT
         (Including NAT) offloading capabilities in non-switchdev mode.
      
         To support connection tracking in non-Switchdev mode (Single NIC mode),
         we need to make use of the current Connection tracking infrastructure
         implemented on top of E-Switch and the mlx5 generic flow table chains
         APIs, to make it work on non-Eswitch steering domain e.g. NIC RX domain,
         the following was performed:
      
       1.1) Refactor current flow steering chains infrastructure and
            updates TC nic mode implementation to use flow table chains.
       1.2) Refactor current Connection Tracking (CT) infrastructure to not
            assume E-switch backend, and make the CT layer agnostic to
            underlying steering mode (E-Switch/NIC)
       1.3) Plumbing to support CT offload in NIC mode.
      
      2) Trivial code cleanups.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      075c1568
    • David S. Miller's avatar
      Merge branch 'dpaa2-mac-add-PCS-support-through-the-Lynx-module' · 54ce00ae
      David S. Miller authored
      Ioana Ciornei says:
      
      ====================
      dpaa2-mac: add PCS support through the Lynx module
      
      This patch set aims to add PCS support in the dpaa2-eth driver by
      leveraging the Lynx PCS module.
      
      The first two patches are some missing pieces: the first one adding
      support for 10GBASER in Lynx PCS while the second one adds a new
      function - of_mdio_find_device - which is helpful in retrieving the PCS
      represented as a mdio_device.  The final patch adds the glue logic
      between phylink and the Lynx PCS module: it retrieves the PCS
      represented as an mdio_device and registers it to Lynx and phylink.
      From that point on, any PCS callbacks are treated by Lynx, without
      dpaa2-eth interaction.
      
      Changes in v2:
       - move put_device() after destroy - 3/3
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      54ce00ae
    • Ioana Ciornei's avatar
      dpaa2-mac: add PCS support through the Lynx module · 94ae899b
      Ioana Ciornei authored
      Include PCS support in the dpaa2-eth driver by integrating it with the
      new Lynx PCS module. There is not much to talk about in terms of changes
      needed in the dpaa2-eth driver since the only steps necessary are to
      find the MDIO device representing the PCS, register it to the Lynx PCS
      module and then let phylink know if its existence also.
      After this, the PCS callbacks will be treated directly by Lynx, without
      interraction from dpaa2-eth's part.
      Signed-off-by: default avatarIoana Ciornei <ioana.ciornei@nxp.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      94ae899b
    • Russell King's avatar
      of: add of_mdio_find_device() api · b5b6775d
      Russell King authored
      Add a helper function which finds the mdio_device structure given a
      device tree node. This is helpful for finding the PCS device based on a
      DTS node but managing it as a mdio_device instead of a phy_device.
      Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
      Signed-off-by: default avatarIoana Ciornei <ioana.ciornei@nxp.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b5b6775d