[openib-general] [PATCH] two fixes for INIT_IB

Michael S. Tsirkin mst at mellanox.co.il
Wed Apr 6 04:46:24 PDT 2005


fixes the INIT_IB command:
1. Allocate 64 bytes for the inbox, so that the address is 16
   bytes aligned as required by the manual.
2. Free the exact number of bytes we allocate.

Signed-off-by: Michael S. Tsirkin <mst at mellanox.co.il>

Index: mthca_cmd.c
===================================================================
--- mthca_cmd.c	(revision 2115)
+++ mthca_cmd.c	(working copy)
@@ -1183,7 +1183,7 @@ int mthca_INIT_IB(struct mthca_dev *dev,
 	int err;
 	u32 flags;
 
-#define INIT_IB_IN_SIZE          56
+#define INIT_IB_IN_SIZE          0x40
 #define INIT_IB_FLAGS_OFFSET     0x00
 #define INIT_IB_FLAG_SIG         (1 << 18)
 #define INIT_IB_FLAG_NG          (1 << 17)
@@ -1224,7 +1224,7 @@ int mthca_INIT_IB(struct mthca_dev *dev,
 	err = mthca_cmd(dev, indma, port, 0, CMD_INIT_IB,
 			CMD_TIME_CLASS_A, status);
 
-	pci_free_consistent(dev->pdev, INIT_HCA_IN_SIZE, inbox, indma);
+	pci_free_consistent(dev->pdev, INIT_IB_IN_SIZE, inbox, indma);
 	return err;
 }
 

-- 
MST - Michael S. Tsirkin



More information about the general mailing list