From: Tianhao Zhang <zhang.tianhao2@zte.com.cn>
To: stephen@networkplumber.org, wang.junlong1@zte.com.cn,
yang.yonggang@zte.com.cn
Cc: dev@dpdk.org, Tianhao Zhang <zhang.tianhao2@zte.com.cn>
Subject: [PATCH v1] net/zxdh: add pcie bar channel check
Date: Tue, 9 Dec 2025 10:16:09 +0800 [thread overview]
Message-ID: <20251209021609.3911854-1-zhang.tianhao2@zte.com.cn> (raw)
[-- 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 --]
reply other threads:[~2025-12-09 2:36 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251209021609.3911854-1-zhang.tianhao2@zte.com.cn \
--to=zhang.tianhao2@zte.com.cn \
--cc=dev@dpdk.org \
--cc=stephen@networkplumber.org \
--cc=wang.junlong1@zte.com.cn \
--cc=yang.yonggang@zte.com.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).