1. 07 2月, 2021 2 次提交
  2. 06 1月, 2021 1 次提交
  3. 22 11月, 2020 1 次提交
  4. 30 9月, 2020 1 次提交
  5. 31 5月, 2020 1 次提交
  6. 29 5月, 2020 1 次提交
  7. 26 4月, 2020 2 次提交
    • J
      net: hns3: refactor the promisc mode setting · c631c696
      Jian Shen 提交于
      As the HNS3 driver doesn't update the MAC address directly in
      function hns3_set_rx_mode() now, it can't know whether the
      MAC table is full from __dev_uc_sync() and __dev_mc_sync(),
      so it's senseless to handle the overflow promisc here.
      
      This patch removes the handle of overflow promisc from function
      hns3_set_rx_mode(), and updates the promisc mode in the service
      task.
      Signed-off-by: NJian Shen <shenjian15@huawei.com>
      Signed-off-by: NHuazhong Tan <tanhuazhong@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c631c696
    • J
      net: hns3: refactor the MAC address configure · ee4bcd3b
      Jian Shen 提交于
      Currently, the HNS3 driver sync and unsync MAC address in function
      hns3_set_rx_mode(). For PF, it adds and deletes MAC address directly
      in the path of dev_set_rx_mode(). If failed, it won't retry until
      next calling of hns3_set_rx_mode(). On the other hand, if request
      add and remove a same address many times at a short interval, each
      request must be done one by one, can't be merged. For VF, it sends
      mailbox messages to PF to request adding or deleting MAC address in
      the path of function hns3_set_rx_mode(), no matter the address is
      configured success.
      
      This patch refines it by recording the MAC address in function
      hns3_set_rx_mode(), and updating MAC address in the service task.
      If failed, it will retry by the next calling of periodical service
      task. It also uses some state to mark the state of each MAC address
      in the MAC list, which can help merge configure request for a same
      address. With these changes, when global reset or IMP reset occurs,
      we can restore the MAC table with the MAC list.
      Signed-off-by: NJian Shen <shenjian15@huawei.com>
      Signed-off-by: NHuazhong Tan <tanhuazhong@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ee4bcd3b
  8. 22 3月, 2020 1 次提交
  9. 12 1月, 2020 1 次提交
    • H
      net: hns3: refactor the procedure of VF FLR · f28368bb
      Huazhong Tan 提交于
      Currently, the actual work of VF FLR is handled in the reset task,
      which is asynchronous. So in some case, if the preparing and
      rebuilding are not done, then the VF FLR will trigger some problems,
      for example, makes hardware go into chaos.
      
      So this patch separates the process of VF FLR from reset task, and
      adds a semaphore to serialize this reset and others.
      
      When FLR's preparing fails, if there has other higher level reset
      pending or failing times less than the HCLGE_FLR_RETRY_CNT, this
      preparing should be retried, otherwise it will get into a wrong state.
      
      BTW, while the hardware reports misc interrupt during pcie_flr(),
      the driver can not receive this interrupt anymore, so disable it
      when hclgevf_flr_prepare() return, and re-enable it when enter
      hclgevf_flr_done().
      
      Avoid declaring internal function hclgevf_enable_vector(), this patch
      also moves its definition forward, and removes unused enum
      hnae3_flr_state.
      Signed-off-by: NHuazhong Tan <tanhuazhong@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f28368bb
  10. 07 1月, 2020 1 次提交
  11. 17 12月, 2019 3 次提交
  12. 06 11月, 2019 1 次提交
  13. 20 10月, 2019 1 次提交
  14. 09 10月, 2019 1 次提交
  15. 10 8月, 2019 2 次提交
  16. 02 8月, 2019 1 次提交
    • H
      net: hns3: clear reset interrupt status in hclge_irq_handle() · 72e2fb07
      Huazhong Tan 提交于
      Currently, the reset interrupt is cleared in the reset task, which
      is too late. Since, when the hardware finish the previous reset,
      it can begin to do a new global/IMP reset, if this new coming reset
      type is same as the previous one, the driver will clear them together,
      then driver can not get that there is another reset, but the hardware
      still wait for the driver to deal with the second one.
      
      So this patch clears PF's reset interrupt status in the
      hclge_irq_handle(), the hardware waits for handshaking from
      driver before doing reset, so the driver and hardware deal with reset
      one by one.
      
      BTW, when VF doing global/IMP reset, it reads PF's reset interrupt
      register to get that whether PF driver's re-initialization is done,
      since VF's re-initialization should be done after PF's. So we add
      a new command and a register bit to do that. When VF receive reset
      interrupt, it sets up this bit, and PF finishes re-initialization
      send command to clear this bit, then VF do re-initialization.
      
      Fixes: 4ed340ab ("net: hns3: Add reset process in hclge_main")
      Signed-off-by: NHuazhong Tan <tanhuazhong@huawei.com>
      Reviewed-by: NYunsheng Lin <linyunsheng@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      72e2fb07
  17. 29 6月, 2019 1 次提交
  18. 26 6月, 2019 1 次提交
  19. 10 6月, 2019 1 次提交
  20. 29 5月, 2019 2 次提交
  21. 04 5月, 2019 1 次提交
    • J
      net: hns3: add support for multiple media type · 88d10bd6
      Jian Shen 提交于
      Previously, we can only identify copper and fiber type, the
      supported link modes of port information are always showing
      SR type. This patch adds support for multiple media types,
      include SR, LR CR, KR. Driver needs to query the media type
      from firmware periodicly, and updates the port information.
      
      The new port information looks like this:
      Settings for eth0:
              Supported ports: [ FIBRE ]
              Supported link modes:   25000baseCR/Full
                                      25000baseSR/Full
                                      1000baseX/Full
                                      10000baseCR/Full
                                      10000baseSR/Full
                                      10000baseLR/Full
              Supported pause frame use: Symmetric
              Supports auto-negotiation: No
              Supported FEC modes: None BaseR
              Advertised link modes:  Not reported
              Advertised pause frame use: No
              Advertised auto-negotiation: No
              Advertised FEC modes: Not reported
              Speed: 10000Mb/s
              Duplex: Full
              Port: FIBRE
              PHYAD: 0
              Transceiver: internal
              Auto-negotiation: off
              Current message level: 0x00000036 (54)
                                     probe link ifdown ifup
              Link detected: yes
      
      In order to be compatible with old firmware which only support
      sfp speed, we remained using the same query command, and kept
      the former logic.
      Signed-off-by: NJian Shen <shenjian15@huawei.com>
      Signed-off-by: NPeng Li <lipeng321@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      88d10bd6
  22. 20 4月, 2019 2 次提交
  23. 15 4月, 2019 1 次提交
  24. 25 2月, 2019 1 次提交
  25. 03 2月, 2019 1 次提交
  26. 04 12月, 2018 1 次提交
  27. 18 11月, 2018 1 次提交
  28. 10 11月, 2018 6 次提交
    • H
      net: hns3: add PCIe FLR support for VF · 6ff3cf07
      Huazhong Tan 提交于
      This patch implements the .reset_prepare and .reset_done
      ops from pci framework to support the VF FLR.
      
      This patch uses hclgevf_set_def_reset_request() and
      hclgevf_reset_event() to handle FLR, so when
      hdev->default_reset_request is non zero, it means there is
      some reset requseted by hclgevf_set_def_reset_request() need
      to be processed. Also get the hdev from the ae_dev because
      hclgevf_reset_event is called with handle being NULL.
      Signed-off-by: NHuazhong Tan <tanhuazhong@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6ff3cf07
    • H
      net: hns3: do VF's pci re-initialization while PF doing FLR · 862d969a
      Huazhong Tan 提交于
      While doing PF FLR, VF's PCIe configuration space will be cleared, so
      the pci and vector of VF should be re-initialized in the VF's reset
      process while PF doing FLR.
      
      Also, this patch fixes some memory not freed problem when pci
      re-initialization is done during reset process.
      Signed-off-by: NHuazhong Tan <tanhuazhong@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      862d969a
    • H
      net: hns3: stop handling command queue while resetting VF · ef5f8e50
      Huazhong Tan 提交于
      According to hardware's description, after the reset occurs, the driver
      needs to re-initialize the command queue before sending and receiving
      any commands. Therefore, the VF's driver needs to identify the command
      queue needs to re-initialize with HCLGEVF_STATE_CMD_DISABLE, and does
      not allow sending or receiving commands before the re-initialization.
      Signed-off-by: NHuazhong Tan <tanhuazhong@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ef5f8e50
    • H
      net: hns3: add reset handling for VF when doing Core/Global/IMP reset · b90fcc5b
      Huazhong Tan 提交于
      When a Core/Global/IMP reset occurs, the hardware sets the reset status
      register of all PF/VF and reports a reset interrupt to all PF/VF and
      firmware.
      
      When receiving the reset interrupt:
      1. The firmware will wait for 100 ms before resetting the hardware and
         clear the reset status register of all PF when hardware reset is done.
      2. The PF/VF driver needs to down the netdev within 100 ms and then wait
         for hardware reset to finish.
      3. After firmware clearing the reset status register of all PF, the PF
         driver reinitializes the hardware and clear the reset status register
         of it's VF.
      4. After PF driver clearing the reset status register of VF, the VF driver
         reinitializes the hardware.
      
      This patch mainly add handling for the step 4.
      Signed-off-by: NHuazhong Tan <tanhuazhong@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b90fcc5b
    • H
      net: hns3: add reset handling for VF when doing PF reset · aa5c4f17
      Huazhong Tan 提交于
      When PF performs a function reset, the hardware will reset both PF
      and all the VF belong to this PF. Hence, both PF's driver and VF's
      driver need to perform corresponding reset operations.
      
      Before PF driver asserting function reset to hardware, it firstly
      set up VF's hardware reset status, and inform the VF driver with
      HNAE3_VF_PF_FUNC_RESET, then VF driver sets this reset type to
      reset_pending and shechule reset task to stop IO and waits for the
      hardware reset status to clear. When PF driver has reinitialized the
      hardware and is ready to process mailbox from VF, PF driver clears
      VF's hardware reset status for VF to continue its reset process.
      
      Also, this patch uses readl_poll_timeout to simplify the hardware reset
      status waitting.
      Signed-off-by: NHuazhong Tan <tanhuazhong@huawei.com>
      Signed-off-by: NYunsheng Lin <linyunsheng@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      aa5c4f17
    • H
      net: hns3: adjust VF's reset process · dea846e8
      Huazhong Tan 提交于
      Currently when VF need to reset itself, it will send a cmd to PF,
      after receiving the VF reset requset, PF sends a cmd to inform
      VF to enter the reset process and send a cmd to firmware to do the
      actual reset for the VF, it is possible that firmware has resetted
      the VF, but VF has not entered the reset process, which may cause
      IO not stopped problem when firmware is resetting VF.
      
      This patch fixes it by adjusting the VF reset process, when VF
      need to reset itself, it will enter the reset process first, and
      it will tell the PF to send cmd to firmware to reset itself.
      
      Add member reset_pending to struct hclgevf_dev, which indicates that
      there is reset event need to be processed by the VF's reset task, and
      the VF's reset task chooses the highest-level one and clears other
      low-level one when it processes reset_pending.
      
      hclge_inform_reset_assert_to_vf function is unused now, but it will
      be used to support the PF reset with VF working, so declare it in
      the header file.
      Signed-off-by: NHuazhong Tan <tanhuazhong@huawei.com>
      Signed-off-by: NYunsheng Lin <linyunsheng@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      dea846e8