Re: [PATCH v2 for-next 07/16] IB/ipoib: Increase ipoib Datagram mode MTU's upper limit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 3/24/2020 9:46 AM, Dennis Dalessandro wrote:
On 3/24/2020 1:45 AM, Leon Romanovsky wrote:
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index babfdb0..da8d0d6 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -462,6 +462,11 @@ enum ib_mtu {
      IB_MTU_4096 = 5
  };

+enum opa_mtu {
+    OPA_MTU_8192 = 6,
+    OPA_MTU_10240 = 7
+};
+
  static inline int ib_mtu_enum_to_int(enum ib_mtu mtu)
  {
      switch (mtu) {
@@ -488,6 +493,28 @@ static inline enum ib_mtu ib_mtu_int_to_enum(int mtu)
          return IB_MTU_256;
  }

+static inline int opa_mtu_enum_to_int(enum opa_mtu mtu)
+{
+    switch (mtu) {
+    case OPA_MTU_8192:
+        return 8192;
+    case OPA_MTU_10240:
+        return 10240;
+    default:
+        return(ib_mtu_enum_to_int((enum ib_mtu)mtu));
+    }
+}
+
+static inline enum opa_mtu opa_mtu_int_to_enum(int mtu)
+{
+    if (mtu >= 10240)
+        return OPA_MTU_10240;
+    else if (mtu >= 8192)
+        return OPA_MTU_8192;
+    else
+        return ((enum opa_mtu)ib_mtu_int_to_enum(mtu));
+}

Is it possible to include opa_port_info.h in the ib_verbs.h and leave all
those functions there?

We can take a look at doing that.

Seems like it will bring in a number of changes that doesn't really buy us anything. We are only adding two inline functions and an enum here. Not like it's a ton of stuff.

-Denny




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux