[Open-FCoE] [FCoE] Fixing some padding issues on ARM

Adhiraj Joshi adhiraj at linsyssoft.com
Fri May 30 14:44:03 UTC 2008


[FCoE] This patch fixes some padding issues on the arm processor.
Description:
On ARM machine I saw kernel panics at couple of places which were triggered
from ASSERT_NOTIMPL().
For ex. On ARM, the sizeof struct fc_frame_header differs from some
hardcoded value and hence the ASSERT_NOTIMPL() panics the kernel.
To fix this some data types/structures have to be marked with "packed"
attribute to overcome the padding issues.
This change fixed the panic on the target ARM machine.

Signed-off by: Adhiraj Joshi <adhiraj at linsyssoft.com>

---

diff -Narup open-fcoe-misc.old/include/net_types.h
open-fcoe-misc/include/net_types.h
--- open-fcoe-misc.old/include/net_types.h      2008-05-09
02:23:37.000000000 -0700
+++ open-fcoe-misc/include/net_types.h  2008-05-30 07:07:51.000000000 -0700
@@ -35,7 +35,7 @@ typedef unsigned char net8_t;         /* direct
  */
 typedef struct {
        u_int16_t       net_data;
-} net16_t;
+} __attribute__ ((packed)) net16_t;

 typedef struct {
        u_int32_t       net_data;
@@ -53,7 +53,7 @@ typedef struct {
  */
 typedef struct {
        unsigned char   net_data[3];
-} net24_t;
+} __attribute__ ((packed)) net24_t;

 /*
  * 48-bit type.  Byte aligned.
diff -Narup open-fcoe-misc.old/libfc/fc_ils.h open-fcoe-misc/libfc/fc_ils.h
--- open-fcoe-misc.old/libfc/fc_ils.h   2008-05-09 02:23:36.000000000 -0700
+++ open-fcoe-misc/libfc/fc_ils.h       2008-05-30 06:56:27.000000000 -0700
@@ -166,7 +166,7 @@ struct fc_ils_gnf {                 /* general name fo
        net8_t          gnf_len;        /* name length, a multiple of 4 */
        net8_t          _gnf_resvd[3];
        char            gnv_val[1];     /* name, possibly with zero fill */
-};
+}__attribute__ ((packed)) ;

 #define        FC_ILS_GNF_LEN  5       /* expected length of structure */
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.open-fcoe.org/pipermail/fcoe-devel/attachments/20080530/63bf88fa/attachment.html>


More information about the devel mailing list