summaryrefslogtreecommitdiffstats
path: root/include/rdma
diff options
context:
space:
mode:
authorDoug Ledford <dledford@redhat.com>2017-02-19 15:18:21 +0100
committerDoug Ledford <dledford@redhat.com>2017-02-19 15:18:21 +0100
commit6dd7abae7110da6fa01f048baf5b679b5a4a56dd (patch)
tree17ca298bbae17f05bdadae7f88e3be0f113a713f /include/rdma
parentIB/cma: Destination and source addr families must match (diff)
parentRDMA: Don't reference kernel private header from UAPI header (diff)
downloadlinux-6dd7abae7110da6fa01f048baf5b679b5a4a56dd.tar.xz
linux-6dd7abae7110da6fa01f048baf5b679b5a4a56dd.zip
Merge branch 'k.o/for-4.10-rc' into HEAD
Diffstat (limited to 'include/rdma')
-rw-r--r--include/rdma/ib_verbs.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index b1ac9735fbbe..8c61532cf521 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -352,6 +352,20 @@ static inline int ib_mtu_enum_to_int(enum ib_mtu mtu)
}
}
+static inline enum ib_mtu ib_mtu_int_to_enum(int mtu)
+{
+ if (mtu >= 4096)
+ return IB_MTU_4096;
+ else if (mtu >= 2048)
+ return IB_MTU_2048;
+ else if (mtu >= 1024)
+ return IB_MTU_1024;
+ else if (mtu >= 512)
+ return IB_MTU_512;
+ else
+ return IB_MTU_256;
+}
+
enum ib_port_state {
IB_PORT_NOP = 0,
IB_PORT_DOWN = 1,