Skip to contentSkip to conversation

bugfixes for hns3 PMD

PATCH In review Min Hu (Connor) 2 participants 5 messages Aug 30, 2021 – Sep 9, 2021 Network drivers

lore
Share & tools
lore
#0 lore raw

cover bugfixes for hns3 PMD

This patch contains three bugfixes for hns3 PMD.

Chengchang Tang (2):
net/hns3: fix queue flow action validation
net/hns3: fix new taskqueue pair reset command

Min Hu (Connor) (1):
net/hns3: fix Tx push capability

 drivers/net/hns3/hns3_cmd.c  | 3 +++
 drivers/net/hns3/hns3_cmd.h  | 1 +
 drivers/net/hns3/hns3_flow.c | 8 ++++----
 drivers/net/hns3/hns3_rxtx.c | 2 +-
 4 files changed, 9 insertions(+), 5 deletions(-)
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/3 net/hns3: fix queue flow action validation

From: Chengchang Tang <[email protected]>

The used_rx_queues only takes effect after device is started, and its value is incorrect before the device is started. Therefore, it is not suitable for flow action to use it to verify the queue index before the device is started.

E.g. Enable dedicated queue in bonding device will configure a queue flow action before start its slave devices. The above problem will make this reasonable flow action configuration fail.

This patch use the nb_rx_queues from the configuration phase to achieve verification.

Fixes a951c1ed3ab5 ("net/hns3: support different numbers of Rx and Tx queues")
Fixes f8e7fcbfd0b8 ("net/hns3: support flow action of queue region")
---
 drivers/net/hns3/hns3_flow.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/hns3/hns3_flow.c +4 -4
index fc77979..841e0b9 100644
@@ -275,10 +275,10 @@ hns3_handle_action_queue(struct rte_eth_dev *dev,
 	struct hns3_hw *hw = &hns->hw;
 
 	queue = (const struct rte_flow_action_queue *)action->conf;
-	if (queue->index >= hw->used_rx_queues) {
+	if (queue->index >= hw->data->nb_rx_queues) {
 		hns3_err(hw, "queue ID(%u) is greater than number of "
 			  "available queue (%u) in driver.",
-			  queue->index, hw->used_rx_queues);
+			  queue->index, hw->data->nb_rx_queues);
 		return rte_flow_error_set(error, EINVAL,
 					  RTE_FLOW_ERROR_TYPE_ACTION_CONF,
 					  action, "Invalid queue ID in PF");
@@ -308,8 +308,8 @@ hns3_handle_action_queue_region(struct rte_eth_dev *dev,
 
 	if ((!rte_is_power_of_2(conf->queue_num)) ||
 		conf->queue_num > hw->rss_size_max ||
-		conf->queue[0] >= hw->used_rx_queues ||
-		conf->queue[0] + conf->queue_num > hw->used_rx_queues) {
+		conf->queue[0] >= hw->data->nb_rx_queues ||
+		conf->queue[0] + conf->queue_num > hw->data->nb_rx_queues) {
 		return rte_flow_error_set(error, EINVAL,
 			RTE_FLOW_ERROR_TYPE_ACTION_CONF, action,
 			"Invalid start queue ID and queue num! the start queue "
Signature · 1 line
2.7.4
#2 lore raw

PATCH 2/3 net/hns3: fix new taskqueue pair reset command

In reply to Min Hu (Connor)

From: Chengchang Tang <[email protected]>

This new taskqueue pair reset command is used incorrectly, resulting in the new command not taking effect.

This patch fix the incorrect use.

Fixes 6911e7c22c61 ("net/hns3: fix long task queue pairs reset time")
---
 drivers/net/hns3/hns3_rxtx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/hns3/hns3_rxtx.c +1 -1
index 0f222b3..481872e 100644
@@ -697,7 +697,7 @@ hns3_reset_rcb_cmd(struct hns3_hw *hw, uint8_t *reset_status)
 
 	hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_CFG_RST_TRIGGER, false);
 	req = (struct hns3_reset_cmd *)desc.data;
-	hns3_set_bit(req->mac_func_reset, HNS3_CFG_RESET_RCB_B, 1);
+	hns3_set_bit(req->fun_reset_rcb, HNS3_CFG_RESET_RCB_B, 1);
 
 	/*
 	 * The start qid should be the global qid of the first tqp of the
Signature · 1 line
2.7.4
#3 lore raw

PATCH 3/3 net/hns3: fix Tx push capability

In reply to Min Hu (Connor)

This patch fixes Tx push capability to be compatible with Kunpeng 920, as Tx push is only supported on Kunpeng 930.

Fixes 23e317dd1fbf ("net/hns3: support Tx push quick doorbell for performance")
---
 drivers/net/hns3/hns3_cmd.c | 3 +++
 drivers/net/hns3/hns3_cmd.h | 1 +
 2 files changed, 4 insertions(+)
drivers/net/hns3/hns3_cmd.c +3 -0
index 928f938..6a1e634 100644
@@ -423,6 +423,7 @@ hns3_get_caps_name(uint32_t caps_id)
 	} dev_caps[] = {
 		{ HNS3_CAPS_FD_QUEUE_REGION_B, "fd_queue_region" },
 		{ HNS3_CAPS_PTP_B,             "ptp"             },
+		{ HNS3_CAPS_TX_PUSH_B,         "tx_push"         },
 		{ HNS3_CAPS_PHY_IMP_B,         "phy_imp"         },
 		{ HNS3_CAPS_TQP_TXRX_INDEP_B,  "tqp_txrx_indep"  },
 		{ HNS3_CAPS_HW_PAD_B,          "hw_pad"          },
@@ -492,6 +493,8 @@ hns3_parse_capability(struct hns3_hw *hw,
 			hns3_warn(hw, "ignore PTP capability due to lack of "
 				  "rxd advanced layout capability.");
 	}
+	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))
drivers/net/hns3/hns3_cmd.h +1 -0
index 88683df..a4683de 100644
@@ -315,6 +315,7 @@ enum HNS3_CAPS_BITS {
 	 */
 	HNS3_CAPS_FD_QUEUE_REGION_B = 2,
 	HNS3_CAPS_PTP_B,
+	HNS3_CAPS_TX_PUSH_B = 6,
 	HNS3_CAPS_PHY_IMP_B = 7,
 	HNS3_CAPS_TQP_TXRX_INDEP_B,
 	HNS3_CAPS_HW_PAD_B,
Signature · 1 line
2.7.4
#4 lore raw
In reply to Min Hu (Connor)
Quoted 9 lines · Min Hu (Connor)

This patch contains three bugfixes for hns3 PMD.

Chengchang Tang (2):
net/hns3: fix queue flow action validation
net/hns3: fix new taskqueue pair reset command

Min Hu (Connor) (1):
net/hns3: fix Tx push capability

Series applied to dpdk-next-net/main, thanks.