Skip to content

Commit 03efecd

Browse files
committed
Merge: RDMA/EFA: Driver update
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/701 JIRA: https://issues.redhat.com/browse/RHEL-86525 Update the efa driver to upstream kernel v6.14 Signed-off-by: Kamal Heib <[email protected]> Approved-by: José Ignacio Tornos Martínez <[email protected]> Approved-by: Michal Schmidt <[email protected]> Approved-by: CKI KWF Bot <[email protected]> Merged-by: Julio Faracco <[email protected]>
2 parents 4193aa9 + d2a6ef3 commit 03efecd

File tree

10 files changed

+229
-50
lines changed

10 files changed

+229
-50
lines changed

drivers/infiniband/hw/efa/efa.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause */
22
/*
3-
* Copyright 2018-2024 Amazon.com, Inc. or its affiliates. All rights reserved.
3+
* Copyright 2018-2025 Amazon.com, Inc. or its affiliates. All rights reserved.
44
*/
55

66
#ifndef _EFA_H_
@@ -57,15 +57,15 @@ struct efa_dev {
5757
u64 db_bar_addr;
5858
u64 db_bar_len;
5959

60-
unsigned int num_irq_vectors;
61-
int admin_msix_vector_idx;
60+
u32 num_irq_vectors;
61+
u32 admin_msix_vector_idx;
6262
struct efa_irq admin_irq;
6363

6464
struct efa_stats stats;
6565

6666
/* Array of completion EQs */
6767
struct efa_eq *eqs;
68-
unsigned int neqs;
68+
u32 neqs;
6969

7070
/* Only stores CQs with interrupts enabled */
7171
struct xarray cqs_xa;

drivers/infiniband/hw/efa/efa_admin_cmds_defs.h

Lines changed: 56 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ enum efa_admin_aq_opcode {
3030
EFA_ADMIN_DEALLOC_UAR = 17,
3131
EFA_ADMIN_CREATE_EQ = 18,
3232
EFA_ADMIN_DESTROY_EQ = 19,
33-
EFA_ADMIN_MAX_OPCODE = 19,
33+
EFA_ADMIN_ALLOC_MR = 20,
34+
EFA_ADMIN_MAX_OPCODE = 20,
3435
};
3536

3637
enum efa_admin_aq_feature_id {
@@ -150,8 +151,11 @@ struct efa_admin_create_qp_cmd {
150151
/* UAR number */
151152
u16 uar;
152153

154+
/* Requested service level for the QP, 0 is the default SL */
155+
u8 sl;
156+
153157
/* MBZ */
154-
u16 reserved;
158+
u8 reserved;
155159

156160
/* MBZ */
157161
u32 reserved2;
@@ -459,6 +463,41 @@ struct efa_admin_dereg_mr_resp {
459463
struct efa_admin_acq_common_desc acq_common_desc;
460464
};
461465

466+
/*
467+
* Allocation of MemoryRegion, required for QP working with Virtual
468+
* Addresses in kernel verbs semantics, ready for fast registration use.
469+
*/
470+
struct efa_admin_alloc_mr_cmd {
471+
/* Common Admin Queue descriptor */
472+
struct efa_admin_aq_common_desc aq_common_desc;
473+
474+
/* Protection Domain */
475+
u16 pd;
476+
477+
/* MBZ */
478+
u16 reserved1;
479+
480+
/* Maximum number of pages this MR supports. */
481+
u32 max_pages;
482+
};
483+
484+
struct efa_admin_alloc_mr_resp {
485+
/* Common Admin Queue completion descriptor */
486+
struct efa_admin_acq_common_desc acq_common_desc;
487+
488+
/*
489+
* L_Key, to be used in conjunction with local buffer references in
490+
* SQ and RQ WQE, or with virtual RQ/CQ rings
491+
*/
492+
u32 l_key;
493+
494+
/*
495+
* R_Key, to be used in RDMA messages to refer to remotely accessed
496+
* memory region
497+
*/
498+
u32 r_key;
499+
};
500+
462501
struct efa_admin_create_cq_cmd {
463502
struct efa_admin_aq_common_desc aq_common_desc;
464503

@@ -483,8 +522,8 @@ struct efa_admin_create_cq_cmd {
483522
*/
484523
u8 cq_caps_2;
485524

486-
/* completion queue depth in # of entries. must be power of 2 */
487-
u16 cq_depth;
525+
/* Sub completion queue depth in # of entries. must be power of 2 */
526+
u16 sub_cq_depth;
488527

489528
/* EQ number assigned to this cq */
490529
u16 eqn;
@@ -519,8 +558,8 @@ struct efa_admin_create_cq_resp {
519558

520559
u16 cq_idx;
521560

522-
/* actual cq depth in number of entries */
523-
u16 cq_actual_depth;
561+
/* actual sub cq depth in number of entries */
562+
u16 sub_cq_actual_depth;
524563

525564
/* CQ doorbell address, as offset to PCIe DB BAR */
526565
u32 db_offset;
@@ -578,6 +617,8 @@ struct efa_admin_basic_stats {
578617
u64 rx_pkts;
579618

580619
u64 rx_drops;
620+
621+
u64 qkey_viol;
581622
};
582623

583624
struct efa_admin_messages_stats {
@@ -677,6 +718,15 @@ struct efa_admin_feature_device_attr_desc {
677718

678719
/* Unique global ID for an EFA device */
679720
u64 guid;
721+
722+
/* The device maximum link speed in Gbit/sec */
723+
u16 max_link_speed_gbps;
724+
725+
/* MBZ */
726+
u16 reserved0;
727+
728+
/* MBZ */
729+
u32 reserved1;
680730
};
681731

682732
struct efa_admin_feature_queue_attr_desc {
@@ -1057,7 +1107,6 @@ struct efa_admin_host_info {
10571107

10581108
/* create_eq_cmd */
10591109
#define EFA_ADMIN_CREATE_EQ_CMD_ENTRY_SIZE_WORDS_MASK GENMASK(4, 0)
1060-
#define EFA_ADMIN_CREATE_EQ_CMD_VIRT_MASK BIT(6)
10611110
#define EFA_ADMIN_CREATE_EQ_CMD_COMPLETION_EVENTS_MASK BIT(0)
10621111

10631112
/* host_info */

drivers/infiniband/hw/efa/efa_admin_defs.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause */
22
/*
3-
* Copyright 2018-2021 Amazon.com, Inc. or its affiliates. All rights reserved.
3+
* Copyright 2018-2024 Amazon.com, Inc. or its affiliates. All rights reserved.
44
*/
55

66
#ifndef _EFA_ADMIN_H_
@@ -96,7 +96,7 @@ struct efa_admin_acq_entry {
9696
struct efa_admin_aenq_common_desc {
9797
u16 group;
9898

99-
u16 syndrom;
99+
u16 syndrome;
100100

101101
/*
102102
* 0 : phase

drivers/infiniband/hw/efa/efa_com.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause */
22
/*
3-
* Copyright 2018-2021 Amazon.com, Inc. or its affiliates. All rights reserved.
3+
* Copyright 2018-2025 Amazon.com, Inc. or its affiliates. All rights reserved.
44
*/
55

66
#ifndef _EFA_COM_H_
@@ -65,7 +65,7 @@ struct efa_com_admin_queue {
6565
u16 depth;
6666
struct efa_com_admin_cq cq;
6767
struct efa_com_admin_sq sq;
68-
u16 msix_vector_idx;
68+
u32 msix_vector_idx;
6969

7070
unsigned long state;
7171

@@ -89,7 +89,7 @@ struct efa_com_aenq {
8989
struct efa_aenq_handlers *aenq_handlers;
9090
dma_addr_t dma_addr;
9191
u32 cc; /* consumer counter */
92-
u16 msix_vector_idx;
92+
u32 msix_vector_idx;
9393
u16 depth;
9494
u8 phase;
9595
};

drivers/infiniband/hw/efa/efa_com_cmd.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ int efa_com_create_qp(struct efa_com_dev *edev,
3131
create_qp_cmd.qp_alloc_size.recv_queue_depth =
3232
params->rq_depth;
3333
create_qp_cmd.uar = params->uarn;
34+
create_qp_cmd.sl = params->sl;
3435

3536
if (params->unsolicited_write_recv)
3637
EFA_SET(&create_qp_cmd.flags, EFA_ADMIN_CREATE_QP_CMD_UNSOLICITED_WRITE_RECV, 1);
@@ -163,7 +164,7 @@ int efa_com_create_cq(struct efa_com_dev *edev,
163164
EFA_SET(&create_cmd.cq_caps_2,
164165
EFA_ADMIN_CREATE_CQ_CMD_CQ_ENTRY_SIZE_WORDS,
165166
params->entry_size_in_bytes / 4);
166-
create_cmd.cq_depth = params->cq_depth;
167+
create_cmd.sub_cq_depth = params->sub_cq_depth;
167168
create_cmd.num_sub_cqs = params->num_sub_cqs;
168169
create_cmd.uar = params->uarn;
169170
if (params->interrupt_mode_enabled) {
@@ -191,7 +192,7 @@ int efa_com_create_cq(struct efa_com_dev *edev,
191192
}
192193

193194
result->cq_idx = cmd_completion.cq_idx;
194-
result->actual_depth = params->cq_depth;
195+
result->actual_depth = params->sub_cq_depth;
195196
result->db_off = cmd_completion.db_offset;
196197
result->db_valid = EFA_GET(&cmd_completion.flags,
197198
EFA_ADMIN_CREATE_CQ_RESP_DB_VALID);
@@ -466,6 +467,7 @@ int efa_com_get_device_attr(struct efa_com_dev *edev,
466467
result->max_rdma_size = resp.u.device_attr.max_rdma_size;
467468
result->device_caps = resp.u.device_attr.device_caps;
468469
result->guid = resp.u.device_attr.guid;
470+
result->max_link_speed_gbps = resp.u.device_attr.max_link_speed_gbps;
469471

470472
if (result->admin_api_version < 1) {
471473
ibdev_err_ratelimited(

drivers/infiniband/hw/efa/efa_com_cmd.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ struct efa_com_create_qp_params {
2727
u16 pd;
2828
u16 uarn;
2929
u8 qp_type;
30+
u8 sl;
3031
u8 unsolicited_write_recv : 1;
3132
};
3233

@@ -71,7 +72,7 @@ struct efa_com_create_cq_params {
7172
/* cq physical base address in OS memory */
7273
dma_addr_t dma_addr;
7374
/* completion queue depth in # of entries */
74-
u16 cq_depth;
75+
u16 sub_cq_depth;
7576
u16 num_sub_cqs;
7677
u16 uarn;
7778
u16 eqn;
@@ -141,6 +142,7 @@ struct efa_com_get_device_attr_result {
141142
u16 max_wr_rdma_sge;
142143
u16 max_tx_batch;
143144
u16 min_sq_depth;
145+
u16 max_link_speed_gbps;
144146
u8 db_bar;
145147
};
146148

0 commit comments

Comments
 (0)