Commit a4de0228 authored by Huazhong Tan's avatar Huazhong Tan Committed by Jakub Kicinski

net: hns3: provide .get_cmdq_stat interface for the client

This patch provides a new interface for the client to query
whether CMDQ is ready to work.
Signed-off-by: default avatarHuazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 4279b4d5
...@@ -552,6 +552,7 @@ struct hnae3_ae_ops { ...@@ -552,6 +552,7 @@ struct hnae3_ae_ops {
int (*set_vf_mac)(struct hnae3_handle *handle, int vf, u8 *p); int (*set_vf_mac)(struct hnae3_handle *handle, int vf, u8 *p);
int (*get_module_eeprom)(struct hnae3_handle *handle, u32 offset, int (*get_module_eeprom)(struct hnae3_handle *handle, u32 offset,
u32 len, u8 *data); u32 len, u8 *data);
bool (*get_cmdq_stat)(struct hnae3_handle *handle);
}; };
struct hnae3_dcb_ops { struct hnae3_dcb_ops {
......
...@@ -6402,6 +6402,14 @@ static bool hclge_get_hw_reset_stat(struct hnae3_handle *handle) ...@@ -6402,6 +6402,14 @@ static bool hclge_get_hw_reset_stat(struct hnae3_handle *handle)
hclge_read_dev(&hdev->hw, HCLGE_FUN_RST_ING); hclge_read_dev(&hdev->hw, HCLGE_FUN_RST_ING);
} }
static bool hclge_get_cmdq_stat(struct hnae3_handle *handle)
{
struct hclge_vport *vport = hclge_get_vport(handle);
struct hclge_dev *hdev = vport->back;
return test_bit(HCLGE_STATE_CMD_DISABLE, &hdev->state);
}
static bool hclge_ae_dev_resetting(struct hnae3_handle *handle) static bool hclge_ae_dev_resetting(struct hnae3_handle *handle)
{ {
struct hclge_vport *vport = hclge_get_vport(handle); struct hclge_vport *vport = hclge_get_vport(handle);
...@@ -11311,6 +11319,7 @@ static const struct hnae3_ae_ops hclge_ops = { ...@@ -11311,6 +11319,7 @@ static const struct hnae3_ae_ops hclge_ops = {
.set_vf_rate = hclge_set_vf_rate, .set_vf_rate = hclge_set_vf_rate,
.set_vf_mac = hclge_set_vf_mac, .set_vf_mac = hclge_set_vf_mac,
.get_module_eeprom = hclge_get_module_eeprom, .get_module_eeprom = hclge_get_module_eeprom,
.get_cmdq_stat = hclge_get_cmdq_stat,
}; };
static struct hnae3_ae_algo ae_algo = { static struct hnae3_ae_algo ae_algo = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment