[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e04487c8-a4a8-bd4f-2ec7-8f67f0f1a49e@broadcom.com>
Date: Tue, 20 Nov 2018 10:36:42 +0100
From: Arend van Spriel <arend.vanspriel@...adcom.com>
To: Sagi Grimberg <sagi@...mberg.me>, linux-nvme@...ts.infradead.org
Cc: linux-block@...r.kernel.org, netdev@...r.kernel.org,
"David S. Miller" <davem@...emloft.net>,
Keith Busch <keith.busch@...el.com>,
Christoph Hellwig <hch@....de>
Subject: Re: [PATCH nvme-cli v2 15/14] nvme: Add TCP transport
On 11/20/2018 4:00 AM, Sagi Grimberg wrote:
> From: Sagi Grimberg <sagi@...htbitslabs.com>
>
> Signed-off-by: Sagi Grimberg <sagi@...htbitslabs.com>
> ---
> fabrics.c | 5 ++++-
> linux/nvme.h | 1 +
> 2 files changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/fabrics.c b/fabrics.c
> index be6a18cd4787..b4fac97253ba 100644
> --- a/fabrics.c
> +++ b/fabrics.c
> @@ -96,6 +96,7 @@ static const char *arg_str(const char * const *strings,
> static const char * const trtypes[] = {
> [NVMF_TRTYPE_RDMA] = "rdma",
> [NVMF_TRTYPE_FC] = "fibre-channel",
> + [NVMF_TRTYPE_TCP] = "tcp",
> [NVMF_TRTYPE_LOOP] = "loop",
> };
>
> @@ -703,11 +704,13 @@ retry:
> /* we can safely ignore the rest of the entries */
> break;
> case NVMF_TRTYPE_RDMA:
> + case NVMF_TRTYPE_TCP:
> switch (e->adrfam) {
> case NVMF_ADDR_FAMILY_IP4:
> case NVMF_ADDR_FAMILY_IP6:
> /* FALLTHRU */
> - len = sprintf(p, ",transport=rdma");
> + len = sprintf(p, ",transport=%s",
> + e->trtype == NVMF_TRTYPE_RDMA ? "rdma" : "tcp");
So why not just use the trtypes array above?
Regards,
Arend
Powered by blists - more mailing lists