RDMA/erdma: erdma fixes 3-20-2023
Subsystems (2)
Cheng Xu
maintainercover RDMA/erdma: erdma fixes 3-20-2023
Though there is an ongoing patch waiting Jason to take a look, this series with small changes may be accepted with less discussion. So I submit them first.
This series has some fixes for erdma driver:
- #1 fixes some typos.
- #2 updates the default EQ depth and max_send_wr for SQ.
- #3 inlines 4 mtt entries for FRMR to achieve the HW limitation.
- #4 defers probing flow if netdevice does not exist temporarily.
Thanks,
Cheng Xu
Cheng Xu (4):
RDMA/erdma: Fix some typos
RDMA/erdma: Update default EQ depth to 4096 and max_send_wr to 8192 RDMA/erdma: Inline mtt entries into WQE if supported RDMA/erdma: Defer probing if netdevice can not be found
drivers/infiniband/hw/erdma/erdma_cq.c | 2 +- drivers/infiniband/hw/erdma/erdma_hw.h | 4 ++-- drivers/infiniband/hw/erdma/erdma_main.c | 2 +- drivers/infiniband/hw/erdma/erdma_qp.c | 4 ++-- drivers/infiniband/hw/erdma/erdma_verbs.h | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-)
Signature · 1 line
2.31.1
Cheng Xu
maintainerPATCH 1/4 RDMA/erdma: Fix some typos
FAA is short for atomic fetch and add, not FAD. Fix this.
--- drivers/infiniband/hw/erdma/erdma_cq.c | 2 +- drivers/infiniband/hw/erdma/erdma_hw.h | 2 +- drivers/infiniband/hw/erdma/erdma_qp.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/infiniband/hw/erdma/erdma_cq.c +1 -1
@@ -65,7 +65,7 @@ static const enum ib_wc_opcode wc_mapping_table[ERDMA_NUM_OPCODES] = { [ERDMA_OP_LOCAL_INV] = IB_WC_LOCAL_INV, [ERDMA_OP_READ_WITH_INV] = IB_WC_RDMA_READ, [ERDMA_OP_ATOMIC_CAS] = IB_WC_COMP_SWAP, - [ERDMA_OP_ATOMIC_FAD] = IB_WC_FETCH_ADD, + [ERDMA_OP_ATOMIC_FAA] = IB_WC_FETCH_ADD, }; static const struct {
drivers/infiniband/hw/erdma/erdma_hw.h +1 -1
@@ -491,7 +491,7 @@ enum erdma_opcode {ERDMA_OP_LOCAL_INV =15 ,ERDMA_OP_READ_WITH_INV =16 ,ERDMA_OP_ATOMIC_CAS =17 , -ERDMA_OP_ATOMIC_FAD =18 , +ERDMA_OP_ATOMIC_FAA =18 ,ERDMA_NUM_OPCODES =19 , ERDMA_OP_INVALID = ERDMA_NUM_OPCODES + 1 };
drivers/infiniband/hw/erdma/erdma_qp.c +1 -1
@@ -439,7 +439,7 @@ static int erdma_push_one_sqe(struct erdma_qp *qp, u16 *pi,cpu_to_le64 (atomic_wr (send_wr)->compare_add); }else { wqe_hdr |=FIELD_PREP (ERDMA_SQE_HDR_OPCODE_MASK , -ERDMA_OP_ATOMIC_FAD ); +ERDMA_OP_ATOMIC_FAA ); atomic_sqe->fetchadd_swap_data =cpu_to_le64 (atomic_wr (send_wr)->compare_add); }
Signature · 1 line
2.31.1
Cheng Xu
maintainerPATCH 2/4 RDMA/erdma: Update default EQ depth to 4096 and max_send_wr to 8192
In reply to Cheng XuMax EQ depth of hardware is 32K, the current default EQ depth is too small for some applications, so change the default depth to 4096. Max send WRs the hardware can support is 8K, but the driver limits the value to 4K. Remove this limitation.
--- drivers/infiniband/hw/erdma/erdma_hw.h | 2 +- drivers/infiniband/hw/erdma/erdma_verbs.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/infiniband/hw/erdma/erdma_hw.h +1 -1
@@ -441,7 +441,7 @@ struct erdma_reg_mr_sqe { };/* EQ related. */ -#define ERDMA_DEFAULT_EQ_DEPTH 256 +#define ERDMA_DEFAULT_EQ_DEPTH 4096/* ceqe */ #define ERDMA_CEQE_HDR_DB_MASK BIT_ULL(63)
drivers/infiniband/hw/erdma/erdma_verbs.h +1 -1
@@ -11,7 +11,7 @@/* RDMA Capability. */ #define ERDMA_MAX_PD (128 * 1024) -#define ERDMA_MAX_SEND_WR 4096 +#define ERDMA_MAX_SEND_WR 8192#define ERDMA_MAX_ORD 128#define ERDMA_MAX_IRD 128#define ERDMA_MAX_SGE_RD 1
Signature · 1 line
2.31.1
Cheng Xu
maintainerPATCH 3/4 RDMA/erdma: Inline mtt entries into WQE if supported
In reply to Cheng XuThe max inline mtt count supported is ERDMA_MAX_INLINE_MTT_ENTRIES. When mr->mem.mtt_nents == ERDMA_MAX_INLINE_MTT_ENTRIES, inline mtt is also supported, fix it.
--- drivers/infiniband/hw/erdma/erdma_qp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/erdma/erdma_qp.c +1 -1
@@ -405,7 +405,7 @@ static int erdma_push_one_sqe(struct erdma_qp *qp, u16 *pi,FIELD_PREP (ERDMA_SQE_MR_MTT_CNT_MASK , mr->mem.mtt_nents); -if (mr->mem.mtt_nents <ERDMA_MAX_INLINE_MTT_ENTRIES ) { +if (mr->mem.mtt_nents <=ERDMA_MAX_INLINE_MTT_ENTRIES ) { attrs |=FIELD_PREP (ERDMA_SQE_MR_MTT_TYPE_MASK ,0 );/* Copy SGLs to SQE content to accelerate */ memcpy(get_queue_entry(qp->kern_qp.sq_buf, idx + 1,
Signature · 1 line
2.31.1
Cheng Xu
maintainerPATCH 4/4 RDMA/erdma: Defer probing if netdevice can not be found
In reply to Cheng XuERDMA device may be probed before its associated netdevice, returning -EPROBE_DEFER allows OS try to probe erdma device later.
--- drivers/infiniband/hw/erdma/erdma_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/erdma/erdma_main.c +1 -1
@@ -56,7 +56,7 @@ static int erdma_netdev_event(struct notifier_block *nb, unsigned long event,static int erdma_enum_and_get_netdev (struct erdma_dev *dev) {struct net_device *netdev; -int ret = -ENODEV ; +int ret = -EPROBE_DEFER ;/* Already binded to a net_device, so we skip. */ if (dev->netdev)
Signature · 1 line
2.31.1
Leon Romanovsky
AppliedQuoted 11 lines · Cheng Xu
Though there is an ongoing patch waiting Jason to take a look, this series with small changes may be accepted with less discussion. So I submit them first.
This series has some fixes for erdma driver:
- #1 fixes some typos.
- #2 updates the default EQ depth andmax_send_wrfor SQ.
- #3 inlines 4 mtt entries for FRMR to achieve the HW limitation.
- #4 defers probing flow if netdevice does not exist temporarily.[...]
Applied, thanks!
[1/4] RDMA/erdma: Fix some typos
https://git.kernel.org/rdma/rdma/c/3fe26c0493e4c2 [2/4] RDMA/erdma: Update default EQ depth to 4096 and max_send_wr to 8192 https://git.kernel.org/rdma/rdma/c/6256aa9ae955d1 [3/4] RDMA/erdma: Inline mtt entries into WQE if supported https://git.kernel.org/rdma/rdma/c/0dd83a4d775671 [4/4] RDMA/erdma: Defer probing if netdevice can not be found https://git.kernel.org/rdma/rdma/c/6bd1bca858f173
Best regards,
Signature · 1 line
Leon Romanovsky <[email protected]>