net: hns3: add opcode about query and clear RAS & MSI-X to special opcode
authorWeihang Li <liweihang@hisilicon.com>
Mon, 3 Jun 2019 02:09:21 +0000 (10:09 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 3 Jun 2019 22:32:50 +0000 (15:32 -0700)
There are four commands being used to query and clear RAS and MSI-X
interrupts status. They should be contained in array of special opcodes
because these commands have several descriptors, and we need to judge
return value in the first descriptor rather than the last one as other
opcodes. In addition, we shouldn't set the NEXT_FLAG of first descriptor.

This patch fixes above issues.

Signed-off-by: Weihang Li <liweihang@hisilicon.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c

index e5329053842bc26c135bc2927d609a0e7baa8df4..7a3bde72415120ca417f560073f5a223287c231e 100644 (file)
@@ -173,7 +173,11 @@ static bool hclge_is_special_opcode(u16 opcode)
                             HCLGE_OPC_STATS_MAC,
                             HCLGE_OPC_STATS_MAC_ALL,
                             HCLGE_OPC_QUERY_32_BIT_REG,
-                            HCLGE_OPC_QUERY_64_BIT_REG};
+                            HCLGE_OPC_QUERY_64_BIT_REG,
+                            HCLGE_QUERY_CLEAR_MPF_RAS_INT,
+                            HCLGE_QUERY_CLEAR_PF_RAS_INT,
+                            HCLGE_QUERY_CLEAR_ALL_MPF_MSIX_INT,
+                            HCLGE_QUERY_CLEAR_ALL_PF_MSIX_INT};
        int i;
 
        for (i = 0; i < ARRAY_SIZE(spec_opcode); i++) {
index 83b07cef4d5023310c38e91914e0e471a796d9e5..b4a7e6a4060528cba4d8fac63c0d6e73b4daa14c 100644 (file)
@@ -1098,8 +1098,6 @@ static int hclge_handle_mpf_ras_error(struct hclge_dev *hdev,
        /* query all main PF RAS errors */
        hclge_cmd_setup_basic_desc(&desc[0], HCLGE_QUERY_CLEAR_MPF_RAS_INT,
                                   true);
-       desc[0].flag |= cpu_to_le16(HCLGE_CMD_FLAG_NEXT);
-
        ret = hclge_cmd_send(&hdev->hw, &desc[0], num);
        if (ret) {
                dev_err(dev, "query all mpf ras int cmd failed (%d)\n", ret);
@@ -1262,8 +1260,6 @@ static int hclge_handle_mpf_ras_error(struct hclge_dev *hdev,
 
        /* clear all main PF RAS errors */
        hclge_cmd_reuse_desc(&desc[0], false);
-       desc[0].flag |= cpu_to_le16(HCLGE_CMD_FLAG_NEXT);
-
        ret = hclge_cmd_send(&hdev->hw, &desc[0], num);
        if (ret)
                dev_err(dev, "clear all mpf ras int cmd failed (%d)\n", ret);
@@ -1293,8 +1289,6 @@ static int hclge_handle_pf_ras_error(struct hclge_dev *hdev,
        /* query all PF RAS errors */
        hclge_cmd_setup_basic_desc(&desc[0], HCLGE_QUERY_CLEAR_PF_RAS_INT,
                                   true);
-       desc[0].flag |= cpu_to_le16(HCLGE_CMD_FLAG_NEXT);
-
        ret = hclge_cmd_send(&hdev->hw, &desc[0], num);
        if (ret) {
                dev_err(dev, "query all pf ras int cmd failed (%d)\n", ret);
@@ -1348,8 +1342,6 @@ static int hclge_handle_pf_ras_error(struct hclge_dev *hdev,
 
        /* clear all PF RAS errors */
        hclge_cmd_reuse_desc(&desc[0], false);
-       desc[0].flag |= cpu_to_le16(HCLGE_CMD_FLAG_NEXT);
-
        ret = hclge_cmd_send(&hdev->hw, &desc[0], num);
        if (ret)
                dev_err(dev, "clear all pf ras int cmd failed (%d)\n", ret);
@@ -1667,8 +1659,6 @@ int hclge_handle_hw_msix_error(struct hclge_dev *hdev,
        /* query all main PF MSIx errors */
        hclge_cmd_setup_basic_desc(&desc[0], HCLGE_QUERY_CLEAR_ALL_MPF_MSIX_INT,
                                   true);
-       desc[0].flag |= cpu_to_le16(HCLGE_CMD_FLAG_NEXT);
-
        ret = hclge_cmd_send(&hdev->hw, &desc[0], mpf_bd_num);
        if (ret) {
                dev_err(dev, "query all mpf msix int cmd failed (%d)\n",
@@ -1700,8 +1690,6 @@ int hclge_handle_hw_msix_error(struct hclge_dev *hdev,
 
        /* clear all main PF MSIx errors */
        hclge_cmd_reuse_desc(&desc[0], false);
-       desc[0].flag |= cpu_to_le16(HCLGE_CMD_FLAG_NEXT);
-
        ret = hclge_cmd_send(&hdev->hw, &desc[0], mpf_bd_num);
        if (ret) {
                dev_err(dev, "clear all mpf msix int cmd failed (%d)\n",
@@ -1713,8 +1701,6 @@ int hclge_handle_hw_msix_error(struct hclge_dev *hdev,
        memset(desc, 0, bd_num * sizeof(struct hclge_desc));
        hclge_cmd_setup_basic_desc(&desc[0], HCLGE_QUERY_CLEAR_ALL_PF_MSIX_INT,
                                   true);
-       desc[0].flag |= cpu_to_le16(HCLGE_CMD_FLAG_NEXT);
-
        ret = hclge_cmd_send(&hdev->hw, &desc[0], pf_bd_num);
        if (ret) {
                dev_err(dev, "query all pf msix int cmd failed (%d)\n",
@@ -1753,8 +1739,6 @@ int hclge_handle_hw_msix_error(struct hclge_dev *hdev,
 
        /* clear all PF MSIx errors */
        hclge_cmd_reuse_desc(&desc[0], false);
-       desc[0].flag |= cpu_to_le16(HCLGE_CMD_FLAG_NEXT);
-
        ret = hclge_cmd_send(&hdev->hw, &desc[0], pf_bd_num);
        if (ret) {
                dev_err(dev, "clear all pf msix int cmd failed (%d)\n",