]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
net: hns3: fix endian issue when PF get mbx message flag
authorPeng Li <lipeng321@huawei.com>
Thu, 8 Mar 2018 11:41:52 +0000 (19:41 +0800)
committerKhalid Elmously <khalid.elmously@canonical.com>
Wed, 6 Jun 2018 18:39:59 +0000 (14:39 -0400)
BugLink: https://bugs.launchpad.net/bugs/1768670
This patch fixes the endian issue when PF get mbx message flag.

Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit f18f0d4d68096ff73eea93c80b1fe5df5514b07f)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c

index 6d48ebfcc509a865c3b3fc29f8c49f25b1710749..f332de6004fbccc1ad3fc25f0fd0d5ad4315ae08 100644 (file)
@@ -333,11 +333,11 @@ void hclge_mbx_handler(struct hclge_dev *hdev)
        struct hclge_mbx_vf_to_pf_cmd *req;
        struct hclge_vport *vport;
        struct hclge_desc *desc;
-       int ret;
+       int ret, flag;
 
+       flag = le16_to_cpu(crq->desc[crq->next_to_use].flag);
        /* handle all the mailbox requests in the queue */
-       while (hnae_get_bit(crq->desc[crq->next_to_use].flag,
-                           HCLGE_CMDQ_RX_OUTVLD_B)) {
+       while (hnae_get_bit(flag, HCLGE_CMDQ_RX_OUTVLD_B)) {
                desc = &crq->desc[crq->next_to_use];
                req = (struct hclge_mbx_vf_to_pf_cmd *)desc->data;
 
@@ -412,6 +412,7 @@ void hclge_mbx_handler(struct hclge_dev *hdev)
                }
                crq->desc[crq->next_to_use].flag = 0;
                hclge_mbx_ring_ptr_move_crq(crq);
+               flag = le16_to_cpu(crq->desc[crq->next_to_use].flag);
        }
 
        /* Write back CMDQ_RQ header pointer, M7 need this pointer */