* [PATCH v1] net/zxdh: add pcie bar channel check
@ 2025-12-09 2:16 Tianhao Zhang
2025-12-22 10:25 ` [PATCH v1 0/2] fix bug Tianhao Zhang
0 siblings, 1 reply; 17+ messages in thread
From: Tianhao Zhang @ 2025-12-09 2:16 UTC (permalink / raw)
To: stephen, wang.junlong1, yang.yonggang; +Cc: dev, Tianhao Zhang
[-- Attachment #1.1.1: Type: text/plain, Size: 1895 bytes --]
Add pcie bar channel check after getting dtb space left.
Signed-off-by: Tianhao Zhang <zhang.tianhao2@zte.com.cn>
---
drivers/net/zxdh/zxdh_np.c | 7 +++++++
drivers/net/zxdh/zxdh_np.h | 2 ++
2 files changed, 9 insertions(+)
diff --git a/drivers/net/zxdh/zxdh_np.c b/drivers/net/zxdh/zxdh_np.c
index 024da113e2..4e2637e1b6 100644
--- a/drivers/net/zxdh/zxdh_np.c
+++ b/drivers/net/zxdh/zxdh_np.c
@@ -3698,6 +3698,13 @@ zxdh_np_dtb_queue_unused_item_num_get(uint32_t dev_id,
rc = zxdh_np_reg_read(dev_id, ZXDH_DTB_INFO_QUEUE_BUF_SPACE,
0, queue_id, p_item_num);
ZXDH_COMM_CHECK_DEV_RC(dev_id, rc, "dpp_reg_read");
+
+ if((*p_item_num & ZXDH_DTB_SPACE_LEFT_MASK) == ZXDH_DTB_SPACE_LEFT_MASK)
+ {
+ PMD_DRV_LOG(ERR, "pcie bar abnormal, get dtb space left false.");
+ return ZXDH_RC_DTB_BAR_ABNORMAL;
+ }
+
return rc;
}
diff --git a/drivers/net/zxdh/zxdh_np.h b/drivers/net/zxdh/zxdh_np.h
index b0823192e7..5b9aec9c8f 100644
--- a/drivers/net/zxdh/zxdh_np.h
+++ b/drivers/net/zxdh/zxdh_np.h
@@ -94,6 +94,7 @@
#define ZXDH_DTB_TAB_ACK_SUCCESS_MASK (0xff)
#define ZXDH_DTB_TAB_ACK_FAILED_MASK (0x1)
#define ZXDH_DTB_TAB_ACK_CHECK_VALUE (0x12345678)
+#define ZXDH_DTB_SPACE_LEFT_MASK (0x3F)
#define ZXDH_DTB_TAB_ACK_VLD_SHIFT (104)
#define ZXDH_DTB_TAB_ACK_STATUS_SHIFT (96)
@@ -321,6 +322,7 @@
#define ZXDH_RC_DTB_DUMP_SIZE_SMALL (ZXDH_RC_DTB_BASE | 0x16)
#define ZXDH_RC_DTB_SEARCH_VPORT_QUEUE_ZERO (ZXDH_RC_DTB_BASE | 0x17)
#define ZXDH_RC_DTB_QUEUE_NOT_ENABLE (ZXDH_RC_DTB_BASE | 0x18)
+#define ZXDH_RC_DTB_BAR_ABNORMAL (ZXDH_RC_DTB_BASE | 0x19)
#define ZXDH_RC_CTRLCH_BASE (0xf00)
#define ZXDH_RC_CTRLCH_MSG_LEN_ZERO (ZXDH_RC_CTRLCH_BASE | 0x0)
--
2.27.0
[-- Attachment #1.1.2: Type: text/html , Size: 3784 bytes --]
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH v1 0/2] fix bug
2025-12-09 2:16 [PATCH v1] net/zxdh: add pcie bar channel check Tianhao Zhang
@ 2025-12-22 10:25 ` Tianhao Zhang
2025-12-22 10:25 ` [PATCH v1 1/2] net/zxdh: add pcie bar channel check Tianhao Zhang
` (2 more replies)
0 siblings, 3 replies; 17+ messages in thread
From: Tianhao Zhang @ 2025-12-22 10:25 UTC (permalink / raw)
To: stephen, wang.junlong1, yang.yonggang; +Cc: dev, Tianhao Zhang
[-- Attachment #1.1.1: Type: text/plain, Size: 405 bytes --]
V1:
- Add pcie bar channel check after getting dtb space left.
- Delete np soft resource uninstallation from NP online uninit process.
Tianhao Zhang (2):
net/zxdh: add pcie bar channel check
net/zxdh: delete np soft resource uninstallation
drivers/net/zxdh/zxdh_np.c | 11 +++++++----
drivers/net/zxdh/zxdh_np.h | 2 ++
2 files changed, 9 insertions(+), 4 deletions(-)
--
2.27.0
[-- Attachment #1.1.2: Type: text/html , Size: 752 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread* [PATCH v1 1/2] net/zxdh: add pcie bar channel check
2025-12-22 10:25 ` [PATCH v1 0/2] fix bug Tianhao Zhang
@ 2025-12-22 10:25 ` Tianhao Zhang
2025-12-22 18:37 ` Stephen Hemminger
2025-12-30 8:11 ` [PATCH v2 0/2] fix npsdk bug Tianhao Zhang
2025-12-22 10:25 ` [PATCH v1 2/2] net/zxdh: delete np soft resource uninstallation Tianhao Zhang
2026-01-13 15:32 ` [PATCH v1 0/2] fix bug Stephen Hemminger
2 siblings, 2 replies; 17+ messages in thread
From: Tianhao Zhang @ 2025-12-22 10:25 UTC (permalink / raw)
To: stephen, wang.junlong1, yang.yonggang; +Cc: dev, Tianhao Zhang
[-- Attachment #1.1.1: Type: text/plain, Size: 1895 bytes --]
Add pcie bar channel check after getting dtb space left.
Signed-off-by: Tianhao Zhang <zhang.tianhao2@zte.com.cn>
---
drivers/net/zxdh/zxdh_np.c | 7 +++++++
drivers/net/zxdh/zxdh_np.h | 2 ++
2 files changed, 9 insertions(+)
diff --git a/drivers/net/zxdh/zxdh_np.c b/drivers/net/zxdh/zxdh_np.c
index 024da113e2..4e2637e1b6 100644
--- a/drivers/net/zxdh/zxdh_np.c
+++ b/drivers/net/zxdh/zxdh_np.c
@@ -3698,6 +3698,13 @@ zxdh_np_dtb_queue_unused_item_num_get(uint32_t dev_id,
rc = zxdh_np_reg_read(dev_id, ZXDH_DTB_INFO_QUEUE_BUF_SPACE,
0, queue_id, p_item_num);
ZXDH_COMM_CHECK_DEV_RC(dev_id, rc, "dpp_reg_read");
+
+ if((*p_item_num & ZXDH_DTB_SPACE_LEFT_MASK) == ZXDH_DTB_SPACE_LEFT_MASK)
+ {
+ PMD_DRV_LOG(ERR, "pcie bar abnormal, get dtb space left false.");
+ return ZXDH_RC_DTB_BAR_ABNORMAL;
+ }
+
return rc;
}
diff --git a/drivers/net/zxdh/zxdh_np.h b/drivers/net/zxdh/zxdh_np.h
index b0823192e7..5b9aec9c8f 100644
--- a/drivers/net/zxdh/zxdh_np.h
+++ b/drivers/net/zxdh/zxdh_np.h
@@ -94,6 +94,7 @@
#define ZXDH_DTB_TAB_ACK_SUCCESS_MASK (0xff)
#define ZXDH_DTB_TAB_ACK_FAILED_MASK (0x1)
#define ZXDH_DTB_TAB_ACK_CHECK_VALUE (0x12345678)
+#define ZXDH_DTB_SPACE_LEFT_MASK (0x3F)
#define ZXDH_DTB_TAB_ACK_VLD_SHIFT (104)
#define ZXDH_DTB_TAB_ACK_STATUS_SHIFT (96)
@@ -321,6 +322,7 @@
#define ZXDH_RC_DTB_DUMP_SIZE_SMALL (ZXDH_RC_DTB_BASE | 0x16)
#define ZXDH_RC_DTB_SEARCH_VPORT_QUEUE_ZERO (ZXDH_RC_DTB_BASE | 0x17)
#define ZXDH_RC_DTB_QUEUE_NOT_ENABLE (ZXDH_RC_DTB_BASE | 0x18)
+#define ZXDH_RC_DTB_BAR_ABNORMAL (ZXDH_RC_DTB_BASE | 0x19)
#define ZXDH_RC_CTRLCH_BASE (0xf00)
#define ZXDH_RC_CTRLCH_MSG_LEN_ZERO (ZXDH_RC_CTRLCH_BASE | 0x0)
--
2.27.0
[-- Attachment #1.1.2: Type: text/html , Size: 3784 bytes --]
^ permalink raw reply related [flat|nested] 17+ messages in thread* Re: [PATCH v1 1/2] net/zxdh: add pcie bar channel check
2025-12-22 10:25 ` [PATCH v1 1/2] net/zxdh: add pcie bar channel check Tianhao Zhang
@ 2025-12-22 18:37 ` Stephen Hemminger
2025-12-30 8:11 ` [PATCH v2 0/2] fix npsdk bug Tianhao Zhang
1 sibling, 0 replies; 17+ messages in thread
From: Stephen Hemminger @ 2025-12-22 18:37 UTC (permalink / raw)
To: Tianhao Zhang; +Cc: wang.junlong1, yang.yonggang, dev
On Mon, 22 Dec 2025 18:25:34 +0800
Tianhao Zhang <zhang.tianhao2@zte.com.cn> wrote:
> Add pcie bar channel check after getting dtb space left.
>
> Signed-off-by: Tianhao Zhang <zhang.tianhao2@zte.com.cn>
> ---
> drivers/net/zxdh/zxdh_np.c | 7 +++++++
> drivers/net/zxdh/zxdh_np.h | 2 ++
> 2 files changed, 9 insertions(+)
>
> diff --git a/drivers/net/zxdh/zxdh_np.c b/drivers/net/zxdh/zxdh_np.c
> index 024da113e2..4e2637e1b6 100644
> --- a/drivers/net/zxdh/zxdh_np.c
> +++ b/drivers/net/zxdh/zxdh_np.c
> @@ -3698,6 +3698,13 @@ zxdh_np_dtb_queue_unused_item_num_get(uint32_t dev_id,
> rc = zxdh_np_reg_read(dev_id, ZXDH_DTB_INFO_QUEUE_BUF_SPACE,
> 0, queue_id, p_item_num);
> ZXDH_COMM_CHECK_DEV_RC(dev_id, rc, "dpp_reg_read");
> +
> + if((*p_item_num & ZXDH_DTB_SPACE_LEFT_MASK) == ZXDH_DTB_SPACE_LEFT_MASK)
> + {
> + PMD_DRV_LOG(ERR, "pcie bar abnormal, get dtb space left false.");
> + return ZXDH_RC_DTB_BAR_ABNORMAL;
> + }
> +
> return rc;
> }
>
The DPDK style is like the Linux kernel coding style, the bracket should be on the if() line.
The indentation is also off.
It is also not clear what "space left" means, could you provide a clearer message.
^ permalink raw reply [flat|nested] 17+ messages in thread* [PATCH v2 0/2] fix npsdk bug
2025-12-22 10:25 ` [PATCH v1 1/2] net/zxdh: add pcie bar channel check Tianhao Zhang
2025-12-22 18:37 ` Stephen Hemminger
@ 2025-12-30 8:11 ` Tianhao Zhang
2025-12-30 8:11 ` [PATCH v2 1/2] net/zxdh: add pcie bar channel check Tianhao Zhang
2025-12-30 8:11 ` [PATCH v2 2/2] net/zxdh: optimize the procedure for NP online uninit Tianhao Zhang
1 sibling, 2 replies; 17+ messages in thread
From: Tianhao Zhang @ 2025-12-30 8:11 UTC (permalink / raw)
To: stephen, wang.junlong1, yang.yonggang; +Cc: dev, Tianhao Zhang
[-- Attachment #1.1.1: Type: text/plain, Size: 631 bytes --]
V2:
- Resolve code style
- Provide clear error messages.
V1:
- Add new timeout error return.
- Add PCIe link health check.
- Remove the NP software resource uninstallation procedure from the NP online uninit process.
- NP software resource uninstallation should be called separately within NP uninit to avoid duplicate resource release.
Tianhao Zhang (2):
net/zxdh: add pcie bar channel check
net/zxdh: optimize the procedure for NP online uninit
drivers/net/zxdh/zxdh_np.c | 12 +++++++-----
drivers/net/zxdh/zxdh_np.h | 3 +++
2 files changed, 10 insertions(+), 5 deletions(-)
--
2.27.0
[-- Attachment #1.1.2: Type: text/html , Size: 1189 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v2 1/2] net/zxdh: add pcie bar channel check
2025-12-30 8:11 ` [PATCH v2 0/2] fix npsdk bug Tianhao Zhang
@ 2025-12-30 8:11 ` Tianhao Zhang
2025-12-30 18:29 ` Stephen Hemminger
2026-02-03 7:17 ` [PATCH v3 0/2] net/zxdh: fix npsdk bug Tianhao Zhang
2025-12-30 8:11 ` [PATCH v2 2/2] net/zxdh: optimize the procedure for NP online uninit Tianhao Zhang
1 sibling, 2 replies; 17+ messages in thread
From: Tianhao Zhang @ 2025-12-30 8:11 UTC (permalink / raw)
To: stephen, wang.junlong1, yang.yonggang; +Cc: dev, Tianhao Zhang
[-- Attachment #1.1.1: Type: text/plain, Size: 2264 bytes --]
After obtaining the DTB element register, check if the PCIe link is abnormal.
Signed-off-by: Tianhao Zhang <zhang.tianhao2@zte.com.cn>
---
drivers/net/zxdh/zxdh_np.c | 8 +++++++-
drivers/net/zxdh/zxdh_np.h | 3 +++
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/net/zxdh/zxdh_np.c b/drivers/net/zxdh/zxdh_np.c
index 024da113e2..89c9283498 100644
--- a/drivers/net/zxdh/zxdh_np.c
+++ b/drivers/net/zxdh/zxdh_np.c
@@ -3698,6 +3698,12 @@ zxdh_np_dtb_queue_unused_item_num_get(uint32_t dev_id,
rc = zxdh_np_reg_read(dev_id, ZXDH_DTB_INFO_QUEUE_BUF_SPACE,
0, queue_id, p_item_num);
ZXDH_COMM_CHECK_DEV_RC(dev_id, rc, "dpp_reg_read");
+
+ if ((*p_item_num & ZXDH_DTB_SPACE_LEFT_MASK) == ZXDH_DTB_SPACE_LEFT_MASK) {
+ PMD_DRV_LOG(ERR, "pcie bar abnormal.");
+ return ZXDH_RC_DTB_BAR_ABNORMAL;
+ }
+
return rc;
}
@@ -5374,7 +5380,7 @@ zxdh_np_dtb_tab_down_success_status_check(uint32_t dev_id,
element_id, 0, ZXDH_DTB_TAB_ACK_UNUSED_MASK);
ZXDH_COMM_CHECK_DEV_RC(dev_id, rc, "zxdh_np_dtb_item_ack_wr");
- return ZXDH_ERR;
+ return ZXDH_RC_DTB_OVER_TIME;
}
rd_cnt++;
diff --git a/drivers/net/zxdh/zxdh_np.h b/drivers/net/zxdh/zxdh_np.h
index b0823192e7..80eac8de37 100644
--- a/drivers/net/zxdh/zxdh_np.h
+++ b/drivers/net/zxdh/zxdh_np.h
@@ -94,6 +94,7 @@
#define ZXDH_DTB_TAB_ACK_SUCCESS_MASK (0xff)
#define ZXDH_DTB_TAB_ACK_FAILED_MASK (0x1)
#define ZXDH_DTB_TAB_ACK_CHECK_VALUE (0x12345678)
+#define ZXDH_DTB_SPACE_LEFT_MASK (0x3F)
#define ZXDH_DTB_TAB_ACK_VLD_SHIFT (104)
#define ZXDH_DTB_TAB_ACK_STATUS_SHIFT (96)
@@ -321,6 +322,8 @@
#define ZXDH_RC_DTB_DUMP_SIZE_SMALL (ZXDH_RC_DTB_BASE | 0x16)
#define ZXDH_RC_DTB_SEARCH_VPORT_QUEUE_ZERO (ZXDH_RC_DTB_BASE | 0x17)
#define ZXDH_RC_DTB_QUEUE_NOT_ENABLE (ZXDH_RC_DTB_BASE | 0x18)
+#define ZXDH_RC_DTB_OVER_TIME (ZXDH_RC_DTB_BASE | 0x19)
+#define ZXDH_RC_DTB_BAR_ABNORMAL (ZXDH_RC_DTB_BASE | 0x1a)
#define ZXDH_RC_CTRLCH_BASE (0xf00)
#define ZXDH_RC_CTRLCH_MSG_LEN_ZERO (ZXDH_RC_CTRLCH_BASE | 0x0)
--
2.27.0
[-- Attachment #1.1.2: Type: text/html , Size: 4777 bytes --]
^ permalink raw reply related [flat|nested] 17+ messages in thread* Re: [PATCH v2 1/2] net/zxdh: add pcie bar channel check
2025-12-30 8:11 ` [PATCH v2 1/2] net/zxdh: add pcie bar channel check Tianhao Zhang
@ 2025-12-30 18:29 ` Stephen Hemminger
2026-02-03 7:17 ` [PATCH v3 0/2] net/zxdh: fix npsdk bug Tianhao Zhang
1 sibling, 0 replies; 17+ messages in thread
From: Stephen Hemminger @ 2025-12-30 18:29 UTC (permalink / raw)
To: Tianhao Zhang; +Cc: wang.junlong1, yang.yonggang, dev
On Tue, 30 Dec 2025 16:11:26 +0800
Tianhao Zhang <zhang.tianhao2@zte.com.cn> wrote:
> After obtaining the DTB element register, check if the PCIe link is abnormal.
>
> Signed-off-by: Tianhao Zhang <zhang.tianhao2@zte.com.cn>
> ---
Queued to next-net and fixed the indentation issues reported by checkpatch.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v3 0/2] net/zxdh: fix npsdk bug
2025-12-30 8:11 ` [PATCH v2 1/2] net/zxdh: add pcie bar channel check Tianhao Zhang
2025-12-30 18:29 ` Stephen Hemminger
@ 2026-02-03 7:17 ` Tianhao Zhang
2026-02-03 7:17 ` [PATCH v3 1/2] net/zxdh: add pcie bar channel check Tianhao Zhang
` (2 more replies)
1 sibling, 3 replies; 17+ messages in thread
From: Tianhao Zhang @ 2026-02-03 7:17 UTC (permalink / raw)
To: stephen, wang.junlong1, yang.yonggang; +Cc: dev, Tianhao Zhang
[-- Attachment #1.1.1: Type: text/plain, Size: 696 bytes --]
V3:
- Fix the indentation issues。
V2:
- Resolve code style.
- Provide clear error messages.
V1:
- Add new timeout error return.
- Add PCIe link health check.
- Remove the NP software resource uninstallation procedure from the NP online uninit process.
- NP software resource uninstallation should be called separately within NP uninit to avoid duplicate resource release.
*** BLURB HERE ***
Tianhao Zhang (2):
net/zxdh: add pcie bar channel check
net/zxdh: optimize the procedure for NP online uninit
drivers/net/zxdh/zxdh_np.c | 12 +++++++-----
drivers/net/zxdh/zxdh_np.h | 3 +++
2 files changed, 10 insertions(+), 5 deletions(-)
--
2.27.0
[-- Attachment #1.1.2: Type: text/html , Size: 1321 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread* [PATCH v3 1/2] net/zxdh: add pcie bar channel check
2026-02-03 7:17 ` [PATCH v3 0/2] net/zxdh: fix npsdk bug Tianhao Zhang
@ 2026-02-03 7:17 ` Tianhao Zhang
2026-02-03 14:35 ` Stephen Hemminger
2026-02-03 7:17 ` [PATCH v3 2/2] net/zxdh: optimize the procedure for NP online uninit Tianhao Zhang
2026-02-05 22:11 ` [PATCH v3 0/2] net/zxdh: fix npsdk bug Stephen Hemminger
2 siblings, 1 reply; 17+ messages in thread
From: Tianhao Zhang @ 2026-02-03 7:17 UTC (permalink / raw)
To: stephen, wang.junlong1, yang.yonggang; +Cc: dev, Tianhao Zhang
[-- Attachment #1.1.1: Type: text/plain, Size: 2254 bytes --]
After obtaining the DTB element register, check if the PCIe link is abnormal.
Signed-off-by: Tianhao Zhang <zhang.tianhao2@zte.com.cn>
---
drivers/net/zxdh/zxdh_np.c | 8 +++++++-
drivers/net/zxdh/zxdh_np.h | 3 +++
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/net/zxdh/zxdh_np.c b/drivers/net/zxdh/zxdh_np.c
index 024da113e2..4cb9dde982 100644
--- a/drivers/net/zxdh/zxdh_np.c
+++ b/drivers/net/zxdh/zxdh_np.c
@@ -3698,6 +3698,12 @@ zxdh_np_dtb_queue_unused_item_num_get(uint32_t dev_id,
rc = zxdh_np_reg_read(dev_id, ZXDH_DTB_INFO_QUEUE_BUF_SPACE,
0, queue_id, p_item_num);
ZXDH_COMM_CHECK_DEV_RC(dev_id, rc, "dpp_reg_read");
+
+ if ((*p_item_num & ZXDH_DTB_SPACE_LEFT_MASK) == ZXDH_DTB_SPACE_LEFT_MASK) {
+ PMD_DRV_LOG(ERR, "pcie bar abnormal.");
+ return ZXDH_RC_DTB_BAR_ABNORMAL;
+ }
+
return rc;
}
@@ -5374,7 +5380,7 @@ zxdh_np_dtb_tab_down_success_status_check(uint32_t dev_id,
element_id, 0, ZXDH_DTB_TAB_ACK_UNUSED_MASK);
ZXDH_COMM_CHECK_DEV_RC(dev_id, rc, "zxdh_np_dtb_item_ack_wr");
- return ZXDH_ERR;
+ return ZXDH_RC_DTB_OVER_TIME;
}
rd_cnt++;
diff --git a/drivers/net/zxdh/zxdh_np.h b/drivers/net/zxdh/zxdh_np.h
index b0823192e7..80eac8de37 100644
--- a/drivers/net/zxdh/zxdh_np.h
+++ b/drivers/net/zxdh/zxdh_np.h
@@ -94,6 +94,7 @@
#define ZXDH_DTB_TAB_ACK_SUCCESS_MASK (0xff)
#define ZXDH_DTB_TAB_ACK_FAILED_MASK (0x1)
#define ZXDH_DTB_TAB_ACK_CHECK_VALUE (0x12345678)
+#define ZXDH_DTB_SPACE_LEFT_MASK (0x3F)
#define ZXDH_DTB_TAB_ACK_VLD_SHIFT (104)
#define ZXDH_DTB_TAB_ACK_STATUS_SHIFT (96)
@@ -321,6 +322,8 @@
#define ZXDH_RC_DTB_DUMP_SIZE_SMALL (ZXDH_RC_DTB_BASE | 0x16)
#define ZXDH_RC_DTB_SEARCH_VPORT_QUEUE_ZERO (ZXDH_RC_DTB_BASE | 0x17)
#define ZXDH_RC_DTB_QUEUE_NOT_ENABLE (ZXDH_RC_DTB_BASE | 0x18)
+#define ZXDH_RC_DTB_OVER_TIME (ZXDH_RC_DTB_BASE | 0x19)
+#define ZXDH_RC_DTB_BAR_ABNORMAL (ZXDH_RC_DTB_BASE | 0x1a)
#define ZXDH_RC_CTRLCH_BASE (0xf00)
#define ZXDH_RC_CTRLCH_MSG_LEN_ZERO (ZXDH_RC_CTRLCH_BASE | 0x0)
--
2.27.0
[-- Attachment #1.1.2: Type: text/html , Size: 4752 bytes --]
^ permalink raw reply related [flat|nested] 17+ messages in thread* Re: [PATCH v3 1/2] net/zxdh: add pcie bar channel check
2026-02-03 7:17 ` [PATCH v3 1/2] net/zxdh: add pcie bar channel check Tianhao Zhang
@ 2026-02-03 14:35 ` Stephen Hemminger
0 siblings, 0 replies; 17+ messages in thread
From: Stephen Hemminger @ 2026-02-03 14:35 UTC (permalink / raw)
To: Tianhao Zhang; +Cc: wang.junlong1, yang.yonggang, dev
On Tue, 3 Feb 2026 15:17:28 +0800
Tianhao Zhang <zhang.tianhao2@zte.com.cn> wrote:
> After obtaining the DTB element register, check if the PCIe link is abnormal.
>
> Signed-off-by: Tianhao Zhang <zhang.tianhao2@zte.com.cn>
> ---
Ok, but the commit message is too terse. How about?
Check for PCIe BAR failure after reading the DTB queue
buffer space register. A value of 0x3F in the low bits
indicates the link is down. Also return a specific error
code for DTB timeout instead of the generic ZXDH_ERR.
I can fix during merge.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v3 2/2] net/zxdh: optimize the procedure for NP online uninit
2026-02-03 7:17 ` [PATCH v3 0/2] net/zxdh: fix npsdk bug Tianhao Zhang
2026-02-03 7:17 ` [PATCH v3 1/2] net/zxdh: add pcie bar channel check Tianhao Zhang
@ 2026-02-03 7:17 ` Tianhao Zhang
2026-02-03 14:35 ` Stephen Hemminger
2026-02-05 22:11 ` [PATCH v3 0/2] net/zxdh: fix npsdk bug Stephen Hemminger
2 siblings, 1 reply; 17+ messages in thread
From: Tianhao Zhang @ 2026-02-03 7:17 UTC (permalink / raw)
To: stephen, wang.junlong1, yang.yonggang; +Cc: dev, Tianhao Zhang
[-- Attachment #1.1.1: Type: text/plain, Size: 849 bytes --]
Remove the NP software resource uninstallation procedure from the NP
online uninit process. The NP software resource uninstallation should be
called separately within NP uninit to avoid duplicate resource
release.
Signed-off-by: Tianhao Zhang <zhang.tianhao2@zte.com.cn>
---
drivers/net/zxdh/zxdh_np.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/net/zxdh/zxdh_np.c b/drivers/net/zxdh/zxdh_np.c
index 4cb9dde982..30c468c218 100644
--- a/drivers/net/zxdh/zxdh_np.c
+++ b/drivers/net/zxdh/zxdh_np.c
@@ -4242,10 +4242,6 @@ zxdh_np_online_uninit(uint32_t dev_id,
if (rc != 0)
PMD_DRV_LOG(ERR, "dtb release port name %s queue id %u", port_name, queue_id);
- rc = zxdh_np_soft_res_uninstall(dev_id);
- if (rc != 0)
- PMD_DRV_LOG(ERR, "zxdh_np_soft_res_uninstall failed");
-
return 0;
}
--
2.27.0
[-- Attachment #1.1.2: Type: text/html , Size: 1565 bytes --]
^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH v3 2/2] net/zxdh: optimize the procedure for NP online uninit
2026-02-03 7:17 ` [PATCH v3 2/2] net/zxdh: optimize the procedure for NP online uninit Tianhao Zhang
@ 2026-02-03 14:35 ` Stephen Hemminger
0 siblings, 0 replies; 17+ messages in thread
From: Stephen Hemminger @ 2026-02-03 14:35 UTC (permalink / raw)
To: Tianhao Zhang; +Cc: wang.junlong1, yang.yonggang, dev
On Tue, 3 Feb 2026 15:17:29 +0800
Tianhao Zhang <zhang.tianhao2@zte.com.cn> wrote:
> Remove the NP software resource uninstallation procedure from the NP
> online uninit process. The NP software resource uninstallation should be
> called separately within NP uninit to avoid duplicate resource
> release.
>
> Signed-off-by: Tianhao Zhang <zhang.tianhao2@zte.com.cn>
> ---
Ok, but slightly confusing commit message; can I reword as.
Move the call to zxdh_np_soft_res_uninstall() out of
zxdh_np_online_uninit() so that software resources are
released once during zxdh_np_uninit() rather than being
freed twice when both paths run.
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v3 0/2] net/zxdh: fix npsdk bug
2026-02-03 7:17 ` [PATCH v3 0/2] net/zxdh: fix npsdk bug Tianhao Zhang
2026-02-03 7:17 ` [PATCH v3 1/2] net/zxdh: add pcie bar channel check Tianhao Zhang
2026-02-03 7:17 ` [PATCH v3 2/2] net/zxdh: optimize the procedure for NP online uninit Tianhao Zhang
@ 2026-02-05 22:11 ` Stephen Hemminger
2 siblings, 0 replies; 17+ messages in thread
From: Stephen Hemminger @ 2026-02-05 22:11 UTC (permalink / raw)
To: Tianhao Zhang; +Cc: wang.junlong1, yang.yonggang, dev
On Tue, 3 Feb 2026 15:17:27 +0800
Tianhao Zhang <zhang.tianhao2@zte.com.cn> wrote:
> V3:
> - Fix the indentation issues。
>
> V2:
> - Resolve code style.
> - Provide clear error messages.
>
> V1:
> - Add new timeout error return.
> - Add PCIe link health check.
> - Remove the NP software resource uninstallation procedure from the NP online uninit process.
> - NP software resource uninstallation should be called separately within NP uninit to avoid duplicate resource release.
Queued to next-net, with reworded commit message
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v2 2/2] net/zxdh: optimize the procedure for NP online uninit
2025-12-30 8:11 ` [PATCH v2 0/2] fix npsdk bug Tianhao Zhang
2025-12-30 8:11 ` [PATCH v2 1/2] net/zxdh: add pcie bar channel check Tianhao Zhang
@ 2025-12-30 8:11 ` Tianhao Zhang
1 sibling, 0 replies; 17+ messages in thread
From: Tianhao Zhang @ 2025-12-30 8:11 UTC (permalink / raw)
To: stephen, wang.junlong1, yang.yonggang; +Cc: dev, Tianhao Zhang
[-- Attachment #1.1.1: Type: text/plain, Size: 849 bytes --]
Remove the NP software resource uninstallation procedure from the NP
online uninit process. The NP software resource uninstallation should be
called separately within NP uninit to avoid duplicate resource
release.
Signed-off-by: Tianhao Zhang <zhang.tianhao2@zte.com.cn>
---
drivers/net/zxdh/zxdh_np.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/net/zxdh/zxdh_np.c b/drivers/net/zxdh/zxdh_np.c
index 89c9283498..7ee9810920 100644
--- a/drivers/net/zxdh/zxdh_np.c
+++ b/drivers/net/zxdh/zxdh_np.c
@@ -4242,10 +4242,6 @@ zxdh_np_online_uninit(uint32_t dev_id,
if (rc != 0)
PMD_DRV_LOG(ERR, "dtb release port name %s queue id %u", port_name, queue_id);
- rc = zxdh_np_soft_res_uninstall(dev_id);
- if (rc != 0)
- PMD_DRV_LOG(ERR, "zxdh_np_soft_res_uninstall failed");
-
return 0;
}
--
2.27.0
[-- Attachment #1.1.2: Type: text/html , Size: 1565 bytes --]
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v1 2/2] net/zxdh: delete np soft resource uninstallation
2025-12-22 10:25 ` [PATCH v1 0/2] fix bug Tianhao Zhang
2025-12-22 10:25 ` [PATCH v1 1/2] net/zxdh: add pcie bar channel check Tianhao Zhang
@ 2025-12-22 10:25 ` Tianhao Zhang
2025-12-22 18:38 ` Stephen Hemminger
2026-01-13 15:32 ` [PATCH v1 0/2] fix bug Stephen Hemminger
2 siblings, 1 reply; 17+ messages in thread
From: Tianhao Zhang @ 2025-12-22 10:25 UTC (permalink / raw)
To: stephen, wang.junlong1, yang.yonggang; +Cc: dev, Tianhao Zhang
[-- Attachment #1.1.1: Type: text/plain, Size: 702 bytes --]
Delete np soft resource uninstallation from NP online uninit process.
Signed-off-by: Tianhao Zhang <zhang.tianhao2@zte.com.cn>
---
drivers/net/zxdh/zxdh_np.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/net/zxdh/zxdh_np.c b/drivers/net/zxdh/zxdh_np.c
index 4e2637e1b6..3bb765e05d 100644
--- a/drivers/net/zxdh/zxdh_np.c
+++ b/drivers/net/zxdh/zxdh_np.c
@@ -4243,10 +4243,6 @@ zxdh_np_online_uninit(uint32_t dev_id,
if (rc != 0)
PMD_DRV_LOG(ERR, "dtb release port name %s queue id %u", port_name, queue_id);
- rc = zxdh_np_soft_res_uninstall(dev_id);
- if (rc != 0)
- PMD_DRV_LOG(ERR, "zxdh_np_soft_res_uninstall failed");
-
return 0;
}
--
2.27.0
[-- Attachment #1.1.2: Type: text/html , Size: 1321 bytes --]
^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH v1 2/2] net/zxdh: delete np soft resource uninstallation
2025-12-22 10:25 ` [PATCH v1 2/2] net/zxdh: delete np soft resource uninstallation Tianhao Zhang
@ 2025-12-22 18:38 ` Stephen Hemminger
0 siblings, 0 replies; 17+ messages in thread
From: Stephen Hemminger @ 2025-12-22 18:38 UTC (permalink / raw)
To: Tianhao Zhang; +Cc: wang.junlong1, yang.yonggang, dev
On Mon, 22 Dec 2025 18:25:35 +0800
Tianhao Zhang <zhang.tianhao2@zte.com.cn> wrote:
> Delete np soft resource uninstallation from NP online uninit process.
>
> Signed-off-by: Tianhao Zhang <zhang.tianhao2@zte.com.cn>
> ---
> drivers/net/zxdh/zxdh_np.c | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/drivers/net/zxdh/zxdh_np.c b/drivers/net/zxdh/zxdh_np.c
> index 4e2637e1b6..3bb765e05d 100644
> --- a/drivers/net/zxdh/zxdh_np.c
> +++ b/drivers/net/zxdh/zxdh_np.c
> @@ -4243,10 +4243,6 @@ zxdh_np_online_uninit(uint32_t dev_id,
> if (rc != 0)
> PMD_DRV_LOG(ERR, "dtb release port name %s queue id %u", port_name, queue_id);
>
> - rc = zxdh_np_soft_res_uninstall(dev_id);
> - if (rc != 0)
> - PMD_DRV_LOG(ERR, "zxdh_np_soft_res_uninstall failed");
> -
> return 0;
> }
>
OK, but would like a better explanation. I assume it something like "soft reset is not necessary on device cleanup"
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v1 0/2] fix bug
2025-12-22 10:25 ` [PATCH v1 0/2] fix bug Tianhao Zhang
2025-12-22 10:25 ` [PATCH v1 1/2] net/zxdh: add pcie bar channel check Tianhao Zhang
2025-12-22 10:25 ` [PATCH v1 2/2] net/zxdh: delete np soft resource uninstallation Tianhao Zhang
@ 2026-01-13 15:32 ` Stephen Hemminger
2 siblings, 0 replies; 17+ messages in thread
From: Stephen Hemminger @ 2026-01-13 15:32 UTC (permalink / raw)
To: Tianhao Zhang; +Cc: wang.junlong1, yang.yonggang, dev
On Mon, 22 Dec 2025 18:25:33 +0800
Tianhao Zhang <zhang.tianhao2@zte.com.cn> wrote:
> V1:
> - Add pcie bar channel check after getting dtb space left.
> - Delete np soft resource uninstallation from NP online uninit process.
>
> Tianhao Zhang (2):
> net/zxdh: add pcie bar channel check
> net/zxdh: delete np soft resource uninstallation
>
> drivers/net/zxdh/zxdh_np.c | 11 +++++++----
> drivers/net/zxdh/zxdh_np.h | 2 ++
> 2 files changed, 9 insertions(+), 4 deletions(-)
>
I started using AI to review code in next-net.
It spotted some issues in these patches, please revise and resubmit.
Now let me read the two patches:---
## DPDK Patch Review: ZXDH PMD Patches
### Patch 1: `net/zxdh: add PCIe BAR channel check`
#### Commit Message
| Check | Status | Notes |
|-------|--------|-------|
| Subject ≤60 chars | ✓ Pass | 35 characters |
| Correct prefix | ✓ Pass | `net/zxdh:` is correct |
| Lowercase after colon | ✓ Pass | |
| Imperative mood | ✓ Pass | "add" |
| No trailing period | ✓ Pass | |
| Body ≤75 chars/line | ✓ Pass | |
| Body doesn't start with "It" | ✓ Pass | |
| Signed-off-by present | ✓ Pass | Real name and valid email |
#### Code Review
**Style Issues (Warning)**:
1. **Mixed changes**: The patch combines alignment/whitespace fixes with functional changes. The parameter alignment changes in `zxdh_np_dtb_queue_unused_item_num_get()` could be a separate cleanup patch. This makes the functional change harder to review.
2. **Log message style**: The error message `"pcie bar abnormal."` has a trailing period. While not strictly forbidden, DPDK log messages typically omit trailing periods for consistency.
**Code Quality (Info)**:
```c
if ((*p_item_num & ZXDH_DTB_SPACE_LEFT_MASK) == ZXDH_DTB_SPACE_LEFT_MASK) {
```
- The comparison is explicit (good) ✓
- Uses named constant (good) ✓
- Consider: what condition does `0x3F` represent? A brief comment explaining why this specific bit pattern indicates a BAR abnormality would aid maintainability.
**Commit Message Content (Warning)**:
The body text:
> After obtaining the DTB element register;
> check if the PCIe link is abnormal.
The semicolon makes this read awkwardly as two sentence fragments. Suggested rewrite:
> Add a check after obtaining the DTB element register to detect
> abnormal PCIe link conditions.
#### Verdict: **Acceptable with minor suggestions**
---
### Patch 2: `net/zxdh: optimize the procedure for NP online uninit`
#### Commit Message
| Check | Status | Notes |
|-------|--------|-------|
| Subject ≤60 chars | ✓ Pass | 52 characters |
| Correct prefix | ✓ Pass | `net/zxdh:` |
| Lowercase after colon | ✓ Pass | |
| Imperative mood | ✓ Pass | "optimize" |
| No trailing period | ✓ Pass | |
| Body ≤75 chars/line | ✓ Pass | All lines under 75 |
| Body doesn't start with "It" | ✓ Pass | Starts with "Remove" |
| Signed-off-by present | ✓ Pass | |
#### Issues Identified
**Warning - Misleading subject line**:
The subject says "optimize" which implies performance improvement, but the body describes removing code to "avoid duplicate resource release." This is actually a **bug fix** (preventing double-free or duplicate cleanup), not an optimization.
Suggested subject alternatives:
- `net/zxdh: fix duplicate resource release in NP online uninit`
- `net/zxdh: remove redundant resource uninstall from online uninit`
**Warning - Potentially missing `Fixes:` tag**:
If this corrects a bug where resources were being released twice, a `Fixes:` tag should reference the commit that introduced the duplicate release. The AGENTS.md guidelines state:
> `Fixes:` tag present for bug fixes with 12-char SHA and exact subject
**Info - Incomplete context**:
The commit message says the uninstallation "should be called separately within NP uninit" but doesn't specify where that happens. A reference to the function or location where `zxdh_np_soft_res_uninstall()` is properly called would help reviewers verify correctness.
#### Code Review
The code change itself is clean - a straightforward removal of 4 lines. No style issues.
#### Verdict: **Needs revision**
---
## Summary
| Patch | Status | Required Actions |
|-------|--------|------------------|
| 0007 (BAR check) | **Acceptable** | Consider separating alignment fixes; improve commit message clarity |
| 0008 (uninit optimize) | **Needs revision** | Fix subject line ("fix" not "optimize"); add `Fixes:` tag if applicable; clarify where resource uninstall is now called |
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2026-02-05 22:11 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-09 2:16 [PATCH v1] net/zxdh: add pcie bar channel check Tianhao Zhang
2025-12-22 10:25 ` [PATCH v1 0/2] fix bug Tianhao Zhang
2025-12-22 10:25 ` [PATCH v1 1/2] net/zxdh: add pcie bar channel check Tianhao Zhang
2025-12-22 18:37 ` Stephen Hemminger
2025-12-30 8:11 ` [PATCH v2 0/2] fix npsdk bug Tianhao Zhang
2025-12-30 8:11 ` [PATCH v2 1/2] net/zxdh: add pcie bar channel check Tianhao Zhang
2025-12-30 18:29 ` Stephen Hemminger
2026-02-03 7:17 ` [PATCH v3 0/2] net/zxdh: fix npsdk bug Tianhao Zhang
2026-02-03 7:17 ` [PATCH v3 1/2] net/zxdh: add pcie bar channel check Tianhao Zhang
2026-02-03 14:35 ` Stephen Hemminger
2026-02-03 7:17 ` [PATCH v3 2/2] net/zxdh: optimize the procedure for NP online uninit Tianhao Zhang
2026-02-03 14:35 ` Stephen Hemminger
2026-02-05 22:11 ` [PATCH v3 0/2] net/zxdh: fix npsdk bug Stephen Hemminger
2025-12-30 8:11 ` [PATCH v2 2/2] net/zxdh: optimize the procedure for NP online uninit Tianhao Zhang
2025-12-22 10:25 ` [PATCH v1 2/2] net/zxdh: delete np soft resource uninstallation Tianhao Zhang
2025-12-22 18:38 ` Stephen Hemminger
2026-01-13 15:32 ` [PATCH v1 0/2] fix bug Stephen Hemminger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox