ibmvnic: Fix ibmvnic_change_mac_addr struct format

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>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Murilo Fossa Vicentini 2017-04-19 13:44:35 -04:00 коммит произвёл David S. Miller
Родитель ffa738555b
Коммит 993a82b0ff
2 изменённых файлов: 4 добавлений и 3 удалений

Просмотреть файл

@ -2890,11 +2890,12 @@ static void ibmvnic_handle_crq(union ibmvnic_crq *crq,
struct ibmvnic_generic_crq *gen_crq = &crq->generic; struct ibmvnic_generic_crq *gen_crq = &crq->generic;
struct net_device *netdev = adapter->netdev; struct net_device *netdev = adapter->netdev;
struct device *dev = &adapter->vdev->dev; struct device *dev = &adapter->vdev->dev;
u64 *u64_crq = (u64 *)crq;
long rc; long rc;
netdev_dbg(netdev, "Handling CRQ: %016lx %016lx\n", netdev_dbg(netdev, "Handling CRQ: %016lx %016lx\n",
((unsigned long int *)crq)[0], (unsigned long int)cpu_to_be64(u64_crq[0]),
((unsigned long int *)crq)[1]); (unsigned long int)cpu_to_be64(u64_crq[1]));
switch (gen_crq->first) { switch (gen_crq->first) {
case IBMVNIC_CRQ_INIT_RSP: case IBMVNIC_CRQ_INIT_RSP:
switch (gen_crq->cmd) { switch (gen_crq->cmd) {

Просмотреть файл

@ -518,8 +518,8 @@ struct ibmvnic_change_mac_addr {
u8 first; u8 first;
u8 cmd; u8 cmd;
u8 mac_addr[6]; u8 mac_addr[6];
struct ibmvnic_rc rc;
u8 reserved[4]; u8 reserved[4];
struct ibmvnic_rc rc;
} __packed __aligned(8); } __packed __aligned(8);
struct ibmvnic_multicast_ctrl { struct ibmvnic_multicast_ctrl {