1. 18 7月, 2022 4 次提交
  2. 13 5月, 2022 2 次提交
  3. 05 5月, 2022 2 次提交
  4. 11 4月, 2022 4 次提交
  5. 16 3月, 2022 1 次提交
  6. 05 3月, 2022 6 次提交
  7. 08 1月, 2022 1 次提交
  8. 07 1月, 2022 1 次提交
  9. 06 1月, 2022 1 次提交
  10. 15 12月, 2021 2 次提交
    • Y
      RDMA/hns: Support direct wqe of userspace · 0045e0d3
      Yixing Liu 提交于
      The current write wqe mechanism is to write to DDR first, and then notify
      the hardware through doorbell to read the data. Direct wqe is a mechanism
      to fill wqe directly into the hardware. In the case of light load, the wqe
      will be filled into pcie bar space of the hardware, this will reduce one
      memory access operation and therefore reduce the latency. SIMD
      instructions allows cpu to write the 512 bits at one time to device
      memory, thus it can be used for posting direct wqe.
      
      Add direct wqe enable switch and address mapping.
      
      Link: https://lore.kernel.org/r/20211207124901.42123-2-liangwenpeng@huawei.comSigned-off-by: NYixing Liu <liuyixing1@huawei.com>
      Signed-off-by: NWenpeng Liang <liangwenpeng@huawei.com>
      Signed-off-by: NJason Gunthorpe <jgg@nvidia.com>
      0045e0d3
    • Y
      RDMA/hns: Fix RNR retransmission issue for HIP08 · 4ad81814
      Yangyang Li 提交于
      Due to the discrete nature of the HIP08 timer unit, a requester might
      finish the timeout period sooner, in elapsed real time, than its responder
      does, even when both sides share the identical RNR timeout length included
      in the RNR Nak packet and the responder indeed starts the timing prior to
      the requester. Furthermore, if a 'providential' resend packet arrived
      before the responder's timeout period expired, the responder is certainly
      entitled to drop the packet silently in the light of IB protocol.
      
      To address this problem, our team made good use of certain hardware facts:
      
      1) The timing resolution regards the transmission arrangements is 1
         microsecond, e.g. if cq_period field is set to 3, it would be
         interpreted as 3 microsecond by hardware
      
      2) A QPC field shall inform the hardware how many timing unit (ticks)
         constitutes a full microsecond, which, by default, is 1000
      
      3) It takes 14ns for the processor to handle a packet in the buffer, so
         the RNR timeout length of 10ns would ensure our processing mechanism is
         disabled during the entire timeout period and the packet won't be
         dropped silently
      
      To achieve (3), we permanently set the QPC field mentioned in (2) to zero
      which nominally indicates every time tick is equivalent to a microsecond
      in wall-clock time; now, a RNR timeout period at face value of 10 would
      only last 10 ticks, which is 10ns in wall-clock time.
      
      It's worth noting that we adapt the driver by magnifying certain
      configuration parameters(cq_period, eq_period and ack_timeout)by 1000
      given the user assumes the configuring timing unit to be microseconds.
      
      Also, this particular improvisation is only deployed on HIP08 since other
      hardware has already solved this issue.
      
      Fixes: cfc85f3e ("RDMA/hns: Add profile support for hip08 driver")
      Link: https://lore.kernel.org/r/20211209140655.49493-1-liangwenpeng@huawei.comSigned-off-by: NYangyang Li <liyangyang20@huawei.com>
      Signed-off-by: NWenpeng Liang <liangwenpeng@huawei.com>
      Signed-off-by: NJason Gunthorpe <jgg@nvidia.com>
      4ad81814
  11. 26 11月, 2021 2 次提交
    • Y
      RDMA/hns: Do not destroy QP resources in the hw resetting phase · b0969f83
      Yangyang Li 提交于
      When hns_roce_v2_destroy_qp() is called, the brief calling process of the
      driver is as follows:
      
       ......
       hns_roce_v2_destroy_qp
       hns_roce_v2_qp_modify
      	   hns_roce_cmd_mbox
       hns_roce_qp_destroy
      
      If hns_roce_cmd_mbox() detects that the hardware is being reset during the
      execution of the hns_roce_cmd_mbox(), the driver will not be able to get
      the return value from the hardware (the firmware cannot respond to the
      driver's mailbox during the hardware reset phase).
      
      The driver needs to wait for the hardware reset to complete before
      continuing to execute hns_roce_qp_destroy(), otherwise it may happen that
      the driver releases the resources but the hardware is still accessing. In
      order to fix this problem, HNS RoCE needs to add a piece of code to wait
      for the hardware reset to complete.
      
      The original interface get_hw_reset_stat() is the instantaneous state of
      the hardware reset, which cannot accurately reflect whether the hardware
      reset is completed, so it needs to be replaced with the ae_dev_reset_cnt
      interface.
      
      The sign that the hardware reset is complete is that the return value of
      the ae_dev_reset_cnt interface is greater than the original value
      reset_cnt recorded by the driver.
      
      Fixes: 6a04aed6 ("RDMA/hns: Fix the chip hanging caused by sending mailbox&CMQ during reset")
      Link: https://lore.kernel.org/r/20211123142402.26936-1-liangwenpeng@huawei.comSigned-off-by: NYangyang Li <liyangyang20@huawei.com>
      Signed-off-by: NWenpeng Liang <liangwenpeng@huawei.com>
      Signed-off-by: NJason Gunthorpe <jgg@nvidia.com>
      b0969f83
    • Y
      RDMA/hns: Do not halt commands during reset until later · 52414e27
      Yangyang Li 提交于
      is_reset is used to indicate whether the hardware starts to reset. When
      hns_roce_hw_v2_reset_notify_down() is called, the hardware has not yet
      started to reset. If is_reset is set at this time, all mailbox operations
      of resource destroy actions will be intercepted by driver. When the driver
      cleans up resources, but the hardware is still accessed, the following
      errors will appear:
      
        arm-smmu-v3 arm-smmu-v3.2.auto: event 0x10 received:
        arm-smmu-v3 arm-smmu-v3.2.auto: 	0x0000350100000010
        arm-smmu-v3 arm-smmu-v3.2.auto: 	0x000002088000003f
        arm-smmu-v3 arm-smmu-v3.2.auto: 	0x00000000a50e0800
        arm-smmu-v3 arm-smmu-v3.2.auto: 	0x0000000000000000
        arm-smmu-v3 arm-smmu-v3.2.auto: event 0x10 received:
        arm-smmu-v3 arm-smmu-v3.2.auto: 	0x0000350100000010
        arm-smmu-v3 arm-smmu-v3.2.auto: 	0x000002088000043e
        arm-smmu-v3 arm-smmu-v3.2.auto: 	0x00000000a50a0800
        arm-smmu-v3 arm-smmu-v3.2.auto: 	0x0000000000000000
        arm-smmu-v3 arm-smmu-v3.2.auto: event 0x10 received:
        arm-smmu-v3 arm-smmu-v3.2.auto: 	0x0000350100000010
        arm-smmu-v3 arm-smmu-v3.2.auto: 	0x0000020880000436
        arm-smmu-v3 arm-smmu-v3.2.auto: 	0x00000000a50a0880
        arm-smmu-v3 arm-smmu-v3.2.auto: 	0x0000000000000000
        arm-smmu-v3 arm-smmu-v3.2.auto: event 0x10 received:
        arm-smmu-v3 arm-smmu-v3.2.auto: 	0x0000350100000010
        arm-smmu-v3 arm-smmu-v3.2.auto: 	0x000002088000043a
        arm-smmu-v3 arm-smmu-v3.2.auto: 	0x00000000a50e0840
        hns3 0000:35:00.0: INT status: CMDQ(0x0) HW errors(0x0) other(0x0)
        arm-smmu-v3 arm-smmu-v3.2.auto: 	0x0000000000000000
        hns3 0000:35:00.0: received unknown or unhandled event of vector0
        arm-smmu-v3 arm-smmu-v3.2.auto: event 0x10 received:
        arm-smmu-v3 arm-smmu-v3.2.auto: 	0x0000350100000010
        {34}[Hardware Error]: Hardware error from APEI Generic Hardware Error Source: 7
      
      is_reset will be set correctly in check_aedev_reset_status(), so the
      setting in hns_roce_hw_v2_reset_notify_down() should be deleted.
      
      Fixes: 726be12f ("RDMA/hns: Set reset flag when hw resetting")
      Link: https://lore.kernel.org/r/20211123084809.37318-1-liangwenpeng@huawei.comSigned-off-by: NYangyang Li <liyangyang20@huawei.com>
      Signed-off-by: NWenpeng Liang <liangwenpeng@huawei.com>
      Signed-off-by: NJason Gunthorpe <jgg@nvidia.com>
      52414e27
  12. 20 11月, 2021 5 次提交
  13. 29 10月, 2021 2 次提交
  14. 26 10月, 2021 1 次提交
  15. 12 10月, 2021 1 次提交
  16. 28 9月, 2021 1 次提交
  17. 24 9月, 2021 1 次提交
    • J
      RDMA/hns: Work around broken constant propagation in gcc 8 · 14351f08
      Jason Gunthorpe 提交于
      gcc 8.3 and 5.4 throw this:
      
      In function 'modify_qp_init_to_rtr',
      ././include/linux/compiler_types.h:322:38: error: call to '__compiletime_assert_1859' declared with attribute error: FIELD_PREP: value too large for the field
        _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
      [..]
      drivers/infiniband/hw/hns/hns_roce_common.h:91:52: note: in expansion of macro 'FIELD_PREP'
         *((__le32 *)ptr + (field_h) / 32) |= cpu_to_le32(FIELD_PREP(   \
                                                          ^~~~~~~~~~
      drivers/infiniband/hw/hns/hns_roce_common.h:95:39: note: in expansion of macro '_hr_reg_write'
       #define hr_reg_write(ptr, field, val) _hr_reg_write(ptr, field, val)
                                             ^~~~~~~~~~~~~
      drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4412:2: note: in expansion of macro 'hr_reg_write'
        hr_reg_write(context, QPC_LP_PKTN_INI, lp_pktn_ini);
      
      Because gcc has miscalculated the constantness of lp_pktn_ini:
      
      	mtu = ib_mtu_enum_to_int(ib_mtu);
      	if (WARN_ON(mtu < 0)) [..]
      	lp_pktn_ini = ilog2(MAX_LP_MSG_LEN / mtu);
      
      Since mtu is limited to {256,512,1024,2048,4096} lp_pktn_ini is between 4
      and 8 which is compatible with the 4 bit field in the FIELD_PREP.
      
      Work around this broken compiler by adding a 'can never be true'
      constraint on lp_pktn_ini's value which clears out the problem.
      
      Fixes: f0cb411a ("RDMA/hns: Use new interface to modify QP context")
      Link: https://lore.kernel.org/r/0-v1-c773ecb137bc+11f-hns_gcc8_jgg@nvidia.comReported-by: NGeert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: NJason Gunthorpe <jgg@nvidia.com>
      14351f08
  18. 26 8月, 2021 3 次提交