Browse Source

[hermon] Add missing __attribute__ (( packed ))

On 64-bit builds, MLX_DECLARE_STRUCT() produces a structure that is
always a multiple of 64 bits long, causing the HCR structure to be
over-length by one dword.  This in turn causes hermon_cmd() to write
beyond the end of the HCR, which causes commands to fail.

Reported-by: Itay Gazit <itayg@mellanox.co.il>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 14 years ago
parent
commit
e8c636fe75
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      src/drivers/infiniband/mlx_bitops.h

+ 2
- 2
src/drivers/infiniband/mlx_bitops.h View File

@@ -46,8 +46,8 @@ typedef unsigned char pseudo_bit_t;
46 46
 		uint8_t bytes[ sizeof ( struct _structure ## _st ) / 8 ];    \
47 47
 		uint32_t dwords[ sizeof ( struct _structure ## _st ) / 32 ]; \
48 48
 		struct _structure ## _st *dummy[0];			     \
49
-	    } u;							     \
50
-	}
49
+	    } __attribute__ (( packed )) u;				     \
50
+	} __attribute__ (( packed ))
51 51
 
52 52
 /** Get pseudo_bit_t structure type from wrapper structure pointer */
53 53
 #define MLX_PSEUDO_STRUCT( _ptr )					     \

Loading…
Cancel
Save