Skip to contentSkip to conversation

print friendly name for trtype and adrfam

PATCH New Ming Lin 3 participants 5 messages Jun 7, 2016 NVMe

lore
Share & tools
lore

Ming Lin

author
#0 lore raw

PATCH 1/1 print friendly name for trtype and adrfam

From: Ming Lin <[email protected]>

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(-)
fabrics.c +36 -2
index c643598..d30bef2 100644
@@ -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);
Signature · 1 line
1.9.1
Applied
#1 lore raw

PATCH 1/1 print friendly name for trtype and adrfam

Quoted 7 lines · Ming Lin

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

Without this patch:
=====Discovery Log Entry 0======

trtype:  1
adrfam:  1
Quoted 6 lines

With this patch:
=====Discovery Log Entry 0======

trtype:  ipv4
adrfam:  rdma
Signed-off-by Ming Lin <ming.l at samsung.com>

Applied.

#2 lore raw

PATCH 1/1 print friendly name for trtype and adrfam

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

Quoted 29 lines
Quoted 29 lines

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

Quoted 7 lines · Ming Lin

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

Without this patch:
=====Discovery Log Entry 0======

trtype:  1
adrfam:  1
Quoted 6 lines

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

author
#3 lore raw

PATCH 1/1 print friendly name for trtype and adrfam

Quoted 2 lines · Dave B

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.

#4 lore raw

PATCH 1/1 print friendly name for trtype and adrfam

Quoted 11 lines · Ming Lin
Quoted 2 lines · Dave B

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.