All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nathan Fontenot <nfont@linux.vnet.ibm.com>
To: netdev@vger.kernel.org
Cc: brking@linux.vnet.ibm.com, jallen@linux.vnet.ibm.com,
	muvic@linux.vnet.ibm.com, tlfalcon@linux.vnet.ibm.com
Subject: [PATCH net-next 02/10] ibmvnic: Fix ibmvnic_change_mac_addr struct format
Date: Wed, 19 Apr 2017 13:44:35 -0400	[thread overview]
Message-ID: <20170419174434.37372.22338.stgit@ltcalpine2-lp23.aus.stglabs.ibm.com> (raw)
In-Reply-To: <20170419174015.37372.48544.stgit@ltcalpine2-lp23.aus.stglabs.ibm.com>

From: Murilo Fossa Vicentini <muvic@linux.vnet.ibm.com>

The ibmvnic_change_mac_addr struct alignment was not matching the defined
format in PAPR+, it had the reserved and return code fields swapped. As a
consequence, the CHANGE_MAC_ADDR_RSP commands were being improperly handled
and executed even when the operation wasn't successfully completed by the
system firmware.

Also changing the endianness of the debug message to make it easier to
parse the CRQ content.

Signed-off-by: Murilo Fossa Vicentini <muvic@linux.vnet.ibm.com>
Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
---
 drivers/net/ethernet/ibm/ibmvnic.c |    5 +++--
 drivers/net/ethernet/ibm/ibmvnic.h |    2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index 7bf3507..625896d 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -2890,11 +2890,12 @@ static void ibmvnic_handle_crq(union ibmvnic_crq *crq,
 	struct ibmvnic_generic_crq *gen_crq = &crq->generic;
 	struct net_device *netdev = adapter->netdev;
 	struct device *dev = &adapter->vdev->dev;
+	u64 *u64_crq = (u64 *)crq;
 	long rc;
 
 	netdev_dbg(netdev, "Handling CRQ: %016lx %016lx\n",
-		   ((unsigned long int *)crq)[0],
-		   ((unsigned long int *)crq)[1]);
+		   (unsigned long int)cpu_to_be64(u64_crq[0]),
+		   (unsigned long int)cpu_to_be64(u64_crq[1]));
 	switch (gen_crq->first) {
 	case IBMVNIC_CRQ_INIT_RSP:
 		switch (gen_crq->cmd) {
diff --git a/drivers/net/ethernet/ibm/ibmvnic.h b/drivers/net/ethernet/ibm/ibmvnic.h
index b0d0b89..1b404ca 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.h
+++ b/drivers/net/ethernet/ibm/ibmvnic.h
@@ -518,8 +518,8 @@ struct ibmvnic_change_mac_addr {
 	u8 first;
 	u8 cmd;
 	u8 mac_addr[6];
-	struct ibmvnic_rc rc;
 	u8 reserved[4];
+	struct ibmvnic_rc rc;
 } __packed __aligned(8);
 
 struct ibmvnic_multicast_ctrl {

  parent reply	other threads:[~2017-04-19 13:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-19 17:44 [PATCH net-next 00/10] ibmvnic: Updates and bug fixes Nathan Fontenot
2017-04-19 17:44 ` [PATCH net-next 01/10] ibmvnic: Report errors when failing to release sub-crqs Nathan Fontenot
2017-04-19 17:44 ` Nathan Fontenot [this message]
2017-04-19 17:44 ` [PATCH net-next 03/10] ibmvnic: Unmap longer term buffer before free Nathan Fontenot
2017-04-19 17:44 ` [PATCH net-next 04/10] ibmvnic: Fixup atomic API usage Nathan Fontenot
2017-04-19 17:44 ` [PATCH net-next 05/10] ibmvnic: Do not disable IRQ after scheduling tasklet Nathan Fontenot
2017-04-19 17:44 ` [PATCH net-next 06/10] ibmvnic: Remove inflight list Nathan Fontenot
2017-04-19 17:45 ` [PATCH net-next 07/10] ibmvnic: Correct crq and resource releasing Nathan Fontenot
2017-04-19 17:45 ` [PATCH net-next 08/10] ibmvnic: Disable irq prior to close Nathan Fontenot
2017-04-19 17:45 ` [PATCH net-next 09/10] ibmvnic: Allocate zero-filled memory for sub crqs Nathan Fontenot
2017-04-19 17:45 ` [PATCH net-next 10/10] ibmvnic: Remove unused bouce buffer Nathan Fontenot
2017-04-21 17:45 ` [PATCH net-next 00/10] ibmvnic: Updates and bug fixes 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=20170419174434.37372.22338.stgit@ltcalpine2-lp23.aus.stglabs.ibm.com \
    --to=nfont@linux.vnet.ibm.com \
    --cc=brking@linux.vnet.ibm.com \
    --cc=jallen@linux.vnet.ibm.com \
    --cc=muvic@linux.vnet.ibm.com \
    --cc=netdev@vger.kernel.org \
    --cc=tlfalcon@linux.vnet.ibm.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.