naccyde / rpms / iproute

Forked from rpms/iproute 8 months ago
Clone

Blame SOURCES/0048-rdma-Fix-representation-of-PortInfo-CapabilityMask.patch

7e752c
From e67f089156708052abeb9c67d77cb0cf966d89c6 Mon Sep 17 00:00:00 2001
7e752c
From: Andrea Claudi <aclaudi@redhat.com>
7e752c
Date: Wed, 29 May 2019 18:40:20 +0200
7e752c
Subject: [PATCH] rdma: Fix representation of PortInfo CapabilityMask
7e752c
7e752c
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1664694
7e752c
Upstream Status: iproute2.git commit d090fbf33bd15
7e752c
7e752c
commit d090fbf33bd15d82978596920b07616aa119ac2f
7e752c
Author: Leon Romanovsky <leonro@mellanox.com>
7e752c
Date:   Sun Sep 16 20:28:13 2018 +0300
7e752c
7e752c
    rdma: Fix representation of PortInfo CapabilityMask
7e752c
7e752c
    The port capability mask represents IBTA PortInfo specification,
7e752c
    but as it is written in description of kernel commit 2f944c0fbf58
7e752c
    ("RDMA: Fix storage of PortInfo CapabilityMask in the kernel"),
7e752c
    the bit 26 was mistakenly overwritten.
7e752c
7e752c
    The rdmatool followed it too and mislead users by presenting wrong
7e752c
    value. Since it never showed proper value, we update the whole
7e752c
    port_cap_mask to comply with IBTA and show real HW values.
7e752c
7e752c
    Fixes: da990ab40a92 ("rdma: Add link object")
7e752c
    Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
7e752c
    Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
7e752c
---
7e752c
 rdma/link.c | 14 ++++++++++----
7e752c
 1 file changed, 10 insertions(+), 4 deletions(-)
7e752c
7e752c
diff --git a/rdma/link.c b/rdma/link.c
7e752c
index 7e914c870994e..7a6d4b7e356d7 100644
7e752c
--- a/rdma/link.c
7e752c
+++ b/rdma/link.c
7e752c
@@ -20,6 +20,7 @@ static int link_help(struct rd *rd)
7e752c
 static const char *caps_to_str(uint32_t idx)
7e752c
 {
7e752c
 #define RDMA_PORT_FLAGS(x) \
7e752c
+	x(RESERVED, 0) \
7e752c
 	x(SM, 1) \
7e752c
 	x(NOTICE, 2) \
7e752c
 	x(TRAP, 3) \
7e752c
@@ -32,7 +33,9 @@ static const char *caps_to_str(uint32_t idx)
7e752c
 	x(SM_DISABLED, 10) \
7e752c
 	x(SYS_IMAGE_GUID, 11) \
7e752c
 	x(PKEY_SW_EXT_PORT_TRAP, 12) \
7e752c
+	x(CABLE_INFO, 13) \
7e752c
 	x(EXTENDED_SPEEDS, 14) \
7e752c
+	x(CAP_MASK2, 15) \
7e752c
 	x(CM, 16) \
7e752c
 	x(SNMP_TUNNEL, 17) \
7e752c
 	x(REINIT, 18) \
7e752c
@@ -43,7 +46,12 @@ static const char *caps_to_str(uint32_t idx)
7e752c
 	x(BOOT_MGMT, 23) \
7e752c
 	x(LINK_LATENCY, 24) \
7e752c
 	x(CLIENT_REG, 25) \
7e752c
-	x(IP_BASED_GIDS, 26)
7e752c
+	x(OTHER_LOCAL_CHANGES, 26) \
7e752c
+	x(LINK_SPPED_WIDTH, 27) \
7e752c
+	x(VENDOR_SPECIFIC_MADS, 28) \
7e752c
+	x(MULT_PKER_TRAP, 29) \
7e752c
+	x(MULT_FDB, 30) \
7e752c
+	x(HIERARCHY_INFO, 31)
7e752c
 
7e752c
 	enum { RDMA_PORT_FLAGS(RDMA_BITMAP_ENUM) };
7e752c
 
7e752c
@@ -51,9 +59,7 @@ static const char *caps_to_str(uint32_t idx)
7e752c
 		rdma_port_names[] = { RDMA_PORT_FLAGS(RDMA_BITMAP_NAMES) };
7e752c
 	#undef RDMA_PORT_FLAGS
7e752c
 
7e752c
-	if (idx < ARRAY_SIZE(rdma_port_names) && rdma_port_names[idx])
7e752c
-		return rdma_port_names[idx];
7e752c
-	return "UNKNOWN";
7e752c
+	return rdma_port_names[idx];
7e752c
 }
7e752c
 
7e752c
 static void link_print_caps(struct rd *rd, struct nlattr **tb)
7e752c
-- 
7e752c
2.20.1
7e752c