SIF related libibverbs patches
cover SIF related libibverbs patches
This is the initial patch series for the work of upstreaming the driver and
user level library for SIF, the new Oracle HCA. My philosophy here has been to make the initial patches as little intrusive as possible, and rather consolidate later. For instance patch 1 could have just changed the signature of ibv_cmd_create_ah but that would have required a simultaneous change of all vendor libraries, which is
much easier to accomplish if they all end up in the same repository...
These patches are needed to support SIF - Oracle's new Infiniband HCA stack from user mode. A corresponding patch set for the kernel will follow shortly.
I have been back and forth with whether or not an ABI version update is required/desired for the (bugfix) patch 2 in this series, which will be followed by a corresponding patch at the kernel level. This should ideally have been a backward compatible change since it does not really logically change the APIs, but because the kernel checks for exact match of sizes of the cmd structures instead of just accepting the expected size even if the provided size is larger, both sides need to change simultaneously in this case to avoid breaking (ibv_reg_mr). In fact, looking at the last ABI change it seems running with version 5 of the ABI on the kernel side is supported, but it will still fail due to the same reason.
No changes are needed for the vendor libraries, except that they need to be rebuilt against the changed kern-abi.h file due to the same size check in the kernel.
We need this patch because we have a vendor specific extension to the ibv_reg_mr response, which breaks if alignment criterias are violated.
This patch 2 and the corresponding kernel patch does not update the ABI version, let me know what you think, if an update is desired, and what MIN and MAX versions we would want to set.
Patch set:
Knut Omang (3):
Add new call ibv_cmd_create_ah_ex which supports extra parameters Add padding to get proper end alignment of ibv_reg_mr_resp Provide remote XRC SRQ number in kernel post_send.
include/infiniband/driver.h | 4 ++++ include/infiniband/kern-abi.h | 2 ++ src/cmd.c | 55 ++++++++++++++++++++++++++----------------- src/libibverbs.map | 1 + 4 files changed, 40 insertions(+), 22 deletions(-)
--
2.5.5
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1472713193-22397-1-git-send-email-knut.omang-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org
PATCH 1/3 Add new call ibv_cmd_create_ah_ex which supports extra parameters
The original call ibv_cmd_create_ah does not allow vendor specific request or response parameters to be defined and passed through to kernel space.
To keep backward compatibility, introduce a new extended call which accepts cmd and resp parameters similar to other parts of the API. Reimplement the old call to just use the new extended call.
--- include/infiniband/driver.h | 4 ++++ src/cmd.c | 50 +++++++++++++++++++++++++-------------------- src/libibverbs.map | 1 + 3 files changed, 33 insertions(+), 22 deletions(-)
include/infiniband/driver.h +4 -0
@@ -229,6 +229,10 @@ int ibv_cmd_post_srq_recv(struct ibv_srq *srq, struct ibv_recv_wr *wr, struct ibv_recv_wr **bad_wr);int ibv_cmd_create_ah (struct ibv_pd *pd,struct ibv_ah *ah,struct ibv_ah_attr *attr); +int ibv_cmd_create_ah_ex (struct ibv_pd *pd,struct ibv_ah *ah, +struct ibv_ah_attr *attr, +struct ibv_create_ah *cmd,size_t cmd_size, +struct ibv_create_ah_resp *resp,size_t resp_size);int ibv_cmd_destroy_ah (struct ibv_ah *ah);int ibv_cmd_attach_mcast (struct ibv_qp *qp,const union ibv_gid *gid,uint16_t lid);int ibv_cmd_detach_mcast (struct ibv_qp *qp,const union ibv_gid *gid,uint16_t lid);
src/cmd.c +28 -22
66 lines not on this page · raw message
src/libibverbs.map +1 -0
@@ -64,6 +64,7 @@ IBVERBS_1.0 { ibv_cmd_post_recv; ibv_cmd_post_srq_recv; ibv_cmd_create_ah; + ibv_cmd_create_ah_ex; ibv_cmd_destroy_ah; ibv_cmd_attach_mcast; ibv_cmd_detach_mcast;
Signature · 6 lines
2.5.5 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1472713193-22397-2-git-send-email-knut.omang-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org
Re: [PATCH libibverbs 1/3] Add new call ibv_cmd_create_ah_ex which supports extra parameters
Quoted 52 lines · Knut Omang
The original call
ibv_cmd_create_ahdoes not allow vendor specific request or response parameters to be defined and passed through to kernel space.To keep backward compatibility, introduce a new extended call which accepts cmd and resp parameters similar to other parts of the API. Reimplement the old call to just use the new extended call.
Signed-off-by Knut Omang <[email protected]>Reviewed-by Mukesh Kacker <[email protected]>--- include/infiniband/driver.h | 4 ++++ src/cmd.c | 50 +++++++++++++++++++++++++-------------------- src/libibverbs.map | 1 + 3 files changed, 33 insertions(+), 22 deletions(-)include/infiniband/driver.h +4
-0@@ -229,6 +229,10 @@ int ibv_cmd_post_srq_recv(struct ibv_srq *srq, struct ibv_recv_wr *wr, struct ibv_recv_wr **bad_wr);int ibv_cmd_create_ah (struct ibv_pd *pd,struct ibv_ah *ah,struct ibv_ah_attr *attr); +int ibv_cmd_create_ah_ex (struct ibv_pd *pd,struct ibv_ah *ah, +struct ibv_ah_attr *attr, +struct ibv_create_ah *cmd,size_t cmd_size, +struct ibv_create_ah_resp *resp,size_t resp_size);int ibv_cmd_destroy_ah (struct ibv_ah *ah);int ibv_cmd_attach_mcast (struct ibv_qp *qp,const union ibv_gid *gid,uint16_t lid);int ibv_cmd_detach_mcast (struct ibv_qp *qp,const union ibv_gid *gid,uint16_t lid);src/cmd.c +3
-10@@ -1463,38 +1463,44 @@ int ibv_cmd_post_srq_recv(struct ibv_srq *srq, struct ibv_recv_wr *wr,return ret; } -int ibv_cmd_create_ah (struct ibv_pd *pd,struct ibv_ah *ah, -struct ibv_ah_attr *attr) +int ibv_cmd_create_ah_ex (struct ibv_pd *pd,struct ibv_ah *ah,struct ibv_ah_attr *attr, +struct ibv_create_ah *cmd,size_t cmd_size, +struct ibv_create_ah_resp *resp,size_t resp_size) { -struct ibv_create_ah cmd; -struct ibv_create_ah_resp resp; - -IBV_INIT_CMD_RESP (&cmd,sizeof cmd,CREATE_AH , &resp,sizeof resp); - cmd.user_handle = (uintptr_t ) ah; - cmd.pd_handle = pd->handle; - cmd.attr.dlid = attr->dlid; - cmd.attr.sl = attr->sl;
src/cmd.c int ibv_cmd_post_srq_recv(struct ibv_srq *srq, struct ibv_recv_wr *wr, · line 1470
Quoted 10 lines
src/cmd.c +1
-9- cmd.attr.src_path_bits = attr->src_path_bits; - cmd.attr.static_rate = attr->static_rate; - cmd.attr.is_global = attr->is_global; - cmd.attr.port_num = attr->port_num; - cmd.attr.grh.flow_label = attr->grh.flow_label; - cmd.attr.grh.sgid_index = attr->grh.sgid_index; - cmd.attr.grh.hop_limit = attr->grh.hop_limit; - cmd.attr.grh.traffic_class = attr->grh.traffic_class; -memcpy (cmd.attr.grh.dgid, attr->grh.dgid.raw,16 ); +IBV_INIT_CMD_RESP (cmd, cmd_size,CREATE_AH , resp, resp_size);
You should start with a patch extending the kernel part while supporting backwards compatibility, later on when patch applied come with a matching user space patch for a review.
In addition, if you supply an extended command you should work with the extended macros for issuing a command to fully enable future extensions (e.g IBV_INIT_CMD_RESP_EX_V) and with a specific EX command as done in other cases (e.g CREATE_QP_EX).
Quoted 45 lines
src/cmd.c +24
-3+ cmd->user_handle = (uintptr_t ) ah; + cmd->pd_handle = pd->handle; + cmd->attr.dlid = attr->dlid; + cmd->attr.sl = attr->sl; + cmd->attr.src_path_bits = attr->src_path_bits; + cmd->attr.static_rate = attr->static_rate; + cmd->attr.is_global = attr->is_global; + cmd->attr.port_num = attr->port_num; + cmd->attr.grh.flow_label = attr->grh.flow_label; + cmd->attr.grh.sgid_index = attr->grh.sgid_index; + cmd->attr.grh.hop_limit = attr->grh.hop_limit; + cmd->attr.grh.traffic_class = attr->grh.traffic_class; +memcpy (cmd->attr.grh.dgid, attr->grh.dgid.raw,16 ); -if (write (pd->context->cmd_fd, &cmd,sizeof cmd) !=sizeof cmd) +if (write (pd->context->cmd_fd, cmd, cmd_size) != cmd_size)return errno; - (void )VALGRIND_MAKE_MEM_DEFINED (&resp,sizeof resp); + (void )VALGRIND_MAKE_MEM_DEFINED (resp,sizeof *resp); - ah->handle = resp.handle; + ah->handle = resp->handle; ah->context = pd->context;return 0 ; } +int ibv_cmd_create_ah (struct ibv_pd *pd,struct ibv_ah *ah, +struct ibv_ah_attr *attr) +{ +struct ibv_create_ah cmd; +struct ibv_create_ah_resp resp; +return ibv_cmd_create_ah_ex (pd, ah, attr, &cmd,sizeof (cmd), &resp,sizeof (resp)); +} +int ibv_cmd_destroy_ah (struct ibv_ah *ah) {struct ibv_destroy_ah cmd;src/libibverbs.map +0
-0
src/libibverbs.map IBVERBS_1.0 { · line 70
Quoted 7 lines
src/libibverbs.map +1
-0@@ -64,6 +64,7 @@ IBVERBS_1.0 { ibv_cmd_post_recv; ibv_cmd_post_srq_recv; ibv_cmd_create_ah; + ibv_cmd_create_ah_ex; ibv_cmd_destroy_ah; ibv_cmd_attach_mcast; ibv_cmd_detach_mcast;
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 09e67035-0c8a-9b44-fa84-08413dd6ac46-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org
Re: [PATCH libibverbs 1/3] Add new call ibv_cmd_create_ah_ex which supports extra parameters
Quoted 59 lines · Yishai Hadas
Quoted 58 lines · Knut Omang
The original call
ibv_cmd_create_ahdoes not allow vendor specific request or response parameters to be defined and passed through to kernel space.To keep backward compatibility, introduce a new extended call which accepts cmd and resp parameters similar to other parts of the API. Reimplement the old call to just use the new extended call.
Signed-off-by Knut Omang <[email protected]>Reviewed-by Mukesh Kacker <[email protected]>---
include/infiniband/driver.h | 4 ++++
src/cmd.c | 50 +++++++++++++++++++++++++-------------------- src/libibverbs.map | 1 +3 files changed, 33 insertions(+), 22 deletions(-)include/infiniband/driver.h +4
-0@@ -229,6 +229,10 @@ int ibv_cmd_post_srq_recv(struct ibv_srq *srq, struct ibv_recv_wr *wr, struct ibv_recv_wr **bad_wr); int ibv_cmd_create_ah(struct ibv_pd *pd, struct ibv_ah *ah, struct ibv_ah_attr *attr); +int ibv_cmd_create_ah_ex (struct ibv_pd *pd,struct ibv_ah *ah, +struct ibv_ah_attr *attr, +struct ibv_create_ah *cmd,size_t cmd_size, +struct ibv_create_ah_resp *resp,size_t resp_size); int ibv_cmd_destroy_ah(struct ibv_ah *ah); int ibv_cmd_attach_mcast(struct ibv_qp *qp, const union ibv_gid *gid, uint16_t lid); int ibv_cmd_detach_mcast(struct ibv_qp *qp, const union ibv_gid *gid, uint16_t lid);src/cmd.c +3
-15@@ -1463,38 +1463,44 @@ int ibv_cmd_post_srq_recv(struct ibv_srq *srq, struct ibv_recv_wr *wr, return ret; } -int ibv_cmd_create_ah (struct ibv_pd *pd,struct ibv_ah *ah, - struct ibv_ah_attr *attr) +int ibv_cmd_create_ah_ex (struct ibv_pd *pd,struct ibv_ah *ah,struct ibv_ah_attr *attr, + struct ibv_create_ah *cmd, size_t cmd_size, + struct ibv_create_ah_resp *resp, size_t resp_size) { - struct ibv_create_ah cmd; -struct ibv_create_ah_resp resp; - -IBV_INIT_CMD_RESP (&cmd,sizeof cmd,CREATE_AH , &resp,sizeof resp); - cmd.user_handle = (uintptr_t) ah; - cmd.pd_handle = pd->handle; - cmd.attr.dlid = attr->dlid; - cmd.attr.sl = attr->sl; - cmd.attr.src_path_bits = attr->src_path_bits; - cmd.attr.static_rate = attr->static_rate; - cmd.attr.is_global = attr->is_global; - cmd.attr.port_num = attr->port_num; - cmd.attr.grh.flow_label = attr->grh.flow_label;
Quoted 8 lines
src/cmd.c int ibv_cmd_post_srq_recv(struct ibv_srq *srq, struct ibv_recv_wr *wr, · line 1470
Quoted 5 lines
src/cmd.c +1
-4- cmd.attr.grh.sgid_index = attr->grh.sgid_index; - cmd.attr.grh.hop_limit = attr->grh.hop_limit; - cmd.attr.grh.traffic_class = attr->grh.traffic_class; -memcpy (cmd.attr.grh.dgid, attr->grh.dgid.raw,16 ); +IBV_INIT_CMD_RESP (cmd, cmd_size,CREATE_AH , resp, resp_size);You should start with a patch extending the kernel part while supporting backwards compatibility, later on when patch applied come with a matching user space patch for a review.
Coming very soon, I realize that the order should have been the opposite.
Quoted 4 lines
In addition, if you supply an extended command you should work with the extended macros for issuing a command to fully enable future extensions (e.g
IBV_INIT_CMD_RESP_EX_V) and with a specific EX command as done in other cases (e.gCREATE_QP_EX).
Hmm - I see - I wrote this patch long before that EX_V logic got added
- I can revisit.
Thanks for the quick reviews,
Knut
Quoted 44 lines
Quoted 44 lines
src/cmd.c +24
-3+ cmd->user_handle = (uintptr_t) ah; + cmd->pd_handle = pd->handle; + cmd->attr.dlid = attr->dlid; + cmd->attr.sl = attr->sl; + cmd->attr.src_path_bits = attr->src_path_bits; + cmd->attr.static_rate = attr->static_rate; + cmd->attr.is_global = attr->is_global; + cmd->attr.port_num = attr->port_num; + cmd->attr.grh.flow_label = attr->grh.flow_label; + cmd->attr.grh.sgid_index = attr->grh.sgid_index; + cmd->attr.grh.hop_limit = attr->grh.hop_limit; + cmd->attr.grh.traffic_class = attr->grh.traffic_class; +memcpy (cmd->attr.grh.dgid, attr->grh.dgid.raw,16 ); -if (write (pd->context->cmd_fd, &cmd,sizeof cmd) !=sizeof cmd) +if (write (pd->context->cmd_fd, cmd, cmd_size) != cmd_size) return errno; - (void )VALGRIND_MAKE_MEM_DEFINED (&resp,sizeof resp); + (void )VALGRIND_MAKE_MEM_DEFINED (resp,sizeof *resp); - ah->handle = resp.handle; + ah->handle = resp->handle; ah->context = pd->context; return 0; } +int ibv_cmd_create_ah (struct ibv_pd *pd,struct ibv_ah *ah, + struct ibv_ah_attr *attr) +{ + struct ibv_create_ah cmd; +struct ibv_create_ah_resp resp; +return ibv_cmd_create_ah_ex (pd, ah, attr, &cmd,sizeof (cmd), &resp,sizeof (resp)); +} + int ibv_cmd_destroy_ah(struct ibv_ah *ah) { struct ibv_destroy_ah cmd;src/libibverbs.map +0
-0@@ -64,6 +64,7 @@ IBVERBS_1.0 {
Quoted 8 lines
src/libibverbs.map IBVERBS_1.0 { · line 70
Quoted 8 lines
src/libibverbs.map +1
-0ibv_cmd_post_recv; ibv_cmd_post_srq_recv; ibv_cmd_create_ah; + ibv_cmd_create_ah_ex; ibv_cmd_destroy_ah; ibv_cmd_attach_mcast; ibv_cmd_detach_mcast;
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH libibverbs 1/3] Add new call ibv_cmd_create_ah_ex which supports extra parameters
In reply to a message not in the archiveQuoted 68 lines · Yishai Hadas
Quoted 53 lines · Knut Omang
The original call
ibv_cmd_create_ahdoes not allow vendor specific request or response parameters to be defined and passed through to kernel space.To keep backward compatibility, introduce a new extended call which accepts cmd and resp parameters similar to other parts of the API. Reimplement the old call to just use the new extended call.
Signed-off-by Knut Omang <[email protected]>Reviewed-by Mukesh Kacker <[email protected]>---
include/infiniband/driver.h | 4 ++++
src/cmd.c | 50 +++++++++++++++++++++++++-------------------- src/libibverbs.map | 1 +3 files changed, 33 insertions(+), 22 deletions(-)include/infiniband/driver.h +4
-0@@ -229,6 +229,10 @@ int ibv_cmd_post_srq_recv(struct ibv_srq *srq, struct ibv_recv_wr *wr, struct ibv_recv_wr **bad_wr); int ibv_cmd_create_ah(struct ibv_pd *pd, struct ibv_ah *ah, struct ibv_ah_attr *attr); +int ibv_cmd_create_ah_ex (struct ibv_pd *pd,struct ibv_ah *ah, +struct ibv_ah_attr *attr, +struct ibv_create_ah *cmd,size_t cmd_size, +struct ibv_create_ah_resp *resp,size_t resp_size); int ibv_cmd_destroy_ah(struct ibv_ah *ah); int ibv_cmd_attach_mcast(struct ibv_qp *qp, const union ibv_gid *gid, uint16_t lid); int ibv_cmd_detach_mcast(struct ibv_qp *qp, const union ibv_gid *gid, uint16_t lid);src/cmd.c +3
-10@@ -1463,38 +1463,44 @@ int ibv_cmd_post_srq_recv(struct ibv_srq *srq, struct ibv_recv_wr *wr, return ret; } -int ibv_cmd_create_ah (struct ibv_pd *pd,struct ibv_ah *ah, - struct ibv_ah_attr *attr) +int ibv_cmd_create_ah_ex (struct ibv_pd *pd,struct ibv_ah *ah,struct ibv_ah_attr *attr, + struct ibv_create_ah *cmd, size_t cmd_size, + struct ibv_create_ah_resp *resp, size_t resp_size) { - struct ibv_create_ah cmd; -struct ibv_create_ah_resp resp; - -IBV_INIT_CMD_RESP (&cmd,sizeof cmd,CREATE_AH , &resp,sizeof resp); - cmd.user_handle = (uintptr_t) ah; - cmd.pd_handle = pd->handle; - cmd.attr.dlid = attr->dlid; - cmd.attr.sl = attr->sl;src/cmd.c int ibv_cmd_post_srq_recv(struct ibv_srq *srq, struct ibv_recv_wr *wr, · line 1470
Quoted 10 lines
src/cmd.c +1
-9- cmd.attr.src_path_bits = attr->src_path_bits; - cmd.attr.static_rate = attr->static_rate; - cmd.attr.is_global = attr->is_global; - cmd.attr.port_num = attr->port_num; - cmd.attr.grh.flow_label = attr->grh.flow_label; - cmd.attr.grh.sgid_index = attr->grh.sgid_index; - cmd.attr.grh.hop_limit = attr->grh.hop_limit; - cmd.attr.grh.traffic_class = attr->grh.traffic_class; -memcpy (cmd.attr.grh.dgid, attr->grh.dgid.raw,16 ); +IBV_INIT_CMD_RESP (cmd, cmd_size,CREATE_AH , resp, resp_size);You should start with a patch extending the kernel part while supporting backwards compatibility, later on when patch applied come with a matching user space patch for a review.
Quoted 4 lines
In addition, if you supply an extended command you should work with the extended macros for issuing a command to fully enable future extensions (e.g
IBV_INIT_CMD_RESP_EX_V) and with a specific EX command as done in other cases (e.gCREATE_QP_EX).
Having looked at the details, I tend to think that what I am adding here is not an extended command, it is more of a fix for a missing feature of the original ibv_cmd_create_ah, and the only reason for introducing a new call is to maintain backward comp. Introducing additional complexity with the kernel involved for something that is a pure user level side seems somewhat overkill.
Maybe I can rename it to ibv_cmd_create_ah_v2 (or v3?) to avoid associating it with the extended command set?
As Jason and I discussed in another subthread here, we can consolidate this into a single command once we get to a common library,
as this is all internal to the rdma user level stack.
Ok?
Knut
Quoted 49 lines
Quoted 49 lines
src/cmd.c +24
-3+ cmd->user_handle = (uintptr_t) ah; + cmd->pd_handle = pd->handle; + cmd->attr.dlid = attr->dlid; + cmd->attr.sl = attr->sl; + cmd->attr.src_path_bits = attr->src_path_bits; + cmd->attr.static_rate = attr->static_rate; + cmd->attr.is_global = attr->is_global; + cmd->attr.port_num = attr->port_num; + cmd->attr.grh.flow_label = attr->grh.flow_label; + cmd->attr.grh.sgid_index = attr->grh.sgid_index; + cmd->attr.grh.hop_limit = attr->grh.hop_limit; + cmd->attr.grh.traffic_class = attr->grh.traffic_class; +memcpy (cmd->attr.grh.dgid, attr->grh.dgid.raw,16 ); -if (write (pd->context->cmd_fd, &cmd,sizeof cmd) !=sizeof cmd) +if (write (pd->context->cmd_fd, cmd, cmd_size) != cmd_size) return errno; - (void )VALGRIND_MAKE_MEM_DEFINED (&resp,sizeof resp); + (void )VALGRIND_MAKE_MEM_DEFINED (resp,sizeof *resp); - ah->handle = resp.handle; + ah->handle = resp->handle; ah->context = pd->context; return 0; } +int ibv_cmd_create_ah (struct ibv_pd *pd,struct ibv_ah *ah, + struct ibv_ah_attr *attr) +{ + struct ibv_create_ah cmd; +struct ibv_create_ah_resp resp; +return ibv_cmd_create_ah_ex (pd, ah, attr, &cmd,sizeof (cmd), &resp,sizeof (resp)); +} + int ibv_cmd_destroy_ah(struct ibv_ah *ah) { struct ibv_destroy_ah cmd;src/libibverbs.map +1
-0@@ -64,6 +64,7 @@ IBVERBS_1.0 { ibv_cmd_post_recv; ibv_cmd_post_srq_recv; ibv_cmd_create_ah; + ibv_cmd_create_ah_ex;
Quoted 8 lines
src/libibverbs.map IBVERBS_1.0 { · line 70
Quoted 4 lines
src/libibverbs.map +0
-0ibv_cmd_destroy_ah; ibv_cmd_attach_mcast; ibv_cmd_detach_mcast;--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [PATCH libibverbs 1/3] Add new call ibv_cmd_create_ah_ex which supports extra parameters
Quoted 69 lines · Knut Omang
Quoted 68 lines · Yishai Hadas
Quoted 53 lines · Knut Omang
The original call
ibv_cmd_create_ahdoes not allow vendor specific request or response parameters to be defined and passed through to kernel space.To keep backward compatibility, introduce a new extended call which accepts cmd and resp parameters similar to other parts of the API. Reimplement the old call to just use the new extended call.
Signed-off-by Knut Omang <[email protected]>Reviewed-by Mukesh Kacker <[email protected]>--- include/infiniband/driver.h | 4 ++++ src/cmd.c | 50 +++++++++++++++++++++++++-------------------- src/libibverbs.map | 1 + 3 files changed, 33 insertions(+), 22 deletions(-)include/infiniband/driver.h +4
-0@@ -229,6 +229,10 @@ int ibv_cmd_post_srq_recv(struct ibv_srq *srq, struct ibv_recv_wr *wr, struct ibv_recv_wr **bad_wr);int ibv_cmd_create_ah (struct ibv_pd *pd,struct ibv_ah *ah,struct ibv_ah_attr *attr); +int ibv_cmd_create_ah_ex (struct ibv_pd *pd,struct ibv_ah *ah, +struct ibv_ah_attr *attr, +struct ibv_create_ah *cmd,size_t cmd_size, +struct ibv_create_ah_resp *resp,size_t resp_size);int ibv_cmd_destroy_ah (struct ibv_ah *ah);int ibv_cmd_attach_mcast (struct ibv_qp *qp,const union ibv_gid *gid,uint16_t lid);int ibv_cmd_detach_mcast (struct ibv_qp *qp,const union ibv_gid *gid,uint16_t lid);src/cmd.c +3
-10@@ -1463,38 +1463,44 @@ int ibv_cmd_post_srq_recv(struct ibv_srq *srq, struct ibv_recv_wr *wr,return ret; } -int ibv_cmd_create_ah (struct ibv_pd *pd,struct ibv_ah *ah, -struct ibv_ah_attr *attr) +int ibv_cmd_create_ah_ex (struct ibv_pd *pd,struct ibv_ah *ah,struct ibv_ah_attr *attr, +struct ibv_create_ah *cmd,size_t cmd_size, +struct ibv_create_ah_resp *resp,size_t resp_size) { -struct ibv_create_ah cmd; -struct ibv_create_ah_resp resp; - -IBV_INIT_CMD_RESP (&cmd,sizeof cmd,CREATE_AH , &resp,sizeof resp); - cmd.user_handle = (uintptr_t ) ah; - cmd.pd_handle = pd->handle; - cmd.attr.dlid = attr->dlid; - cmd.attr.sl = attr->sl;src/cmd.c int ibv_cmd_post_srq_recv(struct ibv_srq *srq, struct ibv_recv_wr *wr, · line 1470
Quoted 10 lines
src/cmd.c +1
-9- cmd.attr.src_path_bits = attr->src_path_bits; - cmd.attr.static_rate = attr->static_rate; - cmd.attr.is_global = attr->is_global; - cmd.attr.port_num = attr->port_num; - cmd.attr.grh.flow_label = attr->grh.flow_label; - cmd.attr.grh.sgid_index = attr->grh.sgid_index; - cmd.attr.grh.hop_limit = attr->grh.hop_limit; - cmd.attr.grh.traffic_class = attr->grh.traffic_class; -memcpy (cmd.attr.grh.dgid, attr->grh.dgid.raw,16 ); +IBV_INIT_CMD_RESP (cmd, cmd_size,CREATE_AH , resp, resp_size);You should start with a patch extending the kernel part while supporting backwards compatibility, later on when patch applied come with a matching user space patch for a review.
Quoted 8 lines
Quoted 4 lines
In addition, if you supply an extended command you should work with the extended macros for issuing a command to fully enable future extensions (e.g
IBV_INIT_CMD_RESP_EX_V) and with a specific EX command as done in other cases (e.gCREATE_QP_EX).Having looked at the details, I tend to think that what I am adding here is not an extended command, it is more of a fix for a missing feature of the original
ibv_cmd_create_ah,
You want to extend the user->kernel API to get some extra data while maintaining BW compatibility. Usually you need for that an extra command which better be extended from day one. Can it be done in the kernel side without a new command ? please send pointer to the matching kernel patch.
Quoted 2 lines
Maybe I can rename it to
ibv_cmd_create_ah_v2(or v3?) to avoid associating it with the extended command set?
In case you need a new command, let's add it in an extended mode so that future extensions will use it instead of having later v3/v4, etc.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 50c8e0ab-f7f4-85b1-09f7-a930ad445ee0-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org
Re: [PATCH libibverbs 1/3] Add new call ibv_cmd_create_ah_ex which supports extra parameters
Quoted 75 lines · Yishai Hadas
Quoted 74 lines · Knut Omang
Quoted 72 lines · Yishai Hadas
Quoted 53 lines · Knut Omang
The original call
ibv_cmd_create_ahdoes not allow vendor specific request or response parameters to be defined and passed through to kernel space.To keep backward compatibility, introduce a new extended call which accepts cmd and resp parameters similar to other parts of the API. Reimplement the old call to just use the new extended call.
Signed-off-by Knut Omang <[email protected]>Reviewed-by Mukesh Kacker <[email protected]>--- include/infiniband/driver.h | 4 ++++ src/cmd.c | 50 +++++++++++++++++++++++++-------------------- src/libibverbs.map | 1 + 3 files changed, 33 insertions(+), 22 deletions(-)include/infiniband/driver.h +4
-0@@ -229,6 +229,10 @@ int ibv_cmd_post_srq_recv(struct ibv_srq *srq, struct ibv_recv_wr *wr, struct ibv_recv_wr **bad_wr);int ibv_cmd_create_ah (struct ibv_pd *pd,struct ibv_ah *ah,struct ibv_ah_attr *attr); +int ibv_cmd_create_ah_ex (struct ibv_pd *pd,struct ibv_ah *ah, +struct ibv_ah_attr *attr, +struct ibv_create_ah *cmd,size_t cmd_size, +struct ibv_create_ah_resp *resp,size_t resp_size);int ibv_cmd_destroy_ah (struct ibv_ah *ah);int ibv_cmd_attach_mcast (struct ibv_qp *qp,const union ibv_gid *gid,uint16_t lid);int ibv_cmd_detach_mcast (struct ibv_qp *qp,const union ibv_gid *gid,uint16_t lid);src/cmd.c +3
-10@@ -1463,38 +1463,44 @@ int ibv_cmd_post_srq_recv(struct ibv_srq *srq, struct ibv_recv_wr *wr,return ret; } -int ibv_cmd_create_ah (struct ibv_pd *pd,struct ibv_ah *ah, -struct ibv_ah_attr *attr) +int ibv_cmd_create_ah_ex (struct ibv_pd *pd,struct ibv_ah *ah,struct ibv_ah_attr *attr, +struct ibv_create_ah *cmd,size_t cmd_size, +struct ibv_create_ah_resp *resp,size_t resp_size) { -struct ibv_create_ah cmd; -struct ibv_create_ah_resp resp; - -IBV_INIT_CMD_RESP (&cmd,sizeof cmd,CREATE_AH , &resp,sizeof resp); - cmd.user_handle = (uintptr_t ) ah; - cmd.pd_handle = pd->handle; - cmd.attr.dlid = attr->dlid; - cmd.attr.sl = attr->sl;src/cmd.c int ibv_cmd_post_srq_recv(struct ibv_srq *srq, struct ibv_recv_wr *wr, · line 1470
Quoted 10 lines
src/cmd.c +1
-9- cmd.attr.src_path_bits = attr->src_path_bits; - cmd.attr.static_rate = attr->static_rate; - cmd.attr.is_global = attr->is_global; - cmd.attr.port_num = attr->port_num; - cmd.attr.grh.flow_label = attr->grh.flow_label; - cmd.attr.grh.sgid_index = attr->grh.sgid_index; - cmd.attr.grh.hop_limit = attr->grh.hop_limit; - cmd.attr.grh.traffic_class = attr->grh.traffic_class; -memcpy (cmd.attr.grh.dgid, attr->grh.dgid.raw,16 ); +IBV_INIT_CMD_RESP (cmd, cmd_size,CREATE_AH , resp, resp_size);You should start with a patch extending the kernel part while supporting backwards compatibility, later on when patch applied come with a matching user space patch for a review.
In addition, if you supply an extended command you should work with the extended macros for issuing a command to fully enable future extensions (e.g
IBV_INIT_CMD_RESP_EX_V) and with a specific EX command as done in other cases (e.gCREATE_QP_EX).
Quoted 8 lines
Quoted 3 lines
Having looked at the details, I tend to think that what I am adding here is not an extended command, it is more of a fix for a missing feature of the original
ibv_cmd_create_ah,You want to extend the
user->kernelAPI to get some extra data while maintaining BW compatibility. Usually you need for that an extra command which better be extended from day one. Can it be done in the kernel side without a new command ?
Yes, as we do not really change the core part of the protocol, we just makes sure that provider specific fields can be transferred.
Quoted 1 line
please send pointer to the matching kernel patch.
This is the related patch, which basically allows drivers to make use of the information sent from user space, by giving the create_ah callback access to udata, if available:
https://www.spinics.net/lists/linux-rdma/msg39879.html
Quoted 5 lines
Quoted 2 lines
Maybe I can rename it to
ibv_cmd_create_ah_v2(or v3?) to avoid associating it with the extended command set?In case you need a new command, let's add it in an extended mode so that future extensions will use it instead of having later v3/v4, etc.
As I don't need a new command on the kernel side,
I assume you mean v2 is ok, that way we avoid unnecessary cruft in my opinion.
Thanks,
Knut
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH libibverbs 1/3] Add new call ibv_cmd_create_ah_ex which supports extra parameters
In reply to a message not in the archivesrc/libibverbs.map IBVERBS_1.0 { · line 67
Quoted 6 lines · Knut Omang
+++ b/src/libibverbs.map
src/libibverbs.map +1
-0@@ -64,6 +64,7 @@ IBVERBS_1.0 { ibv_cmd_post_recv; ibv_cmd_post_srq_recv; ibv_cmd_create_ah; + ibv_cmd_create_ah_ex;
I should also point out that this is not the proper way to use symbol versions. Typically one would tag new symbols with the version number of the release that introduces them, and not just keep re-using 1.0
I know we haven't been doing that, but perhaps we should start.
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 20160901164939.GD6479-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org
Re: [PATCH libibverbs 1/3] Add new call ibv_cmd_create_ah_ex which supports extra parameters
Quoted 12 lines · Jason Gunthorpe
src/libibverbs.map IBVERBS_1.0 { · line 67
Quoted 6 lines · Knut Omang
+++ b/src/libibverbs.map
src/libibverbs.map +1
-0@@ -64,6 +64,7 @@ IBVERBS_1.0 { ibv_cmd_post_recv; ibv_cmd_post_srq_recv; ibv_cmd_create_ah; + ibv_cmd_create_ah_ex;I should also point out that this is not the proper way to use symbol versions. Typically one would tag new symbols with the version number of the release that introduces them, and not just keep re-using 1.0
Quoted 1 line
I know we haven't been doing that, but perhaps we should start.
Yes, I noticed the never changed 1.0 and tried just to follow the usage pattern ;-)
Note that the best solution if we get a merged library repo would just be to eliminate it by folding the arguments into ibv_cmd_create_ah and make it similar to the other *create* functions.
I added it only to avoid breaking vendor libraries.
Knut
Quoted 2 lines
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1472750558.9410.230.camel-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org
Re: [PATCH libibverbs 1/3] Add new call ibv_cmd_create_ah_ex which supports extra parameters
Quoted 3 lines · Knut Omang
Note that the best solution if we get a merged library repo would just be to eliminate it by folding the arguments into
ibv_cmd_create_ahand make it similar to the other *create* functions.
Well, we currently have a promise not to break the ABI facing the providers.
So, we'd still have to use symbol versions when we change the cmd so old providers link. Not sure how much win there is there vs _ex.
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH libibverbs 1/3] Add new call ibv_cmd_create_ah_ex which supports extra parameters
In reply to a message not in the archiveQuoted 13 lines · Knut Omang
Quoted 12 lines · Jason Gunthorpe
src/libibverbs.map IBVERBS_1.0 { · line 67
Quoted 6 lines · Knut Omang
+++ b/src/libibverbs.map
src/libibverbs.map +1
-0@@ -64,6 +64,7 @@ IBVERBS_1.0 { ibv_cmd_post_recv; ibv_cmd_post_srq_recv; ibv_cmd_create_ah; + ibv_cmd_create_ah_ex;I should also point out that this is not the proper way to use symbol versions. Typically one would tag new symbols with the version number of the release that introduces them, and not just keep re-using 1.0
Quoted 4 lines
Quoted 1 line
I know we haven't been doing that, but perhaps we should start.
Yes, I noticed the never changed 1.0 and tried just to follow the usage pattern ;-)
Actually, thinking about this more, not doing this properly breaks RPM since it only summarizes the tag not the actual symbol into the package data.
So, no this is not OK, and maybe we need to retroactively review things :( :(
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 20160901180512.GB20098-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org
Re: [PATCH libibverbs 1/3] Add new call ibv_cmd_create_ah_ex which supports extra parameters
Quoted 19 lines · Jason Gunthorpe
Quoted 13 lines · Knut Omang
Quoted 12 lines · Jason Gunthorpe
Review IBVERBS_1.0 { · line 67
Quoted 6 lines · Knut Omang
+++ b/src/libibverbs.map
(quoted diff) +1
-0@@ -64,6 +64,7 @@ IBVERBS_1.0 { ibv_cmd_post_recv; ibv_cmd_post_srq_recv; ibv_cmd_create_ah; + ibv_cmd_create_ah_ex;I should also point out that this is not the proper way to use symbol versions. Typically one would tag new symbols with the version number of the release that introduces them, and not just keep re-using 1.0
Quoted 4 lines
Quoted 1 line
I know we haven't been doing that, but perhaps we should start.
Yes, I noticed the never changed 1.0 and tried just to follow the usage pattern ;-)
Quoted 6 lines
Actually, thinking about this more, not doing this properly breaks RPM since it only summarizes the tag not the actual symbol into the package data.
So, no this is not OK, and maybe we need to retroactively review things :( :(
For this patch backward binary compatibility is actually preserved - a vendor library continues to work even without recompiling. I deliberately avoided making the ibv_cmd_create_ah function inline to ensure that. Loading libsif would of course break, but with a symbol error.
But versioning is still an issue to consider with patch 2 in this set, as it unfortunately has to change the layout of the data structures between kernel and user space to fix the alignment bug.
Patch 3 has the same alignment issue, but is not used by anyone but our new vendor library.
Knut
Quoted 1 line
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1472754220.9410.236.camel-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org
Re: [PATCH libibverbs 1/3] Add new call ibv_cmd_create_ah_ex which supports extra parameters
Quoted 12 lines · Knut Omang
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines · Knut Omang
Review IBVERBS_1.0 { · line 67
Quoted 6 lines
+++ b/src/libibverbs.map
(quoted diff) +1
-0@@ -64,6 +64,7 @@ IBVERBS_1.0 { ibv_cmd_post_recv; ibv_cmd_post_srq_recv; ibv_cmd_create_ah; + ibv_cmd_create_ah_ex;For this patch backward binary compatibility is actually preserved - a vendor library continues to work even without recompiling. I deliberately avoided making the
ibv_cmd_create_ahfunction inline to ensure that. Loading libsif would of course break, but with a symbol error.
No, this patch is wrong, you added it to IBVERBS_1.0, that isn't allowed.
You need to do something like this:
IBVERBS_1.3 {
global:
ibv_cmd_create_ah_ex;Why? RPM works by having provides like:
libibverbs
libibverbs(x86-64)
libibverbs.so.1()(64bit)
libibverbs.so.1(IBVERBS_1.0)(64bit)
libibverbs.so.1(IBVERBS_1.1)(64bit)
And when you create a client RPM package it strips off the function name and uniques it to produce the Depends.
In other words, once IBVERBS_1.x is shipped in a RPM that stanza in the map file is set in stone. We can never add more symbols to that stanza. We must start a new number.
To be concrete, when your new provider links to ibv_cmd_create_ah_ex@IBVERBS_1.0 rpm will create a dependency libibverbs.so.1(IBVERBS_1.0). *However* every RPM provides that, so the dependency logic in RPM stops working and will let a user install your provider on a system it is not compatible with. When it is set properly to ibv_cmd_create_ah_ex@IBVERBS_1.3 then RPM will only allow the provider RPM to be installed on a system that has the upgraded libibverbs1.
Unfortunately this has been systematically screwed up by recent patches (pay attention Matan and Yisahi), so our symbol versioning is now unusable for RPM based distros.
Debian does this differently and will not be affected. Actual linking should be fine too, AFAIK it is just RPM that will break.
Doug? Is it too late to fix this for the patches you accepted in 2016? The answer to that depends entirely on how far the RPMs have got..
The _cmd_ varients are not too bad, we could fix that in rdma-plumbing in a way that lets us move forward sane sanely, but ibv_query_device_ex@IBVERBS_1.0 should have been tagged _1.2
The fix would be to introduce a ibv_query_device_ex@IBVERBS_1.3 as the new default and continue to provide ibv_query_device_ex@IBVERBS_1.0 for compat against the same physical symbol. New links would then get functional rpm dependencies.
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 20160902020642.GA30057-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org
Re: [PATCH libibverbs 1/3] Add new call ibv_cmd_create_ah_ex which supports extra parameters
Quoted 18 lines · Jason Gunthorpe
Quoted 6 lines · Knut Omang
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines · Knut Omang
Quoted 1 line
Quoted 11 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Review IBVERBS_1.0 { · line 67
Quoted 6 lines
+++ b/src/libibverbs.map
(quoted diff) +1
-0@@ -64,6 +64,7 @@ IBVERBS_1.0 { ibv_cmd_post_recv; ibv_cmd_post_srq_recv; ibv_cmd_create_ah; + ibv_cmd_create_ah_ex;For this patch backward binary compatibility is actually preserved - a vendor library continues to work even without recompiling. I deliberately avoided making the
ibv_cmd_create_ahfunction inline to ensure that. Loading libsif would of course break, but with a symbol error.
Quoted 8 lines
No, this patch is wrong, you added it to IBVERBS_1.0, that isn't allowed.
You need to do something like this:
IBVERBS_1.3 {
global:ibv_cmd_create_ah_ex;
You are quite right - I'll fix the patch like you indicate, using either 1.2 or 1.3 depending on the conclusions on the other changes you mention below, Doug, let me know what value you want,
Thanks,
Knut
Quoted 38 lines
Why? RPM works by having provides like:
libibverbs
libibverbs(x86-64)
libibverbs.so.1()(64bit)
libibverbs.so.1(IBVERBS_1.0)(64bit)
libibverbs.so.1(IBVERBS_1.1)(64bit)And when you create a client RPM package it strips off the function name and uniques it to produce the Depends.
In other words, once IBVERBS_1.x is shipped in a RPM that stanza in the map file is set in stone. We can never add more symbols to that stanza. We must start a new number.
To be concrete, when your new provider links to ibv_cmd_create_ah_ex@IBVERBS_1.0 rpm will create a dependency libibverbs.so.1(IBVERBS_1.0). *However* every RPM provides that, so the dependency logic in RPM stops working and will let a user install your provider on a system it is not compatible with. When it is set properly to ibv_cmd_create_ah_ex@IBVERBS_1.3 then RPM will only allow the provider RPM to be installed on a system that has the upgraded libibverbs1.
Unfortunately this has been systematically screwed up by recent patches (pay attention Matan and Yisahi), so our symbol versioning is now unusable for RPM based distros.
Debian does this differently and will not be affected. Actual linking should be fine too, AFAIK it is just RPM that will break.
Doug? Is it too late to fix this for the patches you accepted in 2016? The answer to that depends entirely on how far the RPMs have got..
The _cmd_ varients are not too bad, we could fix that in rdma-plumbing in a way that lets us move forward sane sanely, but ibv_query_device_ex@IBVERBS_1.0 should have been tagged _1.2
Quoted 6 lines
The fix would be to introduce a ibv_query_device_ex@IBVERBS_1.3 as the new default and continue to provide ibv_query_device_ex@IBVERBS_1.0 for compat against the same physical symbol. New links would then get functional rpm dependencies.
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [PATCH libibverbs 1/3] Add new call ibv_cmd_create_ah_ex which supports extra parameters
Quoted 28 lines · Knut Omang
Quoted 18 lines · Jason Gunthorpe
Quoted 6 lines · Knut Omang
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines · Knut Omang
Quoted 1 line
Quoted 11 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Review IBVERBS_1.0 { · line 67
Quoted 6 lines
+++ b/src/libibverbs.map
(quoted diff) +1
-0@@ -64,6 +64,7 @@ IBVERBS_1.0 { ibv_cmd_post_recv; ibv_cmd_post_srq_recv; ibv_cmd_create_ah; + ibv_cmd_create_ah_ex;For this patch backward binary compatibility is actually preserved - a vendor library continues to work even without recompiling. I deliberately avoided making the
ibv_cmd_create_ahfunction inline to ensure that. Loading libsif would of course break, but with a symbol error.Quoted 8 lines
No, this patch is wrong, you added it to IBVERBS_1.0, that isn't allowed.
You need to do something like this:
IBVERBS_1.3 { global: ibv_cmd_create_ah_ex;
Quoted 48 lines
You are quite right - I'll fix the patch like you indicate, using either 1.2 or 1.3 depending on the conclusions on the other changes you mention below, Doug, let me know what value you want,
Thanks,
KnutQuoted 42 lines
Why? RPM works by having provides like:
libibverbs
libibverbs(x86-64)
libibverbs.so.1()(64bit)
libibverbs.so.1(IBVERBS_1.0)(64bit)
libibverbs.so.1(IBVERBS_1.1)(64bit)And when you create a client RPM package it strips off the function name and uniques it to produce the Depends.
In other words, once IBVERBS_1.x is shipped in a RPM that stanza in the map file is set in stone. We can never add more symbols to that stanza. We must start a new number.
To be concrete, when your new provider links to ibv_cmd_create_ah_ex@IBVERBS_1.0 rpm will create a dependency libibverbs.so.1(IBVERBS_1.0). *However* every RPM provides that, so the dependency logic in RPM stops working and will let a user install your provider on a system it is not compatible with. When it is set properly to ibv_cmd_create_ah_ex@IBVERBS_1.3 then RPM will only allow the provider RPM to be installed on a system that has the upgraded libibverbs1.
Unfortunately this has been systematically screwed up by recent patches (pay attention Matan and Yisahi), so our symbol versioning is now unusable for RPM based distros.
Debian does this differently and will not be affected. Actual linking should be fine too, AFAIK it is just RPM that will break.
Doug? Is it too late to fix this for the patches you accepted in 2016? The answer to that depends entirely on how far the RPMs have got..
The _cmd_ varients are not too bad, we could fix that in rdma-plumbing in a way that lets us move forward sane sanely, but ibv_query_device_ex@IBVERBS_1.0 should have been tagged _1.2
The fix would be to introduce a ibv_query_device_ex@IBVERBS_1.3 as the new default and continue to provide ibv_query_device_ex@IBVERBS_1.0 for compat against the same physical symbol. New links would then get functional rpm dependencies.
Looking more closely at this whole problem, I think for my patch, the right solution is just to avoid adding a new function name and instead provide a redefinition of the original symbol with a new version using the __asm__(".symver ...) construct already nicely used for v.1.0 bw compatibility - just following the pattern already established.
That way old provider builds can continue to work seamlessly and binary compatible, but when recompiling against the new version, the compiler enforces use of the new definitions instead, implicitly enforcing cleanup, which is a good thing..
I think in principle this could have been done for the other _ex functions as well, getting rid of the whole multiple _ex structs stuff.
Knut
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1472887840.9410.364.camel-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org
Re: [PATCH libibverbs 1/3] Add new call ibv_cmd_create_ah_ex which supports extra parameters
Quoted 5 lines · Knut Omang
Looking more closely at this whole problem, I think for my patch, the right solution is just to avoid adding a new function name and instead provide a redefinition of the original symbol with a new version using the
__asm__(".symver ...)construct already nicely used for v.1.0 bw compatibility - just following the pattern already established.
That is possible, but to date we have never done that and have continued to preserve source compatability for providers.
I agree the providers should be updated, but I don't see this being practical until after rdma-plumbing is in place..
So I suggest you proceed as you have with the fixed symbol version.
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 20160905023817.GD21542-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org
Re: [PATCH libibverbs 1/3] Add new call ibv_cmd_create_ah_ex which supports extra parameters
Quoted 8 lines · Jason Gunthorpe
Quoted 5 lines · Knut Omang
Looking more closely at this whole problem, I think for my patch, the right solution is just to avoid adding a new function name and instead provide a redefinition of the original symbol with a new version using the
__asm__(".symver ...)construct already nicely used for v.1.0 bw compatibility - just following the pattern already established.
Quoted 7 lines
That is possible, but to date we have never done that and have continued to preserve source compatability for providers.
I agree the providers should be updated, but I don't see this being practical until after rdma-plumbing is in place..
So I suggest you proceed as you have with the fixed symbol version.
Ok, fine - I have implemented and tested both solutions with current libmlx4 + Connect-X3 and libsif + SIF using the libibverbs and kernel patch sets in the same box, with a small amendment to the size checking in the uverbs ibv_reg_mr path and feel I am ready for a v2 then.
Thanks,
Knut
Quoted 1 line
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 2/3 Add padding to get proper end alignment of ibv_reg_mr_resp
In reply to a message not in the archiveThe user/kernel level API requires all parameter blocks to be 64 bit end aligned.
Also clean up some valgrind/memory initialization issues.
--- include/infiniband/kern-abi.h | 1 + src/cmd.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-)
include/infiniband/kern-abi.h +1 -0
@@ -367,6 +367,7 @@ struct ibv_reg_mr_resp {__u32 mr_handle;__u32 lkey;__u32 rkey; +__u32 reserved; };struct ibv_rereg_mr {
src/cmd.c +4 -1
@@ -1470,6 +1470,7 @@ int ibv_cmd_create_ah_ex(struct ibv_pd *pd, struct ibv_ah *ah, struct ibv_ah_attIBV_INIT_CMD_RESP (cmd, cmd_size,CREATE_AH , resp, resp_size); cmd->user_handle = (uintptr_t ) ah; cmd->pd_handle = pd->handle; + cmd->reserved =0 ; cmd->attr.dlid = attr->dlid; cmd->attr.sl = attr->sl; cmd->attr.src_path_bits = attr->src_path_bits;
@@ -1480,12 +1481,14 @@ int ibv_cmd_create_ah_ex(struct ibv_pd *pd, struct ibv_ah *ah, struct ibv_ah_att cmd->attr.grh.sgid_index = attr->grh.sgid_index; cmd->attr.grh.hop_limit = attr->grh.hop_limit; cmd->attr.grh.traffic_class = attr->grh.traffic_class; + cmd->attr.grh.reserved =0 ; + cmd->attr.reserved =0 ;memcpy (cmd->attr.grh.dgid, attr->grh.dgid.raw,16 );if (write (pd->context->cmd_fd, cmd, cmd_size) != cmd_size)return errno; - (void )VALGRIND_MAKE_MEM_DEFINED (resp,sizeof *resp); + (void )VALGRIND_MAKE_MEM_DEFINED (resp, resp_size); ah->handle = resp->handle; ah->context = pd->context;
Signature · 6 lines
2.5.5 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1472713193-22397-3-git-send-email-knut.omang-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org
Re: [PATCH libibverbs 2/3] Add padding to get proper end alignment of ibv_reg_mr_resp
Quoted 37 lines · Knut Omang
The user/kernel level API requires all parameter blocks to be 64 bit end aligned.
Also clean up some valgrind/memory initialization issues.
Signed-off-by Knut Omang <[email protected]>Reviewed-by Mukesh Kacker <[email protected]>--- include/infiniband/kern-abi.h | 1 + src/cmd.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-)include/infiniband/kern-abi.h +1
-0@@ -367,6 +367,7 @@ struct ibv_reg_mr_resp {__u32 mr_handle;__u32 lkey;__u32 rkey; +__u32 reserved; };struct ibv_rereg_mr {src/cmd.c +1
-0@@ -1470,6 +1470,7 @@ int ibv_cmd_create_ah_ex(struct ibv_pd *pd, struct ibv_ah *ah, struct ibv_ah_attIBV_INIT_CMD_RESP (cmd, cmd_size,CREATE_AH , resp, resp_size); cmd->user_handle = (uintptr_t ) ah; cmd->pd_handle = pd->handle; + cmd->reserved =0 ; cmd->attr.dlid = attr->dlid; cmd->attr.sl = attr->sl; cmd->attr.src_path_bits = attr->src_path_bits;
src/cmd.c int ibv_cmd_create_ah_ex(struct ibv_pd *pd, struct ibv_ah *ah, struct ibv_ah_att · line 1485
Quoted 5 lines
src/cmd.c +2
-0@@ -1480,12 +1481,14 @@ int ibv_cmd_create_ah_ex(struct ibv_pd *pd, struct ibv_ah *ah, struct ibv_ah_att cmd->attr.grh.sgid_index = attr->grh.sgid_index; cmd->attr.grh.hop_limit = attr->grh.hop_limit; cmd->attr.grh.traffic_class = attr->grh.traffic_class; + cmd->attr.grh.reserved =0 ; + cmd->attr.reserved =0 ;
How those changes relate to this patch's subject ? seems that those and below relate to previous ibv_cmd_create_ah_ex patch.
src/cmd.c int ibv_cmd_create_ah_ex(struct ibv_pd *pd, struct ibv_ah *ah, struct ibv_ah_att · line 1494
Quoted 11 lines
src/cmd.c +1
-1memcpy (cmd->attr.grh.dgid, attr->grh.dgid.raw,16 );if (write (pd->context->cmd_fd, cmd, cmd_size) != cmd_size)return errno; - (void )VALGRIND_MAKE_MEM_DEFINED (resp,sizeof *resp); + (void )VALGRIND_MAKE_MEM_DEFINED (resp, resp_size); ah->handle = resp->handle; ah->context = pd->context;
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 6ce4a2f9-64ee-29af-72e8-1c8844436a20-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org
Re: [PATCH libibverbs 2/3] Add padding to get proper end alignment of ibv_reg_mr_resp
Quoted 43 lines · Yishai Hadas
Quoted 42 lines · Knut Omang
The user/kernel level API requires all parameter blocks to be 64 bit end aligned.
Also clean up some valgrind/memory initialization issues.
Signed-off-by Knut Omang <[email protected]>Reviewed-by Mukesh Kacker <[email protected]>---
include/infiniband/kern-abi.h | 1 +
src/cmd.c | 5 ++++-2 files changed, 5 insertions(+), 1 deletion(-)include/infiniband/kern-abi.h +1
-0@@ -367,6 +367,7 @@ struct ibv_reg_mr_resp { __u32 mr_handle; __u32 lkey; __u32 rkey; +__u32 reserved; }; struct ibv_rereg_mr {src/cmd.c +0
-0@@ -1470,6 +1470,7 @@ int ibv_cmd_create_ah_ex(struct ibv_pd *pd,struct
ibv_ah*ah, structibv_ah_attIBV_INIT_CMD_RESP(cmd, cmd_size, CREATE_AH, resp, resp_size);
cmd->user_handle = (uintptr_t) ah; cmd->pd_handle =pd->handle;src/cmd.c +1
-0+ cmd->reserved = 0;cmd->attr.dlid =
attr->dlid; cmd->attr.sl =attr->sl; cmd->attr.src_path_bits =attr->src_path_bits;src/cmd.c +0
-0@@ -1480,12 +1481,14 @@ int ibv_cmd_create_ah_ex(struct ibv_pd *pd,struct
ibv_ah*ah, structibv_ah_att
Quoted 8 lines
src/cmd.c int ibv_cmd_create_ah_ex(struct ibv_pd *pd, struct ibv_ah *ah, struct ibv_ah_att · line 1485
Quoted 5 lines
cmd->attr.grh.sgid_index =
attr->grh.sgid_index; cmd->attr.grh.hop_limit =attr->grh.hop_limit;cmd->attr.grh.traffic_class=attr->grh.traffic_class;src/cmd.c +2
-0+ cmd->attr.grh.reserved = 0; + cmd->attr.reserved = 0;How those changes relate to this patch's subject ? seems that those and
below relate to previousibv_cmd_create_ah_expatch.
These are fixing valgrind complaints in the original code, but because that code got rewritten by the previous patch, it might look that way.
The initial idea was that this whole patch fixes trivial bugs/issues in the current libibverbs, while the other two provides new functionality. I can split this out as a separate patch for the valgrind part, if necessary.
Knut
Quoted 7 lines
Quoted 7 lines
memcpy(cmd->attr.grh.dgid, attr->grh.dgid.raw, 16);if (
write(pd->context->cmd_fd, cmd, cmd_size)!=cmd_size) return errno;
Quoted 6 lines
Quoted 6 lines
src/cmd.c +1
-1- (void )VALGRIND_MAKE_MEM_DEFINED (resp,sizeof *resp); + (void )VALGRIND_MAKE_MEM_DEFINED (resp, resp_size);ah->handle =
resp->handle;
ah->context=pd->context;
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH libibverbs 2/3] Add padding to get proper end alignment of ibv_reg_mr_resp
In reply to a message not in the archiveQuoted 15 lines · Knut Omang
The user/kernel level API requires all parameter blocks to be 64 bit end aligned.
Also clean up some valgrind/memory initialization issues.
Signed-off-by Knut Omang <[email protected]>Reviewed-by Mukesh Kacker <[email protected]>include/infiniband/kern-abi.h | 1 + src/cmd.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-)include/infiniband/kern-abi.h +1
-0+++ b/include/infiniband/kern-abi.h
include/infiniband/kern-abi.h struct ibv_reg_mr_resp { · line 371
Quoted 5 lines
include/infiniband/kern-abi.h +1
-0@@ -367,6 +367,7 @@ struct ibv_reg_mr_resp {__u32 mr_handle;__u32 lkey;__u32 rkey; +__u32 reserved; };
This structure is a copy of include/uapi/rdma/ib_user_verbs.h, so you need to start with a kernel patch proposing this change.
We will eventually get rid of kern-abi.h and use ib_user_verbs.h at some point.
Maybe elaborate on why this is OK and doesn't break anything in that patch..
include/infiniband/kern-abi.h struct ibv_reg_mr_resp { · line 372
Quoted 2 lines
include/infiniband/kern-abi.h +1
-1- (void )VALGRIND_MAKE_MEM_DEFINED (resp,sizeof *resp); + (void )VALGRIND_MAKE_MEM_DEFINED (resp, resp_size);
Why the (void)?
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 20160901164216.GB6479-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org
Re: [PATCH libibverbs 2/3] Add padding to get proper end alignment of ibv_reg_mr_resp
Quoted 12 lines · Jason Gunthorpe
Quoted 11 lines · Knut Omang
The user/kernel level API requires all parameter blocks to be 64 bit end aligned.
Also clean up some valgrind/memory initialization issues.
Signed-off-by Knut Omang <[email protected]>Reviewed-by Mukesh Kacker <[email protected]>include/infiniband/kern-abi.h | 1 + src/cmd.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-)
Quoted 12 lines
include/infiniband/kern-abi.h struct ibv_reg_mr_resp { · line 371
Quoted 9 lines
include/infiniband/kern-abi.h +2
-0+++ b/include/infiniband/kern-abi.h@@ -367,6 +367,7 @@ struct ibv_reg_mr_resp {__u32 mr_handle;__u32 lkey;__u32 rkey; +__u32 reserved; };This structure is a copy of
include/uapi/rdma/ib_user_verbs.h, so you need to start with a kernel patch proposing this change.
Yes, I am aware of that, sorry - I intended to post both sets in sequence but ran into a few recently introduced conflicts in the kernel set, so still working on that (just testing remains)
Quoted 2 lines
We will eventually get rid of
kern-abi.hand useib_user_verbs.hat some point.
Good to get a common file for it and get rid of some copy/paste.
Quoted 7 lines
Maybe elaborate on why this is OK and doesn't break anything in that patch..
include/infiniband/kern-abi.h struct ibv_reg_mr_resp { · line 372
Quoted 2 lines
include/infiniband/kern-abi.h +1
-1- (void )VALGRIND_MAKE_MEM_DEFINED (resp,sizeof *resp); + (void )VALGRIND_MAKE_MEM_DEFINED (resp, resp_size);Why the (void)?
I guess it is there to avoid compiler warnings about unused variables in some configuration. I just kept it as it was in this patch. I see all instances throughout the code has this.
Thanks,
Knut
Quoted 1 line
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 3/3 Provide remote XRC SRQ number in kernel post_send.
In reply to a message not in the archiveAlso proper end align the ibv_kern_send_wr struct.
Requires a corresponding kernel change.
--- include/infiniband/kern-abi.h | 1 + src/cmd.c | 2 ++ 2 files changed, 3 insertions(+)
include/infiniband/kern-abi.h +1 -0
@@ -800,6 +800,7 @@ struct ibv_kern_send_wr {union {struct {__u32 remote_srqn; +__u32 reserved; } xrc; } qp_type; };
src/cmd.c +2 -0
@@ -1293,6 +1293,8 @@ int ibv_cmd_post_send(struct ibv_qp *ibqp, struct ibv_send_wr *wr, tmp->wr.ud.remote_qpn = i->wr.ud.remote_qpn; tmp->wr.ud.remote_qkey = i->wr.ud.remote_qkey; }else { +if (ibqp->qp_type ==IBV_QPT_XRC_SEND ) + tmp->qp_type.xrc.remote_srqn = i->qp_type.xrc.remote_srqn;switch (i->opcode) {case IBV_WR_RDMA_WRITE :case IBV_WR_RDMA_WRITE_WITH_IMM :
Signature · 6 lines
2.5.5 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1472713193-22397-4-git-send-email-knut.omang-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org
Re: [PATCH libibverbs 3/3] Provide remote XRC SRQ number in kernel post_send.
Quoted 3 lines · Knut Omang
Also proper end align the
ibv_kern_send_wrstruct.Requires a corresponding kernel change.
Again, usually starting from a kernel patch then coming with a matching user one.
Quoted 25 lines
Signed-off-by Knut Omang <[email protected]>Reviewed-by Mukesh Kacker <[email protected]>--- include/infiniband/kern-abi.h | 1 + src/cmd.c | 2 ++ 2 files changed, 3 insertions(+)include/infiniband/kern-abi.h +1
-0@@ -800,6 +800,7 @@ struct ibv_kern_send_wr {union {struct {__u32 remote_srqn; +__u32 reserved; } xrc; } qp_type; };src/cmd.c +0
-0
src/cmd.c int ibv_cmd_post_send(struct ibv_qp *ibqp, struct ibv_send_wr *wr, · line 1300
Quoted 8 lines
src/cmd.c +2
-0@@ -1293,6 +1293,8 @@ int ibv_cmd_post_send(struct ibv_qp *ibqp, struct ibv_send_wr *wr, tmp->wr.ud.remote_qpn = i->wr.ud.remote_qpn; tmp->wr.ud.remote_qkey = i->wr.ud.remote_qkey; }else { +if (ibqp->qp_type ==IBV_QPT_XRC_SEND ) + tmp->qp_type.xrc.remote_srqn = i->qp_type.xrc.remote_srqn;switch (i->opcode) {case IBV_WR_RDMA_WRITE :case IBV_WR_RDMA_WRITE_WITH_IMM :
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 67f23338-1a5c-5080-d346-8441afb47670-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org
Re: [PATCH libibverbs 3/3] Provide remote XRC SRQ number in kernel post_send.
Quoted 4 lines · Yishai Hadas
Quoted 3 lines · Knut Omang
Also proper end align the
ibv_kern_send_wrstruct.Requires a corresponding kernel change.
https://www.spinics.net/lists/linux-rdma/msg39884.html
Knut
Quoted 29 lines
Again, usually starting from a kernel patch then coming with a matching user one.
Quoted 25 lines
Signed-off-by Knut Omang <[email protected]>Reviewed-by Mukesh Kacker <[email protected]>--- include/infiniband/kern-abi.h | 1 + src/cmd.c | 2 ++ 2 files changed, 3 insertions(+)include/infiniband/kern-abi.h +1
-0@@ -800,6 +800,7 @@ struct ibv_kern_send_wr {union {struct {__u32 remote_srqn; +__u32 reserved; } xrc; } qp_type; };src/cmd.c +0
-0@@ -1293,6 +1293,8 @@ int ibv_cmd_post_send(struct ibv_qp *ibqp, struct ibv_send_wr *wr, tmp->wr.ud.remote_qpn = i->wr.ud.remote_qpn;
Quoted 9 lines
src/cmd.c int ibv_cmd_post_send(struct ibv_qp *ibqp, struct ibv_send_wr *wr, · line 1300
Quoted 8 lines
src/cmd.c +2
-0tmp->wr.ud.remote_qkey = i->wr.ud.remote_qkey; }else { +if (ibqp->qp_type ==IBV_QPT_XRC_SEND ) + tmp->qp_type.xrc.remote_srqn = i->qp_type.xrc.remote_srqn;switch (i->opcode) {case IBV_WR_RDMA_WRITE :case IBV_WR_RDMA_WRITE_WITH_IMM :
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html