diff --git a/.gitignore b/.gitignore index 5409b7e..502a431 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/rdma-core-15.tar.gz +SOURCES/rdma-core-17.2.tar.gz diff --git a/.rdma-core.metadata b/.rdma-core.metadata index 693952a..b893d26 100644 --- a/.rdma-core.metadata +++ b/.rdma-core.metadata @@ -1 +1 @@ -26da48113931fdd210441c07ae55176cb4d71808 SOURCES/rdma-core-15.tar.gz +630a76fbcdeb3404666bbfba6c8e2d493d21e4fa SOURCES/rdma-core-17.2.tar.gz diff --git a/SOURCES/0001-Add-a-helper-function-to-verify-64-bit-comp-mask.patch b/SOURCES/0001-Add-a-helper-function-to-verify-64-bit-comp-mask.patch deleted file mode 100644 index f3486af..0000000 --- a/SOURCES/0001-Add-a-helper-function-to-verify-64-bit-comp-mask.patch +++ /dev/null @@ -1,75 +0,0 @@ -From abb3bf03bcb543915852204b4fdaf6a88873b51a Mon Sep 17 00:00:00 2001 -From: Noa Osherovich -Date: Wed, 22 Nov 2017 11:11:21 +0200 -Subject: [PATCH rdma-core 1/3] Add a helper function to verify 64 bit comp - mask - -The common check for a mask is as follows: -if (comp_mask & ~COMP_MASK_SUPPORTED_VALUES) - return EINVAL - -This can cause an issue when using 64 bit mask if the supported variable -is signed 32 bit: It will be bitwise inverted and then zeroed to 64 -bits. This way wrong bits in the mask that exceed 32 bits will not raise -an error but will be ignored. - -Add a helper function in driver.h to be used by providers code and fix -wrong mask checks where the above was found to be applicable. - -Signed-off-by: Noa Osherovich -Reviewed-by: Yishai Hadas -(cherry picked from commit ad4419019a006938731035a766b67838678e6048) ---- - libibverbs/driver.h | 5 +++++ - providers/mlx4/verbs.c | 4 ++-- - providers/mlx5/verbs.c | 3 ++- - 3 files changed, 9 insertions(+), 3 deletions(-) - -diff --git a/libibverbs/driver.h b/libibverbs/driver.h -index 887412de..0b2cd089 100644 ---- a/libibverbs/driver.h -+++ b/libibverbs/driver.h -@@ -330,6 +330,11 @@ static inline int verbs_get_srq_num(struct ibv_srq *srq, uint32_t *srq_num) - return ENOSYS; - } - -+static inline bool check_comp_mask(uint64_t input, uint64_t supported) -+{ -+ return (input & ~supported) == 0; -+} -+ - int ibv_query_gid_type(struct ibv_context *context, uint8_t port_num, - unsigned int index, enum ibv_gid_type *type); - #endif /* INFINIBAND_DRIVER_H */ -diff --git a/providers/mlx4/verbs.c b/providers/mlx4/verbs.c -index b966ef2c..7c8f9da8 100644 ---- a/providers/mlx4/verbs.c -+++ b/providers/mlx4/verbs.c -@@ -919,8 +919,8 @@ static struct ibv_qp *create_qp_ex(struct ibv_context *context, - goto err_free; - - if (mlx4qp_attr) { -- if (mlx4qp_attr->comp_mask & -- ~(MLX4DV_QP_INIT_ATTR_MASK_RESERVED - 1)) { -+ if (!check_comp_mask(mlx4qp_attr->comp_mask, -+ MLX4DV_QP_INIT_ATTR_MASK_RESERVED - 1)) { - errno = EINVAL; - goto err_free; - } -diff --git a/providers/mlx5/verbs.c b/providers/mlx5/verbs.c -index 2315a0d9..6506bc36 100644 ---- a/providers/mlx5/verbs.c -+++ b/providers/mlx5/verbs.c -@@ -433,7 +433,8 @@ static struct ibv_cq_ex *create_cq(struct ibv_context *context, - cmd.cqe_size = cqe_sz; - - if (mlx5cq_attr) { -- if (mlx5cq_attr->comp_mask & ~(MLX5DV_CQ_INIT_ATTR_MASK_RESERVED - 1)) { -+ if (!check_comp_mask(mlx5cq_attr->comp_mask, -+ MLX5DV_CQ_INIT_ATTR_MASK_RESERVED - 1)) { - mlx5_dbg(fp, MLX5_DBG_CQ, - "Unsupported vendor comp_mask for create_cq\n"); - errno = EINVAL; --- -2.12.1 - diff --git a/SOURCES/0001-ibacm-incorrect-usage-of-be-byte.patch b/SOURCES/0001-ibacm-incorrect-usage-of-be-byte.patch deleted file mode 100644 index 658a58f..0000000 --- a/SOURCES/0001-ibacm-incorrect-usage-of-be-byte.patch +++ /dev/null @@ -1,51 +0,0 @@ -commit e2c3c3fefa26287dcce1e70634792cff47d775ff -Author: Michael J. Ruhl -Date: Mon Oct 16 10:24:21 2017 -0400 - - ibacm: Incorrect usage of BE byte order of MLID attach/detach_mcast() - - The MLID value passed to ibv_attach/detach_mcast() must be in host - byte order. - - acmp.c incorrectly uses the big endian format when doing a multicast - attach/detach (join). Multicast packets are used to do name resolution - by the libibacmp library. - - There are two possible results because of this issue. - - If a kernel has commit 8561eae60ff9, the attach will fail with an - EINVAL. ibacm will log this as a failure during the multicast join. - - If a kernel does not have commit 8561eae60ff9, the attach will - complete successfully. Packets sent to this address will be dropped - because the packet dlid value and the multicast address information - given by the attach will not match. - - Update MLID usage to use the correct byte order. - - Reviewed-by: Mike Marciniszyn - Signed-off-by: Michael J. Ruhl - Signed-off-by: Doug Ledford - -diff --git a/ibacm/prov/acmp/src/acmp.c b/ibacm/prov/acmp/src/acmp.c -index aa784166..78d9a295 100644 ---- a/ibacm/prov/acmp/src/acmp.c -+++ b/ibacm/prov/acmp/src/acmp.c -@@ -732,7 +732,7 @@ static void acmp_process_join_resp(struct acm_sa_mad *sa_mad) - acm_log(0, "ERROR - unable to create ah\n"); - goto out; - } -- ret = ibv_attach_mcast(ep->qp, &mc_rec->mgid, mc_rec->mlid); -+ ret = ibv_attach_mcast(ep->qp, &dest->mgid, dest->av.dlid); - if (ret) { - acm_log(0, "ERROR - unable to attach QP to multicast group\n"); - ibv_destroy_ah(dest->ah); -@@ -1429,7 +1429,7 @@ static void acmp_ep_join(struct acmp_ep *ep) - - if (ep->mc_dest[0].state == ACMP_READY && ep->mc_dest[0].ah) { - ibv_detach_mcast(ep->qp, &ep->mc_dest[0].mgid, -- be16toh(ep->mc_dest[0].av.dlid)); -+ ep->mc_dest[0].av.dlid); - ibv_destroy_ah(ep->mc_dest[0].ah); - ep->mc_dest[0].ah = NULL; - } diff --git a/SOURCES/0001-iwpmd-fix-double-mutex-unlock.patch b/SOURCES/0001-iwpmd-fix-double-mutex-unlock.patch deleted file mode 100644 index 0d48fec..0000000 --- a/SOURCES/0001-iwpmd-fix-double-mutex-unlock.patch +++ /dev/null @@ -1,30 +0,0 @@ -From c7f4e4485a35b585742c4252816a494eaec1e87c Mon Sep 17 00:00:00 2001 -From: Bharat Potnuri -Date: Wed, 31 Jan 2018 21:07:51 +0530 -Subject: [PATCH rdma-core] iwpmd: fix double mutex unlock - -pthread_mutex_unlock() is used twice and this patch fixes it. - -Fixes: be3fbf85b ("iwpmd: use ccan list.h for pending_messages") -Signed-off-by: Potnuri Bharat Teja -Reviewed-by: Steve Wise -Signed-off-by: Doug Ledford ---- - iwpmd/iwarp_pm_helper.c | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/iwpmd/iwarp_pm_helper.c b/iwpmd/iwarp_pm_helper.c -index bebc151f..b8c23018 100644 ---- a/iwpmd/iwarp_pm_helper.c -+++ b/iwpmd/iwarp_pm_helper.c -@@ -578,7 +578,6 @@ int add_iwpm_pending_msg(iwpm_send_msg *send_msg) - - pthread_mutex_lock(&pending_msg_mutex); - list_add(&pending_messages, &pending_msg->entry); -- pthread_mutex_unlock(&pending_msg_mutex); - pthread_mutex_unlock(&pending_msg_mutex); - /* signal the thread that a new message has been posted */ - pthread_cond_signal(&cond_pending_msg); --- -2.16.1 - diff --git a/SOURCES/0001-redhat-kernel-init-ocrdma-is-tech-preview-too.patch b/SOURCES/0001-redhat-kernel-init-ocrdma-is-tech-preview-too.patch new file mode 100644 index 0000000..6a1f69d --- /dev/null +++ b/SOURCES/0001-redhat-kernel-init-ocrdma-is-tech-preview-too.patch @@ -0,0 +1,40 @@ +From 23a4645a0c390ab2bf8a08e15c8d220b27dcca5f Mon Sep 17 00:00:00 2001 +From: Jarod Wilson +Date: Tue, 5 Jun 2018 10:40:14 -0400 +Subject: [PATCH rdma-core 13/29] redhat/kernel-init: ocrdma is tech-preview + too + +Signed-off-by: Jarod Wilson +--- + redhat/rdma.kernel-init | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/redhat/rdma.kernel-init b/redhat/rdma.kernel-init +index 6f50e72f..acce0066 100644 +--- a/redhat/rdma.kernel-init ++++ b/redhat/rdma.kernel-init +@@ -133,10 +133,6 @@ load_hardware_modules() + load_modules iw_cxgb4 + RC+=$? + fi +- if is_loaded be2net -a ! is_loaded ocrdma; then +- load_modules ocrdma +- RC+=$? +- fi + if is_loaded enic -a ! is_loaded usnic_verbs; then + load_modules usnic_verbs + RC+=$? +@@ -146,6 +142,10 @@ load_hardware_modules() + load_modules i40iw + RC+=$? + fi ++ if is_loaded be2net -a ! is_loaded ocrdma; then ++ load_modules ocrdma ++ RC+=$? ++ fi + fi + return $RC + } +-- +2.16.1 + diff --git a/SOURCES/0001-srp_daemon-Don-t-create-async_ev_thread-if-only-run-.patch b/SOURCES/0001-srp_daemon-Don-t-create-async_ev_thread-if-only-run-.patch deleted file mode 100644 index d70c2fd..0000000 --- a/SOURCES/0001-srp_daemon-Don-t-create-async_ev_thread-if-only-run-.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 441bf55e978cf37167d515a0d48773736cadfe2e Mon Sep 17 00:00:00 2001 -From: Honggang Li -Date: Wed, 20 Dec 2017 03:09:58 +0800 -Subject: [PATCH] srp_daemon: Don't create async_ev_thread if only run once - -fd3005f0cd34 moves the signal handler setup from ibsrpdm path. So, -default signal handler will be used when the main pthread send signal -SIGINT to pthread async_ev_thread. ibsrpdm will exit with non-zero -exit code as default signal handler killed it. ibsrpdm should return -with exit code zero, if no error emerged. - -We should not create async_ev_thread for ibsrpdm. - -Fixes: fd3005f0cd34 ("srp_daemon: Move the setup of the wakeup_pipe after openlog") -Reviewed-by: Bart Van Assche -Signed-off-by: Honggang Li -Signed-off-by: Leon Romanovsky -(cherry picked from commit 3f58c9237533ed9d92f3d08cad56527299781862) -Signed-off-by: Honggang Li ---- - srp_daemon/srp_daemon.c | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - -diff --git a/srp_daemon/srp_daemon.c b/srp_daemon/srp_daemon.c -index 2465ccd9..df6a8b17 100644 ---- a/srp_daemon/srp_daemon.c -+++ b/srp_daemon/srp_daemon.c -@@ -1945,12 +1945,12 @@ static struct resources *alloc_res(void) - run_thread_get_trap_notices, &res->res); - if (ret) - goto err; -- } - -- ret = pthread_create(&res->res.async_ev_thread, NULL, -- run_thread_listen_to_events, &res->res); -- if (ret) -- goto err; -+ ret = pthread_create(&res->res.async_ev_thread, NULL, -+ run_thread_listen_to_events, &res->res); -+ if (ret) -+ goto err; -+ } - - if (config->retry_timeout && !config->once) { - ret = pthread_create(&res->res.reconnect_thread, NULL, --- -2.15.GIT - diff --git a/SOURCES/0001-srp_daemon-Remove-unsupported-systemd-configurations.patch b/SOURCES/0001-srp_daemon-Remove-unsupported-systemd-configurations.patch deleted file mode 100644 index defe5fc..0000000 --- a/SOURCES/0001-srp_daemon-Remove-unsupported-systemd-configurations.patch +++ /dev/null @@ -1,63 +0,0 @@ -From 01ff44aeedce5dba803ea7ae761fa06615b6e0af Mon Sep 17 00:00:00 2001 -From: Honggang Li -Date: Wed, 27 Dec 2017 11:44:33 +0800 -Subject: [PATCH] srp_daemon: Remove unsupported systemd configurations - -Note: This is rhel-7.5 specific patch. - -+--------------------------+---------------+ -| lvalue | systemd | -+--------------------------+---------------+ -| MemoryDenyWriteExecute | 231 | -| ProtectControlGroups | 232 | -| ProtectKernelModules | 232 | -| RestrictRealtime | 231 | -+--------------------------+---------------+ - -RHEL-7.5 includes systemd-219-51 which does not support -those configuration yet, so remove them. - -Signed-off-by: Honggang Li ---- - srp_daemon/srp_daemon.service.in | 3 --- - srp_daemon/srp_daemon_port@.service.in | 4 ---- - 2 files changed, 7 deletions(-) - -diff --git a/srp_daemon/srp_daemon.service.in b/srp_daemon/srp_daemon.service.in -index 93e44425..b8bea643 100644 ---- a/srp_daemon/srp_daemon.service.in -+++ b/srp_daemon/srp_daemon.service.in -@@ -10,11 +10,8 @@ Before=remote-fs-pre.target - Type=oneshot - RemainAfterExit=yes - ExecStart=@CMAKE_INSTALL_FULL_LIBEXECDIR@/srp_daemon/start_on_all_ports --MemoryDenyWriteExecute=yes - PrivateTmp=yes - ProtectHome=yes --ProtectKernelModules=yes --RestrictRealtime=yes - - [Install] - WantedBy=remote-fs-pre.target -diff --git a/srp_daemon/srp_daemon_port@.service.in b/srp_daemon/srp_daemon_port@.service.in -index 3d5a11e8..7516e8a2 100644 ---- a/srp_daemon/srp_daemon_port@.service.in -+++ b/srp_daemon/srp_daemon_port@.service.in -@@ -24,14 +24,10 @@ BindsTo=srp_daemon.service - [Service] - Type=simple - ExecStart=@CMAKE_INSTALL_FULL_SBINDIR@/srp_daemon --systemd -e -c -n -j %I -R 60 --MemoryDenyWriteExecute=yes - PrivateNetwork=yes - PrivateTmp=yes --ProtectControlGroups=yes - ProtectHome=yes --ProtectKernelModules=yes - ProtectSystem=full --RestrictRealtime=yes - SystemCallFilter=~@clock @cpu-emulation @debug @keyring @module @mount @obsolete @raw-io - - [Install] --- -2.15.GIT - diff --git a/SOURCES/0001-srp_daemon-srp_daemon.service-should-be-started-afte.patch b/SOURCES/0001-srp_daemon-srp_daemon.service-should-be-started-afte.patch deleted file mode 100644 index 05e7ea9..0000000 --- a/SOURCES/0001-srp_daemon-srp_daemon.service-should-be-started-afte.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 141910626b7601c4d697274ea49e951584ae24a5 Mon Sep 17 00:00:00 2001 -From: Honggang Li -Date: Fri, 29 Dec 2017 17:21:52 +0800 -Subject: [PATCH] srp_daemon: srp_daemon.service should be started after - network.target - -This is a rhel-7.5 specific workaround as rhel-7.5 is using -systemd-219. - -The srp_daemon service will be started at the very beginning state -of systemd when boot/reboot the machine, in case srp_daemon.service -is not after network.target. As result, the srp_daemon.service will -be terminated because of SERVICE_FAILURE_RESOURCES. - -Fixes: 1c7fe513e3e9 ("srp_daemon: One systemd service per port") -Signed-off-by: Honggang Li ---- - srp_daemon/srp_daemon.service.in | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/srp_daemon/srp_daemon.service.in b/srp_daemon/srp_daemon.service.in -index 188b7e1a..93e44425 100644 ---- a/srp_daemon/srp_daemon.service.in -+++ b/srp_daemon/srp_daemon.service.in -@@ -3,6 +3,7 @@ Description=Daemon that discovers and logs in to SRP target systems - Documentation=man:srp_daemon file:/etc/srp_daemon.conf - DefaultDependencies=false - Conflicts=emergency.target emergency.service -+After=network.target - Before=remote-fs-pre.target - - [Service] --- -2.15.GIT - diff --git a/SOURCES/0002-ibacm-incorrect-list-used-for.patch b/SOURCES/0002-ibacm-incorrect-list-used-for.patch deleted file mode 100644 index e6c9b4e..0000000 --- a/SOURCES/0002-ibacm-incorrect-list-used-for.patch +++ /dev/null @@ -1,51 +0,0 @@ -commit f3a969b4542204c9b09d5c2d229c7b55aaa0995e -Author: Michael J. Ruhl -Date: Mon Oct 16 10:24:40 2017 -0400 - - ibacm: Incorrect list used for subnet list causes a segfault - - Setting the provider keyword in the ibacm_opts.cfg file to something - other than 'default' will cause ibacm to segfault on startup: - - ibacm[32739]: segfault at 302e40 ip 000000000040432d - sp 00007ffe4039e1c0 error 4 in ibacm[400000+c000] - - To re-produce the segfault, change the provider keyword in - ibacm_opts.cfg from: - - provider ibacmp default - - to: - - provider ibacmp 0xFE80000000000000 - - When adding subnets to a provider subnet list, the incorrect list is - used. The list used is the provider_list (list of all providers) - rather than the (specific) provider subnet list. - - This corrupts the provider_list, and causes ibacm to crash with the - above segfault. - - Use the correct list when adding subnet information to a provider. - - Fixes: 26e05f8304a506 ("ibacm: use ccan/list.h") - Reviewed-by: Mike Marciniszyn - Signed-off-by: Michael J. Ruhl - Tested-by: Nicolas Morey-Chaisemartin - Signed-off-by: Doug Ledford - -diff --git a/ibacm/src/acm.c b/ibacm/src/acm.c -index 1ccef948..a67001d4 100644 ---- a/ibacm/src/acm.c -+++ b/ibacm/src/acm.c -@@ -2587,8 +2587,8 @@ static void acm_load_prov_config(void) - return; - } - subnet->subnet_prefix = htobe64(prefix); -- list_add_after(&provider_list, &prov->entry, -- &subnet->entry); -+ list_add_tail(&prov->subnet_list, -+ &subnet->entry); - } - } - } diff --git a/SOURCES/0002-mlx5-Report-Multi-Packet-RQ-capabilities-through-mlx.patch b/SOURCES/0002-mlx5-Report-Multi-Packet-RQ-capabilities-through-mlx.patch deleted file mode 100644 index 6ea691a..0000000 --- a/SOURCES/0002-mlx5-Report-Multi-Packet-RQ-capabilities-through-mlx.patch +++ /dev/null @@ -1,170 +0,0 @@ -From 868a69e7de67e10fc96436ec41dd9e0343053581 Mon Sep 17 00:00:00 2001 -From: Noa Osherovich -Date: Thu, 3 Aug 2017 10:00:14 +0300 -Subject: [PATCH rdma-core 2/3] mlx5: Report Multi-Packet RQ capabilities - through mlx5 direct verbs - -A Multi-Packet RQ is a receive queue where multiple packets are -written to the same WQE. Each message starts in the beginning of a -stride. The total size of the scatter elements of each WQE is -determined upon RQ creation and all the posted WQEs should meet the -determined size. - -A Multi-Packet RQ reduces the number of needed post-recv operations -thus increasing performance. - -It reduces memory footprint by allowing each packet to consume a -different number of strides instead of the whole WR. - -Signed-off-by: Noa Osherovich -Reviewed-by: Yishai Hadas -(cherry picked from commit ec8ec52698c7cbd6d06bd8f3e54b673a52cb4d30) ---- - providers/mlx5/man/mlx5dv_query_device.3 | 19 +++++++++++++++++++ - providers/mlx5/mlx5-abi.h | 11 +++++++++++ - providers/mlx5/mlx5.c | 5 +++++ - providers/mlx5/mlx5.h | 1 + - providers/mlx5/mlx5dv.h | 13 ++++++++++++- - providers/mlx5/verbs.c | 1 + - 6 files changed, 49 insertions(+), 1 deletion(-) - -diff --git a/providers/mlx5/man/mlx5dv_query_device.3 b/providers/mlx5/man/mlx5dv_query_device.3 -index c2fe9a3e..bb047454 100644 ---- a/providers/mlx5/man/mlx5dv_query_device.3 -+++ b/providers/mlx5/man/mlx5dv_query_device.3 -@@ -21,6 +21,25 @@ of the internal hardware structures that mlx5dv.h represents. Additions of new f - structures are handled by comp_mask field. - .PP - .nf -+struct mlx5dv_sw_parsing_caps { -+.in +8 -+uint32_t sw_parsing_offloads; /* Use enum mlx5dv_sw_parsing_offloads */ -+uint32_t supported_qpts; -+.in -8 -+}; -+.PP -+.nf -+struct mlx5dv_striding_rq_caps { -+.in +8 -+uint32_t min_single_stride_log_num_of_bytes; /* min log size of each stride */ -+uint32_t max_single_stride_log_num_of_bytes; /* max log size of each stride */ -+uint32_t min_single_wqe_log_num_of_strides; /* min log number of strides per WQE */ -+uint32_t max_single_wqe_log_num_of_strides; /* max log number of strides per WQE */ -+uint32_t supported_qpts; -+.in -8 -+}; -+.PP -+.nf - struct mlx5dv_context { - .in +8 - uint8_t version; -diff --git a/providers/mlx5/mlx5-abi.h b/providers/mlx5/mlx5-abi.h -index bce9e559..da7d54f2 100644 ---- a/providers/mlx5/mlx5-abi.h -+++ b/providers/mlx5/mlx5-abi.h -@@ -279,6 +279,16 @@ enum mlx5_mpw_caps { - MLX5_SUPPORT_EMPW = 1 << 2, - }; - -+enum mlx5_query_dev_resp_flags { -+ MLX5_QUERY_DEV_RESP_FLAGS_CQE_128B_COMP = 1 << 0, -+ MLX5_QUERY_DEV_RESP_FLAGS_CQE_128B_PAD = 1 << 1, -+}; -+ -+struct mlx5_striding_rq_caps { -+ struct mlx5dv_striding_rq_caps caps; -+ __u32 reserved; -+}; -+ - struct mlx5_query_device_ex_resp { - struct ibv_query_device_resp_ex ibv_resp; - __u32 comp_mask; -@@ -289,6 +299,7 @@ struct mlx5_query_device_ex_resp { - struct mlx5_packet_pacing_caps packet_pacing_caps; - __u32 support_multi_pkt_send_wqe; - __u32 reserved; -+ struct mlx5_striding_rq_caps striding_rq_caps; - }; - - #endif /* MLX5_ABI_H */ -diff --git a/providers/mlx5/mlx5.c b/providers/mlx5/mlx5.c -index e7adf148..88287536 100644 ---- a/providers/mlx5/mlx5.c -+++ b/providers/mlx5/mlx5.c -@@ -636,6 +636,11 @@ int mlx5dv_query_device(struct ibv_context *ctx_in, - if (mctx->vendor_cap_flags & MLX5_VENDOR_CAP_FLAGS_ENHANCED_MPW) - attrs_out->flags |= MLX5DV_CONTEXT_FLAGS_ENHANCED_MPW; - -+ if (attrs_out->comp_mask & MLX5DV_CONTEXT_MASK_STRIDING_RQ) { -+ attrs_out->striding_rq_caps = mctx->striding_rq_caps; -+ comp_mask_out |= MLX5DV_CONTEXT_MASK_STRIDING_RQ; -+ } -+ - attrs_out->comp_mask = comp_mask_out; - - return 0; -diff --git a/providers/mlx5/mlx5.h b/providers/mlx5/mlx5.h -index 46fce282..1e8b45be 100644 ---- a/providers/mlx5/mlx5.h -+++ b/providers/mlx5/mlx5.h -@@ -272,6 +272,7 @@ struct mlx5_context { - uint64_t vendor_cap_flags; /* Use enum mlx5_vendor_cap_flags */ - struct mlx5dv_cqe_comp_caps cqe_comp_caps; - struct mlx5dv_ctx_allocators extern_alloc; -+ struct mlx5dv_striding_rq_caps striding_rq_caps; - }; - - struct mlx5_bitmap { -diff --git a/providers/mlx5/mlx5dv.h b/providers/mlx5/mlx5dv.h -index ffe2c555..0a7fe4d6 100644 ---- a/providers/mlx5/mlx5dv.h -+++ b/providers/mlx5/mlx5dv.h -@@ -58,7 +58,9 @@ enum { - - enum mlx5dv_context_comp_mask { - MLX5DV_CONTEXT_MASK_CQE_COMPRESION = 1 << 0, -- MLX5DV_CONTEXT_MASK_RESERVED = 1 << 1, -+ MLX5DV_CONTEXT_MASK_SWP = 1 << 1, -+ MLX5DV_CONTEXT_MASK_STRIDING_RQ = 1 << 2, -+ MLX5DV_CONTEXT_MASK_RESERVED = 1 << 3, - }; - - struct mlx5dv_cqe_comp_caps { -@@ -66,6 +68,14 @@ struct mlx5dv_cqe_comp_caps { - uint32_t supported_format; /* enum mlx5dv_cqe_comp_res_format */ - }; - -+struct mlx5dv_striding_rq_caps { -+ uint32_t min_single_stride_log_num_of_bytes; -+ uint32_t max_single_stride_log_num_of_bytes; -+ uint32_t min_single_wqe_log_num_of_strides; -+ uint32_t max_single_wqe_log_num_of_strides; -+ uint32_t supported_qpts; -+}; -+ - /* - * Direct verbs device-specific attributes - */ -@@ -74,6 +84,7 @@ struct mlx5dv_context { - uint64_t flags; - uint64_t comp_mask; - struct mlx5dv_cqe_comp_caps cqe_comp_caps; -+ struct mlx5dv_striding_rq_caps striding_rq_caps; - }; - - enum mlx5dv_context_flags { -diff --git a/providers/mlx5/verbs.c b/providers/mlx5/verbs.c -index 6506bc36..e9414c64 100644 ---- a/providers/mlx5/verbs.c -+++ b/providers/mlx5/verbs.c -@@ -2003,6 +2003,7 @@ int mlx5_query_device_ex(struct ibv_context *context, - mctx->vendor_cap_flags |= MLX5_VENDOR_CAP_FLAGS_ENHANCED_MPW; - - mctx->cqe_comp_caps = resp.cqe_comp_caps; -+ mctx->striding_rq_caps = resp.striding_rq_caps.caps; - - major = (raw_fw_ver >> 32) & 0xffff; - minor = (raw_fw_ver >> 16) & 0xffff; --- -2.12.1 - diff --git a/SOURCES/0002-redhat-kernel-init-libi40iw-no-longer-tech-preview.patch b/SOURCES/0002-redhat-kernel-init-libi40iw-no-longer-tech-preview.patch new file mode 100644 index 0000000..1b0e44d --- /dev/null +++ b/SOURCES/0002-redhat-kernel-init-libi40iw-no-longer-tech-preview.patch @@ -0,0 +1,34 @@ +From 93ceaf5ddbb06d93eaa9dcc73a836528eeaf1bf9 Mon Sep 17 00:00:00 2001 +From: Jarod Wilson +Date: Tue, 5 Jun 2018 10:40:47 -0400 +Subject: [PATCH rdma-core 14/29] redhat/kernel-init: libi40iw no longer + tech-preview + +Signed-off-by: Jarod Wilson +--- + redhat/rdma.kernel-init | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/redhat/rdma.kernel-init b/redhat/rdma.kernel-init +index acce0066..9ed33541 100644 +--- a/redhat/rdma.kernel-init ++++ b/redhat/rdma.kernel-init +@@ -137,11 +137,11 @@ load_hardware_modules() + load_modules usnic_verbs + RC+=$? + fi ++ if is_loaded i40e -a ! is_loaded i40iw; then ++ load_modules i40iw ++ RC+=$? ++ fi + if [ "${LOAD_TECH_PREVIEW_DRIVERS}" == "yes" ]; then +- if is_loaded i40e -a ! is_loaded i40iw; then +- load_modules i40iw +- RC+=$? +- fi + if is_loaded be2net -a ! is_loaded ocrdma; then + load_modules ocrdma + RC+=$? +-- +2.16.1 + diff --git a/SOURCES/0003-mlx5-Allow-creation-of-a-Multi-Packet-RQ-using-direc.patch b/SOURCES/0003-mlx5-Allow-creation-of-a-Multi-Packet-RQ-using-direc.patch deleted file mode 100644 index d519244..0000000 --- a/SOURCES/0003-mlx5-Allow-creation-of-a-Multi-Packet-RQ-using-direc.patch +++ /dev/null @@ -1,300 +0,0 @@ -From de7ba62097bef7a75bb995d2ea48704eccc5e4f8 Mon Sep 17 00:00:00 2001 -From: Noa Osherovich -Date: Sun, 6 Aug 2017 10:28:48 +0300 -Subject: [PATCH rdma-core 3/3] mlx5: Allow creation of a Multi-Packet RQ using - direct verbs - -Add needed definitions to allow creation of a Multi-Packet RQ using the -mlx5 direct verbs interface. - -In order to create a Multi-Packet RQ, one needs to provide a -mlx5dv_wq_init_attr containing the following information in its -striding_rq_attrs struct: -- single_stride_log_num_of_bytes: log of size of each stride -- single_wqe_log_num_of_strides: log of number of strides per WQE -- two_byte_shift_en: When enabled, hardware pads 2 bytes of zeros - before writing the message to memory (e.g. for IP alignment). - -Signed-off-by: Noa Osherovich -Reviewed-by: Yishai Hadas -(cherry picked from commit 36a7ea92d214d35b69ad7e668cc21719b2a4d3ba) ---- - debian/ibverbs-providers.symbols | 2 ++ - providers/mlx5/CMakeLists.txt | 2 +- - providers/mlx5/libmlx5.map | 5 +++ - providers/mlx5/mlx5-abi.h | 8 ++++- - providers/mlx5/mlx5dv.h | 46 +++++++++++++++++++++++++- - providers/mlx5/verbs.c | 71 ++++++++++++++++++++++++++++++++++++---- - 6 files changed, 125 insertions(+), 9 deletions(-) - -diff --git a/debian/ibverbs-providers.symbols b/debian/ibverbs-providers.symbols -index cb21dc5b..08ff9061 100644 ---- a/debian/ibverbs-providers.symbols -+++ b/debian/ibverbs-providers.symbols -@@ -8,8 +8,10 @@ libmlx5.so.1 ibverbs-providers #MINVER# - MLX5_1.0@MLX5_1.0 13 - MLX5_1.1@MLX5_1.1 14 - MLX5_1.2@MLX5_1.2 15 -+ MLX5_1.3@MLX5_1.3 16 - mlx5dv_init_obj@MLX5_1.0 13 - mlx5dv_init_obj@MLX5_1.2 15 - mlx5dv_query_device@MLX5_1.0 13 - mlx5dv_create_cq@MLX5_1.1 14 - mlx5dv_set_context_attr@MLX5_1.2 15 -+ mlx5dv_create_wq@MLX5_1.3 16 -diff --git a/providers/mlx5/CMakeLists.txt b/providers/mlx5/CMakeLists.txt -index ab6a42d8..88a406d9 100644 ---- a/providers/mlx5/CMakeLists.txt -+++ b/providers/mlx5/CMakeLists.txt -@@ -11,7 +11,7 @@ if (MLX5_MW_DEBUG) - endif() - - rdma_shared_provider(mlx5 libmlx5.map -- 1 1.2.${PACKAGE_VERSION} -+ 1 1.3.${PACKAGE_VERSION} - buf.c - cq.c - dbrec.c -diff --git a/providers/mlx5/libmlx5.map b/providers/mlx5/libmlx5.map -index 09d886d1..b1402dc2 100644 ---- a/providers/mlx5/libmlx5.map -+++ b/providers/mlx5/libmlx5.map -@@ -17,3 +17,8 @@ MLX5_1.2 { - mlx5dv_init_obj; - mlx5dv_set_context_attr; - } MLX5_1.1; -+ -+MLX5_1.3 { -+ global: -+ mlx5dv_create_wq; -+} MLX5_1.2; -diff --git a/providers/mlx5/mlx5-abi.h b/providers/mlx5/mlx5-abi.h -index da7d54f2..5f0ecea1 100644 ---- a/providers/mlx5/mlx5-abi.h -+++ b/providers/mlx5/mlx5-abi.h -@@ -206,6 +206,10 @@ struct mlx5_create_qp_resp { - __u32 uuar_index; - }; - -+enum mlx5_create_wq_comp_mask { -+ MLX5_IB_CREATE_WQ_STRIDING_RQ = 1 << 0, -+}; -+ - struct mlx5_drv_create_wq { - __u64 buf_addr; - __u64 db_addr; -@@ -214,7 +218,9 @@ struct mlx5_drv_create_wq { - __u32 user_index; - __u32 flags; - __u32 comp_mask; -- __u32 reserved; -+ __u32 single_stride_log_num_of_bytes; -+ __u32 single_wqe_log_num_of_strides; -+ __u32 two_byte_shift_en; - }; - - struct mlx5_create_wq { -diff --git a/providers/mlx5/mlx5dv.h b/providers/mlx5/mlx5dv.h -index 0a7fe4d6..0b9b00df 100644 ---- a/providers/mlx5/mlx5dv.h -+++ b/providers/mlx5/mlx5dv.h -@@ -197,6 +197,43 @@ enum mlx5dv_obj_type { - MLX5DV_OBJ_RWQ = 1 << 3, - }; - -+enum mlx5dv_wq_init_attr_mask { -+ MLX5DV_WQ_INIT_ATTR_MASK_STRIDING_RQ = 1 << 0, -+}; -+ -+struct mlx5dv_striding_rq_init_attr { -+ uint32_t single_stride_log_num_of_bytes; -+ uint32_t single_wqe_log_num_of_strides; -+ uint8_t two_byte_shift_en; -+}; -+ -+struct mlx5dv_wq_init_attr { -+ uint64_t comp_mask; /* Use enum mlx5dv_wq_init_attr_mask */ -+ struct mlx5dv_striding_rq_init_attr striding_rq_attrs; -+}; -+ -+/* -+ * This function creates a work queue object with extra properties -+ * defined by mlx5dv_wq_init_attr struct. -+ * -+ * For each bit in the comp_mask, a field in mlx5dv_wq_init_attr -+ * should follow. -+ * -+ * MLX5DV_WQ_INIT_ATTR_MASK_STRIDING_RQ: Create a work queue with -+ * striding RQ capabilities. -+ * - single_stride_log_num_of_bytes represents the size of each stride in the -+ * WQE and its value should be between min_single_stride_log_num_of_bytes -+ * and max_single_stride_log_num_of_bytes that are reported in -+ * mlx5dv_query_device. -+ * - single_wqe_log_num_of_strides represents the number of strides in each WQE. -+ * Its value should be between min_single_wqe_log_num_of_strides and -+ * max_single_wqe_log_num_of_strides that are reported in mlx5dv_query_device. -+ * - two_byte_shift_en: When enabled, hardware pads 2 bytes of zeroes -+ * before writing the message to memory (e.g. for IP alignment) -+ */ -+struct ibv_wq *mlx5dv_create_wq(struct ibv_context *context, -+ struct ibv_wq_init_attr *wq_init_attr, -+ struct mlx5dv_wq_init_attr *mlx5_wq_attr); - /* - * This function will initialize mlx5dv_xxx structs based on supplied type. - * The information for initialization is taken from ibv_xx structs supplied -@@ -302,7 +339,9 @@ struct mlx5_err_cqe { - }; - - struct mlx5_cqe64 { -- uint8_t rsvd0[17]; -+ uint8_t rsvd0[2]; -+ __be16 wqe_id; -+ uint8_t rsvd4[13]; - uint8_t ml_path; - uint8_t rsvd20[4]; - __be16 slid; -@@ -412,6 +451,11 @@ struct mlx5_wqe_ctrl_seg { - __be32 imm; - }; - -+struct mlx5_mprq_wqe { -+ struct mlx5_wqe_srq_next_seg nseg; -+ struct mlx5_wqe_data_seg dseg; -+}; -+ - struct mlx5_wqe_av { - union { - struct { -diff --git a/providers/mlx5/verbs.c b/providers/mlx5/verbs.c -index e9414c64..15c0d4ed 100644 ---- a/providers/mlx5/verbs.c -+++ b/providers/mlx5/verbs.c -@@ -919,21 +919,36 @@ static int mlx5_calc_sq_size(struct mlx5_context *ctx, - return wq_size; - } - -+enum { -+ DV_CREATE_WQ_SUPPORTED_COMP_MASK = MLX5DV_WQ_INIT_ATTR_MASK_STRIDING_RQ -+}; -+ - static int mlx5_calc_rwq_size(struct mlx5_context *ctx, - struct mlx5_rwq *rwq, -- struct ibv_wq_init_attr *attr) -+ struct ibv_wq_init_attr *attr, -+ struct mlx5dv_wq_init_attr *mlx5wq_attr) - { - size_t wqe_size; - int wq_size; - uint32_t num_scatter; -+ int is_mprq = 0; - int scat_spc; - - if (!attr->max_wr) - return -EINVAL; -+ if (mlx5wq_attr) { -+ if (!check_comp_mask(mlx5wq_attr->comp_mask, -+ DV_CREATE_WQ_SUPPORTED_COMP_MASK)) -+ return -EINVAL; -+ -+ is_mprq = !!(mlx5wq_attr->comp_mask & -+ MLX5DV_WQ_INIT_ATTR_MASK_STRIDING_RQ); -+ } - - /* TBD: check caps for RQ */ - num_scatter = max_t(uint32_t, attr->max_sge, 1); -- wqe_size = sizeof(struct mlx5_wqe_data_seg) * num_scatter; -+ wqe_size = sizeof(struct mlx5_wqe_data_seg) * num_scatter + -+ sizeof(struct mlx5_wqe_srq_next_seg) * is_mprq; - - if (rwq->wq_sig) - wqe_size += sizeof(struct mlx5_rwqe_sig); -@@ -948,7 +963,8 @@ static int mlx5_calc_rwq_size(struct mlx5_context *ctx, - rwq->rq.wqe_shift = mlx5_ilog2(wqe_size); - rwq->rq.max_post = 1 << mlx5_ilog2(wq_size / wqe_size); - scat_spc = wqe_size - -- ((rwq->wq_sig) ? sizeof(struct mlx5_rwqe_sig) : 0); -+ ((rwq->wq_sig) ? sizeof(struct mlx5_rwqe_sig) : 0) - -+ is_mprq * sizeof(struct mlx5_wqe_srq_next_seg); - rwq->rq.max_gs = scat_spc / sizeof(struct mlx5_wqe_data_seg); - return wq_size; - } -@@ -2066,8 +2082,9 @@ static int mlx5_alloc_rwq_buf(struct ibv_context *context, - return 0; - } - --struct ibv_wq *mlx5_create_wq(struct ibv_context *context, -- struct ibv_wq_init_attr *attr) -+static struct ibv_wq *create_wq(struct ibv_context *context, -+ struct ibv_wq_init_attr *attr, -+ struct mlx5dv_wq_init_attr *mlx5wq_attr) - { - struct mlx5_create_wq cmd; - struct mlx5_create_wq_resp resp; -@@ -2092,7 +2109,7 @@ struct ibv_wq *mlx5_create_wq(struct ibv_context *context, - if (rwq->wq_sig) - cmd.drv.flags = MLX5_RWQ_FLAG_SIGNATURE; - -- ret = mlx5_calc_rwq_size(ctx, rwq, attr); -+ ret = mlx5_calc_rwq_size(ctx, rwq, attr, mlx5wq_attr); - if (ret < 0) { - errno = -ret; - goto err; -@@ -2126,6 +2143,35 @@ struct ibv_wq *mlx5_create_wq(struct ibv_context *context, - } - - cmd.drv.user_index = usr_idx; -+ -+ if (mlx5wq_attr) { -+ if (mlx5wq_attr->comp_mask & MLX5DV_WQ_INIT_ATTR_MASK_STRIDING_RQ) { -+ if ((mlx5wq_attr->striding_rq_attrs.single_stride_log_num_of_bytes < -+ ctx->striding_rq_caps.min_single_stride_log_num_of_bytes) || -+ (mlx5wq_attr->striding_rq_attrs.single_stride_log_num_of_bytes > -+ ctx->striding_rq_caps.max_single_stride_log_num_of_bytes)) { -+ errno = EINVAL; -+ goto err_create; -+ } -+ -+ if ((mlx5wq_attr->striding_rq_attrs.single_wqe_log_num_of_strides < -+ ctx->striding_rq_caps.min_single_wqe_log_num_of_strides) || -+ (mlx5wq_attr->striding_rq_attrs.single_wqe_log_num_of_strides > -+ ctx->striding_rq_caps.max_single_wqe_log_num_of_strides)) { -+ errno = EINVAL; -+ goto err_create; -+ } -+ -+ cmd.drv.single_stride_log_num_of_bytes = -+ mlx5wq_attr->striding_rq_attrs.single_stride_log_num_of_bytes; -+ cmd.drv.single_wqe_log_num_of_strides = -+ mlx5wq_attr->striding_rq_attrs.single_wqe_log_num_of_strides; -+ cmd.drv.two_byte_shift_en = -+ mlx5wq_attr->striding_rq_attrs.two_byte_shift_en; -+ cmd.drv.comp_mask |= MLX5_IB_CREATE_WQ_STRIDING_RQ; -+ } -+ } -+ - err = ibv_cmd_create_wq(context, attr, &rwq->wq, &cmd.ibv_cmd, - sizeof(cmd.ibv_cmd), - sizeof(cmd), -@@ -2151,6 +2197,19 @@ err: - return NULL; - } - -+struct ibv_wq *mlx5_create_wq(struct ibv_context *context, -+ struct ibv_wq_init_attr *attr) -+{ -+ return create_wq(context, attr, NULL); -+} -+ -+struct ibv_wq *mlx5dv_create_wq(struct ibv_context *context, -+ struct ibv_wq_init_attr *attr, -+ struct mlx5dv_wq_init_attr *mlx5_wq_attr) -+{ -+ return create_wq(context, attr, mlx5_wq_attr); -+} -+ - int mlx5_modify_wq(struct ibv_wq *wq, struct ibv_wq_attr *attr) - { - struct mlx5_modify_wq cmd = {}; --- -2.12.1 - diff --git a/SOURCES/0003-rdma-hw-modules.rules-i40iw-autoload-breaks-suspend.patch b/SOURCES/0003-rdma-hw-modules.rules-i40iw-autoload-breaks-suspend.patch new file mode 100644 index 0000000..4ac5c7b --- /dev/null +++ b/SOURCES/0003-rdma-hw-modules.rules-i40iw-autoload-breaks-suspend.patch @@ -0,0 +1,31 @@ +From f68729e3c133bddf6fb175a38e128bb2ed338e7a Mon Sep 17 00:00:00 2001 +From: Jarod Wilson +Date: Tue, 5 Jun 2018 10:41:42 -0400 +Subject: [PATCH rdma-core 15/29] rdma-hw-modules.rules: i40iw autoload breaks + suspend + +Signed-off-by: Jarod Wilson +--- + kernel-boot/rdma-hw-modules.rules | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/kernel-boot/rdma-hw-modules.rules b/kernel-boot/rdma-hw-modules.rules +index dde0ab8d..64b9e115 100644 +--- a/kernel-boot/rdma-hw-modules.rules ++++ b/kernel-boot/rdma-hw-modules.rules +@@ -11,7 +11,11 @@ ENV{ID_NET_DRIVER}=="bnxt_en", RUN{builtin}+="kmod load bnxt_re" + ENV{ID_NET_DRIVER}=="cxgb3", RUN{builtin}+="kmod load iw_cxgb3" + ENV{ID_NET_DRIVER}=="cxgb4", RUN{builtin}+="kmod load iw_cxgb4" + ENV{ID_NET_DRIVER}=="hns", RUN{builtin}+="kmod load hns_roce" +-ENV{ID_NET_DRIVER}=="i40e", RUN{builtin}+="kmod load i40iw" ++# i40iw is not entirely suspend/resume friendly, and many systems with ++# i40e NICs aren't iwarp-capable, so Red Hat defaults to not auto-loading ++# the i40iw driver here to keep suspend/resume working. The i40iw driver ++# can still be loaded as needed by the rdma systemd service script. ++# ENV{ID_NET_DRIVER}=="i40e", RUN{builtin}+="kmod load i40iw" + ENV{ID_NET_DRIVER}=="mlx4_en", RUN{builtin}+="kmod load mlx4_ib" + ENV{ID_NET_DRIVER}=="mlx5_core", RUN{builtin}+="kmod load mlx5_ib" + ENV{ID_NET_DRIVER}=="qede", RUN{builtin}+="kmod load qedr" +-- +2.16.1 + diff --git a/SOURCES/0004-Revert-redhat-remove-files-that-we-no-longer-use.patch b/SOURCES/0004-Revert-redhat-remove-files-that-we-no-longer-use.patch new file mode 100644 index 0000000..ccf4912 --- /dev/null +++ b/SOURCES/0004-Revert-redhat-remove-files-that-we-no-longer-use.patch @@ -0,0 +1,524 @@ +From a3fcedf3c4fd338e87ce9728e43b62fd7ede8f7c Mon Sep 17 00:00:00 2001 +From: Jarod Wilson +Date: Wed, 20 Jun 2018 16:22:05 -0400 +Subject: [PATCH rdma-core] Revert "redhat: remove files that we no longer use" + +This reverts commit d6d2396af1b8737b9f003ea45d55dc31d87c5611. + +Upstream doesn't need them, but RHEL7.x does, as people do still bypass +NetworkManager and bring up interfaces using SysV-initscripts type things. + +Signed-off-by: Jarod Wilson +--- + redhat/rdma.ifdown-ib | 183 ++++++++++++++++++++++++++++++ + redhat/rdma.ifup-ib | 308 ++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 491 insertions(+) + create mode 100644 redhat/rdma.ifdown-ib + create mode 100644 redhat/rdma.ifup-ib + +diff --git a/redhat/rdma.ifdown-ib b/redhat/rdma.ifdown-ib +new file mode 100644 +index 00000000..1cb284dc +--- /dev/null ++++ b/redhat/rdma.ifdown-ib +@@ -0,0 +1,183 @@ ++#!/bin/bash ++# Network Interface Configuration System ++# Copyright (c) 1996-2013 Red Hat, Inc. all rights reserved. ++# ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License, version 2, ++# as published by the Free Software Foundation. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ++ ++. /etc/init.d/functions ++ ++cd /etc/sysconfig/network-scripts ++. ./network-functions ++ ++[ -f ../network ] && . ../network ++ ++CONFIG=${1} ++ ++source_config ++ ++# Allow the user to override the detection of our physical device by passing ++# it in. No checking is done, if the user gives us a bogus dev, it's ++# their problem. ++[ -n "${PHYSDEV}" ] && REALDEVICE="$PHYSDEV" ++ ++. /etc/sysconfig/network ++ ++# Check to make sure the device is actually up ++check_device_down ${DEVICE} && exit 0 ++ ++# If we are a P_Key device, we need to munge a few things ++if [ "${PKEY}" = yes ]; then ++ [ -z "${PKEY_ID}" ] && { ++ net_log $"InfiniBand IPoIB device: PKEY=yes requires a PKEY_ID" ++ exit 1 ++ } ++ [ -z "${PHYSDEV}" ] && { ++ net_log $"InfiniBand IPoIB device: PKEY=yes requires a PHYSDEV" ++ exit 1 ++ } ++ # Normalize our PKEY_ID to have the high bit set ++ NEW_PKEY_ID=`printf "0x%04x" $(( 0x8000 | ${PKEY_ID} ))` ++ NEW_PKEY_NAME=`printf "%04x" ${NEW_PKEY_ID}` ++ [ "${DEVICE}" != "${PHYSDEV}.${NEW_PKEY_NAME}" ] && { ++ net_log $"Configured DEVICE name does not match what new device name would be. This ++is most likely because once the PKEY_ID was normalized, it no longer ++resulted in the expected device naming, and so the DEVICE entry in the ++config file needs to be updated to match. This can also be caused by ++giving PKEY_ID as a hex number but without using the mandatory 0x prefix. ++ Configured DEVICE=$DEVICE ++ Configured PHYSDEV=$PHYSDEV ++ Configured PKEY_ID=$PKEY_ID ++ Calculated PKEY_ID=$NEW_PKEY_ID ++ Calculated name=${PHYSDEV}.${NEW_PKEY_NAME}" ++ exit 1 ++ } ++ [ -d "/sys/class/net/${DEVICE}" ] || exit 0 ++ # When we get to downing the IP address, we need REALDEVICE to ++ # point to our PKEY device ++ REALDEVICE="${DEVICE}" ++fi ++ ++ ++if [ "${SLAVE}" != "yes" -o -z "${MASTER}" ]; then ++if [ -n "${HWADDR}" -a -z "${MACADDR}" ]; then ++ HWADDR=$(echo $HWADDR | tail -c 24) ++ FOUNDMACADDR=$(get_hwaddr ${REALDEVICE} | tail -c 24) ++ if [ -n "${FOUNDMACADDR}" -a "${FOUNDMACADDR}" != "${HWADDR}" ]; then ++ NEWCONFIG=$(get_config_by_hwaddr ${FOUNDMACADDR}) ++ if [ -n "${NEWCONFIG}" ]; then ++ eval $(LANG=C grep -F "DEVICE=" $NEWCONFIG) ++ else ++ net_log $"Device ${DEVICE} has MAC address ${FOUNDMACADDR}, instead of configured address ${HWADDR}. Ignoring." ++ exit 1 ++ fi ++ if [ -n "${NEWCONFIG}" -a "${NEWCONFIG##*/}" != "${CONFIG##*/}" -a "${DEVICE}" = "${REALDEVICE}" ]; then ++ exec /sbin/ifdown ${NEWCONFIG} ++ else ++ net_log $"Device ${DEVICE} has MAC address ${FOUNDMACADDR}, instead of configured address ${HWADDR}. Ignoring." ++ exit 1 ++ fi ++ fi ++fi ++fi ++ ++if is_bonding_device ${DEVICE} ; then ++ for device in $(LANG=C grep -l "^[[:space:]]*MASTER=\"\?${DEVICE}\"\?\([[:space:]#]\|$\)" /etc/sysconfig/network-scripts/ifcfg-*) ; do ++ is_ignored_file "$device" && continue ++ /sbin/ifdown ${device##*/} ++ done ++ for arg in $BONDING_OPTS ; do ++ key=${arg%%=*}; ++ [[ "${key}" != "arp_ip_target" ]] && continue ++ value=${arg##*=}; ++ if [ "${value:0:1}" != "" ]; then ++ OLDIFS=$IFS; ++ IFS=','; ++ for arp_ip in $value; do ++ if grep -q $arp_ip /sys/class/net/${DEVICE}/bonding/arp_ip_target; then ++ echo "-$arp_ip" > /sys/class/net/${DEVICE}/bonding/arp_ip_target ++ fi ++ done ++ IFS=$OLDIFS; ++ else ++ value=${value#+}; ++ if grep -q $value /sys/class/net/${DEVICE}/bonding/arp_ip_target; then ++ echo "-$value" > /sys/class/net/${DEVICE}/bonding/arp_ip_target ++ fi ++ fi ++ done ++fi ++ ++/etc/sysconfig/network-scripts/ifdown-ipv6 ${CONFIG} ++ ++retcode=0 ++[ -n "$(pidof -x dhclient)" ] && { ++ for VER in "" 6 ; do ++ if [ -f "/var/run/dhclient$VER-${DEVICE}.pid" ]; then ++ dhcpid=$(cat /var/run/dhclient$VER-${DEVICE}.pid) ++ generate_lease_file_name $VER ++ if [[ "$DHCPRELEASE" = [yY1]* ]]; then ++ /sbin/dhclient -r -lf ${LEASEFILE} -pf /var/run/dhclient$VER-${DEVICE}.pid ${DEVICE} >/dev/null 2>&1 ++ retcode=$? ++ else ++ kill $dhcpid >/dev/null 2>&1 ++ retcode=$? ++ reason=STOP$VER interface=${DEVICE} /sbin/dhclient-script ++ fi ++ if [ -f "/var/run/dhclient$VER-${DEVICE}.pid" ]; then ++ rm -f /var/run/dhclient$VER-${DEVICE}.pid ++ kill $dhcpid >/dev/null 2>&1 ++ fi ++ fi ++ done ++} ++# we can't just delete the configured address because that address ++# may have been changed in the config file since the device was ++# brought up. Flush all addresses associated with this ++# instance instead. ++if [ -d "/sys/class/net/${REALDEVICE}" ]; then ++ if [ "${REALDEVICE}" = "${DEVICE}" ]; then ++ ip addr flush dev ${REALDEVICE} scope global 2>/dev/null ++ else ++ ip addr flush dev ${REALDEVICE} label ${DEVICE} scope global 2>/dev/null ++ fi ++ ++ if [ "${SLAVE}" = "yes" -a -n "${MASTER}" ]; then ++ echo "-${DEVICE}" > /sys/class/net/${MASTER}/bonding/slaves 2>/dev/null ++ fi ++ ++ if [ "${REALDEVICE}" = "${DEVICE}" ]; then ++ ip link set dev ${DEVICE} down 2>/dev/null ++ fi ++fi ++[ "$retcode" = "0" ] && retcode=$? ++ ++# wait up to 5 seconds for device to actually come down... ++waited=0 ++while ! check_device_down ${DEVICE} && [ "$waited" -lt 50 ] ; do ++ usleep 10000 ++ waited=$(($waited+1)) ++done ++ ++if [ "$retcode" = 0 ] ; then ++ /etc/sysconfig/network-scripts/ifdown-post $CONFIG ++ # do NOT use $? because ifdown should return whether or not ++ # the interface went down. ++fi ++ ++if [ -n "$PKEY" ]; then ++ # PKey PKEY ++ echo "$NEW_PKEY_ID" > /sys/class/net/${PHYSDEV}/delete_child ++fi ++ ++exit $retcode +diff --git a/redhat/rdma.ifup-ib b/redhat/rdma.ifup-ib +new file mode 100644 +index 00000000..bb4d4f71 +--- /dev/null ++++ b/redhat/rdma.ifup-ib +@@ -0,0 +1,308 @@ ++#!/bin/bash ++# Network Interface Configuration System ++# Copyright (c) 1996-2013 Red Hat, Inc. all rights reserved. ++# ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License, version 2, ++# as published by the Free Software Foundation. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ++ ++. /etc/init.d/functions ++ ++cd /etc/sysconfig/network-scripts ++. ./network-functions ++ ++[ -f ../network ] && . ../network ++ ++CONFIG="${1}" ++ ++need_config "${CONFIG}" ++ ++source_config ++ ++# Allow the user to override the detection of our physical device by passing ++# it in. No checking is done, if the user gives us a bogus dev, it's ++# their problem. ++[ -n "${PHYSDEV}" ] && REALDEVICE="$PHYSDEV" ++ ++if [ "${BOOTPROTO}" = "dhcp" ]; then ++ DYNCONFIG=true ++fi ++ ++# load the module associated with that device ++# /sbin/modprobe ${REALDEVICE} ++is_available_wait ${REALDEVICE} ${DEVTIMEOUT} ++ ++# bail out, if the MAC does not fit ++if [ -n "${HWADDR}" ]; then ++ FOUNDMACADDR=$(get_hwaddr ${REALDEVICE} | tail -c 24) ++ HWADDR=$(echo $HWADDR | tail -c 24) ++ if [ "${FOUNDMACADDR}" != "${HWADDR}" ]; then ++ net_log $"Device ${DEVICE} has different MAC address than expected, ignoring." ++ exit 1 ++ fi ++fi ++ ++# now check the real state ++is_available ${REALDEVICE} || { ++ if [ -n "$alias" ]; then ++ net_log $"$alias device ${DEVICE} does not seem to be present, delaying initialization." ++ else ++ net_log $"Device ${DEVICE} does not seem to be present, delaying initialization." ++ fi ++ exit 1 ++} ++ ++# if we are a P_Key device, create the device if needed ++if [ "${PKEY}" = yes ]; then ++ [ -z "${PKEY_ID}" ] && { ++ net_log $"InfiniBand IPoIB device: PKEY=yes requires a PKEY_ID" ++ exit 1 ++ } ++ [ -z "${PHYSDEV}" ] && { ++ net_log $"InfiniBand IPoIB device: PKEY=yes requires a PHYSDEV" ++ exit 1 ++ } ++ # Normalize our PKEY_ID to have the high bit set ++ NEW_PKEY_ID=`printf "0x%04x" $(( 0x8000 | ${PKEY_ID} ))` ++ NEW_PKEY_NAME=`printf "%04x" ${NEW_PKEY_ID}` ++ [ "${DEVICE}" != "${PHYSDEV}.${NEW_PKEY_NAME}" ] && { ++ net_log $"Configured DEVICE name does not match what new device name would be. This ++is most likely because once the PKEY_ID was normalized, it no longer ++resulted in the expected device naming, and so the DEVICE entry in the ++config file needs to be updated to match. This can also be caused by ++giving PKEY_ID as a hex number but without using the mandatory 0x prefix. ++ Configured DEVICE=$DEVICE ++ Configured PHYSDEV=$PHYSDEV ++ Configured PKEY_ID=$PKEY_ID ++ Calculated PKEY_ID=$NEW_PKEY_ID ++ Calculated name=${PHYSDEV}.${NEW_PKEY_NAME}" ++ exit 1 ++ } ++ [ -d "/sys/class/net/${DEVICE}" ] || ++ echo "${NEW_PKEY_ID}" > "/sys/class/net/${PHYSDEV}/create_child" ++ [ -d "/sys/class/net/${DEVICE}" ] || { ++ echo "Failed to create child device $NEW_PKEY_ID of $PHYSDEV" ++ exit 1 ++ } ++ # When we get to setting up the IP address, we need REALDEVICE to ++ # point to our new PKEY device ++ REALDEVICE="${DEVICE}" ++fi ++ ++ ++if [ -n "${MACADDR}" ]; then ++ net_log $"IPoIB devices do not support setting the MAC address of the interface" ++ # ip link set dev ${DEVICE} address ${MACADDR} ++fi ++ ++# First, do we even support setting connected mode? ++if [ -e /sys/class/net/${DEVICE}/mode ]; then ++ # OK, set the mode in all cases, that way it gets reset on a down/up ++ # cycle, allowing people to change the mode without rebooting ++ if [ "${CONNECTED_MODE}" = yes ]; then ++ echo connected > /sys/class/net/${DEVICE}/mode ++ # cap the MTU where we should based upon mode ++ [ -z "$MTU" ] && MTU=65520 ++ [ "$MTU" -gt 65520 ] && MTU=65520 ++ else ++ echo datagram > /sys/class/net/${DEVICE}/mode ++ # cap the MTU where we should based upon mode ++ [ -z "$MTU" ] && MTU=2044 ++ [ "$MTU" -gt 2044 ] && MTU=2044 ++ fi ++fi ++ ++if [ -n "${MTU}" ]; then ++ ip link set dev ${DEVICE} mtu ${MTU} ++fi ++ ++# slave device? ++if [ "${SLAVE}" = yes -a "${ISALIAS}" = no -a "${MASTER}" != "" ]; then ++ install_bonding_driver ${MASTER} ++ grep -wq "${DEVICE}" /sys/class/net/${MASTER}/bonding/slaves 2>/dev/null || { ++ /sbin/ip link set dev ${DEVICE} down ++ echo "+${DEVICE}" > /sys/class/net/${MASTER}/bonding/slaves 2>/dev/null ++ } ++ ethtool_set ++ ++ exit 0 ++fi ++ ++# Bonding initialization. For DHCP, we need to enslave the devices early, ++# so it can actually get an IP. ++if [ "$ISALIAS" = no ] && is_bonding_device ${DEVICE} ; then ++ install_bonding_driver ${DEVICE} ++ /sbin/ip link set dev ${DEVICE} up ++ for device in $(LANG=C grep -l "^[[:space:]]*MASTER=\"\?${DEVICE}\"\?\([[:space:]#]\|$\)" /etc/sysconfig/network-scripts/ifcfg-*) ; do ++ is_ignored_file "$device" && continue ++ /sbin/ifup ${device##*/} ++ done ++ ++ [ -n "${LINKDELAY}" ] && /bin/sleep ${LINKDELAY} ++ ++ # add the bits to setup the needed post enslavement parameters ++ for arg in $BONDING_OPTS ; do ++ key=${arg%%=*}; ++ value=${arg##*=}; ++ if [ "${key}" = "primary" ]; then ++ echo $value > /sys/class/net/${DEVICE}/bonding/$key ++ fi ++ done ++fi ++ ++ ++if [ -n "${DYNCONFIG}" ] && [ -x /sbin/dhclient ]; then ++ if [[ "${PERSISTENT_DHCLIENT}" = [yY1]* ]]; then ++ ONESHOT=""; ++ else ++ ONESHOT="-1"; ++ fi; ++ generate_config_file_name ++ generate_lease_file_name ++ DHCLIENTARGS="${DHCLIENTARGS} -H ${DHCP_HOSTNAME:-${HOSTNAME%%.*}} ${ONESHOT} -q ${DHCLIENTCONF} -lf ${LEASEFILE} -pf /var/run/dhclient-${DEVICE}.pid" ++ echo ++ echo -n $"Determining IP information for ${DEVICE}..." ++ if [[ "${PERSISTENT_DHCLIENT}" != [yY1]* ]] && check_link_down ${DEVICE}; then ++ echo $" failed; no link present. Check cable?" ++ exit 1 ++ fi ++ ++ ethtool_set ++ ++ if /sbin/dhclient ${DHCLIENTARGS} ${DEVICE} ; then ++ echo $" done." ++ dhcpipv4="good" ++ else ++ echo $" failed." ++ if [[ "${IPV4_FAILURE_FATAL}" = [Yy1]* ]] ; then ++ exit 1 ++ fi ++ if [[ "$IPV6INIT" != [yY1]* && "$DHCPV6C" != [yY1]* ]] ; then ++ exit 1 ++ fi ++ net_log "Unable to obtain IPv4 DHCP address ${DEVICE}." warning ++ fi ++# end dynamic device configuration ++else ++ if [ -z "${IPADDR}" -a -z "${IPADDR0}" -a -z "${IPADDR1}" -a -z "${IPADDR2}" ]; then ++ # enable device without IP, useful for e.g. PPPoE ++ ip link set dev ${REALDEVICE} up ++ ethtool_set ++ [ -n "${LINKDELAY}" ] && /bin/sleep ${LINKDELAY} ++ else ++ ++ expand_config ++ ++ [ -n "${ARP}" ] && \ ++ ip link set dev ${REALDEVICE} $(toggle_value arp $ARP) ++ ++ if ! ip link set dev ${REALDEVICE} up ; then ++ net_log $"Failed to bring up ${DEVICE}." ++ exit 1 ++ fi ++ ++ ethtool_set ++ ++ [ -n "${LINKDELAY}" ] && /bin/sleep ${LINKDELAY} ++ ++ if [ "${DEVICE}" = "lo" ]; then ++ SCOPE="scope host" ++ else ++ SCOPE=${SCOPE:-} ++ fi ++ ++ if [ -n "$SRCADDR" ]; then ++ SRC="src $SRCADDR" ++ else ++ SRC= ++ fi ++ ++ # set IP address(es) ++ for idx in {0..256} ; do ++ if [ -z "${ipaddr[$idx]}" ]; then ++ break ++ fi ++ ++ if ! LC_ALL=C ip addr ls ${REALDEVICE} | LC_ALL=C grep -q "${ipaddr[$idx]}/${prefix[$idx]}" ; then ++ [ "${REALDEVICE}" != "lo" ] && [ "${arpcheck[$idx]}" != "no" ] && \ ++ /sbin/arping -q -c 2 -w 3 -D -I ${REALDEVICE} ${ipaddr[$idx]} ++ if [ $? = 1 ]; then ++ net_log $"Error, some other host already uses address ${ipaddr[$idx]}." ++ exit 1 ++ fi ++ ++ if ! ip addr add ${ipaddr[$idx]}/${prefix[$idx]} \ ++ brd ${broadcast[$idx]:-+} dev ${REALDEVICE} ${SCOPE} label ${DEVICE}; then ++ net_log $"Error adding address ${ipaddr[$idx]} for ${DEVICE}." ++ fi ++ fi ++ ++ if [ -n "$SRCADDR" ]; then ++ sysctl -w "net.ipv4.conf.${REALDEVICE}.arp_filter=1" >/dev/null 2>&1 ++ fi ++ ++ # update ARP cache of neighboring computers ++ if [ "${REALDEVICE}" != "lo" ]; then ++ /sbin/arping -q -A -c 1 -I ${REALDEVICE} ${ipaddr[$idx]} ++ ( sleep 2; ++ /sbin/arping -q -U -c 1 -I ${REALDEVICE} ${ipaddr[$idx]} ) > /dev/null 2>&1 < /dev/null & ++ fi ++ done ++ ++ # Set a default route. ++ if [ "${DEFROUTE}" != "no" ] && [ -z "${GATEWAYDEV}" -o "${GATEWAYDEV}" = "${REALDEVICE}" ]; then ++ # set up default gateway. replace if one already exists ++ if [ -n "${GATEWAY}" ] && [ "$(ipcalc --network ${GATEWAY} ${netmask[0]} 2>/dev/null)" = "NETWORK=${NETWORK}" ]; then ++ ip route replace default ${METRIC:+metric $METRIC} \ ++ via ${GATEWAY} ${WINDOW:+window $WINDOW} ${SRC} \ ++ ${GATEWAYDEV:+dev $GATEWAYDEV} || ++ net_log $"Error adding default gateway ${GATEWAY} for ${DEVICE}." ++ elif [ "${GATEWAYDEV}" = "${DEVICE}" ]; then ++ ip route replace default ${METRIC:+metric $METRIC} \ ++ ${SRC} ${WINDOW:+window $WINDOW} dev ${REALDEVICE} || ++ net_log $"Erorr adding default gateway for ${REALDEVICE}." ++ fi ++ fi ++ fi ++fi ++ ++# Add Zeroconf route. ++if [ -z "${NOZEROCONF}" -a "${ISALIAS}" = "no" -a "${REALDEVICE}" != "lo" ]; then ++ ip route add 169.254.0.0/16 dev ${REALDEVICE} metric $((1000 + $(cat /sys/class/net/${REALDEVICE}/ifindex))) scope link ++fi ++ ++# Inform firewall which network zone (empty means default) this interface belongs to ++if [ -x /usr/bin/firewall-cmd -a "${REALDEVICE}" != "lo" ]; then ++ /usr/bin/firewall-cmd --zone="${ZONE}" --change-interface="${DEVICE}" > /dev/null 2>&1 ++fi ++ ++# IPv6 initialisation? ++/etc/sysconfig/network-scripts/ifup-ipv6 ${CONFIG} ++if [[ "${DHCPV6C}" = [Yy1]* ]] && [ -x /sbin/dhclient ]; then ++ generate_config_file_name 6 ++ generate_lease_file_name 6 ++ echo ++ echo -n $"Determining IPv6 information for ${DEVICE}..." ++ if /sbin/dhclient -6 -1 ${DHCPV6C_OPTIONS} ${DHCLIENTCONF} -lf ${LEASEFILE} -pf /var/run/dhclient6-${DEVICE}.pid -H ${DHCP_HOSTNAME:-${HOSTNAME%%.*}} ${DEVICE} ; then ++ echo $" done." ++ else ++ echo $" failed." ++ if [ "${dhcpipv4}" = "good" -o -n "${IPADDR}" ]; then ++ net_log "Unable to obtain IPv6 DHCP address ${DEVICE}." warning ++ else ++ exit 1 ++ fi ++ fi ++fi ++ ++exec /etc/sysconfig/network-scripts/ifup-post ${CONFIG} ${2} ++ +-- +2.16.1 + diff --git a/SOURCES/0005-fix_mtu_limiting_for_ipoib.patch b/SOURCES/0005-fix_mtu_limiting_for_ipoib.patch new file mode 100644 index 0000000..873833c --- /dev/null +++ b/SOURCES/0005-fix_mtu_limiting_for_ipoib.patch @@ -0,0 +1,23 @@ +commit ad6295aecbb1cd0ab9e026f951b24b9a7a59bd42 +Author: Jarod Wilson +Date: Tue Jun 26 09:35:08 2018 -0400 + + Fix MTU limiting for IPoIB in datagram mode + + RHEL-only + + Signed-off-by: Jarod Wilson + +diff --git a/redhat/rdma.ifup-ib b/redhat/rdma.ifup-ib +index bb4d4f71..3779e13f 100644 +--- a/redhat/rdma.ifup-ib ++++ b/redhat/rdma.ifup-ib +@@ -117,7 +117,7 @@ if [ -e /sys/class/net/${DEVICE}/mode ]; then + echo datagram > /sys/class/net/${DEVICE}/mode + # cap the MTU where we should based upon mode + [ -z "$MTU" ] && MTU=2044 +- [ "$MTU" -gt 2044 ] && MTU=2044 ++ [ "$MTU" -gt 4092 ] && MTU=4092 + fi + fi + diff --git a/SOURCES/0006-srp_daemon-Remove-unsupported-systemd-configurations.patch b/SOURCES/0006-srp_daemon-Remove-unsupported-systemd-configurations.patch new file mode 100644 index 0000000..defe5fc --- /dev/null +++ b/SOURCES/0006-srp_daemon-Remove-unsupported-systemd-configurations.patch @@ -0,0 +1,63 @@ +From 01ff44aeedce5dba803ea7ae761fa06615b6e0af Mon Sep 17 00:00:00 2001 +From: Honggang Li +Date: Wed, 27 Dec 2017 11:44:33 +0800 +Subject: [PATCH] srp_daemon: Remove unsupported systemd configurations + +Note: This is rhel-7.5 specific patch. + ++--------------------------+---------------+ +| lvalue | systemd | ++--------------------------+---------------+ +| MemoryDenyWriteExecute | 231 | +| ProtectControlGroups | 232 | +| ProtectKernelModules | 232 | +| RestrictRealtime | 231 | ++--------------------------+---------------+ + +RHEL-7.5 includes systemd-219-51 which does not support +those configuration yet, so remove them. + +Signed-off-by: Honggang Li +--- + srp_daemon/srp_daemon.service.in | 3 --- + srp_daemon/srp_daemon_port@.service.in | 4 ---- + 2 files changed, 7 deletions(-) + +diff --git a/srp_daemon/srp_daemon.service.in b/srp_daemon/srp_daemon.service.in +index 93e44425..b8bea643 100644 +--- a/srp_daemon/srp_daemon.service.in ++++ b/srp_daemon/srp_daemon.service.in +@@ -10,11 +10,8 @@ Before=remote-fs-pre.target + Type=oneshot + RemainAfterExit=yes + ExecStart=@CMAKE_INSTALL_FULL_LIBEXECDIR@/srp_daemon/start_on_all_ports +-MemoryDenyWriteExecute=yes + PrivateTmp=yes + ProtectHome=yes +-ProtectKernelModules=yes +-RestrictRealtime=yes + + [Install] + WantedBy=remote-fs-pre.target +diff --git a/srp_daemon/srp_daemon_port@.service.in b/srp_daemon/srp_daemon_port@.service.in +index 3d5a11e8..7516e8a2 100644 +--- a/srp_daemon/srp_daemon_port@.service.in ++++ b/srp_daemon/srp_daemon_port@.service.in +@@ -24,14 +24,10 @@ BindsTo=srp_daemon.service + [Service] + Type=simple + ExecStart=@CMAKE_INSTALL_FULL_SBINDIR@/srp_daemon --systemd -e -c -n -j %I -R 60 +-MemoryDenyWriteExecute=yes + PrivateNetwork=yes + PrivateTmp=yes +-ProtectControlGroups=yes + ProtectHome=yes +-ProtectKernelModules=yes + ProtectSystem=full +-RestrictRealtime=yes + SystemCallFilter=~@clock @cpu-emulation @debug @keyring @module @mount @obsolete @raw-io + + [Install] +-- +2.15.GIT + diff --git a/SOURCES/0007-srp_daemon-srp_daemon.service-should-be-started-afte.patch b/SOURCES/0007-srp_daemon-srp_daemon.service-should-be-started-afte.patch new file mode 100644 index 0000000..05e7ea9 --- /dev/null +++ b/SOURCES/0007-srp_daemon-srp_daemon.service-should-be-started-afte.patch @@ -0,0 +1,35 @@ +From 141910626b7601c4d697274ea49e951584ae24a5 Mon Sep 17 00:00:00 2001 +From: Honggang Li +Date: Fri, 29 Dec 2017 17:21:52 +0800 +Subject: [PATCH] srp_daemon: srp_daemon.service should be started after + network.target + +This is a rhel-7.5 specific workaround as rhel-7.5 is using +systemd-219. + +The srp_daemon service will be started at the very beginning state +of systemd when boot/reboot the machine, in case srp_daemon.service +is not after network.target. As result, the srp_daemon.service will +be terminated because of SERVICE_FAILURE_RESOURCES. + +Fixes: 1c7fe513e3e9 ("srp_daemon: One systemd service per port") +Signed-off-by: Honggang Li +--- + srp_daemon/srp_daemon.service.in | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/srp_daemon/srp_daemon.service.in b/srp_daemon/srp_daemon.service.in +index 188b7e1a..93e44425 100644 +--- a/srp_daemon/srp_daemon.service.in ++++ b/srp_daemon/srp_daemon.service.in +@@ -3,6 +3,7 @@ Description=Daemon that discovers and logs in to SRP target systems + Documentation=man:srp_daemon file:/etc/srp_daemon.conf + DefaultDependencies=false + Conflicts=emergency.target emergency.service ++After=network.target + Before=remote-fs-pre.target + + [Service] +-- +2.15.GIT + diff --git a/SOURCES/i40iw-autoload-breaks-suspend.patch b/SOURCES/i40iw-autoload-breaks-suspend.patch deleted file mode 100644 index 072fc22..0000000 --- a/SOURCES/i40iw-autoload-breaks-suspend.patch +++ /dev/null @@ -1,17 +0,0 @@ -Index: rdma-core-15/kernel-boot/rdma-hw-modules.rules -=================================================================== ---- rdma-core-15.orig/kernel-boot/rdma-hw-modules.rules -+++ rdma-core-15/kernel-boot/rdma-hw-modules.rules -@@ -11,7 +11,11 @@ ENV{ID_NET_DRIVER}=="bnxt_en", RUN{built - ENV{ID_NET_DRIVER}=="cxgb3", RUN{builtin}+="kmod load iw_cxgb3" - ENV{ID_NET_DRIVER}=="cxgb4", RUN{builtin}+="kmod load iw_cxgb4" - ENV{ID_NET_DRIVER}=="hns", RUN{builtin}+="kmod load hns_roce" --ENV{ID_NET_DRIVER}=="i40e", RUN{builtin}+="kmod load i40iw" -+# i40iw is not entirely suspend/resume friendly, and many systems with -+# i40e NICs aren't iwarp-capable, so Red Hat defaults to not auto-loading -+# the i40iw driver here to keep suspend/resume working. The i40iw driver -+# can still be loaded as needed by the rdma systemd service script. -+# ENV{ID_NET_DRIVER}=="i40e", RUN{builtin}+="kmod load i40iw" - ENV{ID_NET_DRIVER}=="mlx4_en", RUN{builtin}+="kmod load mlx4_ib" - ENV{ID_NET_DRIVER}=="mlx5_core", RUN{builtin}+="kmod load mlx5_ib" - ENV{ID_NET_DRIVER}=="qede", RUN{builtin}+="kmod load qedr" diff --git a/SOURCES/libbnxt_re_fix_lat_test_failure_in_event_mode.patch b/SOURCES/libbnxt_re_fix_lat_test_failure_in_event_mode.patch deleted file mode 100644 index 84e5e59..0000000 --- a/SOURCES/libbnxt_re_fix_lat_test_failure_in_event_mode.patch +++ /dev/null @@ -1,73 +0,0 @@ -commit 0b72e02a1fee3e383fad0aa2e7e5cf8c6a06c6bf -Author: Devesh Sharma -Date: Wed Jan 31 01:28:53 2018 -0500 - - libbnxt_re: Fix lat test failure in event mode - - The application assumes that, when CQ is armed, it gives interrupt - for the new CQEs generated and not for the existing CQEs. This is - in-line with the IB-Spec. However, Broadcom HW generates an interrupt - for any unread CQEs not just new ones. This results in a scenario - where the application is expecting a completion for a SEND operation - but it receives a completion for a prior incoming-send/RQE that was - not yet consumed as per the HW thereby leading to failure. - Workaround this by deferring the ARM-ing of the CQ when invoked in - the notify_cq hook to 'poll_cq' so that the CQ is armed after all - completions are consumed. - - Signed-off-by: Devesh Sharma - Signed-off-by: Somnath Kotur - Signed-off-by: Selvin Xavier - -diff --git a/providers/bnxt_re/main.h b/providers/bnxt_re/main.h -index affe24f0..08aa277d 100644 ---- a/providers/bnxt_re/main.h -+++ b/providers/bnxt_re/main.h -@@ -76,6 +76,9 @@ struct bnxt_re_cq { - struct list_head rfhead; - uint32_t cqe_size; - uint8_t phase; -+ int deferred_arm_flags; -+ bool first_arm; -+ bool deferred_arm; - }; - - struct bnxt_re_srq { -diff --git a/providers/bnxt_re/verbs.c b/providers/bnxt_re/verbs.c -index 09ac3335..2e88304c 100644 ---- a/providers/bnxt_re/verbs.c -+++ b/providers/bnxt_re/verbs.c -@@ -202,6 +202,7 @@ struct ibv_cq *bnxt_re_create_cq(struct ibv_context *ibvctx, int ncqe, - cq->phase = resp.phase; - cq->cqq.tail = resp.tail; - cq->udpi = &cntx->udpi; -+ cq->first_arm = true; - - list_head_init(&cq->sfhead); - list_head_init(&cq->rfhead); -@@ -654,6 +655,11 @@ int bnxt_re_poll_cq(struct ibv_cq *ibvcq, int nwc, struct ibv_wc *wc) - - pthread_spin_lock(&cq->cqq.qlock); - dqed = bnxt_re_poll_one(cq, nwc, wc); -+ if (cq->deferred_arm) { -+ bnxt_re_ring_cq_arm_db(cq, cq->deferred_arm_flags); -+ cq->deferred_arm = false; -+ cq->deferred_arm_flags = 0; -+ } - pthread_spin_unlock(&cq->cqq.qlock); - /* Check if anything is there to flush. */ - pthread_spin_lock(&cntx->fqlock); -@@ -718,7 +724,12 @@ int bnxt_re_arm_cq(struct ibv_cq *ibvcq, int flags) - pthread_spin_lock(&cq->cqq.qlock); - flags = !flags ? BNXT_RE_QUE_TYPE_CQ_ARMALL : - BNXT_RE_QUE_TYPE_CQ_ARMSE; -- bnxt_re_ring_cq_arm_db(cq, flags); -+ if (cq->first_arm) { -+ bnxt_re_ring_cq_arm_db(cq, flags); -+ cq->first_arm = false; -+ } -+ cq->deferred_arm = true; -+ cq->deferred_arm_flags = flags; - pthread_spin_unlock(&cq->cqq.qlock); - - return 0; diff --git a/SOURCES/librdmacm-add-support-for-extended-join-mc.patch b/SOURCES/librdmacm-add-support-for-extended-join-mc.patch deleted file mode 100644 index 42ca0a1..0000000 --- a/SOURCES/librdmacm-add-support-for-extended-join-mc.patch +++ /dev/null @@ -1,345 +0,0 @@ -commit 3c1d25b8170b0c30d723b2bf89c390293dc4477c -Author: Jason Gunthorpe -Date: Fri Nov 17 11:59:13 2017 -0700 - - librdmacm: Add support for extended join multicast API - - Add support for specifying MC join flags. The following multicast join - flags will now be supported by librdmacm (as already defined in the join - flags in rdma_user_cm.h through the UAPI of the kernel). - - -Full Member: - The initiator creates the Multicast group (MCG) if it wasn't previously - created, can send Multicast messages to the group and receive messages - from the MCG. - - -Send Only Full Member: - The initiator creates the Multicast group (MCG) if it wasn't previously - created, can send Multicast messages but doesn't receive any messages - from the MCG (send-only). - - Tested-by: Christoph Lameter - Reviewed by: Hal Rosenstock - Signed-off-by: Alex Vesker - Signed-off-by: Christoph Lameter - Reviewed-by: Jason Gunthorpe - Signed-off-by: Jason Gunthorpe - -Index: rdma-core-15/debian/librdmacm-dev.install -=================================================================== ---- rdma-core-15.orig/debian/librdmacm-dev.install -+++ rdma-core-15/debian/librdmacm-dev.install -@@ -33,6 +33,7 @@ usr/share/man/man3/rdma_get_send_comp.3 - usr/share/man/man3/rdma_get_src_port.3 - usr/share/man/man3/rdma_getaddrinfo.3 - usr/share/man/man3/rdma_join_multicast.3 -+usr/share/man/man3/rdma_join_multicast_ex.3 - usr/share/man/man3/rdma_leave_multicast.3 - usr/share/man/man3/rdma_listen.3 - usr/share/man/man3/rdma_migrate_id.3 -Index: rdma-core-15/debian/librdmacm1.symbols -=================================================================== ---- rdma-core-15.orig/debian/librdmacm1.symbols -+++ rdma-core-15/debian/librdmacm1.symbols -@@ -1,5 +1,6 @@ - librdmacm.so.1 librdmacm1 #MINVER# - RDMACM_1.0@RDMACM_1.0 1.0.15 -+ RDMACM_1.1@RDMACM_1.1 16 - raccept@RDMACM_1.0 1.0.16 - rbind@RDMACM_1.0 1.0.16 - rclose@RDMACM_1.0 1.0.16 -@@ -31,6 +32,7 @@ librdmacm.so.1 librdmacm1 #MINVER# - rdma_get_src_port@RDMACM_1.0 1.0.19 - rdma_getaddrinfo@RDMACM_1.0 1.0.15 - rdma_join_multicast@RDMACM_1.0 1.0.15 -+ rdma_join_multicast_ex@RDMACM_1.1 16 - rdma_leave_multicast@RDMACM_1.0 1.0.15 - rdma_listen@RDMACM_1.0 1.0.15 - rdma_migrate_id@RDMACM_1.0 1.0.15 -Index: rdma-core-15/librdmacm/CMakeLists.txt -=================================================================== ---- rdma-core-15.orig/librdmacm/CMakeLists.txt -+++ rdma-core-15/librdmacm/CMakeLists.txt -@@ -10,7 +10,7 @@ publish_headers(infiniband - - rdma_library(rdmacm librdmacm.map - # See Documentation/versioning.md -- 1 1.0.${PACKAGE_VERSION} -+ 1 1.1.${PACKAGE_VERSION} - acm.c - addrinfo.c - cma.c -Index: rdma-core-15/librdmacm/cma.c -=================================================================== ---- rdma-core-15.orig/librdmacm/cma.c -+++ rdma-core-15/librdmacm/cma.c -@@ -114,6 +114,7 @@ struct cma_multicast { - uint32_t handle; - union ibv_gid mgid; - uint16_t mlid; -+ uint16_t join_flags; - struct sockaddr_storage addr; - }; - -@@ -1713,7 +1714,8 @@ int rdma_disconnect(struct rdma_cm_id *i - } - - static int rdma_join_multicast2(struct rdma_cm_id *id, struct sockaddr *addr, -- socklen_t addrlen, void *context) -+ socklen_t addrlen, uint16_t join_flags, -+ void *context) - { - struct ucma_abi_create_id_resp resp; - struct cma_id_private *id_priv; -@@ -1727,6 +1729,7 @@ static int rdma_join_multicast2(struct r - - mc->context = context; - mc->id_priv = id_priv; -+ mc->join_flags = join_flags; - memcpy(&mc->addr, addr, addrlen); - if (pthread_cond_init(&mc->cond, NULL)) { - ret = -1; -@@ -1746,7 +1749,7 @@ static int rdma_join_multicast2(struct r - memcpy(&cmd.addr, addr, addrlen); - cmd.addr_size = addrlen; - cmd.uid = (uintptr_t) mc; -- cmd.reserved = 0; -+ cmd.join_flags = join_flags; - - ret = write(id->channel->fd, &cmd, sizeof cmd); - if (ret != sizeof cmd) { -@@ -1784,6 +1787,30 @@ err1: - return ret; - } - -+int rdma_join_multicast_ex(struct rdma_cm_id *id, -+ struct rdma_cm_join_mc_attr_ex *mc_join_attr, -+ void *context) -+{ -+ int addrlen; -+ -+ if (mc_join_attr->comp_mask >= RDMA_CM_JOIN_MC_ATTR_RESERVED) -+ return ERR(ENOTSUP); -+ -+ if (!(mc_join_attr->comp_mask & RDMA_CM_JOIN_MC_ATTR_ADDRESS)) -+ return ERR(EINVAL); -+ -+ if (!(mc_join_attr->comp_mask & RDMA_CM_JOIN_MC_ATTR_JOIN_FLAGS) || -+ (mc_join_attr->join_flags >= RDMA_MC_JOIN_FLAG_RESERVED)) -+ return ERR(EINVAL); -+ -+ addrlen = ucma_addrlen(mc_join_attr->addr); -+ if (!addrlen) -+ return ERR(EINVAL); -+ -+ return rdma_join_multicast2(id, mc_join_attr->addr, addrlen, -+ mc_join_attr->join_flags, context); -+} -+ - int rdma_join_multicast(struct rdma_cm_id *id, struct sockaddr *addr, - void *context) - { -@@ -1793,7 +1820,8 @@ int rdma_join_multicast(struct rdma_cm_i - if (!addrlen) - return ERR(EINVAL); - -- return rdma_join_multicast2(id, addr, addrlen, context); -+ return rdma_join_multicast2(id, addr, addrlen, -+ RDMA_MC_JOIN_FLAG_FULLMEMBER, context); - } - - int rdma_leave_multicast(struct rdma_cm_id *id, struct sockaddr *addr) -@@ -1821,7 +1849,7 @@ int rdma_leave_multicast(struct rdma_cm_ - if (!mc) - return ERR(EADDRNOTAVAIL); - -- if (id->qp) -+ if (id->qp && (mc->join_flags != RDMA_MC_JOIN_FLAG_SENDONLY_FULLMEMBER)) - ibv_detach_mcast(id->qp, &mc->mgid, mc->mlid); - - CMA_INIT_CMD_RESP(&cmd, sizeof cmd, LEAVE_MCAST, &resp, sizeof resp); -@@ -2009,6 +2037,10 @@ static int ucma_process_join(struct cma_ - if (!evt->id_priv->id.qp) - return 0; - -+ /* Don't attach QP to multicast if joined as send only full member */ -+ if (evt->mc->join_flags == RDMA_MC_JOIN_FLAG_SENDONLY_FULLMEMBER) -+ return 0; -+ - return rdma_seterrno(ibv_attach_mcast(evt->id_priv->id.qp, - &evt->mc->mgid, evt->mc->mlid)); - } -Index: rdma-core-15/librdmacm/librdmacm.map -=================================================================== ---- rdma-core-15.orig/librdmacm/librdmacm.map -+++ rdma-core-15/librdmacm/librdmacm.map -@@ -71,3 +71,8 @@ RDMACM_1.0 { - rdma_create_qp_ex; - local: *; - }; -+ -+RDMACM_1.1 { -+ global: -+ rdma_join_multicast_ex; -+} RDMACM_1.0; -Index: rdma-core-15/librdmacm/man/CMakeLists.txt -=================================================================== ---- rdma-core-15.orig/librdmacm/man/CMakeLists.txt -+++ rdma-core-15/librdmacm/man/CMakeLists.txt -@@ -33,6 +33,7 @@ rdma_man_pages( - rdma_get_src_port.3 - rdma_getaddrinfo.3 - rdma_join_multicast.3 -+ rdma_join_multicast_ex.3 - rdma_leave_multicast.3 - rdma_listen.3 - rdma_migrate_id.3 -Index: rdma-core-15/librdmacm/man/rdma_join_multicast_ex.3 -=================================================================== ---- /dev/null -+++ rdma-core-15/librdmacm/man/rdma_join_multicast_ex.3 -@@ -0,0 +1,66 @@ -+.TH "RDMA_JOIN_MULTICAST_EX" 3 "2017-11-17" "librdmacm" "Librdmacm Programmer's Manual" librdmacm -+.SH NAME -+rdma_join_multicast_ex \- Joins a multicast group with extended options. -+.SH SYNOPSIS -+.B "#include " -+.P -+.B "int" rdma_join_multicast_ex -+.BI "(struct rdma_cm_id *" id "," -+.BI "struct rdma_cm_join_mc_attr_ex *" mc_join_attr "," -+.BI "void *" context ");" -+.SH ARGUMENTS -+.IP "id" 20 -+Communication identifier associated with the request. -+.IP "mc_join_attr" 20 -+Is an rdma_cm_join_mc_attr_ex struct, as defined in . -+.IP "context" 20 -+User-defined context associated with the join request. -+.SH "DESCRIPTION" -+Joins a multicast group (MCG) with extended options. -+Currently supporting MC join with a specified join flag. -+.P -+.nf -+struct rdma_cm_join_mc_attr_ex { -+.in +8 -+uint32_t comp_mask; /* Bitwise OR between "rdma_cm_join_mc_attr_mask" enum */ -+uint32_t join_flags; /* Use a single flag from "rdma_cm_mc_join_flags" enum */ -+struct sockaddr *addr; /* Multicast address identifying the group to join */ -+.in -8 -+}; -+.fi -+.P -+The supported join flags are: -+.P -+.B RDMA_MC_JOIN_FLAG_FULLMEMBER -+- Create multicast group, Send multicast messages to MCG, Receive multicast messages from MCG. -+.P -+.B RDMA_MC_JOIN_FLAG_SENDONLY_FULLMEMBER -+- Create multicast group, Send multicast messages to MCG, Don't receive multicast messages from MCG (send-only). -+.P -+Initiating a MC join as "Send Only Full Member" on InfiniBand requires SM support, otherwise joining will fail. -+.P -+Initiating a MC join as "Send Only Full Member" on RoCEv2/ETH will not send any IGMP messages unlike a Full Member MC join. -+When "Send Only Full Member" is used the QP will not be attached to the MCG. -+.P -+.SH "RETURN VALUE" -+Returns 0 on success, or -1 on error. If an error occurs, errno will be -+set to indicate the failure reason. -+.SH "NOTES" -+Before joining a multicast group, the rdma_cm_id must be bound to -+an RDMA device by calling rdma_bind_addr or rdma_resolve_addr. Use of -+rdma_resolve_addr requires the local routing tables to resolve the -+multicast address to an RDMA device, unless a specific source address -+is provided. The user must call rdma_leave_multicast to leave the -+multicast group and release any multicast resources. After the join -+operation completes, if a QP is associated with the rdma_cm_id, -+it is automatically attached to the multicast group when the multicast -+event is retrieved by the user. Otherwise, the user is responsible -+for calling ibv_attach_mcast to bind the QP to the multicast group. -+The join context is returned to the user through the private_data -+field in the rdma_cm_event. -+.SH "SEE ALSO" -+rdma_join_multicast(3), rdma_leave_multicast(3), rdma_bind_addr(3), rdma_resolve_addr(3), rdma_create_qp(3), -+rdma_get_cm_event(3) -+.SH "AUTHORS" -+.TP -+Alex Vesker -Index: rdma-core-15/librdmacm/rdma_cma.h -=================================================================== ---- rdma-core-15.orig/librdmacm/rdma_cma.h -+++ rdma-core-15/librdmacm/rdma_cma.h -@@ -197,6 +197,29 @@ struct rdma_addrinfo { - struct rdma_addrinfo *ai_next; - }; - -+/* Multicast join compatibility mask attributes */ -+enum rdma_cm_join_mc_attr_mask { -+ RDMA_CM_JOIN_MC_ATTR_ADDRESS = 1 << 0, -+ RDMA_CM_JOIN_MC_ATTR_JOIN_FLAGS = 1 << 1, -+ RDMA_CM_JOIN_MC_ATTR_RESERVED = 1 << 2, -+}; -+ -+/* Multicast join flags */ -+enum rdma_cm_mc_join_flags { -+ RDMA_MC_JOIN_FLAG_FULLMEMBER, -+ RDMA_MC_JOIN_FLAG_SENDONLY_FULLMEMBER, -+ RDMA_MC_JOIN_FLAG_RESERVED, -+}; -+ -+struct rdma_cm_join_mc_attr_ex { -+ /* Bitwise OR between "rdma_cm_join_mc_attr_mask" enum */ -+ uint32_t comp_mask; -+ /* Use a flag from "rdma_cm_mc_join_flags" enum */ -+ uint32_t join_flags; -+ /* Multicast address identifying the group to join */ -+ struct sockaddr *addr; -+}; -+ - /** - * rdma_create_event_channel - Open a channel used to report communication events. - * Description: -@@ -555,6 +578,30 @@ int rdma_join_multicast(struct rdma_cm_i - int rdma_leave_multicast(struct rdma_cm_id *id, struct sockaddr *addr); - - /** -+ * rdma_multicast_ex - Joins a multicast group with options. -+ * @id: Communication identifier associated with the request. -+ * @mc_join_attr: Extensive struct containing multicast join parameters. -+ * @context: User-defined context associated with the join request. -+ * Description: -+ * Joins a multicast group with options. Currently supporting MC join flags. -+ * The QP will be attached based on the given join flag. -+ * Join message will be sent according to the join flag. -+ * Notes: -+ * Before joining a multicast group, the rdma_cm_id must be bound to -+ * an RDMA device by calling rdma_bind_addr or rdma_resolve_addr. Use of -+ * rdma_resolve_addr requires the local routing tables to resolve the -+ * multicast address to an RDMA device. The user must call -+ * rdma_leave_multicast to leave the multicast group and release any -+ * multicast resources. The context is returned to the user through -+ * the private_data field in the rdma_cm_event. -+ * See also: -+ * rdma_leave_multicast, rdma_bind_addr, rdma_resolve_addr, rdma_create_qp -+ */ -+int rdma_join_multicast_ex(struct rdma_cm_id *id, -+ struct rdma_cm_join_mc_attr_ex *mc_join_attr, -+ void *context); -+ -+/** - * rdma_get_cm_event - Retrieves the next pending communication event. - * @channel: Event channel to check for events. - * @event: Allocated information about the next communication event. -Index: rdma-core-15/librdmacm/rdma_cma_abi.h -=================================================================== ---- rdma-core-15.orig/librdmacm/rdma_cma_abi.h -+++ rdma-core-15/librdmacm/rdma_cma_abi.h -@@ -302,7 +302,7 @@ struct ucma_abi_join_mcast { - __u64 uid; - __u32 id; - __u16 addr_size; -- __u16 reserved; -+ __u16 join_flags; - struct sockaddr_storage addr; - }; - diff --git a/SOURCES/librdmacm-mckey-test-support-for-send-only-full-member.patch b/SOURCES/librdmacm-mckey-test-support-for-send-only-full-member.patch deleted file mode 100644 index 218f3fc..0000000 --- a/SOURCES/librdmacm-mckey-test-support-for-send-only-full-member.patch +++ /dev/null @@ -1,96 +0,0 @@ -commit 9db80df802bf9158c2d5a979175667babfce6506 -Author: Jason Gunthorpe -Date: Fri Nov 17 15:04:46 2017 -0700 - - librdmacm: mckey test support for send only full member - - Added a new flag (-o) to mckey which allows mckey to join the multicast - group as Send Only Full Member. - - Demonstrates the use of rdma_join_multicast_ex instead of - rdma_join_multicast. - - Signed-off-by: Alex Vesker - Signed-off-by: Christoph Lameter - Signed-off-by: Jason Gunthorpe - -diff --git a/librdmacm/examples/mckey.c b/librdmacm/examples/mckey.c -index 60cf8a24..7abb5246 100644 ---- a/librdmacm/examples/mckey.c -+++ b/librdmacm/examples/mckey.c -@@ -77,6 +77,7 @@ static int connections = 1; - static int message_size = 100; - static int message_count = 10; - static int is_sender; -+static int send_only; - static int unmapped_addr; - static char *dst_addr; - static char *src_addr; -@@ -241,6 +242,7 @@ static void connect_error(void) - static int addr_handler(struct cmatest_node *node) - { - int ret; -+ struct rdma_cm_join_mc_attr_ex mc_attr; - - ret = verify_test_params(node); - if (ret) -@@ -256,7 +258,14 @@ static int addr_handler(struct cmatest_node *node) - goto err; - } - -- ret = rdma_join_multicast(node->cma_id, test.dst_addr, node); -+ mc_attr.comp_mask = -+ RDMA_CM_JOIN_MC_ATTR_ADDRESS | RDMA_CM_JOIN_MC_ATTR_JOIN_FLAGS; -+ mc_attr.addr = test.dst_addr; -+ mc_attr.join_flags = send_only ? RDMA_MC_JOIN_FLAG_SENDONLY_FULLMEMBER -+ : RDMA_MC_JOIN_FLAG_FULLMEMBER; -+ -+ ret = rdma_join_multicast_ex(node->cma_id, &mc_attr, node); -+ - if (ret) { - perror("mckey: failure joining"); - goto err; -@@ -555,8 +564,7 @@ int main(int argc, char **argv) - { - int op, ret; - -- -- while ((op = getopt(argc, argv, "m:M:sb:c:C:S:p:")) != -1) { -+ while ((op = getopt(argc, argv, "m:M:sb:c:C:S:p:o")) != -1) { - switch (op) { - case 'm': - dst_addr = optarg; -@@ -584,6 +592,10 @@ int main(int argc, char **argv) - case 'p': - port_space = strtol(optarg, NULL, 0); - break; -+ case 'o': -+ send_only = 1; -+ break; -+ - default: - printf("usage: %s\n", argv[0]); - printf("\t-m multicast_address\n"); -@@ -596,6 +608,7 @@ int main(int argc, char **argv) - printf("\t[-S message_size]\n"); - printf("\t[-p port_space - %#x for UDP (default), " - "%#x for IPOIB]\n", RDMA_PS_UDP, RDMA_PS_IPOIB); -+ printf("\t[-o join as a send-only full-member]\n"); - exit(1); - } - } -diff --git a/librdmacm/man/mckey.1 b/librdmacm/man/mckey.1 -index a36f57ba..5e47ce5d 100644 ---- a/librdmacm/man/mckey.1 -+++ b/librdmacm/man/mckey.1 -@@ -41,6 +41,10 @@ The size of each message transferred, in bytes. This value must be smaller - than the MTU of the underlying RDMA transport, or an error will occur. - (default 100) - .TP -+\-o -+Join the multicast group as a send-only full-member. Otherwise the group is -+joined as a full-member. -+.TP - \-p port_space - The port space of the datagram communication. May be either the RDMA - UDP (0x0111) or IPoIB (0x0002) port space. (default RDMA_PS_UDP) diff --git a/SOURCES/mlx4-add-a-report-of-rss-cap.patch b/SOURCES/mlx4-add-a-report-of-rss-cap.patch deleted file mode 100644 index 3777d8d..0000000 --- a/SOURCES/mlx4-add-a-report-of-rss-cap.patch +++ /dev/null @@ -1,50 +0,0 @@ -commit 22a04b26a8c1428b87b3cc35fd256ee615172648 -Author: Guy Levi -Date: Tue Oct 17 15:23:10 2017 +0300 - - mlx4: Add a report of RSS capabilities in ibv_query_device_ex - - Report few extra RSS capabilities that were missed in previous patches. - - Signed-off-by: Guy Levi - Reviewed-by: Yishai Hadas - -diff --git a/providers/mlx4/mlx4-abi.h b/providers/mlx4/mlx4-abi.h -index 4f2132c2..c4783d29 100644 ---- a/providers/mlx4/mlx4-abi.h -+++ b/providers/mlx4/mlx4-abi.h -@@ -99,13 +99,19 @@ struct mlx4_resize_cq { - __u64 buf_addr; - }; - -+struct mlx4_rss_caps { -+ __u64 rx_hash_fields_mask; /* enum ibv_rx_hash_fields */ -+ __u8 rx_hash_function; /* enum ibv_rx_hash_function_flags */ -+ __u8 reserved[7]; -+}; -+ - struct mlx4_query_device_ex_resp { - struct ibv_query_device_resp_ex ibv_resp; - __u32 comp_mask; - __u32 response_length; - __u64 hca_core_clock_offset; - __u32 max_inl_recv_sz; -- __u32 reserved; -+ struct mlx4_rss_caps rss_caps; /* vendor data channel */ - }; - - struct mlx4_query_device_ex { -diff --git a/providers/mlx4/verbs.c b/providers/mlx4/verbs.c -index 8532882e..8a2773f9 100644 ---- a/providers/mlx4/verbs.c -+++ b/providers/mlx4/verbs.c -@@ -87,6 +87,9 @@ int mlx4_query_device_ex(struct ibv_context *context, - if (err) - return err; - -+ attr->rss_caps.rx_hash_fields_mask = resp.rss_caps.rx_hash_fields_mask; -+ attr->rss_caps.rx_hash_function = resp.rss_caps.rx_hash_function; -+ - if (resp.comp_mask & MLX4_QUERY_DEV_RESP_MASK_CORE_CLOCK_OFFSET) { - mctx->core_clock.offset = resp.hca_core_clock_offset; - mctx->core_clock.offset_valid = 1; diff --git a/SOURCES/redhat-kernel-init-libi40iw-no-longer-tech-preview.patch b/SOURCES/redhat-kernel-init-libi40iw-no-longer-tech-preview.patch deleted file mode 100644 index 540acef..0000000 --- a/SOURCES/redhat-kernel-init-libi40iw-no-longer-tech-preview.patch +++ /dev/null @@ -1,28 +0,0 @@ -commit bda9530d37c5451928f6ba2c0ddc8c14d367d581 -Author: Jarod Wilson -Date: Mon Mar 6 15:44:49 2017 -0500 - - redhat/kernel-init: libi40iw no longer tech-preview - - Signed-off-by: Jarod Wilson - -diff --git a/redhat/rdma.kernel-init b/redhat/rdma.kernel-init -index d323f830..65b7a45c 100644 ---- a/redhat/rdma.kernel-init -+++ b/redhat/rdma.kernel-init -@@ -166,11 +166,11 @@ load_hardware_modules() - load_modules usnic_verbs - RC+=$? - fi -+ if is_loaded i40e -a ! is_loaded i40iw; then -+ load_modules i40iw -+ RC+=$? -+ fi - if [ "${LOAD_TECH_PREVIEW_DRIVERS}" == "yes" ]; then -- if is_loaded i40e -a ! is_loaded i40iw; then -- load_modules i40iw -- RC+=$? -- fi - if is_loaded be2net -a ! is_loaded ocrdma; then - load_modules ocrdma - RC+=$? diff --git a/SOURCES/redhat-kernel-init-ocrdma-is-tech-preview.patch b/SOURCES/redhat-kernel-init-ocrdma-is-tech-preview.patch deleted file mode 100644 index f61533b..0000000 --- a/SOURCES/redhat-kernel-init-ocrdma-is-tech-preview.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 0fcf84cc2af776abfd0ce740e99635c8368c4d91 Mon Sep 17 00:00:00 2001 -From: Jarod Wilson -Date: Wed, 1 Feb 2017 16:05:39 -0500 -Subject: [PATCH rdma-core] redhat/kernel-init: ocrdma is tech-preview too - -Signed-off-by: Jarod Wilson ---- - redhat/rdma.kernel-init | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/redhat/rdma.kernel-init b/redhat/rdma.kernel-init -index ecfe5b57..d323f830 100644 ---- a/redhat/rdma.kernel-init -+++ b/redhat/rdma.kernel-init -@@ -162,10 +162,6 @@ load_hardware_modules() - load_modules iw_cxgb4 - RC+=$? - fi -- if is_loaded be2net -a ! is_loaded ocrdma; then -- load_modules ocrdma -- RC+=$? -- fi - if is_loaded enic -a ! is_loaded usnic_verbs; then - load_modules usnic_verbs - RC+=$? -@@ -175,6 +171,10 @@ load_hardware_modules() - load_modules i40iw - RC+=$? - fi -+ if is_loaded be2net -a ! is_loaded ocrdma; then -+ load_modules ocrdma -+ RC+=$? -+ fi - fi - return $RC - } --- -2.11.0 - diff --git a/SPECS/rdma-core.spec b/SPECS/rdma-core.spec index b6ef394..d2b81cc 100644 --- a/SPECS/rdma-core.spec +++ b/SPECS/rdma-core.spec @@ -1,6 +1,6 @@ Name: rdma-core -Version: 15 -Release: 7%{?dist} +Version: 17.2 +Release: 3%{?dist} Summary: RDMA core userspace libraries and daemons # Almost everything is licensed under the OFA dual GPLv2, 2 Clause BSD license @@ -10,22 +10,13 @@ Summary: RDMA core userspace libraries and daemons License: GPLv2 or BSD Url: https://github.com/linux-rdma/rdma-core Source: https://github.com/linux-rdma/rdma-core/releases/download/v%{version}/%{name}-%{version}.tar.gz -Patch1: redhat-kernel-init-ocrdma-is-tech-preview.patch -Patch2: redhat-kernel-init-libi40iw-no-longer-tech-preview.patch -Patch3: 0001-ibacm-incorrect-usage-of-be-byte.patch -Patch4: 0002-ibacm-incorrect-list-used-for.patch -Patch5: 0001-srp_daemon-Don-t-create-async_ev_thread-if-only-run-.patch -Patch6: 0001-srp_daemon-Remove-unsupported-systemd-configurations.patch -Patch7: 0001-srp_daemon-srp_daemon.service-should-be-started-afte.patch -Patch8: librdmacm-add-support-for-extended-join-mc.patch -Patch9: librdmacm-mckey-test-support-for-send-only-full-member.patch -Patch10: 0001-Add-a-helper-function-to-verify-64-bit-comp-mask.patch -Patch11: 0002-mlx5-Report-Multi-Packet-RQ-capabilities-through-mlx.patch -Patch12: 0003-mlx5-Allow-creation-of-a-Multi-Packet-RQ-using-direc.patch -Patch13: mlx4-add-a-report-of-rss-cap.patch -Patch14: 0001-iwpmd-fix-double-mutex-unlock.patch -Patch15: libbnxt_re_fix_lat_test_failure_in_event_mode.patch -Patch16: i40iw-autoload-breaks-suspend.patch +Patch1: 0001-redhat-kernel-init-ocrdma-is-tech-preview-too.patch +Patch2: 0002-redhat-kernel-init-libi40iw-no-longer-tech-preview.patch +Patch3: 0003-rdma-hw-modules.rules-i40iw-autoload-breaks-suspend.patch +Patch4: 0004-Revert-redhat-remove-files-that-we-no-longer-use.patch +Patch5: 0005-fix_mtu_limiting_for_ipoib.patch +Patch6: 0006-srp_daemon-Remove-unsupported-systemd-configurations.patch +Patch7: 0007-srp_daemon-srp_daemon.service-should-be-started-afte.patch BuildRequires: binutils BuildRequires: cmake >= 2.8.11 @@ -51,6 +42,9 @@ Provides: rdma = %{version}-%{release} Obsoletes: rdma < %{version}-%{release} Provides: rdma-ndd = %{version}-%{release} Obsoletes: rdma-ndd < %{version}-%{release} +# libibcm was deprecated and removed +Provides: libibcm = %{version}-%{release} +Obsoletes: libibcm < %{version}-%{release} # the ndd utility moved from infiniband-diags to rdma-core Conflicts: infiniband-diags <= 1.6.5 Requires: pciutils @@ -85,11 +79,6 @@ Provides: libibverbs-devel = %{version}-%{release} Obsoletes: libibverbs-devel < %{version}-%{release} Provides: libibverbs-devel-static = %{version}-%{release} Obsoletes: libibverbs-devel-static < %{version}-%{release} -Requires: libibcm = %{version}-%{release} -Provides: libibcm-devel = %{version}-%{release} -Obsoletes: libibcm-devel < %{version}-%{release} -Provides: libibcm-static = %{version}-%{release} -Obsoletes: libibcm-static < %{version}-%{release} Requires: libibumad = %{version}-%{release} Provides: libibumad-devel = %{version}-%{release} Obsoletes: libibumad-devel < %{version}-%{release} @@ -123,6 +112,10 @@ Provides: libi40iw-devel-static = %{version}-%{release} Obsoletes: libi40iw-devel-static < %{version}-%{release} Provides: libmthca-static = %{version}-%{release} Obsoletes: libmthca-static < %{version}-%{release} +Provides: libehca-devel = %{version}-%{release} +Obsoletes: libehca-devel < %{version}-%{release} +Provides: libehca-static = %{version}-%{release} +Obsoletes: libehca-static < %{version}-%{release} %description devel RDMA core development libraries and headers. @@ -156,6 +149,8 @@ Provides: librxe = %{version}-%{release} Obsoletes: librxe < %{version}-%{release} Provides: libusnic_verbs = %{version}-%{release} Obsoletes: libusnic_verbs < %{version}-%{release} +Provides: libehca = %{version}-%{release} +Obsoletes: libehca < %{version}-%{release} %description -n libibverbs libibverbs is a library that allows userspace processes to use RDMA @@ -220,15 +215,6 @@ Requires: %{name}%{?_isa} = %{version}-%{release} iwpmd provides a userspace service for iWarp drivers to claim tcp ports through the standard socket interface. -%package -n libibcm -Summary: Userspace InfiniBand Connection Manager -Requires: %{name}%{?_isa} = %{version}-%{release} -Requires: libibverbs%{?_isa} = %{version}-%{release} - -%description -n libibcm -libibcm provides a userspace library that handles the majority of the low -level work required to open an RDMA connection between two machines. - %package -n libibumad Summary: OpenFabrics Alliance InfiniBand umad (userspace management datagram) library Requires: %{name}%{?_isa} = %{version}-%{release} @@ -279,15 +265,6 @@ discover and use SCSI devices via the SCSI RDMA Protocol over InfiniBand. %patch5 -p1 %patch6 -p1 %patch7 -p1 -%patch8 -p1 -%patch9 -p1 -%patch10 -p1 -%patch11 -p1 -%patch12 -p1 -%patch13 -p1 -%patch14 -p1 -%patch15 -p1 -%patch16 -p1 %build @@ -325,7 +302,6 @@ mkdir -p %{buildroot}/%{_sysconfdir}/rdma # Red Hat specific glue %global dracutlibdir %{_prefix}/lib/dracut %global sysmodprobedir %{_prefix}/lib/modprobe.d -mkdir -p %{buildroot}/%{_sysconfdir}/sysconfig/network-scripts mkdir -p %{buildroot}%{_sysconfdir}/udev/rules.d mkdir -p %{buildroot}%{_libexecdir} mkdir -p %{buildroot}%{_udevrulesdir} @@ -357,9 +333,6 @@ rm -rf %{buildroot}/%{_initrddir}/ %post -n libibverbs -p /sbin/ldconfig %postun -n libibverbs -p /sbin/ldconfig -%post -n libibcm -p /sbin/ldconfig -%postun -n libibcm -p /sbin/ldconfig - %post -n libibumad -p /sbin/ldconfig %postun -n libibumad -p /sbin/ldconfig @@ -444,6 +417,7 @@ rm -rf %{buildroot}/%{_initrddir}/ %config(noreplace) %{_sysconfdir}/libibverbs.d/*.driver %doc %{_docdir}/%{name}-%{version}/libibverbs.md %doc %{_docdir}/%{name}-%{version}/rxe.md +%doc %{_docdir}/%{name}-%{version}/tag_matching.md %{_bindir}/rxe_cfg %{_mandir}/man7/rxe* %ifnarch s390 @@ -477,10 +451,6 @@ rm -rf %{buildroot}/%{_initrddir}/ %{_mandir}/man8/iwpmd.* %{_mandir}/man5/iwpmd.* -%files -n libibcm -%{_libdir}/libibcm*.so.* -%doc %{_docdir}/%{name}-%{version}/libibcm.md - %files -n libibumad %{_libdir}/libibumad*.so.* @@ -535,11 +505,46 @@ rm -rf %{buildroot}/%{_initrddir}/ %doc %{_docdir}/%{name}-%{version}/ibsrpdm.md %changelog +* Tue Jun 26 2018 Jarod Wilson 17.2-3 +- Restore RHEL7 systemd compat patches for srp_daemon +- Resolves: rhbz#1595019 + +* Wed Jun 20 2018 Jarod Wilson 17.2-2 +- Restore SysV Initscripts ib ifup and ifdown helpers +- Adjust MTU limit for IPoIB in datagram mode via ifup-ib +- Resolves: rhbz#1593426 +- Resolves: rhbz#1593334 + +* Fri Jun 15 2018 Jarod Wilson 17.2-1 +- Rebase to upstream rdma-core v17.2 stable release + +* Wed Jun 13 2018 Jarod Wilson 17.1-3 +- Grab latest stable-v17 fixes from upstream +- Fix Provides/Obsoletes on removed libibcm +- Fix Provides/Obsoletes on removed libehca +- Straighten out SW parsing feature support for DPDK +- Fix mlx5 rate-limiting support +- Resolves: rhbz#1588096 +- Resovles: rhbz#1534856 +- Resolves: rhbz#1589525 + +* Thu May 03 2018 Jarod Wilson 17.1-2 +- Match kernel ABI with kernel v4.17 for 32-on-64bit compatibility +- Resolves: rhbz#1573884 + +* Mon Apr 16 2018 Jarod Wilson 17.1-1 +- Rebase to upstream rdma-core v17.1 stable release +- No more libibcm or ib sysv initscripts +- Resolves: rhbz#1515647 +- Resolves: rhbz#1517208 +- Resolves: rhbz#1523201 +- Resolves: rhbz#1541751 + * Tue Feb 27 2018 Jarod Wilson 15-7 - i40iw: revoke systemd udev rules auto-load on i40e hardware, due to causing problems with suspend and resume, and fall back to load via systemd rdma initscript. -- Resolves: rhbz#1568325 +- Resolves: rhbz#1561566 * Mon Feb 19 2018 Jarod Wilson 15-6 - libbnxt_re: fix lat test failure in event mode