Skip to contentSkip to conversation

updates for hns3 PMD driver

PATCH In review Wei Hu (Xavier) 2 participants 23 messages Aug 25, 2020 – Sep 15, 2020 Network drivers

lore
Share & tools
lore
#0 lore raw

cover updates for hns3 PMD driver

This series are features and fixes for hns3 PMD driver.

Huisong Li (3):
net/hns3: replace private macro with RTE MAX net/hns3: fix default MAC addr from firmware net/hns3: fix some incomplete command structures

Wei Hu (Xavier) (8):
net/hns3: get device capability from firmware net/hns3: get dev specifications from firmware net/hns3: compatibility issues about Rx interrupts net/hns3: compatibility issues about Tx padding short frame net/hns3: add more hardware error types
net/hns3: support a maximun 256 FDIR counter net/hns3: change the log level to INFO
net/hns3: fix Rx/Tx queue offload capability

 drivers/net/hns3/hns3_cmd.c       |   36 +-
 drivers/net/hns3/hns3_cmd.h       |   94 ++-
 drivers/net/hns3/hns3_dcb.c       |    1 -
 drivers/net/hns3/hns3_dcb.h       |   14 +-
 drivers/net/hns3/hns3_ethdev.c    |  187 ++++-
 drivers/net/hns3/hns3_ethdev.h    |  138 +++-
 drivers/net/hns3/hns3_ethdev_vf.c |  124 ++-
 drivers/net/hns3/hns3_fdir.c      |    5 +
 drivers/net/hns3/hns3_intr.c      | 1236 ++++++++++++++++++++++++-----
 drivers/net/hns3/hns3_intr.h      |   40 +-
 drivers/net/hns3/hns3_regs.h      |    7 +
 drivers/net/hns3/hns3_rxtx.c      |   31 +-
 drivers/net/hns3/hns3_rxtx.h      |   11 +-
 drivers/net/hns3/hns3_stats.c     |   78 +-
 drivers/net/hns3/hns3_stats.h     |    2 +
 15 files changed, 1666 insertions(+), 338 deletions(-)
Signature · 1 line
2.27.0
#1 lore raw

PATCH 1/11 net/hns3: get device capability from firmware

From: "Wei Hu (Xavier)" <[email protected]>

This patch adds getting device capabilities from firmware, so driver can supply differnet cpabilities and specifications to upper level applications base on differnet versions of hardware network engine.

---
 drivers/net/hns3/hns3_cmd.c    | 36 ++++++++++++++++++++++++++++------
 drivers/net/hns3/hns3_cmd.h    | 19 +++++++++++++++++-
 drivers/net/hns3/hns3_ethdev.c |  3 ---
 drivers/net/hns3/hns3_ethdev.h | 29 +++++++++++++++++++++++++++
 4 files changed, 77 insertions(+), 10 deletions(-)
drivers/net/hns3/hns3_cmd.c +30 -6
index cbb09887c..0299072ef 100644
@@ -426,8 +426,29 @@ hns3_cmd_send(struct hns3_hw *hw, struct hns3_cmd_desc *desc, int num)
 	return retval;
 }
 
+static void hns3_parse_capability(struct hns3_hw *hw,
+				  struct hns3_query_version_cmd *cmd)
+{
+	uint32_t caps = rte_le_to_cpu_32(cmd->caps[0]);
+
+	if (hns3_get_bit(caps, HNS3_CAPS_UDP_GSO_B))
+		hns3_set_bit(hw->capability, HNS3_DEV_SUPPORT_UDP_GSO_B, 1);
+	if (hns3_get_bit(caps, HNS3_CAPS_ADQ_B))
+		hns3_set_bit(hw->capability, HNS3_DEV_SUPPORT_ADQ_B, 1);
+	if (hns3_get_bit(caps, HNS3_CAPS_PTP_B))
+		hns3_set_bit(hw->capability, HNS3_DEV_SUPPORT_PTP_B, 1);
+	if (hns3_get_bit(caps, HNS3_CAPS_TX_PUSH_B))
+		hns3_set_bit(hw->capability, HNS3_DEV_SUPPORT_TX_PUSH_B, 1);
+	if (hns3_get_bit(caps, HNS3_CAPS_PHY_IMP_B))
+		hns3_set_bit(hw->capability, HNS3_DEV_SUPPORT_COPPER_B, 1);
+	if (hns3_get_bit(caps, HNS3_CAPS_TQP_TXRX_INDEP_B))
+		hns3_set_bit(hw->capability, HNS3_CAPS_TQP_TXRX_INDEP_B, 1);
+	if (hns3_get_bit(caps, HNS3_CAPS_STASH_B))
+		hns3_set_bit(hw->capability, HNS3_DEV_SUPPORT_STASH_B, 1);
+}
+
 static enum hns3_cmd_status
-hns3_cmd_query_firmware_version(struct hns3_hw *hw, uint32_t *version)
+hns3_cmd_query_firmware_version_and_capability(struct hns3_hw *hw)
 {
 	struct hns3_query_version_cmd *resp;
 	struct hns3_cmd_desc desc;
@@ -438,10 +459,13 @@ hns3_cmd_query_firmware_version(struct hns3_hw *hw, uint32_t *version)
 
 	/* Initialize the cmd function */
 	ret = hns3_cmd_send(hw, &desc, 1);
-	if (ret == 0)
-		*version = rte_le_to_cpu_32(resp->firmware);
+	if (ret)
+		return ret;
 
-	return ret;
+	hw->fw_version = rte_le_to_cpu_32(resp->firmware);
+	hns3_parse_capability(hw, resp);
+
+	return 0;
 }
 
 int
@@ -519,13 +543,13 @@ hns3_cmd_init(struct hns3_hw *hw)
 	}
 	rte_atomic16_clear(&hw->reset.disable_cmd);
 
-	ret = hns3_cmd_query_firmware_version(hw, &version);
+	ret = hns3_cmd_query_firmware_version_and_capability(hw);
 	if (ret) {
 		PMD_INIT_LOG(ERR, "firmware version query failed %d", ret);
 		goto err_cmd_init;
 	}
 
-	hw->fw_version = version;
+	version = hw->fw_version;
 	PMD_INIT_LOG(INFO, "The firmware version is %lu.%lu.%lu.%lu",
 		     hns3_get_field(version, HNS3_FW_VERSION_BYTE3_M,
 				    HNS3_FW_VERSION_BYTE3_S),
drivers/net/hns3/hns3_cmd.h +18 -1
index d70f42e5d..a13b799f4 100644
@@ -264,9 +264,26 @@ struct hns3_rx_priv_buff_cmd {
 #define HNS3_FW_VERSION_BYTE1_M		GENMASK(15, 8)
 #define HNS3_FW_VERSION_BYTE0_S		0
 #define HNS3_FW_VERSION_BYTE0_M		GENMASK(7, 0)
+
+enum HNS3_CAPS_BITS {
+	HNS3_CAPS_UDP_GSO_B,
+	HNS3_CAPS_ATR_B,
+	HNS3_CAPS_ADQ_B,
+	HNS3_CAPS_PTP_B,
+	HNS3_CAPS_INT_QL_B,
+	HNS3_CAPS_SIMPLE_BD_B,
+	HNS3_CAPS_TX_PUSH_B,
+	HNS3_CAPS_PHY_IMP_B,
+	HNS3_CAPS_TQP_TXRX_INDEP_B,
+	HNS3_CAPS_HW_PAD_B,
+	HNS3_CAPS_STASH_B,
+};
+#define HNS3_QUERY_CAP_LENGTH		3
 struct hns3_query_version_cmd {
 	uint32_t firmware;
-	uint32_t firmware_rsv[5];
+	uint32_t hardware;
+	uint32_t rsv;
+	uint32_t caps[HNS3_QUERY_CAP_LENGTH]; /* capabilities of device */
 };
 
 #define HNS3_RX_PRIV_EN_B	15
drivers/net/hns3/hns3_ethdev.c +0 -3
index fab1914c3..44fd69fa1 100644
@@ -2837,9 +2837,6 @@ hns3_get_capability(struct hns3_hw *hw)
 	}
 	hw->revision = revision;
 
-	if (revision >= PCI_REVISION_ID_HIP09_A)
-		hns3_set_bit(hw->capability, HNS3_DEV_SUPPORT_COPPER_B, 1);
-
 	return 0;
 }
 
drivers/net/hns3/hns3_ethdev.h +29 -0
index 0e665e59b..1914e588d 100644
@@ -535,13 +535,42 @@ struct hns3_adapter {
 
 #define HNS3_DEV_SUPPORT_DCB_B			0x0
 #define HNS3_DEV_SUPPORT_COPPER_B		0x1
+#define HNS3_DEV_SUPPORT_UDP_GSO_B		0x2
+#define HNS3_DEV_SUPPORT_ADQ_B			0x3
+#define HNS3_DEV_SUPPORT_PTP_B			0x4
+#define HNS3_DEV_SUPPORT_TX_PUSH_B		0x5
+#define HNS3_DEV_SUPPORT_INDEP_TXRX_B		0x6
+#define HNS3_DEV_SUPPORT_STASH_B		0x7
 
 #define hns3_dev_dcb_supported(hw) \
 	hns3_get_bit((hw)->capability, HNS3_DEV_SUPPORT_DCB_B)
 
+/* Support copper media type */
 #define hns3_dev_copper_supported(hw) \
 	hns3_get_bit((hw)->capability, HNS3_DEV_SUPPORT_COPPER_B)
 
+/* Support UDP GSO offload */
+#define hns3_dev_udp_gso_supported(hw) \
+	hns3_get_bit((hw)->capability, HNS3_DEV_SUPPORT_UDP_GSO_B)
+
+/* Support Application Device Queue */
+#define hns3_dev_adq_supported(hw) \
+	hns3_get_bit((hw)->capability, HNS3_DEV_SUPPORT_ADQ_B)
+
+/* Support PTP timestamp offload */
+#define hns3_dev_ptp_supported(hw) \
+	hns3_get_bit((hw)->capability, HNS3_DEV_SUPPORT_PTP_B)
+
+#define hns3_dev_tx_push_supported(hw) \
+	hns3_get_bit((hw)->capability, HNS3_DEV_SUPPORT_TX_PUSH_B)
+
+/* Support to Independently enable/disable/reset Tx or Rx queues */
+#define hns3_dev_indep_txrx_supported(hw) \
+	hns3_get_bit((hw)->capability, HNS3_DEV_SUPPORT_INDEP_TXRX_B)
+
+#define hns3_dev_stash_supported(hw) \
+	hns3_get_bit((hw)->capability, HNS3_DEV_SUPPORT_STASH_B)
+
 #define HNS3_DEV_PRIVATE_TO_HW(adapter) \
 	(&((struct hns3_adapter *)adapter)->hw)
 #define HNS3_DEV_PRIVATE_TO_ADAPTER(adapter) \
Signature · 1 line
2.27.0
#2 lore raw

PATCH 2/11 net/hns3: get dev specifications from firmware

In reply to Wei Hu (Xavier)

From: "Wei Hu (Xavier)" <[email protected]>

This patch adds getting PF/VF device specifications from firmware.

---
 drivers/net/hns3/hns3_cmd.h       | 15 ++++++++
 drivers/net/hns3/hns3_dcb.c       |  1 -
 drivers/net/hns3/hns3_dcb.h       |  2 +
 drivers/net/hns3/hns3_ethdev.c    | 61 ++++++++++++++++++++++++++++++-
 drivers/net/hns3/hns3_ethdev.h    |  6 +++
 drivers/net/hns3/hns3_ethdev_vf.c | 59 +++++++++++++++++++++++++++++-
 6 files changed, 141 insertions(+), 3 deletions(-)
drivers/net/hns3/hns3_cmd.h +15 -0
index a13b799f4..65aa8bad8 100644
@@ -93,6 +93,8 @@ enum hns3_opcode_type {
 	HNS3_OPC_QUERY_32_BIT_REG       = 0x0041,
 	HNS3_OPC_QUERY_64_BIT_REG       = 0x0042,
 
+	HNS3_OPC_QUERY_DEV_SPECS        = 0x0050,
+
 	/* MAC command */
 	HNS3_OPC_CONFIG_MAC_MODE        = 0x0301,
 	HNS3_OPC_QUERY_LINK_STATUS      = 0x0307,
@@ -805,6 +807,19 @@ struct hns3_reset_cmd {
 	uint8_t rsv[22];
 };
 
+#define HNS3_QUERY_DEV_SPECS_BD_NUM		4
+struct hns3_dev_specs_0_cmd {
+	uint32_t rsv0;
+	uint32_t mac_entry_num;
+	uint32_t mng_entry_num;
+	uint16_t rss_ind_tbl_size;
+	uint16_t rss_key_size;
+	uint16_t intr_ql_max;
+	uint8_t max_non_tso_bd_num;
+	uint8_t rsv1;
+	uint32_t max_tm_rate;
+};
+
 #define HNS3_MAX_TQP_NUM_PER_FUNC	64
 #define HNS3_DEFAULT_TX_BUF		0x4000    /* 16k  bytes */
 #define HNS3_TOTAL_PKT_BUF		0x108000  /* 1.03125M bytes */
drivers/net/hns3/hns3_dcb.c +0 -1
index 02628b6b6..c1be49e0f 100644
@@ -19,7 +19,6 @@
 #define HNS3_SHAPER_BS_U_DEF	5
 #define HNS3_SHAPER_BS_S_DEF	20
 #define BW_MAX_PERCENT		100
-#define HNS3_ETHER_MAX_RATE	100000
 
 /*
  * hns3_shaper_para_calc: calculate ir parameter for the shaper
drivers/net/hns3/hns3_dcb.h +2 -0
index 9c2c5f21c..1636c5ae8 100644
@@ -5,6 +5,8 @@
 #ifndef _HNS3_DCB_H_
 #define _HNS3_DCB_H_
 
+#define HNS3_ETHER_MAX_RATE		100000
+
 /* MAC Pause */
 #define HNS3_TX_MAC_PAUSE_EN_MSK	BIT(0)
 #define HNS3_RX_MAC_PAUSE_EN_MSK	BIT(1)
drivers/net/hns3/hns3_ethdev.c +60 -1

77 lines not on this page · raw message

drivers/net/hns3/hns3_ethdev.h +6 -0
index 1914e588d..1810cf0ed 100644
@@ -381,6 +381,8 @@ struct hns3_hw {
 	uint16_t rss_size_max;      /* HW defined max RSS task queue */
 	uint16_t num_tx_desc;       /* desc num of per tx queue */
 	uint16_t num_rx_desc;       /* desc num of per rx queue */
+	uint32_t mng_entry_num;     /* number of manager table entry */
+	uint32_t mac_entry_num;     /* number of mac-vlan table entry */
 
 	struct rte_ether_addr mc_addrs[HNS3_MC_MACADDR_NUM];
 	int mc_addrs_num; /* Multicast mac addresses number */
@@ -388,6 +390,8 @@ struct hns3_hw {
 	/* The configuration info of RSS */
 	struct hns3_rss_conf rss_info;
 	bool rss_dis_flag; /* disable rss flag. true: disable, false: enable */
+	uint16_t rss_ind_tbl_size;
+	uint16_t rss_key_size;
 
 	uint8_t num_tc;             /* Total number of enabled TCs */
 	uint8_t hw_tc_map;
@@ -406,6 +410,8 @@ struct hns3_hw {
 	uint16_t tx_qnum_per_tc;    /* TX queue number per TC */
 
 	uint32_t capability;
+	uint32_t max_tm_rate;
+	uint8_t max_non_tso_bd_num; /* max BD number of one non-TSO packet */
 
 	struct hns3_port_base_vlan_config port_base_vlan_cfg;
 	/*
drivers/net/hns3/hns3_ethdev_vf.c +58 -1

75 lines not on this page · raw message

Signature · 1 line
2.27.0
#3 lore raw

PATCH 3/11 net/hns3: compatibility issues about Rx interrupts

In reply to Wei Hu (Xavier)

From: "Wei Hu (Xavier)" <[email protected]>

There are difference about queue's interrupt configurations for different versions of hardware network engine, such as queue's interrupt mapping mode, coalesce configuration, etc.

The following uses the configuration differences of the interrupt mapping mode as an example.
1) For some versions of hardware network engine, such as kunpeng 920, because of the hardware constraint, we need implement unmmapping relationship configurations by binding all queues to the last interrupt vector and reserving the last interrupt vector. This results in a decrease of the maximum queues when upper applications call the rte_eth_dev_configure API function to enable Rx interrupt.
2) And for another versions, sunch as kunpeng 930, hns3 PMD driver can map/unmmap all interrupt vectors with queues when Rx interrupt is enabled.

This patch resolves configuration differences about Rx interrupts based on kunpeng 920 and kunpeng 930.

---
 drivers/net/hns3/hns3_cmd.h       | 14 +++++---
 drivers/net/hns3/hns3_ethdev.c    | 31 +++++++++--------
 drivers/net/hns3/hns3_ethdev.h    | 56 +++++++++++++++++++++++++++++++
 drivers/net/hns3/hns3_ethdev_vf.c | 29 +++++++++-------
 drivers/net/hns3/hns3_regs.h      |  4 +++
 drivers/net/hns3/hns3_rxtx.c      | 20 ++++++++++-
 drivers/net/hns3/hns3_rxtx.h      |  2 ++
 7 files changed, 123 insertions(+), 33 deletions(-)
drivers/net/hns3/hns3_cmd.h +9 -5
index 65aa8bad8..c2b0361b6 100644
@@ -368,21 +368,25 @@ struct hns3_func_status_cmd {
 	uint8_t rsv[2];
 };
 
-#define HNS3_VEC_NUM_S		0
-#define HNS3_VEC_NUM_M		GENMASK(7, 0)
+#define HNS3_PF_VEC_NUM_S	0
+#define HNS3_PF_VEC_NUM_M	GENMASK(15, 0)
 #define HNS3_MIN_VECTOR_NUM	2 /* one for msi-x, another for IO */
 struct hns3_pf_res_cmd {
 	uint16_t tqp_num;
 	uint16_t buf_size;
 	uint16_t msixcap_localid_ba_nic;
-	uint16_t msixcap_localid_ba_rocee;
-	uint16_t pf_intr_vector_number;
+	uint16_t nic_pf_intr_vector_number;
+	uint16_t roce_pf_intr_vector_number;
 	uint16_t pf_own_fun_number;
 	uint16_t tx_buf_size;
 	uint16_t dv_buf_size;
-	uint32_t rsv[2];
+	uint16_t tqp_num_ext;
+	uint16_t roh_pf_intr_vector_number;
+	uint32_t rsv[1];
 };
 
+#define HNS3_VF_VEC_NUM_S	0
+#define HNS3_VF_VEC_NUM_M	GENMASK(7, 0)
 struct hns3_vf_res_cmd {
 	uint16_t tqp_num;
 	uint16_t reserved;
drivers/net/hns3/hns3_ethdev.c +17 -14
index 951f26d42..3cc1fbc32 100644
@@ -2208,7 +2208,7 @@ hns3_bind_ring_with_vector(struct hns3_hw *hw, uint8_t vector_id, bool mmap,
 static int
 hns3_init_ring_with_vector(struct hns3_hw *hw)
 {
-	uint8_t vec;
+	uint16_t vec;
 	int ret;
 	int i;
 
@@ -2219,27 +2219,23 @@ hns3_init_ring_with_vector(struct hns3_hw *hw)
 	 * vector. In the initialization clearing the all hardware mapping
 	 * relationship configurations between queues and interrupt vectors is
 	 * needed, so some error caused by the residual configurations, such as
-	 * the unexpected Tx interrupt, can be avoid. Because of the hardware
-	 * constraints in hns3 hardware engine, we have to implement clearing
-	 * the mapping relationship configurations by binding all queues to the
-	 * last interrupt vector and reserving the last interrupt vector. This
-	 * method results in a decrease of the maximum queues when upper
-	 * applications call the rte_eth_dev_configure API function to enable
-	 * Rx interrupt.
+	 * the unexpected Tx interrupt, can be avoid.
 	 */
 	vec = hw->num_msi - 1; /* vector 0 for misc interrupt, not for queue */
-	/* vec - 1: the last interrupt is reserved */
-	hw->intr_tqps_num = vec > hw->tqps_num ? hw->tqps_num : vec - 1;
+	if (hw->intr.mapping_mode == HNS3_INTR_MAPPING_VEC_RSV_ONE)
+		vec = vec - 1; /* the last interrupt is reserved */
+	hw->intr_tqps_num = RTE_MIN(vec, hw->tqps_num);
 	for (i = 0; i < hw->intr_tqps_num; i++) {
 		/*
-		 * Set gap limiter and rate limiter configuration of queue's
-		 * interrupt.
+		 * Set gap limiter/rate limiter/quanity limiter algorithm
+		 * configuration for interrupt coalesce of queue's interrupt.
 		 */
 		hns3_set_queue_intr_gl(hw, i, HNS3_RING_GL_RX,
 				       HNS3_TQP_INTR_GL_DEFAULT);
 		hns3_set_queue_intr_gl(hw, i, HNS3_RING_GL_TX,
 				       HNS3_TQP_INTR_GL_DEFAULT);
 		hns3_set_queue_intr_rl(hw, i, HNS3_TQP_INTR_RL_DEFAULT);
+		hns3_set_queue_intr_ql(hw, i, HNS3_TQP_INTR_QL_DEFAULT);
 
 		ret = hns3_bind_ring_with_vector(hw, vec, false,
 						 HNS3_RING_TYPE_TX, i);
@@ -2669,8 +2665,8 @@ hns3_query_pf_resource(struct hns3_hw *hw)
 	pf->dv_buf_size = roundup(pf->dv_buf_size, HNS3_BUF_SIZE_UNIT);
 
 	hw->num_msi =
-	    hns3_get_field(rte_le_to_cpu_16(req->pf_intr_vector_number),
-			   HNS3_VEC_NUM_M, HNS3_VEC_NUM_S);
+		hns3_get_field(rte_le_to_cpu_16(req->nic_pf_intr_vector_number),
+			       HNS3_PF_VEC_NUM_M, HNS3_PF_VEC_NUM_S);
 
 	return 0;
 }
@@ -2885,6 +2881,9 @@ hns3_get_capability(struct hns3_hw *hw)
 
 	if (revision < PCI_REVISION_ID_HIP09_A) {
 		hns3_set_default_dev_specifications(hw);
+		hw->intr.mapping_mode = HNS3_INTR_MAPPING_VEC_RSV_ONE;
+		hw->intr.coalesce_mode = HNS3_INTR_COALESCE_NON_QL;
+		hw->intr.gl_unit = HNS3_INTR_COALESCE_GL_UINT_2US;
 		return 0;
 	}
 
@@ -2896,6 +2895,10 @@ hns3_get_capability(struct hns3_hw *hw)
 		return ret;
 	}
 
+	hw->intr.mapping_mode = HNS3_INTR_MAPPING_VEC_ALL;
+	hw->intr.coalesce_mode = HNS3_INTR_COALESCE_QL;
+	hw->intr.gl_unit = HNS3_INTR_COALESCE_GL_UINT_1US;
+
 	return 0;
 }
 
drivers/net/hns3/hns3_ethdev.h +56 -0

68 lines not on this page · raw message

drivers/net/hns3/hns3_ethdev_vf.c +16 -13
index 19a077209..44657d362 100644
@@ -693,7 +693,7 @@ hns3vf_bind_ring_with_vector(struct hns3_hw *hw, uint8_t vector_id,
 static int
 hns3vf_init_ring_with_vector(struct hns3_hw *hw)
 {
-	uint8_t vec;
+	uint16_t vec;
 	int ret;
 	int i;
 
@@ -704,27 +704,23 @@ hns3vf_init_ring_with_vector(struct hns3_hw *hw)
 	 * vector. In the initialization clearing the all hardware mapping
 	 * relationship configurations between queues and interrupt vectors is
 	 * needed, so some error caused by the residual configurations, such as
-	 * the unexpected Tx interrupt, can be avoid. Because of the hardware
-	 * constraints in hns3 hardware engine, we have to implement clearing
-	 * the mapping relationship configurations by binding all queues to the
-	 * last interrupt vector and reserving the last interrupt vector. This
-	 * method results in a decrease of the maximum queues when upper
-	 * applications call the rte_eth_dev_configure API function to enable
-	 * Rx interrupt.
+	 * the unexpected Tx interrupt, can be avoid.
 	 */
 	vec = hw->num_msi - 1; /* vector 0 for misc interrupt, not for queue */
-	/* vec - 1: the last interrupt is reserved */
-	hw->intr_tqps_num = vec > hw->tqps_num ? hw->tqps_num : vec - 1;
+	if (hw->intr.mapping_mode == HNS3_INTR_MAPPING_VEC_RSV_ONE)
+		vec = vec - 1; /* the last interrupt is reserved */
+	hw->intr_tqps_num = RTE_MIN(vec, hw->tqps_num);
 	for (i = 0; i < hw->intr_tqps_num; i++) {
 		/*
-		 * Set gap limiter and rate limiter configuration of queue's
-		 * interrupt.
+		 * Set gap limiter/rate limiter/quanity limiter algorithm
+		 * configuration for interrupt coalesce of queue's interrupt.
 		 */
 		hns3_set_queue_intr_gl(hw, i, HNS3_RING_GL_RX,
 				       HNS3_TQP_INTR_GL_DEFAULT);
 		hns3_set_queue_intr_gl(hw, i, HNS3_RING_GL_TX,
 				       HNS3_TQP_INTR_GL_DEFAULT);
 		hns3_set_queue_intr_rl(hw, i, HNS3_TQP_INTR_RL_DEFAULT);
+		hns3_set_queue_intr_ql(hw, i, HNS3_TQP_INTR_QL_DEFAULT);
 
 		ret = hns3vf_bind_ring_with_vector(hw, vec, false,
 						   HNS3_RING_TYPE_TX, i);
@@ -1134,6 +1130,9 @@ hns3vf_get_capability(struct hns3_hw *hw)
 
 	if (revision < PCI_REVISION_ID_HIP09_A) {
 		hns3vf_set_default_dev_specifications(hw);
+		hw->intr.mapping_mode = HNS3_INTR_MAPPING_VEC_RSV_ONE;
+		hw->intr.coalesce_mode = HNS3_INTR_COALESCE_NON_QL;
+		hw->intr.gl_unit = HNS3_INTR_COALESCE_GL_UINT_2US;
 		return 0;
 	}
 
@@ -1145,6 +1144,10 @@ hns3vf_get_capability(struct hns3_hw *hw)
 		return ret;
 	}
 
+	hw->intr.mapping_mode = HNS3_INTR_MAPPING_VEC_ALL;
+	hw->intr.coalesce_mode = HNS3_INTR_COALESCE_QL;
+	hw->intr.gl_unit = HNS3_INTR_COALESCE_GL_UINT_1US;
+
 	return 0;
 }
 
@@ -1616,7 +1619,7 @@ hns3_query_vf_resource(struct hns3_hw *hw)
 
 	req = (struct hns3_vf_res_cmd *)desc.data;
 	num_msi = hns3_get_field(rte_le_to_cpu_16(req->vf_intr_vector_number),
-				 HNS3_VEC_NUM_M, HNS3_VEC_NUM_S);
+				 HNS3_VF_VEC_NUM_M, HNS3_VF_VEC_NUM_S);
 	if (num_msi < HNS3_MIN_VECTOR_NUM) {
 		hns3_err(hw, "Just %u msi resources, not enough for vf(min:%d)",
 			 num_msi, HNS3_MIN_VECTOR_NUM);
drivers/net/hns3/hns3_regs.h +4 -0
index 64bd6931b..bf6df6300 100644
@@ -92,13 +92,17 @@
 #define HNS3_TQP_INTR_GL1_REG			0x20200
 #define HNS3_TQP_INTR_GL2_REG			0x20300
 #define HNS3_TQP_INTR_RL_REG			0x20900
+#define HNS3_TQP_INTR_TX_QL_REG			0x20e00
+#define HNS3_TQP_INTR_RX_QL_REG			0x20f00
 
 #define HNS3_TQP_INTR_REG_SIZE			4
 #define HNS3_TQP_INTR_GL_MAX			0x1FE0
 #define HNS3_TQP_INTR_GL_DEFAULT		20
+#define HNS3_TQP_INTR_GL_UNIT_1US		BIT(31)
 #define HNS3_TQP_INTR_RL_MAX			0xEC
 #define HNS3_TQP_INTR_RL_ENABLE_MASK		0x40
 #define HNS3_TQP_INTR_RL_DEFAULT		0
+#define HNS3_TQP_INTR_QL_DEFAULT		0
 
 /* gl_usec convert to hardware count, as writing each 1 represents 2us */
 #define HNS3_GL_USEC_TO_REG(gl_usec)		((gl_usec) >> 1)
drivers/net/hns3/hns3_rxtx.c +19 -1
index fc1a256f3..d39576621 100644
@@ -536,7 +536,10 @@ hns3_set_queue_intr_gl(struct hns3_hw *hw, uint16_t queue_id,
 		return;
 
 	addr = offset[gl_idx] + queue_id * HNS3_TQP_INTR_REG_SIZE;
-	value = HNS3_GL_USEC_TO_REG(gl_value);
+	if (hw->intr.gl_unit == HNS3_INTR_COALESCE_GL_UINT_1US)
+		value = gl_value | HNS3_TQP_INTR_GL_UNIT_1US;
+	else
+		value = HNS3_GL_USEC_TO_REG(gl_value);
 
 	hns3_write_dev(hw, addr, value);
 }
@@ -557,6 +560,21 @@ hns3_set_queue_intr_rl(struct hns3_hw *hw, uint16_t queue_id, uint16_t rl_value)
 	hns3_write_dev(hw, addr, value);
 }
 
+void
+hns3_set_queue_intr_ql(struct hns3_hw *hw, uint16_t queue_id, uint16_t ql_value)
+{
+	uint32_t addr;
+
+	if (hw->intr.coalesce_mode == HNS3_INTR_COALESCE_NON_QL)
+		return;
+
+	addr = HNS3_TQP_INTR_TX_QL_REG + queue_id * HNS3_TQP_INTR_REG_SIZE;
+	hns3_write_dev(hw, addr, ql_value);
+
+	addr = HNS3_TQP_INTR_RX_QL_REG + queue_id * HNS3_TQP_INTR_REG_SIZE;
+	hns3_write_dev(hw, addr, ql_value);
+}
+
 static void
 hns3_queue_intr_enable(struct hns3_hw *hw, uint16_t queue_id, bool en)
 {
drivers/net/hns3/hns3_rxtx.h +2 -0
index f1fb3b56a..15c609ceb 100644
@@ -397,6 +397,8 @@ void hns3_set_queue_intr_gl(struct hns3_hw *hw, uint16_t queue_id,
 			    uint8_t gl_idx, uint16_t gl_value);
 void hns3_set_queue_intr_rl(struct hns3_hw *hw, uint16_t queue_id,
 			    uint16_t rl_value);
+void hns3_set_queue_intr_ql(struct hns3_hw *hw, uint16_t queue_id,
+			    uint16_t ql_value);
 int hns3_set_fake_rx_or_tx_queues(struct rte_eth_dev *dev, uint16_t nb_rx_q,
 				  uint16_t nb_tx_q);
 int hns3_config_gro(struct hns3_hw *hw, bool en);
Signature · 1 line
2.27.0
#4 lore raw

PATCH 4/11 net/hns3: compatibility issues about Tx padding short frame

In reply to Wei Hu (Xavier)

From: "Wei Hu (Xavier)" <[email protected]>

There are differece about padding ultra-short frame in Tx procession for different versions of hardware network engine.

If packet length is less than minimum packet length supported by hardware in Tx direction, driver need to pad it to avoid error. The minimum packet length in Tx direction is 33 based on kunpeng 920, and 9 based on kunpeng 930.

---
 drivers/net/hns3/hns3_ethdev.c    |  2 ++
 drivers/net/hns3/hns3_ethdev.h    |  8 +++++++-
 drivers/net/hns3/hns3_ethdev_vf.c |  2 ++
 drivers/net/hns3/hns3_rxtx.c      | 11 +++++++----
 drivers/net/hns3/hns3_rxtx.h      |  9 ++++++++-
 5 files changed, 26 insertions(+), 6 deletions(-)
drivers/net/hns3/hns3_ethdev.c +2 -0
index 3cc1fbc32..4797cfb2f 100644
@@ -2884,6 +2884,7 @@ hns3_get_capability(struct hns3_hw *hw)
 		hw->intr.mapping_mode = HNS3_INTR_MAPPING_VEC_RSV_ONE;
 		hw->intr.coalesce_mode = HNS3_INTR_COALESCE_NON_QL;
 		hw->intr.gl_unit = HNS3_INTR_COALESCE_GL_UINT_2US;
+		hw->min_tx_pkt_len = HNS3_HIP08_MIN_TX_PKT_LEN;
 		return 0;
 	}
 
@@ -2898,6 +2899,7 @@ hns3_get_capability(struct hns3_hw *hw)
 	hw->intr.mapping_mode = HNS3_INTR_MAPPING_VEC_ALL;
 	hw->intr.coalesce_mode = HNS3_INTR_COALESCE_QL;
 	hw->intr.gl_unit = HNS3_INTR_COALESCE_GL_UINT_1US;
+	hw->min_tx_pkt_len = HNS3_HIP09_MIN_TX_PKT_LEN;
 
 	return 0;
 }
drivers/net/hns3/hns3_ethdev.h +7 -1
index b8eb7ddc1..a5405147d 100644
@@ -58,7 +58,8 @@
 #define HNS3_MAX_MTU	(HNS3_MAX_FRAME_LEN - HNS3_ETH_OVERHEAD)
 #define HNS3_DEFAULT_MTU		1500UL
 #define HNS3_DEFAULT_FRAME_LEN		(HNS3_DEFAULT_MTU + HNS3_ETH_OVERHEAD)
-#define HNS3_MIN_PKT_SIZE		60
+#define HNS3_HIP08_MIN_TX_PKT_LEN	33
+#define HNS3_HIP09_MIN_TX_PKT_LEN	9
 
 #define HNS3_4_TCS			4
 #define HNS3_8_TCS			8
@@ -464,6 +465,11 @@ struct hns3_hw {
 
 	uint32_t capability;
 	uint32_t max_tm_rate;
+	/*
+	 * The minimun length of the packet supported by hardware in the Tx
+	 * direction.
+	 */
+	uint32_t min_tx_pkt_len;
 
 	struct hns3_queue_intr intr;
 
drivers/net/hns3/hns3_ethdev_vf.c +2 -0
index 44657d362..3b2ba69bb 100644
@@ -1133,6 +1133,7 @@ hns3vf_get_capability(struct hns3_hw *hw)
 		hw->intr.mapping_mode = HNS3_INTR_MAPPING_VEC_RSV_ONE;
 		hw->intr.coalesce_mode = HNS3_INTR_COALESCE_NON_QL;
 		hw->intr.gl_unit = HNS3_INTR_COALESCE_GL_UINT_2US;
+		hw->min_tx_pkt_len = HNS3_HIP08_MIN_TX_PKT_LEN;
 		return 0;
 	}
 
@@ -1147,6 +1148,7 @@ hns3vf_get_capability(struct hns3_hw *hw)
 	hw->intr.mapping_mode = HNS3_INTR_MAPPING_VEC_ALL;
 	hw->intr.coalesce_mode = HNS3_INTR_COALESCE_QL;
 	hw->intr.gl_unit = HNS3_INTR_COALESCE_GL_UINT_1US;
+	hw->min_tx_pkt_len = HNS3_HIP09_MIN_TX_PKT_LEN;
 
 	return 0;
 }
drivers/net/hns3/hns3_rxtx.c +7 -4
index d39576621..308d0a671 100644
@@ -1915,6 +1915,7 @@ hns3_tx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t nb_desc,
 	txq->configured = true;
 	txq->io_base = (void *)((char *)hw->io_base + HNS3_TQP_REG_OFFSET +
 				idx * HNS3_TQP_REG_SIZE);
+	txq->min_tx_pkt_len = hw->min_tx_pkt_len;
 	txq->over_length_pkt_cnt = 0;
 	txq->exceed_limit_bd_pkt_cnt = 0;
 	txq->exceed_limit_bd_reassem_fail = 0;
@@ -2743,14 +2744,16 @@ hns3_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 		}
 
 		/*
-		 * If packet length is less than minimum packet size, driver
-		 * need to pad it.
+		 * If packet length is less than minimum packet length supported
+		 * by hardware in Tx direction, driver need to pad it to avoid
+		 * error.
 		 */
-		if (unlikely(rte_pktmbuf_pkt_len(tx_pkt) < HNS3_MIN_PKT_SIZE)) {
+		if (unlikely(rte_pktmbuf_pkt_len(tx_pkt) <
+						txq->min_tx_pkt_len)) {
 			uint16_t add_len;
 			char *appended;
 
-			add_len = HNS3_MIN_PKT_SIZE -
+			add_len = txq->min_tx_pkt_len -
 					 rte_pktmbuf_pkt_len(tx_pkt);
 			appended = rte_pktmbuf_append(tx_pkt, add_len);
 			if (appended == NULL) {
drivers/net/hns3/hns3_rxtx.h +8 -1
index 15c609ceb..c365a2925 100644
@@ -291,6 +291,12 @@ struct hns3_tx_queue {
 	 */
 	uint16_t pvid_state;
 
+	/*
+	 * The minimun length of the packet supported by hardware in the Tx
+	 * direction.
+	 */
+	uint32_t min_tx_pkt_len;
+
 	bool tx_deferred_start; /* don't start this queue in dev start */
 	bool configured;        /* indicate if tx queue has been configured */
 
@@ -333,7 +339,8 @@ struct hns3_tx_queue {
 	 *
 	 * - pkt_padding_fail_cnt
 	 *     Total count which the packet length is less than minimum packet
-	 *     size HNS3_MIN_PKT_SIZE and fail to be appended with 0.
+	 *     length(struct hns3_tx_queue::min_tx_pkt_len) supported by
+	 *     hardware in Tx direction and fail to be appended with 0.
 	 */
 	uint64_t over_length_pkt_cnt;
 	uint64_t exceed_limit_bd_pkt_cnt;
Signature · 1 line
2.27.0
#5 lore raw

PATCH 5/11 net/hns3: add more hardware error types

In reply to Wei Hu (Xavier)

From: "Wei Hu (Xavier)" <[email protected]>

The new firmware adds the hardware error types reported by MSI-x mode. These errors are defined as RAS errors in hardware and belong to a different type from the MSI-x errors processed by the driver.

When hardware detects an hardware errors, which need to be handled with the driver otherwise the device cannot run properly, it reports error information through the MSI-x interrupt. After receiving the interrupt reported by the hardware, the driver queries the error information and identifies the error level, then rectifies the error. All errors will be logged. In addition, the hardware may be reset at the function or global level based on the error level. After the reset is complete, the hardware will recovers to the normal status.

---
 drivers/net/hns3/hns3_cmd.h    |   46 +-
 drivers/net/hns3/hns3_ethdev.c |   67 +-
 drivers/net/hns3/hns3_ethdev.h |   34 +-
 drivers/net/hns3/hns3_intr.c   | 1236 ++++++++++++++++++++++++++------
 drivers/net/hns3/hns3_intr.h   |   40 +-
 drivers/net/hns3/hns3_regs.h   |    3 +
 drivers/net/hns3/hns3_stats.c  |   78 +-
 drivers/net/hns3/hns3_stats.h  |    2 +
 8 files changed, 1249 insertions(+), 257 deletions(-)
drivers/net/hns3/hns3_cmd.h +27 -19
index c2b0361b6..87d60539d 100644
@@ -100,7 +100,6 @@ enum hns3_opcode_type {
 	HNS3_OPC_QUERY_LINK_STATUS      = 0x0307,
 	HNS3_OPC_CONFIG_MAX_FRM_SIZE    = 0x0308,
 	HNS3_OPC_CONFIG_SPEED_DUP       = 0x0309,
-	HNS3_MAC_COMMON_INT_EN          = 0x030E,
 
 	/* PFC/Pause commands */
 	HNS3_OPC_CFG_MAC_PAUSE_EN       = 0x0701,
@@ -153,10 +152,6 @@ enum hns3_opcode_type {
 	HNS3_OPC_RX_COM_THRD_ALLOC      = 0x0904,
 	HNS3_OPC_RX_COM_WL_ALLOC        = 0x0905,
 
-	/* SSU module INT commands */
-	HNS3_SSU_ECC_INT_CMD            = 0x0989,
-	HNS3_SSU_COMMON_INT_CMD         = 0x098C,
-
 	/* TQP management command */
 	HNS3_OPC_SET_TQP_MAP            = 0x0A01,
 
@@ -166,11 +161,6 @@ enum hns3_opcode_type {
 	HNS3_OPC_CFG_COM_TQP_QUEUE      = 0x0B20,
 	HNS3_OPC_RESET_TQP_QUEUE        = 0x0B22,
 
-	/* PPU module intr commands */
-	HNS3_PPU_MPF_ECC_INT_CMD        = 0x0B40,
-	HNS3_PPU_MPF_OTHER_INT_CMD      = 0x0B41,
-	HNS3_PPU_PF_OTHER_INT_CMD       = 0x0B42,
-
 	/* TSO command */
 	HNS3_OPC_TSO_GENERIC_CONFIG     = 0x0C01,
 	HNS3_OPC_GRO_GENERIC_CONFIG     = 0x0C10,
@@ -216,17 +206,30 @@ enum hns3_opcode_type {
 	HNS3_OPC_SFP_GET_SPEED          = 0x7104,
 
 	/* Interrupts commands */
-	HNS3_OPC_ADD_RING_TO_VECTOR	= 0x1503,
-	HNS3_OPC_DEL_RING_TO_VECTOR	= 0x1504,
+	HNS3_OPC_ADD_RING_TO_VECTOR     = 0x1503,
+	HNS3_OPC_DEL_RING_TO_VECTOR     = 0x1504,
 
 	/* Error INT commands */
-	HNS3_QUERY_MSIX_INT_STS_BD_NUM          = 0x1513,
-	HNS3_QUERY_CLEAR_ALL_MPF_MSIX_INT       = 0x1514,
-	HNS3_QUERY_CLEAR_ALL_PF_MSIX_INT        = 0x1515,
-
-	/* PPP module intr commands */
-	HNS3_PPP_CMD0_INT_CMD                   = 0x2100,
-	HNS3_PPP_CMD1_INT_CMD                   = 0x2101,
+	HNS3_OPC_MAC_COMMON_INT_EN              = 0x030E,
+	HNS3_OPC_TM_SCH_ECC_INT_EN              = 0x0829,
+	HNS3_OPC_SSU_ECC_INT_CMD                = 0x0989,
+	HNS3_OPC_SSU_COMMON_INT_CMD             = 0x098C,
+	HNS3_OPC_PPU_MPF_ECC_INT_CMD            = 0x0B40,
+	HNS3_OPC_PPU_MPF_OTHER_INT_CMD          = 0x0B41,
+	HNS3_OPC_PPU_PF_OTHER_INT_CMD           = 0x0B42,
+	HNS3_OPC_COMMON_ECC_INT_CFG             = 0x1505,
+	HNS3_OPC_QUERY_RAS_INT_STS_BD_NUM       = 0x1510,
+	HNS3_OPC_QUERY_CLEAR_MPF_RAS_INT        = 0x1511,
+	HNS3_OPC_QUERY_CLEAR_PF_RAS_INT         = 0x1512,
+	HNS3_OPC_QUERY_MSIX_INT_STS_BD_NUM      = 0x1513,
+	HNS3_OPC_QUERY_CLEAR_ALL_MPF_MSIX_INT   = 0x1514,
+	HNS3_OPC_QUERY_CLEAR_ALL_PF_MSIX_INT    = 0x1515,
+	HNS3_OPC_IGU_EGU_TNL_INT_EN             = 0x1803,
+	HNS3_OPC_IGU_COMMON_INT_EN              = 0x1806,
+	HNS3_OPC_TM_QCN_MEM_INT_CFG             = 0x1A14,
+	HNS3_OPC_PPP_CMD0_INT_CMD               = 0x2100,
+	HNS3_OPC_PPP_CMD1_INT_CMD               = 0x2101,
+	HNS3_OPC_NCSI_INT_EN                    = 0x2401,
 };
 
 #define HNS3_CMD_FLAG_IN	BIT(0)
@@ -236,6 +239,11 @@ enum hns3_opcode_type {
 #define HNS3_CMD_FLAG_NO_INTR	BIT(4)
 #define HNS3_CMD_FLAG_ERR_INTR	BIT(5)
 
+#define HNS3_MPF_RAS_INT_MIN_BD_NUM	10
+#define HNS3_PF_RAS_INT_MIN_BD_NUM	4
+#define HNS3_MPF_MSIX_INT_MIN_BD_NUM	10
+#define HNS3_PF_MSIX_INT_MIN_BD_NUM	4
+
 #define HNS3_BUF_SIZE_UNIT	256
 #define HNS3_BUF_MUL_BY		2
 #define HNS3_BUF_DIV_BY		2
drivers/net/hns3/hns3_ethdev.c +60 -7

136 lines not on this page · raw message

drivers/net/hns3/hns3_ethdev.h +29 -5
index a5405147d..ca4cade42 100644
@@ -491,11 +491,35 @@ struct hns3_hw {
 #define HNS3_FLAG_VNET_BASE_SCH_MODE		2
 
 struct hns3_err_msix_intr_stats {
-	uint64_t mac_afifo_tnl_intr_cnt;
-	uint64_t ppu_mpf_abnormal_intr_st2_cnt;
-	uint64_t ssu_port_based_pf_intr_cnt;
-	uint64_t ppp_pf_abnormal_intr_cnt;
-	uint64_t ppu_pf_abnormal_intr_cnt;
+	uint64_t mac_afifo_tnl_int_cnt;
+	uint64_t ppu_mpf_abn_int_st2_msix_cnt;
+	uint64_t ssu_port_based_pf_int_cnt;
+	uint64_t ppp_pf_abnormal_int_cnt;
+	uint64_t ppu_pf_abnormal_int_msix_cnt;
+
+	uint64_t imp_tcm_ecc_int_cnt;
+	uint64_t cmdq_mem_ecc_int_cnt;
+	uint64_t imp_rd_poison_int_cnt;
+	uint64_t tqp_int_ecc_int_cnt;
+	uint64_t msix_ecc_int_cnt;
+	uint64_t ssu_ecc_multi_bit_int_0_cnt;
+	uint64_t ssu_ecc_multi_bit_int_1_cnt;
+	uint64_t ssu_common_ecc_int_cnt;
+	uint64_t igu_int_cnt;
+	uint64_t ppp_mpf_abnormal_int_st1_cnt;
+	uint64_t ppp_mpf_abnormal_int_st3_cnt;
+	uint64_t ppu_mpf_abnormal_int_st1_cnt;
+	uint64_t ppu_mpf_abn_int_st2_ras_cnt;
+	uint64_t ppu_mpf_abnormal_int_st3_cnt;
+	uint64_t tm_sch_int_cnt;
+	uint64_t qcn_fifo_int_cnt;
+	uint64_t qcn_ecc_int_cnt;
+	uint64_t ncsi_ecc_int_cnt;
+	uint64_t ssu_port_based_err_int_cnt;
+	uint64_t ssu_fifo_overflow_int_cnt;
+	uint64_t ssu_ets_tcg_int_cnt;
+	uint64_t igu_egu_tnl_int_cnt;
+	uint64_t ppu_pf_abnormal_int_ras_cnt;
 };
 
 /* vlan entry information. */
drivers/net/hns3/hns3_intr.c +1022 -214

1,469 lines not on this page · raw message

drivers/net/hns3/hns3_intr.h +36 -4
index d0af16c50..2b802bc7c 100644
@@ -19,6 +19,22 @@
 #define HNS3_MAC_COMMON_ERR_INT_EN		0x107FF
 #define HNS3_MAC_COMMON_ERR_INT_EN_MASK		0x107FF
 
+#define HNS3_IMP_TCM_ECC_ERR_INT_EN		0xFFFF0000
+#define HNS3_IMP_TCM_ECC_ERR_INT_EN_MASK	0xFFFF0000
+#define HNS3_IMP_ITCM4_ECC_ERR_INT_EN		0x300
+#define HNS3_IMP_ITCM4_ECC_ERR_INT_EN_MASK	0x300
+#define HNS3_IMP_RD_POISON_ERR_INT_EN		0x0100
+#define HNS3_IMP_RD_POISON_ERR_INT_EN_MASK	0x0100
+
+#define HNS3_CMDQ_NIC_ECC_ERR_INT_EN		0xFFFF
+#define HNS3_CMDQ_NIC_ECC_ERR_INT_EN_MASK	0xFFFF
+
+#define HNS3_TQP_ECC_ERR_INT_EN			0x0FFF
+#define HNS3_TQP_ECC_ERR_INT_EN_MASK		0x0FFF
+
+#define HNS3_MSIX_SRAM_ECC_ERR_INT_EN		0x0F000000
+#define HNS3_MSIX_SRAM_ECC_ERR_INT_EN_MASK	0x0F000000
+
 #define HNS3_PPU_MPF_ABNORMAL_INT0_EN		GENMASK(31, 0)
 #define HNS3_PPU_MPF_ABNORMAL_INT0_EN_MASK	GENMASK(31, 0)
 #define HNS3_PPU_MPF_ABNORMAL_INT1_EN		GENMASK(31, 0)
@@ -31,8 +47,6 @@
 #define HNS3_PPU_MPF_ABNORMAL_INT3_EN_MASK	GENMASK(23, 16)
 #define HNS3_PPU_PF_ABNORMAL_INT_EN		GENMASK(5, 0)
 #define HNS3_PPU_PF_ABNORMAL_INT_EN_MASK	GENMASK(5, 0)
-#define HNS3_PPU_PF_INT_MSIX_MASK		0x27
-#define HNS3_PPU_MPF_INT_ST2_MSIX_MASK		GENMASK(29, 28)
 
 #define HNS3_SSU_1BIT_ECC_ERR_INT_EN		GENMASK(31, 0)
 #define HNS3_SSU_1BIT_ECC_ERR_INT_EN_MASK	GENMASK(31, 0)
@@ -46,8 +60,17 @@
 #define HNS3_SSU_PORT_BASED_ERR_INT_EN_MASK	0x0BFF0000
 #define HNS3_SSU_FIFO_OVERFLOW_ERR_INT_EN	GENMASK(23, 0)
 #define HNS3_SSU_FIFO_OVERFLOW_ERR_INT_EN_MASK	GENMASK(23, 0)
-#define HNS3_SSU_COMMON_ERR_INT_MASK		GENMASK(9, 0)
-#define HNS3_SSU_PORT_INT_MSIX_MASK		0x7BFF
+
+#define HNS3_IGU_ERR_INT_ENABLE			0x0000066F
+#define HNS3_IGU_ERR_INT_DISABLE		0x00000660
+#define HNS3_IGU_ERR_INT_EN_MASK		0x000F
+#define HNS3_IGU_TNL_ERR_INT_EN			0x0002AABF
+#define HNS3_IGU_TNL_ERR_INT_EN_MASK		0x003F
+
+#define HNS3_NCSI_ERR_INT_EN			0x3
+
+#define HNS3_TM_SCH_ECC_ERR_INT_EN		0x3
+#define HNS3_TM_QCN_MEM_ERR_INT_EN		0xFFFFFF
 
 #define HNS3_RESET_PROCESS_MS			200
 
@@ -62,8 +85,17 @@ struct hns3_hw_error {
 	enum hns3_reset_level reset_level;
 };
 
+struct hns3_hw_error_desc {
+	uint8_t desc_offset;
+	uint8_t data_offset;
+	const char *msg;
+	const struct hns3_hw_error *hw_err;
+};
+
 int hns3_enable_hw_error_intr(struct hns3_adapter *hns, bool state);
 void hns3_handle_msix_error(struct hns3_adapter *hns, uint64_t *levels);
+void hns3_handle_ras_error(struct hns3_adapter *hns, uint64_t *levels);
+
 void hns3_intr_unregister(const struct rte_intr_handle *hdl,
 			  rte_intr_callback_fn cb_fn, void *cb_arg);
 void hns3_notify_reset_ready(struct hns3_hw *hw, bool enable);
drivers/net/hns3/hns3_regs.h +3 -0
index bf6df6300..5cf924e19 100644
@@ -27,6 +27,9 @@
 
 #define HNS3_VECTOR0_OTHER_INT_STS_REG	0x20800
 
+#define HNS3_RAS_PF_OTHER_INT_STS_REG	0x20B00
+#define HNS3_RAS_REG_NFE_MASK		0xFF00
+
 #define HNS3_MISC_VECTOR_REG_BASE	0x20400
 #define HNS3_VECTOR0_OTER_EN_REG	0x20600
 #define HNS3_MISC_RESET_STS_REG		0x20700
drivers/net/hns3/hns3_stats.c +70 -8

91 lines not on this page · raw message

drivers/net/hns3/hns3_stats.h +2 -0
index 0993c5f57..07570cb31 100644
@@ -148,4 +148,6 @@ int hns3_dev_xstats_get_names_by_id(struct rte_eth_dev *dev,
 				    const uint64_t *ids,
 				    uint32_t size);
 int hns3_stats_reset(struct rte_eth_dev *dev);
+void hns3_error_int_stats_add(struct hns3_adapter *hns, const char *err);
+
 #endif /* _HNS3_STATS_H_ */
Signature · 1 line
2.27.0
#6 lore raw

Re: [dpdk-dev] [PATCH 05/11] net/hns3: add more hardware error types

Quoted 17 lines · Wei Hu (Xavier)

From: "Wei Hu (Xavier)" <[email protected]>

The new firmware adds the hardware error types reported by MSI-x mode. These errors are defined as RAS errors in hardware and belong to a different type from the MSI-x errors processed by the driver.

When hardware detects an hardware errors, which need to be handled with the driver otherwise the device cannot run properly, it reports error information through the MSI-x interrupt. After receiving the interrupt reported by the hardware, the driver queries the error information and identifies the error level, then rectifies the error. All errors will be logged. In addition, the hardware may be reset at the function or global level based on the error level. After the reset is complete, the hardware will recovers to the normal status.

<...>

drivers/net/hns3/hns3_intr.c hns3_find_highest_level(struct hns3_adapter *hns, const char *reg, · line 1392

Quoted 7 lines
drivers/net/hns3/hns3_intr.c +4 -1
+	bd_num = RTE_MAX(mpf_bd_num, pf_bd_num);
 	desc = rte_zmalloc(NULL, bd_num * sizeof(struct hns3_cmd_desc), 0);
 	if (desc == NULL) {
-		hns3_err(hw, "fail to zmalloc desc");
+		hns3_err(hw,
+			 "fail to zmalloc desc for handling msix error, size = %lu",
+			 bd_num * sizeof(struct hns3_cmd_desc));

The log is causing build error for 32bit, because of "%lu" for sizeof() output [1], fixing as "%lu" -> "%zu" while merging. Doing same for other instance below.

[1]
In file included from .../drivers/net/hns3/hns3_intr.c:16:
.../drivers/net/hns3/hns3_intr.c: In function ‘hns3_handle_msix_error’:
.../drivers/net/hns3/hns3_logs.h:16:38: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 6 has type ‘uint32_t’ {aka ‘unsigned int’} [-Werror=format=]
16 | rte_log(level, hns3_logtype_driver, "%s %s(): " fmt, \
| ^~~~~~~~~~~
.../drivers/net/hns3/hns3_logs.h:20:2: note: in expansion of macro ‘PMD_DRV_LOG_RAW’

   20 |  PMD_DRV_LOG_RAW(hw, RTE_LOG_ERR, fmt "\n", ## args)
      |  ^~~~~~~~~~~~~~~
.../drivers/net/hns3/hns3_intr.c:1390:3: note: in expansion of macro ‘hns3_err’
 1390 |   hns3_err(hw,
      |   ^~~~~~~~
.../drivers/net/hns3/hns3_intr.c:1391:61: note: format string is defined here
 1391 |     "fail to zmalloc desc for handling msix error, size = %lu",
      |                                                           ~~^
      |                                                             |
      |                                                             long

unsigned int
| %u

#7 lore raw

PATCH 6/11 net/hns3: support a maximun 256 FDIR counter

In reply to Wei Hu (Xavier)

From: "Wei Hu (Xavier)" <[email protected]>

The FDIR counter was used to count the number of FDIR hit, the maximum number of the counter is 128 based on kunpeng 920, and it was 256 based on kunpeng 930.

The firmware is responsible to allocate counters for diffent PF devices, so the available counter number of one PF may be bigger than 128.

Currently, there are two places using the counter in hns3 PMD driver:
1. Configure the counter. Driver uses the command whose opcode is HNS3_OPC_FD_AD_OP, now we extend one bit to hold the high bit of counter-id in the command format.
2. Query the statistic information of the counter. Driver uses the command whose opcode is HNS3_OPC_FD_COUNTER_OP, now the command already support 16-bit counter-id.

---
 drivers/net/hns3/hns3_fdir.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/net/hns3/hns3_fdir.c +5 -0
index 6ab439d06..5c3dd05f2 100644
@@ -41,6 +41,8 @@
 #define HNS3_FD_AD_WR_RULE_ID_B	0
 #define HNS3_FD_AD_RULE_ID_S		1
 #define HNS3_FD_AD_RULE_ID_M		GENMASK(13, 1)
+#define HNS3_FD_AD_COUNTER_HIGH_BIT     7
+#define HNS3_FD_AD_COUNTER_HIGH_BIT_B   26
 
 enum HNS3_PORT_TYPE {
 	HOST_PORT,
@@ -424,6 +426,9 @@ static int hns3_fd_ad_config(struct hns3_hw *hw, int loc,
 		     action->write_rule_id_to_bd);
 	hns3_set_field(ad_data, HNS3_FD_AD_RULE_ID_M, HNS3_FD_AD_RULE_ID_S,
 		       action->rule_id);
+	/* set extend bit if counter_id is in [128 ~ 255] */
+	if (action->counter_id & BIT(HNS3_FD_AD_COUNTER_HIGH_BIT))
+		hns3_set_bit(ad_data, HNS3_FD_AD_COUNTER_HIGH_BIT_B, 1);
 	ad_data <<= HNS3_FD_AD_DATA_S;
 	hns3_set_bit(ad_data, HNS3_FD_AD_DROP_B, action->drop_packet);
 	hns3_set_bit(ad_data, HNS3_FD_AD_DIRECT_QID_B,
Signature · 1 line
2.27.0
#8 lore raw

PATCH 7/11 net/hns3: replace private macro with RTE MAX

In reply to Wei Hu (Xavier)

From: Huisong Li <[email protected]>

This patch uses RTE_MAX function in DPDK lib to replace the private macro named max_t in hns3 PMD driver.

---
 drivers/net/hns3/hns3_ethdev.c | 5 ++---
 drivers/net/hns3/hns3_ethdev.h | 5 -----
 2 files changed, 2 insertions(+), 8 deletions(-)
drivers/net/hns3/hns3_ethdev.c +2 -3
index b9ee11413..fca035d4f 100644
@@ -3285,7 +3285,7 @@ hns3_is_rx_buf_ok(struct hns3_hw *hw, struct hns3_pkt_buf_alloc *buf_alloc,
 					+ pf->dv_buf_size;
 
 	shared_buf_tc = tc_num * aligned_mps + aligned_mps;
-	shared_std = roundup(max_t(uint32_t, shared_buf_min, shared_buf_tc),
+	shared_std = roundup(RTE_MAX(shared_buf_min, shared_buf_tc),
 			     HNS3_BUF_SIZE_UNIT);
 
 	rx_priv = hns3_get_rx_priv_buff_alloced(buf_alloc);
@@ -3315,8 +3315,7 @@ hns3_is_rx_buf_ok(struct hns3_hw *hw, struct hns3_pkt_buf_alloc *buf_alloc,
 		if (tc_num)
 			hi_thrd = hi_thrd / tc_num;
 
-		hi_thrd = max_t(uint32_t, hi_thrd,
-				HNS3_BUF_MUL_BY * aligned_mps);
+		hi_thrd = RTE_MAX(hi_thrd, HNS3_BUF_MUL_BY * aligned_mps);
 		hi_thrd = rounddown(hi_thrd, HNS3_BUF_SIZE_UNIT);
 		lo_thrd = hi_thrd - aligned_mps / HNS3_BUF_DIV_BY;
 	} else {
drivers/net/hns3/hns3_ethdev.h +0 -5
index ca4cade42..a42479d64 100644
@@ -708,11 +708,6 @@ struct hns3_adapter {
 
 #define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
 
-#define max_t(type, x, y) ({                    \
-	type __max1 = (x);                      \
-	type __max2 = (y);                      \
-	__max1 > __max2 ? __max1 : __max2; })
-
 static inline void hns3_write_reg(void *base, uint32_t reg, uint32_t value)
 {
 	rte_write32(value, (volatile void *)((char *)base + reg));
Signature · 1 line
2.27.0
#9 lore raw

PATCH 8/11 net/hns3: change the log level to INFO

In reply to Wei Hu (Xavier)

From: "Wei Hu (Xavier)" <[email protected]>

This patch changes the log level from NOTICE to INFO.

---
 drivers/net/hns3/hns3_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/hns3/hns3_ethdev.c +2 -2
index fca035d4f..3827d3277 100644
@@ -5744,5 +5744,5 @@ static struct rte_pci_driver rte_hns3_pmd = {
 RTE_PMD_REGISTER_PCI(net_hns3, rte_hns3_pmd);
 RTE_PMD_REGISTER_PCI_TABLE(net_hns3, pci_id_hns3_map);
 RTE_PMD_REGISTER_KMOD_DEP(net_hns3, "* igb_uio | vfio-pci");
-RTE_LOG_REGISTER(hns3_logtype_init, pmd.net.hns3.init, NOTICE);
-RTE_LOG_REGISTER(hns3_logtype_driver, pmd.net.hns3.driver, NOTICE);
+RTE_LOG_REGISTER(hns3_logtype_init, pmd.net.hns3.init, INFO);
+RTE_LOG_REGISTER(hns3_logtype_driver, pmd.net.hns3.driver, INFO);
Signature · 1 line
2.27.0
#10 lore raw

Re: [dpdk-dev] [PATCH 08/11] net/hns3: change the log level to INFO

Quoted 15 lines · Wei Hu (Xavier)

From: "Wei Hu (Xavier)" <[email protected]>

This patch changes the log level from NOTICE to INFO.

---
 drivers/net/hns3/hns3_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/hns3/hns3_ethdev.c +0 -0
index fca035d4f..3827d3277 100644

drivers/net/hns3/hns3_ethdev.c static struct rte_pci_driver rte_hns3_pmd = { · line 5748

Quoted 7 lines
drivers/net/hns3/hns3_ethdev.c +2 -2
@@ -5744,5 +5744,5 @@ static struct rte_pci_driver rte_hns3_pmd = {
 RTE_PMD_REGISTER_PCI(net_hns3, rte_hns3_pmd);
 RTE_PMD_REGISTER_PCI_TABLE(net_hns3, pci_id_hns3_map);
 RTE_PMD_REGISTER_KMOD_DEP(net_hns3, "* igb_uio | vfio-pci");
-RTE_LOG_REGISTER(hns3_logtype_init, pmd.net.hns3.init, NOTICE);
-RTE_LOG_REGISTER(hns3_logtype_driver, pmd.net.hns3.driver, NOTICE);
+RTE_LOG_REGISTER(hns3_logtype_init, pmd.net.hns3.init, INFO);
+RTE_LOG_REGISTER(hns3_logtype_driver, pmd.net.hns3.driver, INFO);

Why making the PMD more verbose by default? You can update the log level dynamically when need to be more verbose.

Common approach is to set default PMD log level is to 'NOTICE', I think this is good to make applications more usable.

#11 lore raw

Re: [dpdk-dev] [PATCH 08/11] net/hns3: change the log level to INFO

Hi,Ferruh Yigit

Quoted 27 lines · Ferruh Yigit
Quoted 15 lines · Wei Hu (Xavier)

From: "Wei Hu (Xavier)" <[email protected]>

This patch changes the log level from NOTICE to INFO.

---
  drivers/net/hns3/hns3_ethdev.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/hns3/hns3_ethdev.c +0 -0
index fca035d4f..3827d3277 100644

drivers/net/hns3/hns3_ethdev.c static struct rte_pci_driver rte_hns3_pmd = { · line 5748

Quoted 7 lines
drivers/net/hns3/hns3_ethdev.c +2 -2
@@ -5744,5 +5744,5 @@ static struct rte_pci_driver rte_hns3_pmd = {
  RTE_PMD_REGISTER_PCI(net_hns3, rte_hns3_pmd);
  RTE_PMD_REGISTER_PCI_TABLE(net_hns3, pci_id_hns3_map);
  RTE_PMD_REGISTER_KMOD_DEP(net_hns3, "* igb_uio | vfio-pci");
-RTE_LOG_REGISTER(hns3_logtype_init, pmd.net.hns3.init, NOTICE);
-RTE_LOG_REGISTER(hns3_logtype_driver, pmd.net.hns3.driver, NOTICE);
+RTE_LOG_REGISTER(hns3_logtype_init, pmd.net.hns3.init, INFO);
+RTE_LOG_REGISTER(hns3_logtype_driver, pmd.net.hns3.driver, INFO);

Why making the PMD more verbose by default? You can update the log level dynamically when need to be more verbose.

Quoted 2 lines

Common approach is to set default PMD log level is to 'NOTICE', I think this is good to make applications more usable.

Currently hns3 PMD driver invokes the private macro named hns3_info in several places, we found that these information wouldn't never be logged.

    hns3_info -> rte_log(RTE_LOG_INFO, hns3_logtype_dirver,...)

To display the related log information, we need to execute the following code in the application, right? Is there any other way? extern int hns3_logtype_driver;
rte_log_set_level(hns3_logtype_driver, RTE_LOG_INFO);

Thanks, Xavier

Quoted 1 line
#12 lore raw

Re: [dpdk-dev] [PATCH 08/11] net/hns3: change the log level to INFO

Quoted 33 lines · Wei Hu (Xavier)

Hi,Ferruh Yigit

Quoted 27 lines · Ferruh Yigit
Quoted 15 lines · Wei Hu (Xavier)

From: "Wei Hu (Xavier)" <[email protected]>

This patch changes the log level from NOTICE to INFO.

---
  drivers/net/hns3/hns3_ethdev.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/hns3/hns3_ethdev.c +0 -0
index fca035d4f..3827d3277 100644

drivers/net/hns3/hns3_ethdev.c static struct rte_pci_driver rte_hns3_pmd = { · line 5748

Quoted 7 lines
drivers/net/hns3/hns3_ethdev.c +2 -2
@@ -5744,5 +5744,5 @@ static struct rte_pci_driver rte_hns3_pmd = {
  RTE_PMD_REGISTER_PCI(net_hns3, rte_hns3_pmd);
  RTE_PMD_REGISTER_PCI_TABLE(net_hns3, pci_id_hns3_map);
  RTE_PMD_REGISTER_KMOD_DEP(net_hns3, "* igb_uio | vfio-pci");
-RTE_LOG_REGISTER(hns3_logtype_init, pmd.net.hns3.init, NOTICE);
-RTE_LOG_REGISTER(hns3_logtype_driver, pmd.net.hns3.driver, NOTICE);
+RTE_LOG_REGISTER(hns3_logtype_init, pmd.net.hns3.init, INFO);
+RTE_LOG_REGISTER(hns3_logtype_driver, pmd.net.hns3.driver, INFO);

Why making the PMD more verbose by default? You can update the log level dynamically when need to be more verbose.

Quoted 2 lines

Common approach is to set default PMD log level is to 'NOTICE', I think this is good to make applications more usable.

Quoted 9 lines

Currently hns3 PMD driver invokes the private macro named hns3_info in several places, we found that these information wouldn't never be logged.

     hns3_info -> rte_log(RTE_LOG_INFO, hns3_logtype_dirver,...)

To display the related log information, we need to execute the following code in the application, right? Is there any other way? extern int hns3_logtype_driver; rte_log_set_level(hns3_logtype_driver, RTE_LOG_INFO);

Hi Xavier,

This is mainly it. Setting log level to something ">= 'RTE_LOG_INFO'" using 'rte_log_set_level()' will display INFO level logs.

There are some variant functions too, 'rte_log_set_level_pattern()' & 'rte_log_set_level_regexp()', these let use change log level of multiple components, like "pmd.net.*"

Another way is provide the log level to application via eal command "--log-level=<type-match>:<int>", like "--log-level=*:debug". This arg is wrapper to above APIs.

Or if you are using testpmd, can change the log level via command "set log" dynamically, like "set log pmd.net.hns3*".
Applications can do something similar to change log levels on demand based on their need, so components doesn't need to be verbose by default.

#13 lore raw

Re: [dpdk-dev] [PATCH 08/11] net/hns3: change the log level to INFO

Hi, Ferruh Yigit

Quoted 50 lines · Ferruh Yigit
Quoted 31 lines · Wei Hu (Xavier)

Hi,Ferruh Yigit

Quoted 26 lines · Ferruh Yigit
Quoted 15 lines · Wei Hu (Xavier)

From: "Wei Hu (Xavier)" <[email protected]>

This patch changes the log level from NOTICE to INFO.

---
   drivers/net/hns3/hns3_ethdev.c | 4 ++--
   1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/hns3/hns3_ethdev.c +0 -0
index fca035d4f..3827d3277 100644

drivers/net/hns3/hns3_ethdev.c static struct rte_pci_driver rte_hns3_pmd = { · line 5748

Quoted 7 lines
drivers/net/hns3/hns3_ethdev.c +2 -2
@@ -5744,5 +5744,5 @@ static struct rte_pci_driver rte_hns3_pmd = {
   RTE_PMD_REGISTER_PCI(net_hns3, rte_hns3_pmd);
   RTE_PMD_REGISTER_PCI_TABLE(net_hns3, pci_id_hns3_map);
   RTE_PMD_REGISTER_KMOD_DEP(net_hns3, "* igb_uio | vfio-pci");
-RTE_LOG_REGISTER(hns3_logtype_init, pmd.net.hns3.init, NOTICE);
-RTE_LOG_REGISTER(hns3_logtype_driver, pmd.net.hns3.driver, NOTICE);
+RTE_LOG_REGISTER(hns3_logtype_init, pmd.net.hns3.init, INFO);
+RTE_LOG_REGISTER(hns3_logtype_driver, pmd.net.hns3.driver, INFO);

Why making the PMD more verbose by default? You can update the log level dynamically when need to be more verbose.

Quoted 2 lines

Common approach is to set default PMD log level is to 'NOTICE', I think this is good to make applications more usable.

Quoted 9 lines

Currently hns3 PMD driver invokes the private macro named hns3_info in several places, we found that these information wouldn't never be logged.

      hns3_info -> rte_log(RTE_LOG_INFO, hns3_logtype_dirver,...)

To display the related log information, we need to execute the following code in the application, right? Is there any other way? extern int hns3_logtype_driver; rte_log_set_level(hns3_logtype_driver, RTE_LOG_INFO);

Hi Xavier,

This is mainly it. Setting log level to something ">= 'RTE_LOG_INFO'" using 'rte_log_set_level()' will display INFO level logs.

There are some variant functions too, 'rte_log_set_level_pattern()' & 'rte_log_set_level_regexp()', these let use change log level of multiple components, like "pmd.net.*"

Quoted 9 lines

Another way is provide the log level to application via eal command "--log-level=<type-match>:<int>", like "--log-level=*:debug". This arg is wrapper to above APIs.

Or if you are using testpmd, can change the log level via command "set log" dynamically, like "set log pmd.net.hns3*".
Applications can do something similar to change log levels on demand based on their need, so components doesn't need to be verbose by default.

Thanks for your detail description.

Regards

Xavier

#14 lore raw

PATCH 9/11 net/hns3: fix default MAC addr from firmware

In reply to Wei Hu (Xavier)

From: Huisong Li <[email protected]>

Currently, default MAC address obtained from firmware in hns3 PF PMD driver is directly used by .mac_addr_set ops implementation function when the rte_eth_dev_start API function is executed. At this moment, if the default MAC addr isn't an unicast address, it will fail to set default MAC addr to hardware.

So this patch adds the validity check of default MAC addr in hns3 PF PMD driver. We will use a random unicast address, if the default MAC address obtained from firmware is not a vailid unicast address.

In addition, this patch also adjusts the location of processing default MAC addr in hns3 VF PMD driver so as to increase relevance and readability of the code.

Fixes eab21776717 ("net/hns3: support setting VF MAC address by PF driver")
Fixes d51867db65c ("net/hns3: add initialization")
---
 drivers/net/hns3/hns3_ethdev.c    | 11 +++++++++++
 drivers/net/hns3/hns3_ethdev_vf.c | 29 ++++++++++++++---------------
 2 files changed, 25 insertions(+), 15 deletions(-)
drivers/net/hns3/hns3_ethdev.c +11 -0
index 3827d3277..14e4b9e35 100644
@@ -5574,6 +5574,8 @@ static int
 hns3_dev_init(struct rte_eth_dev *eth_dev)
 {
 	struct hns3_adapter *hns = eth_dev->data->dev_private;
+	char mac_str[RTE_ETHER_ADDR_FMT_SIZE];
+	struct rte_ether_addr *eth_addr;
 	struct hns3_hw *hw = &hns->hw;
 	int ret;
 
@@ -5646,6 +5648,15 @@ hns3_dev_init(struct rte_eth_dev *eth_dev)
 		goto err_rte_zmalloc;
 	}
 
+	eth_addr = (struct rte_ether_addr *)hw->mac.mac_addr;
+	if (!rte_is_valid_assigned_ether_addr(eth_addr)) {
+		rte_eth_random_addr(hw->mac.mac_addr);
+		rte_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE,
+				(struct rte_ether_addr *)hw->mac.mac_addr);
+		hns3_warn(hw, "default mac_addr from firmware is an invalid "
+			  "unicast address, using random MAC address %s",
+			  mac_str);
+	}
 	rte_ether_addr_copy((struct rte_ether_addr *)hw->mac.mac_addr,
 			    &eth_dev->data->mac_addrs[0]);
 
drivers/net/hns3/hns3_ethdev_vf.c +14 -15
index 3b2ba69bb..7fd0e6a43 100644
@@ -1748,21 +1748,6 @@ hns3vf_init_vf(struct rte_eth_dev *eth_dev)
 		goto err_get_config;
 	}
 
-	/*
-	 * The hns3 PF ethdev driver in kernel support setting VF MAC address
-	 * on the host by "ip link set ..." command. To avoid some incorrect
-	 * scenes, for example, hns3 VF PMD driver fails to receive and send
-	 * packets after user configure the MAC address by using the
-	 * "ip link set ..." command, hns3 VF PMD driver keep the same MAC
-	 * address strategy as the hns3 kernel ethdev driver in the
-	 * initialization. If user configure a MAC address by the ip command
-	 * for VF device, then hns3 VF PMD driver will start with it, otherwise
-	 * start with a random MAC address in the initialization.
-	 */
-	ret = rte_is_zero_ether_addr((struct rte_ether_addr *)hw->mac.mac_addr);
-	if (ret)
-		rte_eth_random_addr(hw->mac.mac_addr);
-
 	ret = hns3vf_clear_vport_list(hw);
 	if (ret) {
 		PMD_INIT_LOG(ERR, "Failed to clear tbl list: %d", ret);
@@ -2644,8 +2629,22 @@ hns3vf_dev_init(struct rte_eth_dev *eth_dev)
 		goto err_rte_zmalloc;
 	}
 
+	/*
+	 * The hns3 PF ethdev driver in kernel support setting VF MAC address
+	 * on the host by "ip link set ..." command. To avoid some incorrect
+	 * scenes, for example, hns3 VF PMD driver fails to receive and send
+	 * packets after user configure the MAC address by using the
+	 * "ip link set ..." command, hns3 VF PMD driver keep the same MAC
+	 * address strategy as the hns3 kernel ethdev driver in the
+	 * initialization. If user configure a MAC address by the ip command
+	 * for VF device, then hns3 VF PMD driver will start with it, otherwise
+	 * start with a random MAC address in the initialization.
+	 */
+	if (rte_is_zero_ether_addr((struct rte_ether_addr *)hw->mac.mac_addr))
+		rte_eth_random_addr(hw->mac.mac_addr);
 	rte_ether_addr_copy((struct rte_ether_addr *)hw->mac.mac_addr,
 			    &eth_dev->data->mac_addrs[0]);
+
 	hw->adapter_state = HNS3_NIC_INITIALIZED;
 	/*
 	 * Pass the information to the rte_eth_dev_close() that it should also
Signature · 1 line
2.27.0
#15 lore raw

PATCH 10/11 net/hns3: fix Rx/Tx queue offload capability

In reply to Wei Hu (Xavier)

From: "Wei Hu (Xavier)" <[email protected]>

According to rte_eth_rx_queue_setup and rte_eth_tx_queue_setup API function, rx_queue_offload_capa and rx_offload_capa, tx_queue_offload_capa and tx_offload_capa must be mutually exclusive in the '.dev_infos_get' ops implementation function. Otherwise, rte_eth_rx_queue_setup or rte_eth_tx_queue_setup will fail, if user uses rx_offload_capa and tx_offload_capa obtained by calling the rte_eth_dev_info_get API function.

Currently, offload capabilities are enabled for all Rx/Tx queues in hns3 PF and VF PMD driver, and offload capability only applied in a Rx/Tx queue is not supported. This patch fixes Rx/Tx queue offload capability.

Fixes 1f5ca0b460cd67 ("net/hns3: support some device operations")
Fixes a5475d61fa34b8 ("net/hns3: support VF")
---
 drivers/net/hns3/hns3_ethdev.c    | 5 +++--
 drivers/net/hns3/hns3_ethdev_vf.c | 5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)
drivers/net/hns3/hns3_ethdev.c +3 -2
index 14e4b9e35..281d8b928 100644
@@ -2459,6 +2459,7 @@ hns3_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *info)
 	info->max_mac_addrs = HNS3_UC_MACADDR_NUM;
 	info->max_mtu = info->max_rx_pktlen - HNS3_ETH_OVERHEAD;
 	info->max_lro_pkt_size = HNS3_MAX_LRO_SIZE;
+	info->rx_queue_offload_capa = 0;
 	info->rx_offload_capa = (DEV_RX_OFFLOAD_IPV4_CKSUM |
 				 DEV_RX_OFFLOAD_TCP_CKSUM |
 				 DEV_RX_OFFLOAD_UDP_CKSUM |
@@ -2472,7 +2473,7 @@ hns3_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *info)
 				 DEV_RX_OFFLOAD_JUMBO_FRAME |
 				 DEV_RX_OFFLOAD_RSS_HASH |
 				 DEV_RX_OFFLOAD_TCP_LRO);
-	info->tx_queue_offload_capa = DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+	info->tx_queue_offload_capa = 0;
 	info->tx_offload_capa = (DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM |
 				 DEV_TX_OFFLOAD_IPV4_CKSUM |
 				 DEV_TX_OFFLOAD_TCP_CKSUM |
@@ -2483,7 +2484,7 @@ hns3_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *info)
 				 DEV_TX_OFFLOAD_VXLAN_TNL_TSO |
 				 DEV_TX_OFFLOAD_GRE_TNL_TSO |
 				 DEV_TX_OFFLOAD_GENEVE_TNL_TSO |
-				 info->tx_queue_offload_capa |
+				 DEV_TX_OFFLOAD_MBUF_FAST_FREE |
 				 hns3_txvlan_cap_get(hw));
 
 	info->rx_desc_lim = (struct rte_eth_desc_lim) {
drivers/net/hns3/hns3_ethdev_vf.c +3 -2
index 7fd0e6a43..2f7a96826 100644
@@ -903,6 +903,7 @@ hns3vf_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *info)
 	info->max_mtu = info->max_rx_pktlen - HNS3_ETH_OVERHEAD;
 	info->max_lro_pkt_size = HNS3_MAX_LRO_SIZE;
 
+	info->rx_queue_offload_capa = 0;
 	info->rx_offload_capa = (DEV_RX_OFFLOAD_IPV4_CKSUM |
 				 DEV_RX_OFFLOAD_UDP_CKSUM |
 				 DEV_RX_OFFLOAD_TCP_CKSUM |
@@ -915,7 +916,7 @@ hns3vf_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *info)
 				 DEV_RX_OFFLOAD_JUMBO_FRAME |
 				 DEV_RX_OFFLOAD_RSS_HASH |
 				 DEV_RX_OFFLOAD_TCP_LRO);
-	info->tx_queue_offload_capa = DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+	info->tx_queue_offload_capa = 0;
 	info->tx_offload_capa = (DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM |
 				 DEV_TX_OFFLOAD_IPV4_CKSUM |
 				 DEV_TX_OFFLOAD_TCP_CKSUM |
@@ -926,7 +927,7 @@ hns3vf_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *info)
 				 DEV_TX_OFFLOAD_VXLAN_TNL_TSO |
 				 DEV_TX_OFFLOAD_GRE_TNL_TSO |
 				 DEV_TX_OFFLOAD_GENEVE_TNL_TSO |
-				 info->tx_queue_offload_capa |
+				 DEV_TX_OFFLOAD_MBUF_FAST_FREE |
 				 hns3_txvlan_cap_get(hw));
 
 	info->rx_desc_lim = (struct rte_eth_desc_lim) {
Signature · 1 line
2.27.0
#16 lore raw

Re: [dpdk-dev] [PATCH 10/11] net/hns3: fix Rx/Tx queue offload capability

Quoted 8 lines · Wei Hu (Xavier)

From: "Wei Hu (Xavier)" <[email protected]>

According to rte_eth_rx_queue_setup and rte_eth_tx_queue_setup API function, rx_queue_offload_capa and rx_offload_capa, tx_queue_offload_capa and tx_offload_capa must be mutually exclusive in the '.dev_infos_get' ops implementation function. Otherwise, rte_eth_rx_queue_setup or rte_eth_tx_queue_setup will fail, if user uses rx_offload_capa and tx_offload_capa obtained by calling the rte_eth_dev_info_get API function.

Can you please clarify what is fixed here?

If the PMD doesn't support 'DEV_TX_OFFLOAD_MBUF_FAST_FREE' to be configured per queue, it makes sense the update the capability reporting to match it.

But having an offload as queue offload shouldn't cause any error on setting it on port wise (to all queues). I am asking because if you are getting error 'rte_eth_rx_queue_setup()' / 'rte_eth_tx_queue_setup()' the reason can be something else.
Also what do you mean by "'tx_queue_offload_capa' and 'tx_offload_capa' must be mutually exclusive"? All queue offloads should be present in the port offload, because of an offload can be applied to any specific queue, this means it can be applied to all queues which means it can be applied port wise.

Quoted 21 lines

Currently, offload capabilities are enabled for all Rx/Tx queues in hns3 PF and VF PMD driver, and offload capability only applied in a Rx/Tx queue is not supported. This patch fixes Rx/Tx queue offload capability.

Fixes 1f5ca0b460cd67 ("net/hns3: support some device operations")
Fixes a5475d61fa34b8 ("net/hns3: support VF")
---
 drivers/net/hns3/hns3_ethdev.c    | 5 +++--
 drivers/net/hns3/hns3_ethdev_vf.c | 5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)
drivers/net/hns3/hns3_ethdev.c +0 -0
index 14e4b9e35..281d8b928 100644

drivers/net/hns3/hns3_ethdev.c hns3_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *info) · line 2462

Quoted 4 lines
drivers/net/hns3/hns3_ethdev.c +1 -0
@@ -2459,6 +2459,7 @@ hns3_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *info)
 	info->max_mac_addrs = HNS3_UC_MACADDR_NUM;
 	info->max_mtu = info->max_rx_pktlen - HNS3_ETH_OVERHEAD;
 	info->max_lro_pkt_size = HNS3_MAX_LRO_SIZE;
+	info->rx_queue_offload_capa = 0;

No need to set 'rx_queue_offload_capa' or 'tx_queue_offload_capa' to zero since zero is their default value.

#17 lore raw

Re: [dpdk-dev] [PATCH 10/11] net/hns3: fix Rx/Tx queue offload capability

Hi, Ferruh Yigit

Quoted 14 lines · Ferruh Yigit
Quoted 8 lines · Wei Hu (Xavier)

From: "Wei Hu (Xavier)" <[email protected]>

According to rte_eth_rx_queue_setup and rte_eth_tx_queue_setup API function, rx_queue_offload_capa and rx_offload_capa, tx_queue_offload_capa and tx_offload_capa must be mutually exclusive in the '.dev_infos_get' ops implementation function. Otherwise, rte_eth_rx_queue_setup or rte_eth_tx_queue_setup will fail, if user uses rx_offload_capa and tx_offload_capa obtained by calling the rte_eth_dev_info_get API function.

Can you please clarify what is fixed here?

If the PMD doesn't support 'DEV_TX_OFFLOAD_MBUF_FAST_FREE' to be configured per queue, it makes sense the update the capability reporting to match it.

Quoted 8 lines

But having an offload as queue offload shouldn't cause any error on setting it on port wise (to all queues). I am asking because if you are getting error 'rte_eth_rx_queue_setup()' / 'rte_eth_tx_queue_setup()' the reason can be something else.
Also what do you mean by "'tx_queue_offload_capa' and 'tx_offload_capa' must be mutually exclusive"? All queue offloads should be present in the port offload, because of an offload can be applied to any specific queue, this means it can be applied to all queues which means it can be applied port wise.

"rx_queue_offload_capa and rx_offload_capa, tx_queue_offload_capa

 and tx_offload_capa must be mutually exclusive" -- It's wrong, we misunderstood

the process of rte_eth_rx_queue_setup and rte_eth_tx_queue_setup.

Thanks :-)

We will update the commit log as below:

Currently, offload capabilities are only enabled for all Rx/Tx queues in hns3 PF and VF PMD driver, and offload capability only applied in a Rx/Tx queue is not supported. So this patch moves 'DEV_TX_OFFLOAD_MBUF_FAST_FREE' from tx_queue_offload_capa to tx_offload_capa.

Quoted 15 lines
Quoted 15 lines

Currently, offload capabilities are enabled for all Rx/Tx queues in hns3 PF and VF PMD driver, and offload capability only applied in a Rx/Tx queue is not supported. This patch fixes Rx/Tx queue offload capability.

Fixes 1f5ca0b460cd67 ("net/hns3: support some device operations")
Fixes a5475d61fa34b8 ("net/hns3: support VF")
---
  drivers/net/hns3/hns3_ethdev.c    | 5 +++--
  drivers/net/hns3/hns3_ethdev_vf.c | 5 +++--
  2 files changed, 6 insertions(+), 4 deletions(-)
Quoted 11 lines

drivers/net/hns3/hns3_ethdev.c hns3_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *info) · line 2462

Quoted 9 lines
drivers/net/hns3/hns3_ethdev.c +1 -0
index 14e4b9e35..281d8b928 100644
@@ -2459,6 +2459,7 @@ hns3_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *info)
  	info->max_mac_addrs = HNS3_UC_MACADDR_NUM;
  	info->max_mtu = info->max_rx_pktlen - HNS3_ETH_OVERHEAD;
  	info->max_lro_pkt_size = HNS3_MAX_LRO_SIZE;
+	info->rx_queue_offload_capa = 0;

No need to set 'rx_queue_offload_capa' or 'tx_queue_offload_capa' to zero since zero is their default value.

Ok, I  will fix it in V2.

Thanks

Regards

Xavier

#18 lore raw

PATCH v2 1/1 net/hns3: fix Rx/Tx queue offload capability

In reply to Wei Hu (Xavier)

From: "Wei Hu (Xavier)" <[email protected]>

Currently, offload capabilities are only enabled for all Rx/Tx queues in hns3 PF/VF PMD driver, and offload capability only applied in a Rx/Tx queue is not supported. So this patch moves 'DEV_TX_OFFLOAD_MBUF_FAST_FREE' from tx_queue_offload_capa to tx_offload_capa.

Fixes 1f5ca0b460cd67 ("net/hns3: support some device operations")
Fixes a5475d61fa34b8 ("net/hns3: support VF")

---
v1 -> v2: move DEV_TX_OFFLOAD_MBUF_FAST_FREE from tx_queue_offload
to tx_offload_capa in .dev_info_get ops implementation function.

---
 drivers/net/hns3/hns3_ethdev.c    | 3 +--
 drivers/net/hns3/hns3_ethdev_vf.c | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)
drivers/net/hns3/hns3_ethdev.c +1 -2
index 0727c6d..7af504e 100644
@@ -2478,7 +2478,6 @@ hns3_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *info)
 				 DEV_RX_OFFLOAD_JUMBO_FRAME |
 				 DEV_RX_OFFLOAD_RSS_HASH |
 				 DEV_RX_OFFLOAD_TCP_LRO);
-	info->tx_queue_offload_capa = DEV_TX_OFFLOAD_MBUF_FAST_FREE;
 	info->tx_offload_capa = (DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM |
 				 DEV_TX_OFFLOAD_IPV4_CKSUM |
 				 DEV_TX_OFFLOAD_TCP_CKSUM |
@@ -2489,7 +2488,7 @@ hns3_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *info)
 				 DEV_TX_OFFLOAD_VXLAN_TNL_TSO |
 				 DEV_TX_OFFLOAD_GRE_TNL_TSO |
 				 DEV_TX_OFFLOAD_GENEVE_TNL_TSO |
-				 info->tx_queue_offload_capa |
+				 DEV_TX_OFFLOAD_MBUF_FAST_FREE |
 				 hns3_txvlan_cap_get(hw));
 
 	info->rx_desc_lim = (struct rte_eth_desc_lim) {
drivers/net/hns3/hns3_ethdev_vf.c +1 -2
index 44e51b5..0be76f6 100644
@@ -942,7 +942,6 @@ hns3vf_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *info)
 				 DEV_RX_OFFLOAD_JUMBO_FRAME |
 				 DEV_RX_OFFLOAD_RSS_HASH |
 				 DEV_RX_OFFLOAD_TCP_LRO);
-	info->tx_queue_offload_capa = DEV_TX_OFFLOAD_MBUF_FAST_FREE;
 	info->tx_offload_capa = (DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM |
 				 DEV_TX_OFFLOAD_IPV4_CKSUM |
 				 DEV_TX_OFFLOAD_TCP_CKSUM |
@@ -953,7 +952,7 @@ hns3vf_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *info)
 				 DEV_TX_OFFLOAD_VXLAN_TNL_TSO |
 				 DEV_TX_OFFLOAD_GRE_TNL_TSO |
 				 DEV_TX_OFFLOAD_GENEVE_TNL_TSO |
-				 info->tx_queue_offload_capa |
+				 DEV_TX_OFFLOAD_MBUF_FAST_FREE |
 				 hns3_txvlan_cap_get(hw));
 
 	info->rx_desc_lim = (struct rte_eth_desc_lim) {
Signature · 1 line
2.9.5
Applied
#19 lore raw

Re: [dpdk-dev] [PATCH v2] net/hns3: fix Rx/Tx queue offload capability

Quoted 7 lines · Wei Hu (Xavier)

From: "Wei Hu (Xavier)" <[email protected]>

Currently, offload capabilities are only enabled for all Rx/Tx queues in hns3 PF/VF PMD driver, and offload capability only applied in a Rx/Tx queue is not supported. So this patch moves 'DEV_TX_OFFLOAD_MBUF_FAST_FREE' from tx_queue_offload_capa to tx_offload_capa.

Quoted 6 lines
Fixes 1f5ca0b460cd67 ("net/hns3: support some device operations")
Fixes a5475d61fa34b8 ("net/hns3: support VF")

Applied to dpdk-next-net/main, thanks.

#20 lore raw

PATCH 11/11 net/hns3: fix some incomplete command structures

In reply to Wei Hu (Xavier)

From: Huisong Li <[email protected]>

The descriptor of the command between firmware and hns3 PMD driver consists of 8-byte header and 24-byte data field. The contents sent to firmware are packaged into a command structure as the data field of command descriptor.

There are some command structures in hns3_dcb.h file that are less than 24 byte. So this patch fixes these incomplete command structures.

Fixes 62e3ccc2b94c6 ("net/hns3: support flow control")
---
 drivers/net/hns3/hns3_dcb.h | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
drivers/net/hns3/hns3_dcb.h +11 -1
index 1636c5ae8..557d88bc1 100644
@@ -26,16 +26,19 @@ enum hns3_shap_bucket {
 struct hns3_priority_weight_cmd {
 	uint8_t pri_id;
 	uint8_t dwrr;
+	uint8_t rsvd[22];
 };
 
 struct hns3_qs_weight_cmd {
 	uint16_t qs_id;
 	uint8_t dwrr;
+	uint8_t rsvd[21];
 };
 
 struct hns3_pg_weight_cmd {
 	uint8_t pg_id;
 	uint8_t dwrr;
+	uint8_t rsvd[22];
 };
 
 struct hns3_ets_tc_weight_cmd {
@@ -50,6 +53,7 @@ struct hns3_qs_to_pri_link_cmd {
 	uint8_t priority;
 #define HNS3_DCB_QS_PRI_LINK_VLD_MSK	BIT(0)
 	uint8_t link_vld;
+	uint8_t rsvd1[18];
 };
 
 struct hns3_nq_to_qs_link_cmd {
@@ -57,6 +61,7 @@ struct hns3_nq_to_qs_link_cmd {
 	uint16_t rsvd;
 #define HNS3_DCB_Q_QS_LINK_VLD_MSK	BIT(10)
 	uint16_t qset_id;
+	uint8_t rsvd1[18];
 };
 
 #define HNS3_DCB_SHAP_IR_B_MSK  GENMASK(7, 0)
@@ -74,12 +79,14 @@ struct hns3_pri_shapping_cmd {
 	uint8_t pri_id;
 	uint8_t rsvd[3];
 	uint32_t pri_shapping_para;
+	uint32_t rsvd1[4];
 };
 
 struct hns3_pg_shapping_cmd {
 	uint8_t pg_id;
 	uint8_t rsvd[3];
 	uint32_t pg_shapping_para;
+	uint32_t rsvd1[4];
 };
 
 #define HNS3_BP_GRP_NUM		32
@@ -92,16 +99,18 @@ struct hns3_bp_to_qs_map_cmd {
 	uint8_t rsvd[2];
 	uint8_t qs_group_id;
 	uint32_t qs_bit_map;
-	uint32_t rsvd1;
+	uint32_t rsvd1[4];
 };
 
 struct hns3_pfc_en_cmd {
 	uint8_t tx_rx_en_bitmap;
 	uint8_t pri_en_bitmap;
+	uint8_t rsvd[22];
 };
 
 struct hns3_port_shapping_cmd {
 	uint32_t port_shapping_para;
+	uint32_t rsvd[5];
 };
 
 struct hns3_cfg_pause_param_cmd {
@@ -119,6 +128,7 @@ struct hns3_pg_to_pri_link_cmd {
 	uint8_t pg_id;
 	uint8_t rsvd1[3];
 	uint8_t pri_bit_map;
+	uint8_t rsvd2[19];
 };
 
 enum hns3_shaper_level {
Signature · 1 line
2.27.0
#21 lore raw
In reply to Wei Hu (Xavier)

Hi, all

   Are there any comments?

Thanks

Xavier

Quoted 34 lines · Wei Hu (Xavier)

This series are features and fixes for hns3 PMD driver.

Huisong Li (3):
net/hns3: replace private macro with RTE MAX net/hns3: fix default MAC addr from firmware net/hns3: fix some incomplete command structures

Wei Hu (Xavier) (8):
net/hns3: get device capability from firmware net/hns3: get dev specifications from firmware net/hns3: compatibility issues about Rx interrupts net/hns3: compatibility issues about Tx padding short frame net/hns3: add more hardware error types
net/hns3: support a maximun 256 FDIR counter net/hns3: change the log level to INFO
net/hns3: fix Rx/Tx queue offload capability

  drivers/net/hns3/hns3_cmd.c       |   36 +-
  drivers/net/hns3/hns3_cmd.h       |   94 ++-
  drivers/net/hns3/hns3_dcb.c       |    1 -
  drivers/net/hns3/hns3_dcb.h       |   14 +-
  drivers/net/hns3/hns3_ethdev.c    |  187 ++++-
  drivers/net/hns3/hns3_ethdev.h    |  138 +++-
  drivers/net/hns3/hns3_ethdev_vf.c |  124 ++-
  drivers/net/hns3/hns3_fdir.c      |    5 +
  drivers/net/hns3/hns3_intr.c      | 1236 ++++++++++++++++++++++++-----
  drivers/net/hns3/hns3_intr.h      |   40 +-
  drivers/net/hns3/hns3_regs.h      |    7 +
  drivers/net/hns3/hns3_rxtx.c      |   31 +-
  drivers/net/hns3/hns3_rxtx.h      |   11 +-
  drivers/net/hns3/hns3_stats.c     |   78 +-
  drivers/net/hns3/hns3_stats.h     |    2 +
  15 files changed, 1666 insertions(+), 338 deletions(-)
#22 lore raw
Quoted 26 lines · Wei Hu (Xavier)

Hi, all

   Are there any comments?

Thanks

Xavier

Quoted 17 lines · Wei Hu (Xavier)

This series are features and fixes for hns3 PMD driver.

Huisong Li (3):
net/hns3: replace private macro with RTE MAX net/hns3: fix default MAC addr from firmware net/hns3: fix some incomplete command structures

Wei Hu (Xavier) (8):
net/hns3: get device capability from firmware net/hns3: get dev specifications from firmware net/hns3: compatibility issues about Rx interrupts net/hns3: compatibility issues about Tx padding short frame net/hns3: add more hardware error types
net/hns3: support a maximun 256 FDIR counter net/hns3: change the log level to INFO
net/hns3: fix Rx/Tx queue offload capability

Since the patches in the set are not dependent to each-other, I partially merged it. I have already put some comments on the not merged ones (8/11 & 10/11), after discussion they can be sent as incremental patches.

Except 8/11 & 10/11,
Series applied to dpdk-next-net/main, thanks.