Re: [PATCH for-next 02/10] IB/core: Pass network namespace as a parameter to relevant functions
flat view
From: Yann Droneaud <hidden>
Date: 2015-02-01 12:26:50
Also in:
linux-rdma
Hi, Le dimanche 01 février 2015 à 13:28 +0200, Shachar Raindel a écrit :
From: Guy Shapiro <guysh-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> Add network namespace parameters for the address related ib_core functions. The parameter is passed to lower level function, instead of &init_net, so things are done in the correct namespace. For now pass &init_net on every caller. Callers that will pass &init_net permanently are marked with an appropriate comment. Signed-off-by: Haggai Eran <haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> Signed-off-by: Yotam Kenneth <yotamke-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> Signed-off-by: Shachar Raindel <raindel-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> Signed-off-by: Guy Shapiro <guysh-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> --- drivers/infiniband/core/agent.c | 4 +++- drivers/infiniband/core/cm.c | 9 +++++++-- drivers/infiniband/core/mad_rmpp.c | 10 ++++++++-- drivers/infiniband/core/user_mad.c | 4 +++- drivers/infiniband/core/verbs.c | 10 ++++++---- drivers/infiniband/ulp/srpt/ib_srpt.c | 3 ++- include/rdma/ib_verbs.h | 15 +++++++++++++-- 7 files changed, 42 insertions(+), 13 deletions(-)
quoted hunk
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index 0d74f1de99aa..dd4c80cea8d3 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h@@ -48,6 +48,7 @@ #include <linux/rwsem.h> #include <linux/scatterlist.h> #include <linux/workqueue.h> +#include <net/net_namespace.h> #include <uapi/linux/if_ether.h> #include <linux/atomic.h>@@ -1801,9 +1802,14 @@ struct ib_ah *ib_create_ah(struct ib_pd *pd, struct ib_ah_attr *ah_attr); * ignored unless the work completion indicates that the GRH is valid. * @ah_attr: Returned attributes that can be used when creating an address * handle for replying to the message. + * @net: The network namespace to use for address resolution. + * + * It is the caller's responsibility to make sure the network namespace is + * alive until the function returns.
Why ?
quoted hunk
*/ int ib_init_ah_from_wc(struct ib_device *device, u8 port_num, struct ib_wc *wc, - struct ib_grh *grh, struct ib_ah_attr *ah_attr); + struct ib_grh *grh, struct ib_ah_attr *ah_attr, + struct net *net); /** * ib_create_ah_from_wc - Creates an address handle associated with the@@ -1813,12 +1819,17 @@ int ib_init_ah_from_wc(struct ib_device *device, u8 port_num, struct ib_wc *wc, * @grh: References the received global route header. This parameter is * ignored unless the work completion indicates that the GRH is valid. * @port_num: The outbound port number to associate with the address. + * @net: The network namespace to use for address resolution. * * The address handle is used to reference a local or global destination * in all UD QP post sends. + * + * It is the caller's responsibility to make sure the network namespace is + * alive until the function returns.
Why ? Regards. -- Yann Droneaud OPTEYA -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html