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

Hannes Reinecke hare at suse.de
Wed May 5 09:47:14 BST 2021


On 5/4/21 9:56 PM, Sagi Grimberg wrote:
> 
>> From: Martin Belanger <martin.belanger at dell.com>
> 
> Change log is missing...
> 
>>
>> ---
>>   drivers/nvme/host/core.c    |  5 +++++
>>   drivers/nvme/host/fabrics.c | 14 +++++++++++++
>>   drivers/nvme/host/fabrics.h |  6 +++++-
>>   drivers/nvme/host/tcp.c     | 41 ++++++++++++++++++++++++++++++++++---
>>   4 files changed, 62 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
>> index 288ac47ff5b4..91ae11a1ae26 100644
>> --- a/drivers/nvme/host/core.c
>> +++ b/drivers/nvme/host/core.c
>> @@ -3961,6 +3961,11 @@ static int nvme_class_uevent(struct device
>> *dev, struct kobj_uevent_env *env)
>>             ret = add_uevent_var(env, "NVME_HOST_TRADDR=%s",
>>                   opts->host_traddr ?: "none");
>> +        if (ret)
>> +            return ret;
>> +
>> +        ret = add_uevent_var(env, "NVME_HOST_TRIFACE=%s",
>> +                opts->host_triface ?: "none");
> 
> Given that this was the original intent for host_traddr, why not have
> host_traddr resolve the iface from the address and set sockopt
> SO_BINDTODEVICE on it?
> 
That was my question, too.

I would vastly prefer to not have another option to deal with
(as it raises the question whether to add it eg during
'nvme connect-all')
And one could argue that this was the intention of _having_ the
host_traddr argument in the first place ...

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		        Kernel Storage Architect
hare at suse.de			               +49 911 74053 688
SUSE Software Solutions Germany GmbH, 90409 Nürnberg
GF: F. Imendörffer, HRB 36809 (AG Nürnberg)



More information about the Linux-nvme mailing list