public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Jason Gunthorpe <jgg-uk2M96/98Pc@public.gmane.org>
Cc: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH, resend 4/4] IB/srp: Add RDMA/CM support
Date: Fri, 05 Jan 2018 13:06:58 -0500	[thread overview]
Message-ID: <1515175618.3403.26.camel@redhat.com> (raw)
In-Reply-To: <20180105173448.GY11348-uk2M96/98Pc@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 3237 bytes --]

On Fri, 2018-01-05 at 10:34 -0700, Jason Gunthorpe wrote:
> On Fri, Jan 05, 2018 at 12:21:10PM -0500, Doug Ledford wrote:
> 
> > > +static int srp_parse_in(struct sockaddr_storage *sa, const char *addr_port_str)
> > > +{
> > > +	char *addr = kstrdup(addr_port_str, GFP_KERNEL);
> > > +	char *port_str = addr;
> > > +	int ret;
> > > +
> > > +	if (!addr)
> > > +		return -ENOMEM;
> > > +	strsep(&port_str, ":");
> > > +	ret = inet_pton_with_scope(&init_net, AF_UNSPEC, addr, port_str, sa);
> > > +	kfree(addr);
> > > +	return ret;
> > > +}
> > > +
> > 
> > This particular function is problematic in that it adds new namespace
> > unaware code.  The namespace code in the RDMA stack is in a limbo state
> > of partially implemented, partially not.  I'm loathe to add any more
> > code that is not fully namespace aware as that just worsens the
> > hysteresis in the stack.  So we need to figure out how to do this in a
> > namespace aware manner.  I haven't previously been thinking about this
> > specific namespace issue, so I'm not prepared to even make suggestions
> > for a fix for this yet...
> 
> Do the userspace daemon's still manage the connection to SRP?
> 
> If yes, then the networking information should be relative to the
> namespace of the thing that wrote to the sysfs file..

Maybe, maybe not.  It depends on the implementation.  IIRC you get one
daemon per port, not one daemon per mount.  In that situation, it's
conceivable that you might want to allow the init_net namespace to host
a master daemon that mounts all mounts on a specific port under a
variety of namespaces and then you don't need to run a separate daemon
in the namespace itself.  You can reduce the privilege level of
applications in the namespace this way.  But, that's an implementation
detail.

> Also, are there srp_daemon patches for this too? I've been asking to
> see the userspace side for new uAPI features before accepting the
> kernel part so that everything can be well understood. If yes, please
> send, even if it is RFCish..

No, the target code is likewise clueless about namespaces.  I suspect
(although I haven't looked) that the target code's Add RDMACM support
patch will have the same problem.

And, FWIW, the iser/isert code also has this same namespace issue.

And this is all complicated by the fact that the block devices created
by the SRP code might be mounted filesystems, or might be presented as
raw block devices to apps.  If it's a filesystem, then we get a pass as
the filesystem layer will determine if any given read/write should go
through based upon the bind mounts of the filesystem and the namespace
of the application accessing the filesystem.  But if the block device is
directly accessed by a user space application, like maybe a database
writing directly to the block device or even just mkfs/fsck, then we
need to enforce namespaces ourselves.  For that we need to know what
namespace(s) the device is created in, and what namespace the app
opening the device is in.

-- 
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
    GPG KeyID: B826A3330E572FDD
    Key fingerprint = AE6B 1BDA 122B 23B4 265B  1274 B826 A333 0E57 2FDD

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2018-01-05 18:06 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-04 22:28 [PATCH, resend 0/4] IB/srp: Add RDMA/CM support Bart Van Assche
     [not found] ` <20180104222842.26756-1-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
2018-01-04 22:28   ` [PATCH, resend 1/4] IB/srp: Use kstrtoull() instead of simple_strtoull() Bart Van Assche
2018-01-04 22:28   ` [PATCH, resend 2/4] IB/srp: Make the path record query error message more informative Bart Van Assche
2018-01-04 22:28   ` [PATCH, resend 3/4] IB/srp: Refactor srp_send_req() Bart Van Assche
2018-01-04 22:28   ` [PATCH, resend 4/4] IB/srp: Add RDMA/CM support Bart Van Assche
     [not found]     ` <20180104222842.26756-5-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
2018-01-05 17:21       ` Doug Ledford
     [not found]         ` <1515172870.3403.11.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2018-01-05 17:34           ` Jason Gunthorpe
     [not found]             ` <20180105173448.GY11348-uk2M96/98Pc@public.gmane.org>
2018-01-05 17:51               ` Bart Van Assche
     [not found]                 ` <1515174677.3254.11.camel-Sjgp3cTcYWE@public.gmane.org>
2018-01-05 17:55                   ` Jason Gunthorpe
2018-01-05 18:06               ` Doug Ledford [this message]
     [not found]                 ` <1515175618.3403.26.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2018-01-05 18:12                   ` Bart Van Assche
     [not found]                     ` <1515175964.3254.15.camel-Sjgp3cTcYWE@public.gmane.org>
2018-01-05 18:15                       ` Doug Ledford
2018-01-05 19:25                   ` Jason Gunthorpe
     [not found]                     ` <20180105192549.GA11348-uk2M96/98Pc@public.gmane.org>
2018-01-05 20:23                       ` Doug Ledford
     [not found]                         ` <1515183835.3403.62.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2018-01-05 20:35                           ` Jason Gunthorpe
     [not found]                             ` <20180105203506.GD11348-uk2M96/98Pc@public.gmane.org>
2018-01-05 20:53                               ` Bart Van Assche
2018-01-05 23:13                               ` Doug Ledford
     [not found]                                 ` <1515193988.3403.69.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2018-01-05 23:27                                   ` Jason Gunthorpe
2018-01-05 17:45           ` Bart Van Assche
2018-01-05 17:22   ` [PATCH, resend 0/4] " Doug Ledford

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=1515175618.3403.26.camel@redhat.com \
    --to=dledford-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=bart.vanassche-Sjgp3cTcYWE@public.gmane.org \
    --cc=jgg-uk2M96/98Pc@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@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