Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a524ef77 authored by Michal Schmidt's avatar Michal Schmidt Committed by David S. Miller
Browse files

bnx2x: fix receive of VF->PF mailbox messages by the PF on big-endian



On ppc64 the PF did not receive messages from VFs correctly.

Fields of struct vf_pf_event_data are little-endian.

Signed-off-by: default avatarMichal Schmidt <mschmidt@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5cc5c2d2
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -5213,9 +5213,9 @@ struct eth_event_data {
struct vf_pf_event_data {
	u8 vf_id;
	u8 reserved0;
	u16 reserved1;
	u32 msg_addr_lo;
	u32 msg_addr_hi;
	__le16 reserved1;
	__le32 msg_addr_lo;
	__le32 msg_addr_hi;
};

/*
+4 −2
Original line number Diff line number Diff line
@@ -2187,8 +2187,10 @@ void bnx2x_vf_mbx_schedule(struct bnx2x *bp,

	/* Update VFDB with current message and schedule its handling */
	mutex_lock(&BP_VFDB(bp)->event_mutex);
	BP_VF_MBX(bp, vf_idx)->vf_addr_hi = vfpf_event->msg_addr_hi;
	BP_VF_MBX(bp, vf_idx)->vf_addr_lo = vfpf_event->msg_addr_lo;
	BP_VF_MBX(bp, vf_idx)->vf_addr_hi =
		le32_to_cpu(vfpf_event->msg_addr_hi);
	BP_VF_MBX(bp, vf_idx)->vf_addr_lo =
		le32_to_cpu(vfpf_event->msg_addr_lo);
	BP_VFDB(bp)->event_occur |= (1ULL << vf_idx);
	mutex_unlock(&BP_VFDB(bp)->event_mutex);