Re: [RFC v2 03/10] IB/hfi-vnic: Virtual Network Interface Controller (VNIC) netdev

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

 



On Thu, Dec 15, 2016 at 09:24:20PM -0700, Jason Gunthorpe wrote:
>>+struct __hfi_vesw_info {
>>+	u16  fabric_id;
>>+	u16  vesw_id;
>>+
>>+	u8   rsvd0[6];
>>+	u16  def_port_mask;
>>+
>>+	u8   rsvd1[2];
>>+	u16  pkey;
>>+
>>+	u8   rsvd2[4];
>>+	u32  u_mcast_dlid;
>>+	u32  u_ucast_dlid[HFI_VESW_MAX_NUM_DEF_PORT];
>>+
>>+	u8   rsvd3[44];
>>+	u16  eth_mtu[HFI_VNIC_MAX_NUM_PCP];
>>+	u16  eth_mtu_non_vlan;
>>+	u8   rsvd4[2];
>>+} __packed;
>
>This goes on the network too? Also looks like it has endian problems.
>
>Ditto for all the __packed structures.
>

This is in CPU format. There is a separate big endian version of
this

Why are CPU handled structures packed and full of reserved fields?
Don't pack them if they are not pushed out to the network..

There were lots of __packed structures, any that go on the network
need be/le annoations.


Well, driver treats the reserved fields to be sticky. ie., information
block returned (upon GET) to EM is not changed (from SET) except few fields which driver is expected to modify. Structures that go on wire are big endian __packed structures in hfi_vnic_encap.h. Ok, I will remove the __packed attribute from CPU handled structures here.

Niranjana

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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