mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-24 17:59:32 +00:00
net: hns3: add opcode about query and clear RAS & MSI-X to special opcode
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>
This commit is contained in:
parent
36701aee36
commit
7832f0bd9f
2 changed files with 5 additions and 17 deletions
|
@ -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++) {
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in a new issue