]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
Revert "UBUNTU: SAUCE: net: hns3: Fix for VF mailbox receiving unknown message"
authordann frazier <dann.frazier@canonical.com>
Thu, 16 Aug 2018 19:19:05 +0000 (13:19 -0600)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 5 Sep 2018 12:18:30 +0000 (14:18 +0200)
BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit 500c12d24904a684cc88ec4dc17771c4b1338596.
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: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c

index e9d5a4f96304e114722caea9c21509a4e0b6cc6c..0e57a76019eddccd17ea438a72951ca8c07286aa 100644 (file)
@@ -126,13 +126,6 @@ int hclgevf_send_mbx_msg(struct hclgevf_dev *hdev, u16 code, u16 subcode,
        return status;
 }
 
-static bool hclgevf_cmd_crq_empty(struct hclgevf_hw *hw)
-{
-       u32 tail = hclgevf_read_dev(hw, HCLGEVF_NIC_CRQ_TAIL_REG);
-
-       return tail == hw->cmq.crq.next_to_use;
-}
-
 void hclgevf_mbx_handler(struct hclgevf_dev *hdev)
 {
        struct hclgevf_mbx_resp_status *resp;
@@ -147,22 +140,11 @@ void hclgevf_mbx_handler(struct hclgevf_dev *hdev)
        resp = &hdev->mbx_resp;
        crq = &hdev->hw.cmq.crq;
 
-       while (!hclgevf_cmd_crq_empty(&hdev->hw)) {
+       flag = le16_to_cpu(crq->desc[crq->next_to_use].flag);
+       while (hnae3_get_bit(flag, HCLGEVF_CMDQ_RX_OUTVLD_B)) {
                desc = &crq->desc[crq->next_to_use];
                req = (struct hclge_mbx_pf_to_vf_cmd *)desc->data;
 
-               flag = le16_to_cpu(crq->desc[crq->next_to_use].flag);
-               if (unlikely(!hnae3_get_bit(flag, HCLGEVF_CMDQ_RX_OUTVLD_B))) {
-                       dev_warn(&hdev->pdev->dev,
-                                "dropped invalid mailbox message, code = %d\n",
-                                req->msg[0]);
-
-                       /* dropping/not processing this invalid message */
-                       crq->desc[crq->next_to_use].flag = 0;
-                       hclge_mbx_ring_ptr_move_crq(crq);
-                       continue;
-               }
-
                /* synchronous messages are time critical and need preferential
                 * treatment. Therefore, we need to acknowledge all the sync
                 * responses as quickly as possible so that waiting tasks do not
@@ -224,6 +206,7 @@ void hclgevf_mbx_handler(struct hclgevf_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 */