ib_srpt: Port to Linux kernel v6.1

Support for the following IB changes in the Linux kernel v6.1:
- 91a3f14ec953 ("IB/cm: Remove the service_mask parameter from ib_cm_listen()")
This commit is contained in:
Gleb Chesnokov
2022-10-27 12:31:00 +03:00
parent 45f9f12bb3
commit 3961019e74
5 changed files with 28 additions and 1 deletions
+4
View File
@@ -100,6 +100,9 @@ function evaluate(stmnt, pattern, arg, op, result) {
"(LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0) \\&\\& " \
"RHEL_RELEASE_CODE -0 < 7 * 256 + 5)", stmnt)
gsub("defined\\(IB_CM_LISTEN_TAKES_THIRD_ARG\\)",
"(LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0))", stmnt)
gsub("IB_CLIENT_ADD_ONE_RETURNS_INT",
"(LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0) || " \
"RHEL_RELEASE_CODE -0 >= 8 * 256 + 4)", stmnt)
@@ -441,6 +444,7 @@ function handle_if(evaluated)
|| $0 ~ "IB_CLIENT_ADD_ONE_RETURNS_INT" \
|| $0 ~ "IB_CLIENT_REMOVE_TAKES_TWO_ARGS" \
|| $0 ~ "IB_CM_LISTEN_TAKES_FOURTH_ARG" \
|| $0 ~ "IB_CM_LISTEN_TAKES_THIRD_ARG" \
|| $0 ~ "IB_CREATE_CQ_HAS_INIT_ATTR" \
|| $0 ~ "IB_PD_HAS_LOCAL_DMA_LKEY" \
|| $0 ~ "IB_QUERY_GID_HAS_ATTR_ARG" \
+6
View File
@@ -182,6 +182,12 @@ conftest/cm_listen/result-$(KVER).txt: \
echo "$(call run_conftest,cm_listen, \
-DIB_CM_LISTEN_TAKES_FOURTH_ARG)" >"$@"
conftest/cm_listen_2/result-$(KVER).txt: \
conftest/cm_listen_2/cm_listen_2.c \
conftest/cm_listen_2/Kbuild
echo "$(call run_conftest,cm_listen_2, \
-DIB_CM_LISTEN_TAKES_THIRD_ARG)" >"$@"
conftest/create_cq/result-$(KVER).txt: \
conftest/create_cq/create_cq.c \
conftest/create_cq/Kbuild
+3
View File
@@ -0,0 +1,3 @@
LINUXINCLUDE := $(CONFTEST_CFLAGS) $(LINUXINCLUDE)
obj-m += cm_listen_2.o
+11
View File
@@ -0,0 +1,11 @@
#include <linux/module.h>
#include <rdma/ib_cm.h>
static int __init modinit(void)
{
return ib_cm_listen(NULL, 0, 0);
}
module_init(modinit);
MODULE_LICENSE("GPL");
+4 -1
View File
@@ -4403,9 +4403,12 @@ static int srpt_add_one(struct ib_device *device)
* in the system as service_id; therefore, the target_id will change
* if this HCA is gone bad and replaced by different HCA
*/
ret = ib_cm_listen(sdev->cm_id, cpu_to_be64(srpt_service_guid), 0
ret = ib_cm_listen(sdev->cm_id, cpu_to_be64(srpt_service_guid)
#ifdef IB_CM_LISTEN_TAKES_FOURTH_ARG
, 0
, NULL
#elif defined(IB_CM_LISTEN_TAKES_THIRD_ARG)
, 0
#endif
);
if (ret) {