Blame SOURCES/0001-Only-load-i40iw-for-i40e-device-with-specific-PCI-ID.patch

28879c
From 23408827f9f74062a43041154a78505bc9fa4ed8 Mon Sep 17 00:00:00 2001
28879c
From: Honggang Li <honli@redhat.com>
28879c
Date: Tue, 3 Nov 2020 20:21:33 +0800
28879c
Subject: [PATCH] Only load i40iw for i40e device with specific PCI IDs
28879c
28879c
This a redhat specific hack to handle i40iw huge memory consuming issue.
28879c
28879c
rdma-core upstream maintainer believes this issue should be handled in
28879c
kernel space with i40e/i40iw driver. Unfortunately, Intel does not care
28879c
about this request.
28879c
28879c
<snip>
28879c
Just for the record, why is it a bad idea to use the original udev
28879c
rule that contained "kmod load i40iw". Two reasons:
28879c
a) for most i40e NICs i40iw is irrelevant and we have the memory issue
28879c
that Intel won't fix.
28879c
b) if i40iw is loaded you can no longer unload i40e by itself.
28879c
$ modprobe i40iw
28879c
$ modprobe -r i40e
28879c
modprobe: FATAL: Module i40e is in use.
28879c
28879c
Bad user experience and we may break existing user scripts!
28879c
Even worse unloading i40iw unloads i40e implicitly.
28879c
Also i40iw is going away upstream at some point.
28879c
<snip>
28879c
28879c
Resolves: bz1850462
28879c
28879c
Signed-off-by: Honggang Li <honli@redhat.com>
28879c
---
28879c
 kernel-boot/rdma-hw-modules.rules | 20 +++++++++++++++++++-
28879c
 1 file changed, 19 insertions(+), 1 deletion(-)
28879c
28879c
diff --git a/kernel-boot/rdma-hw-modules.rules b/kernel-boot/rdma-hw-modules.rules
28879c
index 95eaf7206702..541516eb98f4 100644
28879c
--- a/kernel-boot/rdma-hw-modules.rules
28879c
+++ b/kernel-boot/rdma-hw-modules.rules
28879c
@@ -11,11 +11,29 @@ ENV{ID_NET_DRIVER}=="be2net", RUN{builtin}+="kmod load ocrdma"
28879c
 ENV{ID_NET_DRIVER}=="bnxt_en", RUN{builtin}+="kmod load bnxt_re"
28879c
 ENV{ID_NET_DRIVER}=="cxgb4", RUN{builtin}+="kmod load iw_cxgb4"
28879c
 ENV{ID_NET_DRIVER}=="hns", RUN{builtin}+="kmod load hns_roce"
28879c
-ENV{ID_NET_DRIVER}=="i40e", RUN{builtin}+="kmod load i40iw"
28879c
 ENV{ID_NET_DRIVER}=="mlx4_en", RUN{builtin}+="kmod load mlx4_ib"
28879c
 ENV{ID_NET_DRIVER}=="mlx5_core", RUN{builtin}+="kmod load mlx5_ib"
28879c
 ENV{ID_NET_DRIVER}=="qede", RUN{builtin}+="kmod load qedr"
28879c
 
28879c
+# Because most of X722 don't support RDMA, only load i40iw for X722 with specific device IDs.
28879c
+#define I40E_INTEL_VENDOR_ID            0x8086
28879c
+#define I40E_DEV_ID_X722                0x37CC
28879c
+#define I40E_DEV_ID_KX_X722             0x37CE
28879c
+#define I40E_DEV_ID_QSFP_X722           0x37CF
28879c
+#define I40E_DEV_ID_SFP_X722            0x37D0
28879c
+#define I40E_DEV_ID_1G_BASE_T_X722      0x37D1
28879c
+#define I40E_DEV_ID_10G_BASE_T_X722     0x37D2
28879c
+#define I40E_DEV_ID_SFP_I_X722          0x37D3
28879c
+#define I40E_DEV_ID_X722_VF             0x37CD
28879c
+ENV{ID_NET_DRIVER}=="i40e", ENV{ID_VENDOR_ID}=="0x8086", ENV{ID_MODEL_ID}=="0x37cc", RUN{builtin}+="kmod load i40iw"
28879c
+ENV{ID_NET_DRIVER}=="i40e", ENV{ID_VENDOR_ID}=="0x8086", ENV{ID_MODEL_ID}=="0x37ce", RUN{builtin}+="kmod load i40iw"
28879c
+ENV{ID_NET_DRIVER}=="i40e", ENV{ID_VENDOR_ID}=="0x8086", ENV{ID_MODEL_ID}=="0x37cf", RUN{builtin}+="kmod load i40iw"
28879c
+ENV{ID_NET_DRIVER}=="i40e", ENV{ID_VENDOR_ID}=="0x8086", ENV{ID_MODEL_ID}=="0x37d0", RUN{builtin}+="kmod load i40iw"
28879c
+ENV{ID_NET_DRIVER}=="i40e", ENV{ID_VENDOR_ID}=="0x8086", ENV{ID_MODEL_ID}=="0x37d1", RUN{builtin}+="kmod load i40iw"
28879c
+ENV{ID_NET_DRIVER}=="i40e", ENV{ID_VENDOR_ID}=="0x8086", ENV{ID_MODEL_ID}=="0x37d2", RUN{builtin}+="kmod load i40iw"
28879c
+ENV{ID_NET_DRIVER}=="i40e", ENV{ID_VENDOR_ID}=="0x8086", ENV{ID_MODEL_ID}=="0x37d3", RUN{builtin}+="kmod load i40iw"
28879c
+ENV{ID_NET_DRIVER}=="i40e", ENV{ID_VENDOR_ID}=="0x8086", ENV{ID_MODEL_ID}=="0x37cd", RUN{builtin}+="kmod load i40iw"
28879c
+
28879c
 # The user must explicitly load these modules via /etc/modules-load.d/ or otherwise
28879c
 # rxe
28879c
 
28879c
-- 
28879c
2.25.4
28879c