Skip to content
Snippets Groups Projects
Commit ccbef101 authored by Rocky Automation's avatar Rocky Automation :tv:
Browse files

import imports/r8/kmod-idpf-irdma-0.0.129.20_0.0.647-11.el8_10.cloud

parent b380f373
No related merge requests found
From 14044d8a14d8b37605371ed8ef3e053809ff1477 Mon Sep 17 00:00:00 2001
From: Jacob Moroni <jmoroni@google.com>
Date: Thu, 23 Jan 2025 18:48:58 +0000
Subject: [PATCH] irdma: enforce even CQ size and remove doorbell optimization
These changes have already been applied to the user space
provider, so add them to the kernel module as well.
Signed-off-by: Jacob Moroni <jmoroni@google.com>
---
rdma-driver/src/irdma/irdma_kcompat.c | 2 ++
rdma-driver/src/irdma/main.h | 2 +-
rdma-driver/src/irdma/uk.c | 29 +--------------------------
rdma-driver/src/irdma/verbs.c | 5 ++++-
4 files changed, 8 insertions(+), 30 deletions(-)
diff --git a/rdma-driver/src/irdma/irdma_kcompat.c b/rdma-driver/src/irdma/irdma_kcompat.c
index 6b1bf6a..cc1e581 100644
--- a/rdma-driver/src/irdma/irdma_kcompat.c
+++ b/rdma-driver/src/irdma/irdma_kcompat.c
@@ -2555,6 +2555,8 @@ struct ib_cq *irdma_create_cq(struct ib_device *ibdev,
entries++;
if (!cqe_64byte_ena && dev->hw_attrs.uk_attrs.hw_rev >= IRDMA_GEN_2)
entries *= 2;
+ if (entries & 1)
+ entries += 1; /* cq size must be an even number */
ukinfo->cq_size = entries;
if (cqe_64byte_ena)
diff --git a/rdma-driver/src/irdma/main.h b/rdma-driver/src/irdma/main.h
index a406cf5..a0136ae 100644
--- a/rdma-driver/src/irdma/main.h
+++ b/rdma-driver/src/irdma/main.h
@@ -84,7 +84,7 @@ extern struct auxiliary_driver i40iw_auxiliary_drv;
#define IRDMA_MACIP_ADD 1
#define IRDMA_MACIP_DELETE 2
-#define IW_CCQ_SIZE (IRDMA_CQP_SW_SQSIZE_2048 + 1)
+#define IW_CCQ_SIZE (IRDMA_CQP_SW_SQSIZE_2048 + 2)
#define IW_CEQ_SIZE 2048
#define IW_AEQ_SIZE 2048
diff --git a/rdma-driver/src/irdma/uk.c b/rdma-driver/src/irdma/uk.c
index ca65f25..e92b051 100644
--- a/rdma-driver/src/irdma/uk.c
+++ b/rdma-driver/src/irdma/uk.c
@@ -119,35 +119,8 @@ void irdma_clr_wqes(struct irdma_qp_uk *qp, u32 qp_wqe_idx)
*/
void irdma_uk_qp_post_wr(struct irdma_qp_uk *qp)
{
- u64 temp;
- u32 hw_sq_tail;
- u32 sw_sq_head;
-
- /* valid bit is written and loads completed before reading shadow */
mb();
-
- /* read the doorbell shadow area */
- get_64bit_val(qp->shadow_area, 0, &temp);
-
- hw_sq_tail = (u32)FIELD_GET(IRDMA_QP_DBSA_HW_SQ_TAIL, temp);
- sw_sq_head = IRDMA_RING_CURRENT_HEAD(qp->sq_ring);
- if (sw_sq_head != qp->initial_ring.head) {
- if (qp->push_dropped) {
- writel(qp->qp_id, qp->wqe_alloc_db);
- qp->push_dropped = false;
- } else if (sw_sq_head != hw_sq_tail) {
- if (sw_sq_head > qp->initial_ring.head) {
- if (hw_sq_tail >= qp->initial_ring.head &&
- hw_sq_tail < sw_sq_head)
- writel(qp->qp_id, qp->wqe_alloc_db);
- } else {
- if (hw_sq_tail >= qp->initial_ring.head ||
- hw_sq_tail < sw_sq_head)
- writel(qp->qp_id, qp->wqe_alloc_db);
- }
- }
- }
-
+ writel(qp->qp_id, qp->wqe_alloc_db);
qp->initial_ring.head = qp->sq_ring.head;
}
diff --git a/rdma-driver/src/irdma/verbs.c b/rdma-driver/src/irdma/verbs.c
index f26cde4..5cbbe54 100644
--- a/rdma-driver/src/irdma/verbs.c
+++ b/rdma-driver/src/irdma/verbs.c
@@ -1741,8 +1741,11 @@ static int irdma_resize_cq(struct ib_cq *ibcq, int entries,
if (!iwcq->user_mode) {
entries++;
- if (rf->sc_dev.hw_attrs.uk_attrs.hw_rev >= IRDMA_GEN_2)
+ if (!iwcq->sc_cq.cq_uk.avoid_mem_cflct &&
+ dev->hw_attrs.uk_attrs.hw_rev >= IRDMA_GEN_2)
entries *= 2;
+ if (entries & 1)
+ entries += 1; /* cq size must be an even number */
}
info.cq_size = max(entries, 4);
......@@ -10,7 +10,8 @@
%define IDPF_VER 0.0.647
# If kmod_kernel_version isn't defined on the rpmbuild line, define it here.
%{!?kmod_kernel_version: %define kmod_kernel_version 4.18.0-553.16.1.el8_10.cloud.0.1}
# Simply use latest installed kernel-devel on the system. If we don't have one (like in the src.rpm build), default to epoch:
%{!?kmod_kernel_version: %define kmod_kernel_version %(sh -c 'find /usr/src/kernels/* -maxdepth 0 -type d 2> /dev/null || date +"%%s"' | sort -V | tail -1 | awk -F '/' '{print $NF}' | sed 's/\.%{_arch}//')}
# Information in description for secure-boot signed builds
%if 0%{?pe_signing_certkeyslot:1}
......@@ -26,7 +27,7 @@
Name: kmod-%{kmod_name}
Version: %{IRDMA_VER}_%{IDPF_VER}
Release: 9%{?dist}
Release: 11%{?dist}
Summary: Kernel modules for IRDMA + IDPF
Group: System Environment/Kernel
License: GPLv2
......@@ -38,6 +39,7 @@ Source1: kmod-%{kmod_name}.conf
Patch1: main...jakemoroni-ethernet-linux-irdma-and-idpf-main.patch
Patch2: single-flush.patch
Patch3: irdma-netdev-notifiers.patch
Patch4: even-cq-size.patch
ExcludeArch: i686
......@@ -63,7 +65,7 @@ ExcludeArch: i686
%global kernel_source() %{_usrsrc}/kernels/%{kmod_kernel_version}.%{_arch}
BuildRequires: elfutils-libelf-devel
BuildRequires: kernel-devel = %{kmod_kernel_version}
BuildRequires: kernel-devel
BuildRequires: kernel-abi-stablelists
BuildRequires: kernel-rpm-macros
BuildRequires: redhat-rpm-config
......@@ -248,6 +250,9 @@ exit 0
%changelog
* Fri Jan 24 2025 Jonathan Dieter <jdieter@ciq.com> - 0.0.129.20_0.0.647-11
- Add patch from Google to enforce even CQ size
* Fri Dec 13 2024 Jonathan Dieter <jdieter@ciq.com> - 0.0.129.20_0.0.647-9
- Clean up spec file for SIG/Cloud
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment