Linux-NVME Archive on lore.kernel.org
 help / color / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: Sagi Grimberg <sagi@grimberg.me>,
	"Belanger, Martin" <Martin.Belanger@dell.com>,
	Martin Belanger <nitram_67@hotmail.com>,
	"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>
Cc: "kbusch@kernel.org" <kbusch@kernel.org>,
	"axboe@fb.com" <axboe@fb.com>, "hch@lst.de" <hch@lst.de>
Subject: Re: [PATCH 1/1] Add 'Transport Interface' (triface) option. This can be used to specify the IP interface to use for the connection. The driver uses that to set SO_BINDTODEVICE on the socket before connecting.
Date: Wed, 12 May 2021 08:09:30 +0200
Message-ID: <2d747a9f-d29d-de1c-7bdc-69e11bf5d9da@suse.de> (raw)
In-Reply-To: <9c7d43e1-e13e-43a9-8212-ff48467d3a49@grimberg.me>

On 5/11/21 7:13 PM, Sagi Grimberg wrote:
> 
>> I've been thinking about what you said regarding the need to repeat 
>> the -w option when two interfaces share the same IP address. I think 
>> we're looking at the problem from a different point of view. The 
>> current implementation uses an IP address to identify an interface. I, 
>> on the other hand, believe that the best way to identify an interface 
>> is by its "interface name or index". In previous emails, I provided 
>> examples of the problems that may occur when using an IP address to 
>> identify an interface. For example, one can assign the same IP address 
>> to different interfaces making it impossible to distinguish interfaces 
>> by their IP address alone. Another example is that the low level APIs 
>> (e.g. setsockopt(SO_BINDTODEVICE) don’t even require the source IP 
>> address. They only need the interface name/index. So, why go through 
>> the trouble of performing a reverse address lookup to retrieve the 
>> interface name/index when the address is not used at all?
>>
>> By the way, if nvme-cli/linux-nvme allowed specifying interfaces by 
>> name/index, then we would not really need to repeat the -w option 
>> unless we also wanted to set the source address at the same time. 
>> Setting the source address is a completely different thing from 
>> setting the interface. One should be allowed to set one independently 
>> from the other, or both, or none.
>>
>> If you look at how ping is implemented, they do not infer the 
>> interface from the IP address. If one wants to force ping to go over 
>> an interface, then one must provide the interface by name/index using 
>> the -I option. If one wants to change the source IP address (without 
>> forcing a specific interface), then one provides the IP address to the 
>> -I option. It's simple and intuitive. And ping also supports appending 
>> the interface to the Destination IP using the '%' delimiter for 
>> IPv6-only as per RFC4007.
>>
>> I think that nvme-cli/linux-nvme should follow the ping approach. 
>> Interfaces should never be inferred from source IP addresses, but 
>> instead be clearly identified by their name or index. And setting the 
>> source address should be independent from setting the interface.
> 
> I'm starting to think that we are going in circles, I'm getting to
> the point that having host_iface is the right way to go.
> 
> We can have nvme-cli convert <addr>%iface notation to
> "..,host_traddr=<addr>,host_iface=<iface>,.." when creating the
> controller string...

That was my thinking, too; the only _other_ way would be to have a 
host_traddr _imply_ a binding to the underlying interface.
We could define that, but having a single option doing _two_ different 
things is not good software design.
So let's do the 'host_iface' thingie.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                Kernel Storage Architect
hare@suse.de                              +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

  reply index

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20210415192848.962891-1-nitram_67@hotmail.com>
2021-04-15 19:28 ` Martin Belanger
2021-05-01 11:34   ` Hannes Reinecke
2021-05-03 16:59     ` Belanger, Martin
2021-05-04 13:25       ` Hannes Reinecke
2021-05-04 19:56   ` Sagi Grimberg
2021-05-05  8:47     ` Hannes Reinecke
2021-05-05 14:31       ` Belanger, Martin
2021-05-05 18:33         ` James Smart
2021-05-05 20:32         ` Sagi Grimberg
2021-05-06 18:27           ` Michael Christie
2021-05-06  6:05         ` Hannes Reinecke
2021-05-06  7:00           ` Hannes Reinecke
2021-05-06 15:46             ` Belanger, Martin
2021-05-07 18:20               ` Sagi Grimberg
2021-05-10 13:49                 ` Belanger, Martin
2021-05-10 18:13                   ` Sagi Grimberg
2021-05-10 19:18                     ` Belanger, Martin
2021-05-11  0:28                       ` Sagi Grimberg
2021-05-11 13:41                         ` Belanger, Martin
2021-05-11 17:13                           ` Sagi Grimberg
2021-05-12  6:09                             ` Hannes Reinecke [this message]
2021-05-12 12:12                               ` Belanger, Martin
2021-05-12 22:12                                 ` Sagi Grimberg

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=2d747a9f-d29d-de1c-7bdc-69e11bf5d9da@suse.de \
    --to=hare@suse.de \
    --cc=Martin.Belanger@dell.com \
    --cc=axboe@fb.com \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=nitram_67@hotmail.com \
    --cc=sagi@grimberg.me \
    /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

Linux-NVME Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-nvme/0 linux-nvme/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-nvme linux-nvme/ https://lore.kernel.org/linux-nvme \
		linux-nvme@lists.infradead.org
	public-inbox-index linux-nvme

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-nvme


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git