Commit f111581c authored by shaojijie's avatar shaojijie Committed by Jiantao Xiao
Browse files

net: hns3: add supports fast reporting of faulty nodes

driver inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I6QRKC


CVE: NA

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

Services are switched only when no response is received within 10 seconds.
As a result, services cannot be switched quickly. Therefore, if the chip
is not suspended, the NIC sends a specific message to notify other nodes
of the event. In this way, the service switchover is performed quickly.

Signed-off-by: default avatarshaojijie <shaojijie@huawei.com>
Signed-off-by: default avatarTian Jiang <jiangtian6@h-partners.com>
Signed-off-by: default avatarJiantao Xiao <xiaojiantao1@h-partners.com>
parent 26f6cbad
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -103,6 +103,7 @@ enum HNAE3_DEV_CAP_BITS {
	HNAE3_DEV_SUPPORT_LANE_NUM_B,
	HNAE3_DEV_SUPPORT_WOL_B,
	HNAE3_DEV_SUPPORT_VF_FAULT_B,
	HNAE3_DEV_SUPPORT_NOTIFY_PKT_B,
};

#define hnae3_ae_dev_fd_supported(ae_dev) \
@@ -174,6 +175,9 @@ enum HNAE3_DEV_CAP_BITS {
#define hnae3_ae_dev_vf_fault_supported(ae_dev) \
	test_bit(HNAE3_DEV_SUPPORT_VF_FAULT_B, (ae_dev)->caps)

#define hnae3_ae_dev_notify_pkt_supported(ae_dev) \
	test_bit(HNAE3_DEV_SUPPORT_NOTIFY_PKT_B, (ae_dev)->caps)

enum HNAE3_PF_CAP_BITS {
	HNAE3_PF_SUPPORT_VLAN_FLTR_MDF_B = 0,
};
+10 −0
Original line number Diff line number Diff line
@@ -30,6 +30,8 @@ enum hnae3_ext_opcode {
	HNAE3_EXT_OPC_EVENT_CALLBACK,
	HNAE3_EXT_OPC_GET_PFC_STORM_PARA,
	HNAE3_EXT_OPC_SET_PFC_STORM_PARA,
	HNAE3_EXT_OPC_SET_NOTIFY_PARAM,
	HNAE3_EXT_OPC_SET_NOTIFY_START,
};

struct hnae3_pfc_storm_para {
@@ -39,4 +41,12 @@ struct hnae3_pfc_storm_para {
	u32 times;
	u32 recovery_period_ms;
};

struct hnae3_notify_pkt_param {
	u32 ipg;     /* inter-packet gap of sending, the unit is one cycle of clock */
	u16 num;     /* packet number of sending */
	u8 enable;   /* send enable, 0=Disable, 1=Enable */
	u8 init;     /* initialization flag, product does not need to set value */
	u8 data[64]; /* note packet data */
};
#endif
+1 −0
Original line number Diff line number Diff line
@@ -156,6 +156,7 @@ static const struct hclge_comm_caps_bit_map hclge_pf_cmd_caps[] = {
	{HCLGE_COMM_CAP_LANE_NUM_B, HNAE3_DEV_SUPPORT_LANE_NUM_B},
	{HCLGE_COMM_CAP_WOL_B, HNAE3_DEV_SUPPORT_WOL_B},
	{HCLGE_COMM_CAP_VF_FAULT_B, HNAE3_DEV_SUPPORT_VF_FAULT_B},
	{HCLGE_COMM_CAP_NOTIFY_PKT_B, HNAE3_DEV_SUPPORT_NOTIFY_PKT_B},
};

static const struct hclge_comm_caps_bit_map hclge_vf_cmd_caps[] = {
+1 −0
Original line number Diff line number Diff line
@@ -348,6 +348,7 @@ enum HCLGE_COMM_CAP_BITS {
	HCLGE_COMM_CAP_VF_FAULT_B = 26,
	HCLGE_COMM_CAP_LANE_NUM_B = 27,
	HCLGE_COMM_CAP_WOL_B = 28,
	HCLGE_COMM_CAP_NOTIFY_PKT_B = 29,
};

enum HCLGE_COMM_API_CAP_BITS {
+14 −0
Original line number Diff line number Diff line
@@ -143,3 +143,17 @@ int nic_get_pfc_storm_para(struct net_device *ndev, int dir, int *enable,
	return 0;
}
EXPORT_SYMBOL(nic_get_pfc_storm_para);

int nic_set_notify_pkt_param(struct net_device *ndev,
			     struct hnae3_notify_pkt_param *param)
{
	return nic_invoke_pri_ops(ndev, HNAE3_EXT_OPC_SET_NOTIFY_PARAM,
				  param, sizeof(*param));
}
EXPORT_SYMBOL(nic_set_notify_pkt_param);

int nic_set_notify_pkt_start(struct net_device *ndev)
{
	return nic_invoke_pri_ops(ndev, HNAE3_EXT_OPC_SET_NOTIFY_START, NULL, 0);
}
EXPORT_SYMBOL(nic_set_notify_pkt_start);
Loading