Skip to contentSkip to conversation

bugfix for hns3 PMD

PATCH In review Min Hu (Connor) 2 participants 6 messages May 10, 2021 – May 11, 2021 Network drivers

lore
Share & tools
lore
#0 lore raw

cover bugfix for hns3 PMD

This patch set contains four bugfix for hns3 PMD

Chengwen Feng (4):
net/hns3: fix unsupported mbx msg id log error net/hns3: fix secondary process request start/stop Rx/Tx net/hns3: fix memory barrier incorrectly placed net/hns3: return fail if FEC mode not support

 drivers/net/hns3/hns3_ethdev.c | 6 ++++--
 drivers/net/hns3/hns3_mbx.c    | 2 +-
 drivers/net/hns3/hns3_mp.c     | 4 ++--
 3 files changed, 7 insertions(+), 5 deletions(-)
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/4 net/hns3: fix unsupported mbx msg id log error

From: Chengwen Feng <[email protected]>

The mailbox message id is uint8_t, but the unsupported mailbox message id was logged by uint16.

Fixes 463e748964f5 ("net/hns3: support mailbox")
---
 drivers/net/hns3/hns3_mbx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/hns3/hns3_mbx.c +1 -1
index 31ab130..f36cb10 100644
@@ -540,7 +540,7 @@ hns3_dev_handle_mbx_msg(struct hns3_hw *hw)
 			break;
 		default:
 			hns3_err(hw, "received unsupported(%u) mbx msg",
-				 req->msg[0]);
+				 opcode);
 			break;
 		}
 
Signature · 1 line
2.7.4
#2 lore raw

PATCH 2/4 net/hns3: fix secondary process request start/stop Rx/Tx

In reply to Min Hu (Connor)

From: Chengwen Feng <[email protected]>

This secondary process should not send request to start/stop Rx/Tx, this patch fixes it.

Fixes 23d4b61fee5d ("net/hns3: support multiple process")
---
 drivers/net/hns3/hns3_mp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/hns3/hns3_mp.c +1 -1
index ac0b5a0..cab784f 100644
@@ -130,7 +130,7 @@ mp_req_on_rxtx(struct rte_eth_dev *dev, enum hns3_mp_req_type type)
 	int ret;
 	int i;
 
-	if (!hw->secondary_cnt)
+	if (rte_eal_process_type() == RTE_PROC_SECONDARY || !hw->secondary_cnt)
 		return;
 	if (type != HNS3_MP_REQ_START_RXTX && type != HNS3_MP_REQ_STOP_RXTX) {
 		hns3_err(hw, "port %u unknown request (req_type %d)",
Signature · 1 line
2.7.4
#3 lore raw

PATCH 3/4 net/hns3: fix memory barrier incorrectly placed

In reply to Min Hu (Connor)

From: Chengwen Feng <[email protected]>

The memory barrier is used to ensure that the response is returned only after the Tx/Rx function is set, it should place after the Rx/Tx function is set.

Fixes 23d4b61fee5d ("net/hns3: support multiple process")
---
 drivers/net/hns3/hns3_mp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/hns3/hns3_mp.c +1 -1
index cab784f..a8485f5 100644
@@ -86,8 +86,8 @@ mp_secondary_handle(const struct rte_mp_msg *mp_msg, const void *peer)
 	case HNS3_MP_REQ_START_RXTX:
 		PMD_INIT_LOG(INFO, "port %u starting datapath",
 			     dev->data->port_id);
-		rte_mb();
 		hns3_set_rxtx_function(dev);
+		rte_mb();
 		mp_init_msg(dev, &mp_res, param->type);
 		res->result = 0;
 		ret = rte_mp_reply(&mp_res, peer);
Signature · 1 line
2.7.4
#4 lore raw

PATCH 4/4 net/hns3: return fail if FEC mode not support

In reply to Min Hu (Connor)

From: Chengwen Feng <[email protected]>

If the FEC mode was not supported, it should return error code.

This patch also adds a space when log error info.

Fixes 9bf2ea8dbc65 ("net/hns3: support FEC")
---
 drivers/net/hns3/hns3_ethdev.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/hns3/hns3_ethdev.c +4 -2
index 2056a37..0758ef5 100644
@@ -6991,9 +6991,11 @@ hns3_fec_set(struct rte_eth_dev *dev, uint32_t mode)
 		return ret;
 
 	/* HNS3 PMD driver only support one bit set mode, e.g. 0x1, 0x4 */
-	if (!is_fec_mode_one_bit_set(mode))
-		hns3_err(hw, "FEC mode(0x%x) not supported in HNS3 PMD,"
+	if (!is_fec_mode_one_bit_set(mode)) {
+		hns3_err(hw, "FEC mode(0x%x) not supported in HNS3 PMD, "
 			     "FEC mode should be only one bit set", mode);
+		return -EINVAL;
+	}
 
 	/*
 	 * Check whether the configured mode is within the FEC capability.
Signature · 1 line
2.7.4
#5 lore raw
In reply to Min Hu (Connor)
Quoted 8 lines · Min Hu (Connor)

This patch set contains four bugfix for hns3 PMD

Chengwen Feng (4):
net/hns3: fix unsupported mbx msg id log error net/hns3: fix secondary process request start/stop Rx/Tx net/hns3: fix memory barrier incorrectly placed net/hns3: return fail if FEC mode not support

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