Skip to contentSkip to conversation

ehca: ehca_av.c use constant for max mtu

PATCH In review Hoang-Nam Nguyen 3 participants 3 messages Nov 5, 2006 – Nov 8, 2006 InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH 4/4 ehca: ehca_av.c use constant for max mtu

Hello Roland!
This is a patch for ehca, mainly a code change to adhere to kernel coding style. It defines and uses a constant EHCA_MAX_MTU instead hardcoded value.
Thanks!
Nam

---

 ehca_av.c |    5 ++---
 hipz_hw.h |    2 ++
 2 files changed, 4 insertions(+), 3 deletions(-)
drivers/infiniband/hw/ehca/ehca_av.c +2 -3
index 3bac197..214e2fd 100644
@@ -118,8 +118,7 @@ struct ib_ah *ehca_create_ah(struct ib_p
   }
   memcpy(&av->av.grh.word_1, &gid, sizeof(gid));
  }
- /* for the time being we use a hard coded PMTU of 2048 Bytes */
- av->av.pmtu = 4;
+ av->av.pmtu = EHCA_MAX_MTU;
 
  /* dgid comes in grh.word_3 */
  memcpy(&av->av.grh.word_3, &ah_attr->grh.dgid,
@@ -193,7 +192,7 @@ int ehca_modify_ah(struct ib_ah *ah, str
   memcpy(&new_ehca_av.grh.word_1, &gid, sizeof(gid));
  }
 
- new_ehca_av.pmtu = 4; /* see also comment in create_ah() */
+ new_ehca_av.pmtu = EHCA_MAX_MTU;
 
  memcpy(&new_ehca_av.grh.word_3, &ah_attr->grh.dgid,
         sizeof(ah_attr->grh.dgid));
drivers/infiniband/hw/ehca/hipz_hw.h +2 -0
index 3fc92b0..fad9136 100644
@@ -45,6 +45,8 @@ #define __HIPZ_HW_H__
 
 #include "ehca_tools.h"
 
+#define EHCA_MAX_MTU 4
+
 /* QP Table Entry Memory Map */
 struct hipz_qptemm {
  u64 qpx_hcr;
drivers/infiniband/hw/ehca/ehca_av.c +2 -3
index 3bac197..214e2fd 100644
@@ -118,8 +118,7 @@ struct ib_ah *ehca_create_ah(struct ib_p
 		}
 		memcpy(&av->av.grh.word_1, &gid, sizeof(gid));
 	}
-	/* for the time being we use a hard coded PMTU of 2048 Bytes */
-	av->av.pmtu = 4;
+	av->av.pmtu = EHCA_MAX_MTU;
 
 	/* dgid comes in grh.word_3 */
 	memcpy(&av->av.grh.word_3, &ah_attr->grh.dgid,
@@ -193,7 +192,7 @@ int ehca_modify_ah(struct ib_ah *ah, str
 		memcpy(&new_ehca_av.grh.word_1, &gid, sizeof(gid));
 	}
 
-	new_ehca_av.pmtu = 4; /* see also comment in create_ah() */
+	new_ehca_av.pmtu = EHCA_MAX_MTU;
 
 	memcpy(&new_ehca_av.grh.word_3, &ah_attr->grh.dgid,
 	       sizeof(ah_attr->grh.dgid));
drivers/infiniband/hw/ehca/hipz_hw.h +2 -0
index 3fc92b0..fad9136 100644
@@ -45,6 +45,8 @@ #define __HIPZ_HW_H__
 
 #include "ehca_tools.h"
 
+#define EHCA_MAX_MTU 4
+
 /* QP Table Entry Memory Map */
 struct hipz_qptemm {
 	u64 qpx_hcr;
#1 lore raw

Can you fix your patch sending technique ? A mangled patch inline with a non-mangled one in attachment... that's a bit gross. Just get a proper one inline and be done with it. If your mailer can't be coerced into not damaging patches, then use another one for sending them.

Cheers,
Ben