mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-14 09:11:27 +00:00
srpt: Port to Linux kernel v5.0 (merge r7853 from trunk)
git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.3.x@7896 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -93,6 +93,9 @@ function evaluate(stmnt, pattern, arg, op, result) {
|
||||
gsub("HAVE_DEV_ATTR_MAX_SEND_SGE",
|
||||
"(LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0))", stmnt)
|
||||
|
||||
gsub("HAVE_RDMA_DESTROY_AH_WITH_FLAGS",
|
||||
"(LINUX_VERSION_CODE >= KERNEL_VERSION(4, 21, 0))", stmnt)
|
||||
|
||||
gsub("HAVE_RDMA_DESTROY_AH",
|
||||
"(LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0))", stmnt)
|
||||
|
||||
@@ -352,6 +355,7 @@ function handle_if(evaluated)
|
||||
|| $0 ~ "HAVE_IB_QUERY_DEVICE" \
|
||||
|| $0 ~ "HAVE_IB_SET_CPI_RESP_TIME" \
|
||||
|| $0 ~ "HAVE_RDMA_DESTROY_AH" \
|
||||
|| $0 ~ "HAVE_RDMA_DESTROY_AH_WITH_FLAGS" \
|
||||
|| $0 ~ "HAVE_RDMA_QUERY_GID" \
|
||||
|| $0 ~ "HAVE_STRUCT_SRP_LOGIN_REQ_RDMA" \
|
||||
|| $0 ~ "IB_CLIENT_REMOVE_TAKES_TWO_ARGS" \
|
||||
|
||||
@@ -266,6 +266,12 @@ conftest/rdma_destroy_ah/result-$(KVER).txt: \
|
||||
echo "$(call run_conftest_bool,rdma_destroy_ah, \
|
||||
HAVE_RDMA_DESTROY_AH)" >"$@"
|
||||
|
||||
conftest/rdma_destroy_ah_with_flags/result-$(KVER).txt: \
|
||||
conftest/rdma_destroy_ah_with_flags/rdma_destroy_ah_with_flags.c\
|
||||
conftest/rdma_destroy_ah_with_flags/Makefile
|
||||
echo "$(call run_conftest_bool,rdma_destroy_ah_with_flags, \
|
||||
HAVE_RDMA_DESTROY_AH_WITH_FLAGS)" >"$@"
|
||||
|
||||
conftest/rdma_query_gid/result-$(KVER).txt: \
|
||||
conftest/rdma_query_gid/rdma_query_gid.c \
|
||||
conftest/rdma_query_gid/Makefile
|
||||
|
||||
3
srpt/conftest/rdma_destroy_ah_with_flags/Makefile
Normal file
3
srpt/conftest/rdma_destroy_ah_with_flags/Makefile
Normal file
@@ -0,0 +1,3 @@
|
||||
LINUXINCLUDE := $(PRE_CFLAGS) $(LINUXINCLUDE)
|
||||
|
||||
obj-m += rdma_destroy_ah_with_flags.o
|
||||
@@ -0,0 +1,11 @@
|
||||
#include <linux/module.h>
|
||||
#include <rdma/ib_verbs.h>
|
||||
|
||||
static int modinit(void)
|
||||
{
|
||||
return rdma_destroy_ah(NULL, 0) != 0;
|
||||
|
||||
}
|
||||
|
||||
module_init(modinit);
|
||||
MODULE_LICENSE("GPL");
|
||||
@@ -583,7 +583,9 @@ static void srpt_mgmt_method_get(struct srpt_port *sp, struct ib_mad *rq_mad,
|
||||
static void srpt_mad_send_handler(struct ib_mad_agent *mad_agent,
|
||||
struct ib_mad_send_wc *mad_wc)
|
||||
{
|
||||
#if HAVE_RDMA_DESTROY_AH
|
||||
#if HAVE_RDMA_DESTROY_AH_WITH_FLAGS
|
||||
rdma_destroy_ah(mad_wc->send_buf->ah, RDMA_DESTROY_AH_SLEEPABLE);
|
||||
#elif HAVE_RDMA_DESTROY_AH
|
||||
rdma_destroy_ah(mad_wc->send_buf->ah);
|
||||
#else
|
||||
ib_destroy_ah(mad_wc->send_buf->ah);
|
||||
@@ -659,7 +661,9 @@ static void srpt_mad_recv_handler(struct ib_mad_agent *mad_agent,
|
||||
ib_free_send_mad(rsp);
|
||||
|
||||
err_rsp:
|
||||
#if HAVE_RDMA_DESTROY_AH
|
||||
#if HAVE_RDMA_DESTROY_AH_WITH_FLAGS
|
||||
rdma_destroy_ah(ah, RDMA_DESTROY_AH_SLEEPABLE);
|
||||
#elif HAVE_RDMA_DESTROY_AH
|
||||
rdma_destroy_ah(ah);
|
||||
#else
|
||||
ib_destroy_ah(ah);
|
||||
|
||||
@@ -114,9 +114,11 @@ enum {
|
||||
SRP_CMD_ORDERED_Q = 0x2,
|
||||
SRP_CMD_ACA = 0x4,
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 21, 0)
|
||||
SRP_LOGIN_RSP_MULTICHAN_NO_CHAN = 0x0,
|
||||
SRP_LOGIN_RSP_MULTICHAN_TERMINATED = 0x1,
|
||||
SRP_LOGIN_RSP_MULTICHAN_MAINTAINED = 0x2,
|
||||
#endif
|
||||
|
||||
MIN_SRPT_SQ_SIZE = 16,
|
||||
DEF_SRPT_SQ_SIZE = 256,
|
||||
|
||||
Reference in New Issue
Block a user