net: hns3: Change fw error code NOT_EXEC to NOT_SUPPORTED
authorYunsheng Lin <linyunsheng@huawei.com>
Tue, 22 Jan 2019 23:39:34 +0000 (07:39 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Dec 2019 14:38:00 +0000 (15:38 +0100)
[ Upstream commit 4a402f47cfce904051cd8b31bef4fe2910d9dce9 ]

According to firmware error code definition, the error code of 2
means NOT_SUPPORTED, this patch changes it to NOT_SUPPORTED.

Signed-off-by: Yunsheng Lin <linyunsheng@huawei.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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h

index 8b511e6e0ce9d2dac76249b9178fc81365031a7e..396ea0db71023384b1bd17e05ab09f266611e910 100644 (file)
@@ -251,6 +251,8 @@ int hclge_cmd_send(struct hclge_hw *hw, struct hclge_desc *desc, int num)
                        if ((enum hclge_cmd_return_status)desc_ret ==
                            HCLGE_CMD_EXEC_SUCCESS)
                                retval = 0;
+                       else if (desc_ret == HCLGE_CMD_NOT_SUPPORTED)
+                               retval = -EOPNOTSUPP;
                        else
                                retval = -EIO;
                        hw->cmq.last_status = (enum hclge_cmd_status)desc_ret;
index 758cf394813126450ce190b24d16af5e41f7b92b..3823ae6303ad619cf793f1c99a5d05a3b52423e1 100644 (file)
@@ -52,7 +52,7 @@ struct hclge_cmq_ring {
 enum hclge_cmd_return_status {
        HCLGE_CMD_EXEC_SUCCESS  = 0,
        HCLGE_CMD_NO_AUTH       = 1,
-       HCLGE_CMD_NOT_EXEC      = 2,
+       HCLGE_CMD_NOT_SUPPORTED = 2,
        HCLGE_CMD_QUEUE_FULL    = 3,
 };