Unverified Commit 219f14d2 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!11247 [openEuler-22.03-LTS-SP4]UNIC: Using UBL-related macros to isolate UB header files

Merge Pull Request from: @mufengyan 
 
UNIC: Using UBL-related macros to isolate UB header files

driver inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IAN6V7


CVE: NA

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

To improve the maintainability of the HNS3 and UNIC drivers,
the header files used by the UNIC are isolated by using the
CONFIG_HNS3_UBL macro. Use CONFIG_UB_UDMA_HNS3 to isolate
the header files related to the UDMA and use the CONFIG_UBL
macro to isolate the ubl.h file.
When the driver runs in UB mode, the debugfs should use ub
dentry rather than the nic dentry. Thus we use the macro
CONFIG_HNS3_UBL to isolate these two dentries.

Signed-off-by: default avatarFengyan Mu <mufengyan@hisilicon.com>
 
Link:https://gitee.com/openeuler/kernel/pulls/11247

 

Reviewed-by: default avatarLin Yunsheng <linyunsheng@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parents 8dcba592 acd5977f
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -7,7 +7,9 @@
#include "hnae3.h"
#include "hns3_debugfs.h"
#include "hns3_enet.h"
#ifdef CONFIG_HNS3_UBL
#include "hns3_unic_debugfs.h"
#endif

static struct dentry *hns3_dbgfs_root;

+7 −0
Original line number Diff line number Diff line
@@ -5,6 +5,9 @@
#define __HNS3_DEBUGFS_H

#include "hnae3.h"
#ifdef CONFIG_HNS3_UBL
#include "hns3_unic_debugfs.h"
#endif

#define HNS3_DBG_READ_LEN	65536
#define HNS3_DBG_READ_LEN_128KB	0x20000
@@ -48,7 +51,11 @@ struct hns3_dbg_dentry_info {
struct hns3_dbg_cmd_info {
	const char *name;
	enum hnae3_dbg_cmd cmd;
#ifdef CONFIG_HNS3_UBL
	enum hns3_dbg_ub_dentry_type dentry;
#else
	enum hns3_dbg_dentry_type dentry;
#endif
	u32 buf_len;
	int (*init)(struct hnae3_handle *handle, unsigned int cmd);
};
+4 −0
Original line number Diff line number Diff line
@@ -23,11 +23,15 @@
#include <net/vxlan.h>
#include <net/geneve.h>

#if IS_ENABLED(CONFIG_UBL)
#include "ubl.h"
#endif
#include "hnae3.h"
#include "hnae3_ext.h"
#include "hns3_enet.h"
#ifdef CONFIG_HNS3_UBL
#include "hns3_unic.h"
#endif
#include "hns3_roh.h"
/* All hns3 tracepoints are defined by the include below, which
 * must be included exactly once across the whole kernel with
+2 −0
Original line number Diff line number Diff line
@@ -8,7 +8,9 @@

#include "hns3_enet.h"
#include "hns3_ethtool.h"
#ifdef CONFIG_HNS3_UBL
#include "hns3_unic.h"
#endif

/* tqp related stats */
#define HNS3_TQP_STAT(_string, _member)	{			\
+2 −0
Original line number Diff line number Diff line
@@ -18,7 +18,9 @@
#include "hnae3.h"
#include "hns3_debugfs.h"
#include "hns3_enet.h"
#ifdef CONFIG_HNS3_UBL
#include "hns3_unic_debugfs.h"
#endif

static struct hns3_dbg_dentry_info ub_dbg_dentry[] = {
	{
Loading