*** irdma 6.8 rc fixes ***
Subsystems (2)
cover *** irdma 6.8 rc fixes ***
Small set of fixes for the irdma driver.
Mike Marciniszyn (1):
RDMA/irdma: Fix KASAN issue with tasklet
Mustafa Ismail (2):
RDMA/irdma: Set the CQ read threshold for GEN 1
RDMA/irdma: Add AE for too many RNRS
Shiraz Saleem (1):
RDMA/irdma: Validate max_send_wr and max_recv_wr
drivers/infiniband/hw/irdma/defs.h | 1 + drivers/infiniband/hw/irdma/hw.c | 8 ++++++++ drivers/infiniband/hw/irdma/verbs.c | 9 +++++---- 3 files changed, 14 insertions(+), 4 deletions(-)
Signature · 1 line
2.42.0
PATCH 1/4 RDMA/irdma: Fix KASAN issue with tasklet
From: Mike Marciniszyn <[email protected]>
KASAN testing revealed the following issue assocated with freeing an IRQ.
[50006.466686] Call Trace: [50006.466691] <IRQ> [50006.489538] dump_stack+0x5c/0x80 [50006.493475] print_address_description.constprop.6+0x1a/0x150 [50006.499872] ? irdma_sc_process_ceq+0x483/0x790 [irdma] [50006.505742] ? irdma_sc_process_ceq+0x483/0x790 [irdma] [50006.511644] kasan_report.cold.11+0x7f/0x118 [50006.516572] ? irdma_sc_process_ceq+0x483/0x790 [irdma] [50006.522473] irdma_sc_process_ceq+0x483/0x790 [irdma] [50006.528232] irdma_process_ceq+0xb2/0x400 [irdma] [50006.533601] ? irdma_hw_flush_wqes_callback+0x370/0x370 [irdma] [50006.540298] irdma_ceq_dpc+0x44/0x100 [irdma] [50006.545306] tasklet_action_common.isra.14+0x148/0x2c0 [50006.551096] __do_softirq+0x1d0/0xaf8 [50006.555396] irq_exit_rcu+0x219/0x260 [50006.559670] irq_exit+0xa/0x20 [50006.563320] smp_apic_timer_interrupt+0x1bf/0x690 [50006.568645] apic_timer_interrupt+0xf/0x20 [50006.573341] </IRQ>
The issue is that a tasklet could be pending on another core racing the delete of the irq.
Fix by insuring any scheduled tasklet is killed after deleting the irq.
--- drivers/infiniband/hw/irdma/hw.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/infiniband/hw/irdma/hw.c +7 -0
@@ -570,6 +570,13 @@ static void irdma_destroy_irq(struct irdma_pci_f *rf, dev->irq_ops->irdma_dis_irq (dev, msix_vec->idx);irq_update_affinity_hint (msix_vec->irq,NULL );free_irq (msix_vec->irq, dev_id); +if (rf == dev_id) { +tasklet_kill (&rf->dpc_tasklet); + }else { +struct irdma_ceq *iwceq = (struct irdma_ceq *)dev_id; + +tasklet_kill (&iwceq->dpc_tasklet); + } }/**
Signature · 1 line
2.42.0
PATCH 2/4 RDMA/irdma: Validate max_send_wr and max_recv_wr
In reply to Sindhu DevaleFrom: Shiraz Saleem <[email protected]>
Validate that max_send_wr and max_recv_wr is within the supported range.
--- drivers/infiniband/hw/irdma/verbs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/infiniband/hw/irdma/verbs.c +3 -1
@@ -839,7 +839,9 @@ static int irdma_validate_qp_attrs(struct ib_qp_init_attr *init_attr,if (init_attr->cap.max_inline_data > uk_attrs->max_hw_inline || init_attr->cap.max_send_sge > uk_attrs->max_hw_wq_frags || - init_attr->cap.max_recv_sge > uk_attrs->max_hw_wq_frags) + init_attr->cap.max_recv_sge > uk_attrs->max_hw_wq_frags || + init_attr->cap.max_send_wr > uk_attrs->max_hw_wq_quanta || + init_attr->cap.max_recv_wr > uk_attrs->max_hw_rq_quanta)return -EINVAL ;if (rdma_protocol_roce (&iwdev->ibdev,1 )) {
Signature · 1 line
2.42.0
PATCH 3/4 RDMA/irdma: Set the CQ read threshold for GEN 1
In reply to Sindhu DevaleFrom: Mustafa Ismail <[email protected]>
The CQ shadow read threshold is currently not set for GEN 2. This could cause an invalid CQ overflow condition, so remove the GEN check that exclused GEN 1.
--- drivers/infiniband/hw/irdma/verbs.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/infiniband/hw/irdma/verbs.c +2 -3
@@ -2186,9 +2186,8 @@ static int irdma_create_cq(struct ib_cq *ibcq, info.cq_base_pa = iwcq->kmem.pa; } -if (dev->hw_attrs.uk_attrs.hw_rev >=IRDMA_GEN_2 ) - info.shadow_read_threshold =min (info.cq_uk_init_info.cq_size /2 , - (u32 )IRDMA_MAX_CQ_READ_THRESH ); + info.shadow_read_threshold =min (info.cq_uk_init_info.cq_size /2 , + (u32 )IRDMA_MAX_CQ_READ_THRESH );if (irdma_sc_cq_init (cq, &info)) {ibdev_dbg (&iwdev->ibdev,"VERBS: init cq fail\n" );
Signature · 1 line
2.42.0
PATCH 4/4 RDMA/irdma: Add AE for too many RNRS
In reply to Sindhu DevaleFrom: Mustafa Ismail <[email protected]>
Add IRDMA_AE_LLP_TOO_MANY_RNRS to the list of AE's processed as an abnormal asyncronous event.
--- drivers/infiniband/hw/irdma/defs.h | 1 + drivers/infiniband/hw/irdma/hw.c | 1 + 2 files changed, 2 insertions(+)
drivers/infiniband/hw/irdma/defs.h +1 -0
@@ -346,6 +346,7 @@ enum irdma_cqp_op_type {#define IRDMA_AE_LLP_TOO_MANY_KEEPALIVE_RETRIES 0x050b#define IRDMA_AE_LLP_DOUBT_REACHABILITY 0x050c#define IRDMA_AE_LLP_CONNECTION_ESTABLISHED 0x050e +#define IRDMA_AE_LLP_TOO_MANY_RNRS 0x050f#define IRDMA_AE_RESOURCE_EXHAUSTION 0x0520#define IRDMA_AE_RESET_SENT 0x0601#define IRDMA_AE_TERMINATE_SENT 0x0602
drivers/infiniband/hw/irdma/hw.c +1 -0
@@ -387,6 +387,7 @@ static void irdma_process_aeq(struct irdma_pci_f *rf)case IRDMA_AE_LLP_TOO_MANY_RETRIES :case IRDMA_AE_LCE_QP_CATASTROPHIC :case IRDMA_AE_LCE_FUNCTION_CATASTROPHIC : +case IRDMA_AE_LLP_TOO_MANY_RNRS :case IRDMA_AE_LCE_CQ_CATASTROPHIC :case IRDMA_AE_UDA_XMIT_DGRAM_TOO_LONG :default :
Signature · 1 line
2.42.0
Leon Romanovsky
AppliedQuoted 10 lines · Sindhu Devale
Small set of fixes for the irdma driver.
Mike Marciniszyn (1):
RDMA/irdma: Fix KASAN issue with taskletMustafa Ismail (2):
RDMA/irdma: Set the CQ read threshold for GEN 1
RDMA/irdma: Add AE for too many RNRS[...]
Applied, thanks!
[1/4] RDMA/irdma: Fix KASAN issue with tasklet
https://git.kernel.org/rdma/rdma/c/bd97cea7b18a0a [2/4] RDMA/irdma: Validate max_send_wr and max_recv_wr https://git.kernel.org/rdma/rdma/c/ee107186bcfd25 [3/4] RDMA/irdma: Set the CQ read threshold for GEN 1 https://git.kernel.org/rdma/rdma/c/4823a004d8301d [4/4] RDMA/irdma: Add AE for too many RNRS https://git.kernel.org/rdma/rdma/c/772e5fb3884306
Best regards,
Signature · 1 line
Leon Romanovsky <[email protected]>