Netdev List
 help / color / mirror / Atom feed
From: Shachar Raindel <raindel-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
To: roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	liranl-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org,
	guysh-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org,
	haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org,
	yotamke-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org,
	raindel-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org
Subject: [PATCH v1 09/10] IB/ucma: Take the network namespace from the process
Date: Wed, 11 Feb 2015 17:06:43 +0200	[thread overview]
Message-ID: <1423667204-8807-10-git-send-email-raindel@mellanox.com> (raw)
In-Reply-To: <1423667204-8807-1-git-send-email-raindel-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

From: Guy Shapiro <guysh-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

Add support for network namespaces from user space. This is done by passing
the network namespace of the process instead of init_net.

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/ucma.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/infiniband/core/ucma.c b/drivers/infiniband/core/ucma.c
index de755f2..d25a209 100644
--- a/drivers/infiniband/core/ucma.c
+++ b/drivers/infiniband/core/ucma.c
@@ -42,6 +42,7 @@
 #include <linux/slab.h>
 #include <linux/sysctl.h>
 #include <linux/module.h>
+#include <linux/nsproxy.h>
 
 #include <rdma/rdma_user_cm.h>
 #include <rdma/ib_marshall.h>
@@ -392,7 +393,7 @@ static ssize_t ucma_create_id(struct ucma_file *file, const char __user *inbuf,
 
 	ctx->uid = cmd.uid;
 	ctx->cm_id = rdma_create_id(ucma_event_handler, ctx, cmd.ps, qp_type,
-				    &init_net);
+				    current->nsproxy->net_ns);
 	if (IS_ERR(ctx->cm_id)) {
 		ret = PTR_ERR(ctx->cm_id);
 		goto err1;
-- 
1.7.11.2

--
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

  parent reply	other threads:[~2015-02-11 15:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-11 15:06 [PATCH v1 00/10] Add network namespace support in the RDMA-CM Shachar Raindel
2015-02-11 15:06 ` [PATCH v1 01/10] IB/addr: Pass network namespace as a parameter Shachar Raindel
2015-02-11 15:06 ` [PATCH v1 02/10] IB/core: Pass network namespace as a parameter to relevant functions Shachar Raindel
     [not found] ` <1423667204-8807-1-git-send-email-raindel-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-02-11 15:06   ` [PATCH v1 03/10] IB/core: Find the network namespace matching connection parameters Shachar Raindel
2015-02-11 15:06   ` Shachar Raindel [this message]
2015-02-16  8:10   ` [PATCH v1 00/10] Add network namespace support in the RDMA-CM Shachar Raindel
2015-02-11 15:06 ` [PATCH v1 04/10] IB/ipoib: Return IPoIB devices as possible matches to get_net_device_by_port_pkey_ip Shachar Raindel
2015-02-11 15:06 ` [PATCH v1 05/10] IB/cm,cma: Move RDMA IP CM private-data parsing code from ib_cma to ib_cm Shachar Raindel
2015-02-11 15:06 ` [PATCH v1 06/10] IB/cm: Add network namespace support Shachar Raindel
2015-02-11 15:06 ` [PATCH v1 07/10] IB/cma: Separate port allocation to network namespaces Shachar Raindel
2015-02-11 15:06 ` [PATCH v1 08/10] IB/cma: Add support for " Shachar Raindel
2015-02-11 15:06 ` [PATCH v1 10/10] IB/ucm: Add partial " Shachar Raindel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1423667204-8807-10-git-send-email-raindel@mellanox.com \
    --to=raindel-vpraknaxozvwk0htik3j/w@public.gmane.org \
    --cc=guysh-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=liranl-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=yotamke-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox