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

!11071 【olk 5.10】net: hns3: add some feature patches

Merge Pull Request from: @chen-hao418 
 
    driver inclusion
    category: feature
    bugzilla: https://gitee.com/openeuler/kernel/issues/IALRBN
    CVE: NA
 
 
Link:https://gitee.com/openeuler/kernel/pulls/11071

 

Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parents 4d846c94 b4e04c2d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ hclgevf-objs = hns3vf/hclgevf_main.o hns3vf/hclgevf_mbx.o hns3vf/hclgevf_devlin
hclgevf-$(CONFIG_HNS3_UBL) += hns3_common/hclge_comm_unic_addr.o hns3vf/hclgevf_unic_ip.o hns3vf/hclgevf_unic_guid.o \
				hns3vf/hclgevf_unic_addr.o
hclgevf-$(CONFIG_UB_UDMA_HNS3) += hns3vf/hclgevf_udma.o
hclgevf-$(CONFIG_HNS3_DCB) += hns3vf/hclgevf_dcb.o

obj-$(CONFIG_HNS3_HCLGE) += hclge.o
hclge-objs = hns3pf/hclge_main.o hns3pf/hclge_mdio.o hns3pf/hclge_tm.o hns3pf/hclge_sysfs.o hns3pf/hclge_regs.o \
+16 −1
Original line number Diff line number Diff line
@@ -7,6 +7,8 @@
#include <linux/mutex.h>
#include <linux/types.h>

#include "hnae3.h"

enum HCLGE_MBX_OPCODE {
	HCLGE_MBX_RESET = 0x01,		/* (VF -> PF) assert reset */
	HCLGE_MBX_ASSERTING_RESET,	/* (PF -> VF) PF is asserting reset */
@@ -49,6 +51,8 @@ enum HCLGE_MBX_OPCODE {
	HCLGE_MBX_GET_RING_VECTOR_MAP,	/* (VF -> PF) get ring-to-vector map */
	HCLGE_MBX_SET_QB = 0x28,        /* (VF -> PF) set queue bonding */
	HCLGE_MBX_PUSH_QB_STATE,        /* (PF -> VF) push qb state */
	HCLGE_MBX_SET_TC = 0x30,        /* (VF -> PF) set tc */
	HCLGE_MBX_EVENT_NOTIFY,  /* (PF -> VF) event notify */

	HCLGE_MBX_SET_MGUID = 0x50,	/* (VF -> PF) set mc guid */
	HCLGE_UNIC_MBX_SET_IP,		/* (VF -> PF) set ip addr */
@@ -100,6 +104,10 @@ enum hclge_mbx_qb_cfg_subcode {
	HCLGE_MBX_QB_GET_STATE		/* query whether qb enabled */
};

enum hclge_mbx_event_notify_type {
	HCLGE_MBX_DSCP_CHANGE = 0,
};

#define HCLGE_MBX_MAX_MSG_SIZE	14
#define HCLGE_MBX_MAX_RESP_DATA_SIZE	8U
#define HCLGE_MBX_MAX_RING_CHAIN_PARAM_NUM	4
@@ -115,7 +123,7 @@ struct hclge_ring_chain_param {

struct hclge_basic_info {
	u8 hw_tc_map;
	u8 rsv;
	u8 tc_max;
	__le16 mbx_api_version;
	__le32 pf_caps;
};
@@ -243,6 +251,13 @@ struct hclge_mbx_mtu_info {
	__le32 mtu;
};

struct hclge_mbx_tc_info {
	__le32 prio_tc_map;
	u8 tc_dwrr[HNAE3_MAX_TC];
	u8 num_tc;
	u8 tc_sch_mode; /* 0: sp; 1: dwrr */
};

#pragma pack()

/* used by VF to store the received Async responses from PF */
+10 −0
Original line number Diff line number Diff line
@@ -142,6 +142,7 @@ enum HNAE3_DEV_CAP_BITS {
	HNAE3_DEV_SUPPORT_TM_FLUSH_B,
	HNAE3_DEV_SUPPORT_VF_FAULT_B,
	HNAE3_DEV_SUPPORT_ERR_MOD_GEN_REG_B,
	HNAE3_DEV_SUPPORT_VF_MULTI_TCS_B,
};

#define hnae3_ae_dev_fd_supported(ae_dev) \
@@ -222,8 +223,12 @@ enum HNAE3_DEV_CAP_BITS {
#define hnae3_ae_dev_gen_reg_dfx_supported(hdev) \
	test_bit(HNAE3_DEV_SUPPORT_ERR_MOD_GEN_REG_B, (hdev)->ae_dev->caps)

#define hnae3_ae_dev_vf_multi_tcs_supported(hdev) \
	test_bit(HNAE3_DEV_SUPPORT_VF_MULTI_TCS_B, (hdev)->ae_dev->caps)

enum HNAE3_PF_CAP_BITS {
	HNAE3_PF_SUPPORT_VLAN_FLTR_MDF_B = 0,
	HNAE3_PF_SUPPORT_VF_MULTI_TCS_B = 1,
};
#define ring_ptr_move_fw(ring, p) \
	((ring)->p = ((ring)->p + 1) % (ring)->desc_num)
@@ -881,6 +886,10 @@ struct hnae3_dcb_ops {
	int (*ieee_setpfc)(struct hnae3_handle *, struct ieee_pfc *);
	int (*ieee_setapp)(struct hnae3_handle *h, struct dcb_app *app);
	int (*ieee_delapp)(struct hnae3_handle *h, struct dcb_app *app);
	int (*ieee_setmaxrate)(struct hnae3_handle *h,
			       struct ieee_maxrate *maxrate);
	int (*ieee_getmaxrate)(struct hnae3_handle *h,
			       struct ieee_maxrate *maxrate);

	/* DCBX configuration */
	u8   (*getdcbx)(struct hnae3_handle *);
@@ -914,6 +923,7 @@ struct hnae3_tc_info {

#define HNAE3_MAX_DSCP			64
#define HNAE3_PRIO_ID_INVALID		0xff
#define HNAE3_PRIO_ID_MAP_INVALID	0xf
struct hnae3_knic_private_info {
	struct net_device *netdev; /* Set by KNIC client when init instance */
	u16 rss_size;		   /* Allocated RSS queues */
+2 −0
Original line number Diff line number Diff line
@@ -159,6 +159,7 @@ static const struct hclge_comm_caps_bit_map hclge_pf_cmd_caps[] = {
	{HCLGE_COMM_CAP_TM_FLUSH_B, HNAE3_DEV_SUPPORT_TM_FLUSH_B},
	{HCLGE_COMM_CAP_VF_FAULT_B, HNAE3_DEV_SUPPORT_VF_FAULT_B},
	{HCLGE_COMM_CAP_ERR_MOD_GEN_REG_B, HNAE3_DEV_SUPPORT_ERR_MOD_GEN_REG_B},
	{HCLGE_COMM_CAP_VF_MULTI_TCS, HNAE3_DEV_SUPPORT_VF_MULTI_TCS_B},
};

static const struct hclge_comm_caps_bit_map hclge_vf_cmd_caps[] = {
@@ -172,6 +173,7 @@ static const struct hclge_comm_caps_bit_map hclge_vf_cmd_caps[] = {
	{HCLGE_COMM_CAP_RXD_ADV_LAYOUT_B, HNAE3_DEV_SUPPORT_RXD_ADV_LAYOUT_B},
	{HCLGE_COMM_CAP_CQ_B, HNAE3_DEV_SUPPORT_CQ_B},
	{HCLGE_COMM_CAP_GRO_B, HNAE3_DEV_SUPPORT_GRO_B},
	{HCLGE_COMM_CAP_VF_MULTI_TCS, HNAE3_DEV_SUPPORT_VF_MULTI_TCS_B},
};

static void
+4 −0
Original line number Diff line number Diff line
@@ -268,6 +268,9 @@ enum hclge_opcode_type {
	HCLGE_OPC_IMP_STATS_INFO		= 0x7013,
	HCLGE_OPC_IMP_COMPAT_CFG		= 0x701A,

	/* dscp pri map command */
	HCLGE_OPC_DSCP_PRI_MAP		= 0x7039,

	/* SFP command */
	HCLGE_OPC_GET_SFP_EEPROM	= 0x7100,
	HCLGE_OPC_GET_SFP_EXIST		= 0x7101,
@@ -366,6 +369,7 @@ enum HCLGE_COMM_CAP_BITS {
	HCLGE_COMM_CAP_NOTIFY_PKT_B = 29,
	HCLGE_COMM_CAP_TM_FLUSH_B = 31,
	HCLGE_COMM_CAP_ERR_MOD_GEN_REG_B = 32,
	HCLGE_COMM_CAP_VF_MULTI_TCS = 34,
};

enum HCLGE_COMM_API_CAP_BITS {
Loading