All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH nvme-cli] print friendly name for trtype and adrfam
@ 2016-06-07 21:33 Ming Lin
  2016-06-07 21:50 ` Keith Busch
  0 siblings, 1 reply; 5+ messages in thread
From: Ming Lin @ 2016-06-07 21:33 UTC (permalink / raw)


From: Ming Lin <ming.l@samsung.com>

Without this patch:
=====Discovery Log Entry 0======
trtype:  1
adrfam:  1

With this patch:
=====Discovery Log Entry 0======
trtype:  ipv4
adrfam:  rdma

Signed-off-by: Ming Lin <ming.l at samsung.com>
---
 fabrics.c | 38 ++++++++++++++++++++++++++++++++++++--
 1 file changed, 36 insertions(+), 2 deletions(-)

diff --git a/fabrics.c b/fabrics.c
index c643598..d30bef2 100644
--- a/fabrics.c
+++ b/fabrics.c
@@ -271,8 +271,42 @@ static void print_discovery_log(struct nvmf_disc_rsp_page_hdr *log, int numrec)
 		struct nvmf_disc_rsp_page_entry *e = &log->entries[i];
 
 		printf("=====Discovery Log Entry %d======\n", i);
-		printf("trtype:  %d\n", e->trtype);
-		printf("adrfam:  %d\n", e->adrfam);
+
+		printf("trtype:  ");
+		switch(e->trtype) {
+		case NVMF_ADDR_FAMILY_IP4:
+			printf("ipv4\n");
+			break;
+		case NVMF_ADDR_FAMILY_IP6:
+			printf("ipv6\n");
+			break;
+		case NVMF_ADDR_FAMILY_IB:
+			printf("ib\n");
+			break;
+		case NVMF_ADDR_FAMILY_FC:
+			printf("fc\n");
+			break;
+		default:
+			printf("unknown\n");
+			break;
+		}
+
+		printf("adrfam:  ");
+		switch(e->adrfam) {
+		case NVMF_TRTYPE_RDMA:
+			printf("rdma\n");
+			break;
+		case NVMF_TRTYPE_FC:
+			printf("fc\n");
+			break;
+		case NVMF_TRTYPE_LOOP:
+			printf("loop\n");
+			break;
+		default:
+			printf("unknown\n");
+			break;
+		}
+
 		printf("nqntype: %d\n", e->nqntype);
 		printf("treq:    %d\n", e->treq);
 		printf("portid:  %d\n", e->portid);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH nvme-cli] print friendly name for trtype and adrfam
  2016-06-07 21:33 [PATCH nvme-cli] print friendly name for trtype and adrfam Ming Lin
@ 2016-06-07 21:50 ` Keith Busch
  2016-06-07 21:52   ` Minturn, Dave B
  0 siblings, 1 reply; 5+ messages in thread
From: Keith Busch @ 2016-06-07 21:50 UTC (permalink / raw)


On Tue, Jun 07, 2016@02:33:20PM -0700, Ming Lin wrote:
> From: Ming Lin <ming.l at samsung.com>
> 
> Without this patch:
> =====Discovery Log Entry 0======
> trtype:  1
> adrfam:  1
> 
> With this patch:
> =====Discovery Log Entry 0======
> trtype:  ipv4
> adrfam:  rdma
> 
> Signed-off-by: Ming Lin <ming.l at samsung.com>

Applied.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH nvme-cli] print friendly name for trtype and adrfam
  2016-06-07 21:50 ` Keith Busch
@ 2016-06-07 21:52   ` Minturn, Dave B
  2016-06-07 21:58     ` Ming Lin
  0 siblings, 1 reply; 5+ messages in thread
From: Minturn, Dave B @ 2016-06-07 21:52 UTC (permalink / raw)


It looks like you have the trtype (transport type) and adrfam (address family) swapped in the switch statements.
..Dave


>>-----Original Message-----
>>From: Linux-nvme [mailto:linux-nvme-bounces at lists.infradead.org] On
>>Behalf Of Keith Busch
>>Sent: Tuesday, June 07, 2016 2:51 PM
>>To: Ming Lin <mlin at kernel.org>
>>Cc: Christoph Hellwig <hch at lst.de>; linux-nvme at lists.infradead.org
>>Subject: Re: [PATCH nvme-cli] print friendly name for trtype and adrfam
>>
>>On Tue, Jun 07, 2016@02:33:20PM -0700, Ming Lin wrote:
>>> From: Ming Lin <ming.l at samsung.com>
>>>
>>> Without this patch:
>>> =====Discovery Log Entry 0======
>>> trtype:  1
>>> adrfam:  1
>>>
>>> With this patch:
>>> =====Discovery Log Entry 0======
>>> trtype:  ipv4
>>> adrfam:  rdma
>>>
>>> Signed-off-by: Ming Lin <ming.l at samsung.com>
>>
>>Applied.
>>
>>_______________________________________________
>>Linux-nvme mailing list
>>Linux-nvme at lists.infradead.org
>>http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH nvme-cli] print friendly name for trtype and adrfam
  2016-06-07 21:52   ` Minturn, Dave B
@ 2016-06-07 21:58     ` Ming Lin
  2016-06-07 22:08       ` Keith Busch
  0 siblings, 1 reply; 5+ messages in thread
From: Ming Lin @ 2016-06-07 21:58 UTC (permalink / raw)


On Tue, Jun 7, 2016 at 2:52 PM, Minturn, Dave B
<dave.b.minturn@intel.com> wrote:
> It looks like you have the trtype (transport type) and adrfam (address family) swapped in the switch statements.
> ..Dave

Ooops. Too bad.

Keith, is it OK to rebase your tree with a new patch?
Or should I send a incremental *fix* patch?

Sorry for this.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH nvme-cli] print friendly name for trtype and adrfam
  2016-06-07 21:58     ` Ming Lin
@ 2016-06-07 22:08       ` Keith Busch
  0 siblings, 0 replies; 5+ messages in thread
From: Keith Busch @ 2016-06-07 22:08 UTC (permalink / raw)


On Tue, Jun 07, 2016@02:58:50PM -0700, Ming Lin wrote:
> On Tue, Jun 7, 2016 at 2:52 PM, Minturn, Dave B
> <dave.b.minturn@intel.com> wrote:
> > It looks like you have the trtype (transport type) and adrfam (address family) swapped in the switch statements.
> > ..Dave
> 
> Ooops. Too bad.
> 
> Keith, is it OK to rebase your tree with a new patch?
> Or should I send a incremental *fix* patch?
> 
> Sorry for this.

No worries, I jumped the gun on this. Just send me an incremental fix
since I already pushed.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-06-07 22:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-07 21:33 [PATCH nvme-cli] print friendly name for trtype and adrfam Ming Lin
2016-06-07 21:50 ` Keith Busch
2016-06-07 21:52   ` Minturn, Dave B
2016-06-07 21:58     ` Ming Lin
2016-06-07 22:08       ` Keith Busch

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.