RDMA/core: Add support for iWARP Port Mapper user space service (Version 2)
PATCH 1/3 RDMA/core: Add support for iWARP Port Mapper user space service (Version 2)
The patch adds support for iWarp Port Mapper user space service
1) Netlink interface functions are added: ibnl_unicast() and ibnl_mulitcast() for sending netlink messages to user space
2) The signature of the existing ibnl_put_msg() is changed to more generic
3) Two netlink clients are added: RDMA_NL_NES, RDMA_NL_C4IW corresponding to the two iWarp drivers - nes and cxgb4 which use the IWPM service
4) Enums are added to enumerate the attributes in the netlink messages, which are exchanged between the user space IWPM service and the iWARP drivers
5) New files iw_portmap.h, iwpm_util.c iwpm_msg.c and iwpm_util.h are created which contain the IWPM core functionality (service requests and callbacks)
iwpm_util.c, iwpm_msg.c and iwpm_util.h are added to infiniband/core and the source files are compiled as part of iw_cm module. iw_portmap.h which contains the port mapper driver API is added to include/rdma. The iWarp drivers nes and cxgb4 are the two port mapper clients which use the provided IWPM core functionality to communicate with the user space port mapper service.
Signed-off by: Peter Waskiewicz <[email protected]>
--- drivers/infiniband/core/Makefile | 2 +- drivers/infiniband/core/cma.c | 3 +- drivers/infiniband/core/iwpm_msg.c | 691 +++++++++++++++++++++++++++++++++++ drivers/infiniband/core/iwpm_util.c | 609 ++++++++++++++++++++++++++++++ drivers/infiniband/core/iwpm_util.h | 238 ++++++++++++ drivers/infiniband/core/netlink.c | 18 +- include/rdma/iw_portmap.h | 199 ++++++++++ include/rdma/rdma_netlink.h | 23 ++- include/uapi/rdma/rdma_netlink.h | 96 +++++- 9 files changed, 1873 insertions(+), 6 deletions(-) create mode 100644 drivers/infiniband/core/iwpm_msg.c create mode 100644 drivers/infiniband/core/iwpm_util.c create mode 100644 drivers/infiniband/core/iwpm_util.h create mode 100644 include/rdma/iw_portmap.h
drivers/infiniband/core/Makefile +1 -1
@@ -18,7 +18,7 @@ ib_sa-y := sa_query.o multicast.o ib_cm-y := cm.o -iw_cm-y := iwcm.o +iw_cm-y := iwcm.o iwpm_util.o iwpm_msg.o rdma_cm-y := cma.o
drivers/infiniband/core/cma.c +2 -1
@@ -3633,7 +3633,8 @@ static int cma_get_id_stats(struct sk_buff *skb, struct netlink_callback *cb) id_stats =ibnl_put_msg (skb, &nlh, cb->nlh->nlmsg_seq,sizeof *id_stats,RDMA_NL_RDMA_CM , -RDMA_NL_RDMA_CM_ID_STATS ); +RDMA_NL_RDMA_CM_ID_STATS , +NLM_F_MULTI );if (!id_stats) goto out;
drivers/infiniband/core/iwpm_msg.c new file +691 -0
691 lines not on this page · raw message
drivers/infiniband/core/iwpm_util.c new file +609 -0
609 lines not on this page · raw message
drivers/infiniband/core/iwpm_util.h new file +238 -0
238 lines not on this page · raw message
drivers/infiniband/core/netlink.c +16 -2
@@ -103,13 +103,13 @@ int ibnl_remove_client(int index)EXPORT_SYMBOL (ibnl_remove_client);void *ibnl_put_msg (struct sk_buff *skb,struct nlmsghdr **nlh,int seq, -int len,int client,int op) +int len,int client,int op,int flags) {unsigned char *prev_tail; prev_tail =skb_tail_pointer (skb); *nlh =nlmsg_put (skb,0 , seq,RDMA_NL_GET_TYPE (client, op), - len,NLM_F_MULTI ); + len, flags);if (!*nlh) goto out_nlmsg_trim; (*nlh)->nlmsg_len =skb_tail_pointer (skb) - prev_tail;
@@ -172,6 +172,20 @@ static void ibnl_rcv(struct sk_buff *skb)mutex_unlock (&ibnl_mutex); } +int ibnl_unicast (struct sk_buff *skb,struct nlmsghdr *nlh, +__u32 pid) +{ +return nlmsg_unicast (nls, skb, pid); +} +EXPORT_SYMBOL (ibnl_unicast); + +int ibnl_multicast (struct sk_buff *skb,struct nlmsghdr *nlh, +unsigned int group,gfp_t flags) +{ +return nlmsg_multicast (nls, skb,0 , group, flags); +} +EXPORT_SYMBOL (ibnl_multicast); +int __init ibnl_init (void ) {struct netlink_kernel_cfg cfg = {
include/rdma/iw_portmap.h new file +199 -0
199 lines not on this page · raw message
include/rdma/rdma_netlink.h +22 -1
@@ -43,7 +43,7 @@ int ibnl_remove_client(int index);* Returns the allocated buffer on success and NULL on failure. */ void *ibnl_put_msg (struct sk_buff *skb,struct nlmsghdr **nlh,int seq, -int len,int client,int op); +int len,int client,int op,int flags);/** * Put a new attribute in a supplied skb. * @skb: The netlink skb.
@@ -56,4 +56,25 @@ void *ibnl_put_msg(struct sk_buff *skb, struct nlmsghdr **nlh, int seq,int ibnl_put_attr (struct sk_buff *skb,struct nlmsghdr *nlh,int len,void *data,int type); +/** +* Send the supplied skb to a specific userspace PID. +* @skb: The netlink skb +* @nlh: Header of the netlink message to send +* @pid: Userspace netlink process ID +* Returns 0 on success or a negative error code. +*/ +int ibnl_unicast (struct sk_buff *skb,struct nlmsghdr *nlh, +__u32 pid); + +/** +* Send the supplied skb to a netlink group. +* @skb: The netlink skb +* @nlh: Header of the netlink message to send +* @group: Netlink group ID +* @flags: allocation flags +* Returns 0 on success or a negative error code. +*/ +int ibnl_multicast (struct sk_buff *skb,struct nlmsghdr *nlh, +unsigned int group,gfp_t flags); +#endif /* _RDMA_NETLINK_H */
include/uapi/rdma/rdma_netlink.h +95 -1
113 lines not on this page · raw message
Signature · 6 lines
1.7.1 -- 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
Quoted 1 line · Tatyana Nikolova
The patch adds support for iWarp Port Mapper user space service
Reading the change-log below, I noted that pretty much nothing in it explains what
is the role of this port mapper, with that presentation you sent not being part of the upstream kernel, I think you need to add some documentation. Care to resend this patch with modified change-log so Roland can rebase his for-next branch or just send what you want to add and Roland can re-word this commit.
Or.
Quoted 22 lines
1) Netlink interface functions are added:
ibnl_unicast()andibnl_mulitcast()for sending netlink messages to user space2) The signature of the existing
ibnl_put_msg()is changed to more generic3) Two netlink clients are added:
RDMA_NL_NES,RDMA_NL_C4IWcorresponding to the two iWarp drivers - nes and cxgb4 which use the IWPM service4) Enums are added to enumerate the attributes in the netlink messages, which are exchanged between the user space IWPM service and the iWARP drivers
5) New files
iw_portmap.h,iwpm_util.ciwpm_msg.candiwpm_util.hare created which contain the IWPM core functionality (service requests and callbacks)
iwpm_util.c,iwpm_msg.candiwpm_util.hare added to infiniband/core and the source files are compiled as part ofiw_cmmodule.iw_portmap.hwhich contains the port mapper driver API is added toinclude/rdma. The iWarp drivers nes and cxgb4 are the two port mapper clients which use the provided IWPM core functionality to communicate with the user space port mapper service.
Quoted 3 lines
Signed-off-by Tatyana Nikolova <[email protected]>Signed-off-by Steve Wise <[email protected]>Signed-off by: Peter Waskiewicz <[email protected]>
--
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): CAJZOPZ+woOAzGfnRnMs7X71+3z4sBhaf37SZnPyBTGzNaNoveg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Quoted 10 lines · Or Gerlitz
Quoted 1 line · Tatyana Nikolova
The patch adds support for iWarp Port Mapper user space service
Reading the change-log below, I noted that pretty much nothing in it explains what
is the role of this port mapper, with that presentation you sent not being part of the upstream kernel, I think you need to add some documentation. Care to resend this patch with modified change-log so Roland can rebase his for-next branch or just send what you want to add and Roland can re-word this commit.
Quoted 2 lines
Or.
Perhaps the cover letter text should be added?
http://permalink.gmane.org/gmane.linux.drivers.rdma/19688
--
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