netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michal Schmidt <mschmidt@redhat.com>
To: netdev@vger.kernel.org
Cc: Yuval Mintz <Yuval.Mintz@qlogic.com>,
	Ariel Elior <Ariel.Elior@qlogic.com>
Subject: [PATCH net 3/7] bnx2x: fix receive of VF->PF mailbox messages by the PF on big-endian
Date: Wed,  2 Mar 2016 13:47:07 +0100	[thread overview]
Message-ID: <1456922831-15071-4-git-send-email-mschmidt@redhat.com> (raw)
In-Reply-To: <1456922831-15071-1-git-send-email-mschmidt@redhat.com>

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

Fields of struct vf_pf_event_data are little-endian.

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_hsi.h  | 6 +++---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c | 6 ++++--
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_hsi.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_hsi.h
index 47b13ed..1058591 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_hsi.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_hsi.h
@@ -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;
 };
 
 /*
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c
index 1374e53..bfae300 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c
@@ -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);
 
-- 
2.5.0

  parent reply	other threads:[~2016-03-02 12:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-02 12:47 [PATCH net 0/7] bnx2x: endianness fixes Michal Schmidt
2016-03-02 12:47 ` [PATCH net 1/7] bnx2x: fix crash on big-endian when adding VLAN Michal Schmidt
2016-03-02 12:47 ` [PATCH net 2/7] bnx2x: fix sending VF->PF messages on big-endian Michal Schmidt
2016-03-02 12:47 ` Michal Schmidt [this message]
2016-03-02 12:47 ` [PATCH net 4/7] bnx2x: access cfc_del_event only if the opcode is CFC_DEL Michal Schmidt
2016-03-02 12:47 ` [PATCH net 5/7] bnx2x: define fields of struct cfc_del_event_data as little-endian Michal Schmidt
2016-03-02 12:47 ` [PATCH net 6/7] bnx2x: define event data reserved fields " Michal Schmidt
2016-03-02 12:47 ` [PATCH net 7/7] bnx2x: fix indentation in bnx2x_sp_task() Michal Schmidt
2016-03-02 13:45 ` [PATCH net 0/7] bnx2x: endianness fixes Ariel Elior
2016-03-02 18:34 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1456922831-15071-4-git-send-email-mschmidt@redhat.com \
    --to=mschmidt@redhat.com \
    --cc=Ariel.Elior@qlogic.com \
    --cc=Yuval.Mintz@qlogic.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).