提交 d33753d4 编写于 作者: Y Yonglong Liu 提交者: Yang Yingliang

net: hns3: fix RoCE calling the wrong function problem

driver inclusion
category: bugfix
bugzilla: NA
CVE: NA

----------------------------

In hnae3.h, if the function is not for test, the definition must before
CONFIG_HNS3_TEST! Because RoCE will use hnae3.h, and it won't set
CONFIG_HNS3_TEST, that may cause RoCE calling the wrong function.
Signed-off-by: NYonglong Liu <liuyonglong@huawei.com>
Reviewed-by: NYongxin Li <liyongxin1@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 e655f1e6
...@@ -552,13 +552,6 @@ struct hnae3_ae_ops { ...@@ -552,13 +552,6 @@ struct hnae3_ae_ops {
void (*mac_disconnect_phy)(struct hnae3_handle *handle); void (*mac_disconnect_phy)(struct hnae3_handle *handle);
bool (*reset_done)(struct hnae3_handle *handle, bool done); bool (*reset_done)(struct hnae3_handle *handle, bool done);
void (*handle_imp_error)(struct hnae3_handle *handle); void (*handle_imp_error)(struct hnae3_handle *handle);
#ifdef CONFIG_HNS3_TEST
int (*send_cmdq)(struct hnae3_handle *handle, void *data, int num);
int (*test_cmdq)(struct hnae3_handle *handle, void *data, int *len);
int (*ecc_handle)(struct hnae3_ae_dev *ae_dev);
int (*priv_ops)(struct hnae3_handle *handle, int opcode,
void *data, int length);
#endif
int (*get_vf_config)(struct hnae3_handle *handle, int vf, int (*get_vf_config)(struct hnae3_handle *handle, int vf,
struct ifla_vf_info *ivf); struct ifla_vf_info *ivf);
int (*set_vf_link_state)(struct hnae3_handle *handle, int vf, int (*set_vf_link_state)(struct hnae3_handle *handle, int vf,
...@@ -574,6 +567,18 @@ struct hnae3_ae_ops { ...@@ -574,6 +567,18 @@ struct hnae3_ae_ops {
bool (*get_cmdq_stat)(struct hnae3_handle *handle); bool (*get_cmdq_stat)(struct hnae3_handle *handle);
int (*suspend)(struct hnae3_ae_dev *ae_dev); int (*suspend)(struct hnae3_ae_dev *ae_dev);
int (*resume)(struct hnae3_ae_dev *ae_dev); int (*resume)(struct hnae3_ae_dev *ae_dev);
/* Notice! If the function is not for test, the definition must before
* CONFIG_HNS3_TEST! Because RoCE will use this head file, and it won't
* set CONFIG_HNS3_TEST, that may cause RoCE calling the wrong function.
*/
#ifdef CONFIG_HNS3_TEST
int (*send_cmdq)(struct hnae3_handle *handle, void *data, int num);
int (*test_cmdq)(struct hnae3_handle *handle, void *data, int *len);
int (*ecc_handle)(struct hnae3_ae_dev *ae_dev);
int (*priv_ops)(struct hnae3_handle *handle, int opcode,
void *data, int length);
#endif
}; };
struct hnae3_dcb_ops { struct hnae3_dcb_ops {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册