Skip to contentSkip to conversation

XSC PMD for Yunsilicon NICs

PATCH In review Renyong Wan 5 participants 31 messages Jan 28, 2025 – Feb 15, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v7 cover XSC PMD for Yunsilicon NICs

This xsc PMD (**librte_net_xsc**) provides poll mode driver for Yunsilicon metaScale serials NICs.

Features:
---------
- MTU update
- TSO
- RSS hash
- RSS key update
- RSS reta update
- L3 checksum offload
- L4 checksum offload
- Inner L3 checksum
- Inner L4 checksum
- Basic stats
- Stats per queue

Support NICs:
-------------

- metaScale-200S   Single QSFP56 Port 200GE SmartNIC
- metaScale-200    Quad QSFP28 Ports 100GE SmartNIC
- metaScale-50     Dual QSFP28 Port 25GE SmartNIC
- metaScale-100Q   Quad QSFP28 Port 25GE SmartNIC

---

v7:
* Remove the packed attributes of sub structures and unions.
* Remove the cast of xdev->dev_priv.
* Remove the cast of malloc return value.
* Define the size of xdev->name to PCI_PRI_STR_SIZE.
* Change the name of Wanrenyong to Renyong Wan

v6:
* Remove unnecessary paren.
* Add the feature of stats per queue in xsc.ini.
* Use memcpy instead of rte_memcpy in non critical path.
* Rebase from the main branch and merge release notes.
* Replace __rte_packed with __rte_packed_begin and __rte_packed_end.

v5:
* fix compilation errors.
* fix coding style issue with misspelling.
* remove some unnecessary parameter checks.
* remove unnecessary call of rte_wmb.
* Rearrange elements in structure to avoid holes.

v4:
* Based on the review comments from previous versions, reconstruct the xsc PMD to eliminate the dependency on rdma core library and proprietary kernel driver, while adding support for the vfio kernel driver.

v3:
* fix compilation errors

v2:
* fix checkpatch warnings and errors

---
Renyong Wan (15):
net/xsc: add xsc PMD framework
net/xsc: add xsc device initialization
net/xsc: add xsc mailbox
net/xsc: add xsc dev ops to support VFIO driver
net/xsc: add PCT interfaces
net/xsc: initialize xsc representors
net/xsc: add ethdev configure and RSS ops
net/xsc: add Rx and Tx queue setup
net/xsc: add ethdev start
net/xsc: add ethdev stop and close
net/xsc: add ethdev Rx burst
net/xsc: add ethdev Tx burst
net/xsc: add basic stats ops
net/xsc: add ethdev infos get
net/xsc: add ethdev link and MTU ops

 .mailmap                               |   5 +
 MAINTAINERS                            |  10 +
 doc/guides/nics/features/xsc.ini       |  19 +
 doc/guides/nics/index.rst              |   1 +
 doc/guides/nics/xsc.rst                |  31 +
 doc/guides/rel_notes/release_25_03.rst |   4 +
 drivers/net/meson.build                |   1 +
 drivers/net/xsc/meson.build            |  17 +
 drivers/net/xsc/xsc_cmd.h              | 387 +++++++++++
 drivers/net/xsc/xsc_defs.h             | 100 +++
 drivers/net/xsc/xsc_dev.c              | 397 +++++++++++
 drivers/net/xsc/xsc_dev.h              | 184 +++++
 drivers/net/xsc/xsc_ethdev.c           | 917 +++++++++++++++++++++++++
 drivers/net/xsc/xsc_ethdev.h           |  63 ++
 drivers/net/xsc/xsc_log.h              |  24 +
 drivers/net/xsc/xsc_np.c               | 492 +++++++++++++
 drivers/net/xsc/xsc_np.h               | 154 +++++
 drivers/net/xsc/xsc_rx.c               | 512 ++++++++++++++
 drivers/net/xsc/xsc_rx.h               |  65 ++
 drivers/net/xsc/xsc_rxtx.h             | 191 +++++
 drivers/net/xsc/xsc_tx.c               | 354 ++++++++++
 drivers/net/xsc/xsc_tx.h               |  62 ++
 drivers/net/xsc/xsc_vfio.c             | 746 ++++++++++++++++++++
 drivers/net/xsc/xsc_vfio_mbox.c        | 691 +++++++++++++++++++
 drivers/net/xsc/xsc_vfio_mbox.h        | 142 ++++
 25 files changed, 5569 insertions(+)
 create mode 100644 doc/guides/nics/features/xsc.ini
 create mode 100644 doc/guides/nics/xsc.rst
 create mode 100644 drivers/net/xsc/meson.build
 create mode 100644 drivers/net/xsc/xsc_cmd.h
 create mode 100644 drivers/net/xsc/xsc_defs.h
 create mode 100644 drivers/net/xsc/xsc_dev.c
 create mode 100644 drivers/net/xsc/xsc_dev.h
 create mode 100644 drivers/net/xsc/xsc_ethdev.c
 create mode 100644 drivers/net/xsc/xsc_ethdev.h
 create mode 100644 drivers/net/xsc/xsc_log.h
 create mode 100644 drivers/net/xsc/xsc_np.c
 create mode 100644 drivers/net/xsc/xsc_np.h
 create mode 100644 drivers/net/xsc/xsc_rx.c
 create mode 100644 drivers/net/xsc/xsc_rx.h
 create mode 100644 drivers/net/xsc/xsc_rxtx.h
 create mode 100644 drivers/net/xsc/xsc_tx.c
 create mode 100644 drivers/net/xsc/xsc_tx.h
 create mode 100644 drivers/net/xsc/xsc_vfio.c
 create mode 100644 drivers/net/xsc/xsc_vfio_mbox.c
 create mode 100644 drivers/net/xsc/xsc_vfio_mbox.h
Signature · 1 line
2.25.1
#1 lore raw

PATCH v7 1/15 net/xsc: add xsc PMD framework

Add xsc PMD framework, doc and build infrastructure, supporting PCI probe.

---

v7:
* Change the name of Wanrenyong to Renyong Wan.

v6:
* Delete the included header file net/if.h.
* Rebase the main branch to merge release notes.

---
 .mailmap                               |  5 ++
 MAINTAINERS                            | 10 +++
 doc/guides/nics/features/xsc.ini       |  9 +++
 doc/guides/nics/index.rst              |  1 +
 doc/guides/nics/xsc.rst                | 31 +++++++++
 doc/guides/rel_notes/release_25_03.rst |  4 ++
 drivers/net/meson.build                |  1 +
 drivers/net/xsc/meson.build            | 11 ++++
 drivers/net/xsc/xsc_defs.h             | 15 +++++
 drivers/net/xsc/xsc_ethdev.c           | 88 ++++++++++++++++++++++++++
 drivers/net/xsc/xsc_ethdev.h           | 15 +++++
 drivers/net/xsc/xsc_log.h              | 24 +++++++
 12 files changed, 214 insertions(+)
 create mode 100644 doc/guides/nics/features/xsc.ini
 create mode 100644 doc/guides/nics/xsc.rst
 create mode 100644 drivers/net/xsc/meson.build
 create mode 100644 drivers/net/xsc/xsc_defs.h
 create mode 100644 drivers/net/xsc/xsc_ethdev.c
 create mode 100644 drivers/net/xsc/xsc_ethdev.h
 create mode 100644 drivers/net/xsc/xsc_log.h
.mailmap +5 -0
index ebead7f072..a0e77d45c9 100644
@@ -371,6 +371,7 @@ Dongdong Liu <[email protected]>
 Dongsheng Rong <[email protected]>
 Dongsu Han <[email protected]>
 Dong Wang <[email protected]>
+Dongwei Xu <[email protected]>
 Dongyang Pan <[email protected]>
 Dong Zhou <[email protected]> <[email protected]>
 Don Provan <[email protected]>
@@ -1065,6 +1066,7 @@ Nagadheeraj Rottela <[email protected]>
 Naga Harish K S V <[email protected]>
 Naga Suresh Somarowthu <[email protected]>
 Nalla Pradeep <[email protected]>
+Na Na <[email protected]>
 Na Na <[email protected]>
 Nan Chen <[email protected]>
 Nandini Persad <[email protected]>
@@ -1273,6 +1275,7 @@ Remi Pommarel <[email protected]>
 Remigiusz Konca <[email protected]>
 Remy Horton <[email protected]>
 Renata Saiakhova <[email protected]>
+Renyong Wan <[email protected]>
 Reshma Pattan <[email protected]> <[email protected]>
 Ricardo Roldan <[email protected]>
 Ricardo Salveti <[email protected]>
@@ -1309,6 +1312,7 @@ Ronak Doshi <[email protected]> <[email protected]>
 Ron Beider <[email protected]>
 Ronghua Zhang <[email protected]>
 RongQiang Xie <[email protected]>
+Rong Qian <[email protected]>
 RongQing Li <[email protected]>
 Rongwei Liu <[email protected]>
 Rory Sexton <[email protected]>
@@ -1689,6 +1693,7 @@ Xiaonan Zhang <[email protected]>
 Xiao Wang <[email protected]>
 Xiaoxiao Zeng <[email protected]>
 Xiaoxin Peng <[email protected]>
+Xiaoxiong Zhang <[email protected]>
 Xiaoyu Min <[email protected]> <[email protected]>
 Xiaoyun Li <[email protected]>
 Xiaoyun Wang <[email protected]>
MAINTAINERS +10 -0
index b86cdd266b..4ee8098f10 100644
@@ -1075,6 +1075,16 @@ F: drivers/net/avp/
 F: doc/guides/nics/avp.rst
 F: doc/guides/nics/features/avp.ini
 
+Yunsilicon xsc
+M: Renyong Wan <[email protected]>
+M: Na Na <[email protected]>
+M: Rong Qian <[email protected]>
+M: Xiaoxiong Zhang <[email protected]>
+M: Dongwei Xu <[email protected]>
+F: drivers/net/xsc/
+F: doc/guides/nics/xsc.rst
+F: doc/guides/nics/features/xsc.ini
+
 ZTE zxdh - EXPERIMENTAL
 M: Junlong Wang <[email protected]>
 M: Lijie Shan <[email protected]>
doc/guides/nics/features/xsc.ini new file +9 -0
new file mode 100644
index 0000000000..b5c44ce535
@@ -0,0 +1,9 @@
+;
+; Supported features of the 'xsc' network poll mode driver.
+;
+; Refer to default.ini for the full list of available PMD features.
+;
+[Features]
+Linux                = Y
+ARMv8                = Y
+x86-64               = Y
doc/guides/nics/index.rst +1 -0
index 50688d9f64..10a2eca3b0 100644
@@ -70,4 +70,5 @@ Network Interface Controller Drivers
     vhost
     virtio
     vmxnet3
+    xsc
     zxdh
doc/guides/nics/xsc.rst new file +31 -0
new file mode 100644
index 0000000000..8e189db541
@@ -0,0 +1,31 @@
+..  SPDX-License-Identifier: BSD-3-Clause
+    Copyright 2024 Yunsilicon Technology Co., Ltd
+
+XSC Poll Mode Driver
+======================
+
+The xsc PMD (**librte_net_xsc**) provides poll mode driver support for
+10/25/50/100/200 Gbps Yunsilicon metaScale Series Network Adapters.
+
+Supported NICs
+--------------
+
+The following Yunsilicon device models are supported by the same xsc driver:
+
+  - metaScale-200S
+  - metaScale-200
+  - metaScale-100Q
+  - metaScale-50
+
+Prerequisites
+--------------
+
+- Follow the DPDK :ref:`Getting Started Guide for Linux <linux_gsg>` to setup the basic DPDK environment.
+
+- Learning about Yunsilicon metaScale Series NICs using
+  `<https://www.yunsilicon.com/#/productInformation>`_.
+
+Limitations or Known issues
+---------------------------
+32bit ARCHs are not supported.
+Windows and BSD are not supported yet.
doc/guides/rel_notes/release_25_03.rst +4 -0
index 931fe98879..3710493aad 100644
@@ -72,6 +72,10 @@ New Features
 
   * Added support for virtual function VF (ngbe_vf).
 
+* **Added Yunsilicon xsc net driver [EXPERIMENTAL].**
+
+  * Added the PMD for Yunsilicon metaScale serials NICs.
+
 
 Removed Items
 -------------
drivers/net/meson.build +1 -0
index dafd637ba4..c1ca7b0b39 100644
@@ -63,6 +63,7 @@ drivers = [
         'vhost',
         'virtio',
         'vmxnet3',
+        'xsc',
         'zxdh',
 ]
 std_deps = ['ethdev', 'kvargs'] # 'ethdev' also pulls in mbuf, net, eal etc
drivers/net/xsc/meson.build new file +11 -0
new file mode 100644
index 0000000000..84a09a23de
@@ -0,0 +1,11 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2025 Yunsilicon Technology Co., Ltd.
+
+if not is_linux or not dpdk_conf.get('RTE_ARCH_64')
+    build = false
+    reason = 'only supported on 64bit Linux'
+endif
+
+sources = files(
+        'xsc_ethdev.c',
+)
drivers/net/xsc/xsc_defs.h new file +15 -0
new file mode 100644
index 0000000000..7c91d3443f
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright 2025 Yunsilicon Technology Co., Ltd.
+ */
+
+#ifndef XSC_DEFS_H_
+#define XSC_DEFS_H_
+
+#define XSC_PCI_VENDOR_ID		0x1f67
+#define XSC_PCI_DEV_ID_MS		0x1111
+#define XSC_PCI_DEV_ID_MSVF		0x1112
+#define XSC_PCI_DEV_ID_MVH		0x1151
+#define XSC_PCI_DEV_ID_MVHVF		0x1152
+#define XSC_PCI_DEV_ID_MVS		0x1153
+
+#endif /* XSC_DEFS_H_ */
drivers/net/xsc/xsc_ethdev.c new file +88 -0

88 lines not on this page · raw message

drivers/net/xsc/xsc_ethdev.h new file +15 -0
new file mode 100644
index 0000000000..508f5a86de
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright 2025 Yunsilicon Technology Co., Ltd.
+ */
+
+#ifndef _XSC_ETHDEV_H_
+#define _XSC_ETHDEV_H_
+
+struct xsc_ethdev_priv {
+	struct rte_eth_dev *eth_dev;
+	struct rte_pci_device *pci_dev;
+};
+
+#define TO_XSC_ETHDEV_PRIV(dev) ((struct xsc_ethdev_priv *)(dev)->data->dev_private)
+
+#endif /* _XSC_ETHDEV_H_ */
drivers/net/xsc/xsc_log.h new file +24 -0
new file mode 100644
index 0000000000..16de436edb
@@ -0,0 +1,24 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright 2025 Yunsilicon Technology Co., Ltd.
+ */
+
+#ifndef _XSC_LOG_H_
+#define _XSC_LOG_H_
+
+#include <rte_log.h>
+
+extern int xsc_logtype_init;
+extern int xsc_logtype_driver;
+
+#define RTE_LOGTYPE_XSC_INIT	xsc_logtype_init
+#define RTE_LOGTYPE_XSC_DRV	xsc_logtype_driver
+
+#define PMD_INIT_LOG(level, ...) \
+	RTE_LOG_LINE_PREFIX(level, XSC_INIT, "%s(): ", __func__, __VA_ARGS__)
+
+#define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
+
+#define PMD_DRV_LOG(level, ...) \
+	RTE_LOG_LINE_PREFIX(level, XSC_DRV, "%s(): ", __func__, __VA_ARGS__)
+
+#endif /* _XSC_LOG_H_ */
Signature · 1 line
2.25.1
#2 lore raw

PATCH v7 2/15 net/xsc: add xsc device initialization

In reply to Renyong Wan

XSC device is a hardware abstract level device serving as a handle to interact with hardware.

---

v7:
* Define the size of xdev->name to PCI_PRI_STR_SIZE.

v5:
* Fix coding style issue with misspelling
* Rearrange the elements in struct xsc_hwinfo to reduce holes

---
 drivers/net/xsc/meson.build  |   1 +
 drivers/net/xsc/xsc_defs.h   |  16 ++++
 drivers/net/xsc/xsc_dev.c    | 181 +++++++++++++++++++++++++++++++++++
 drivers/net/xsc/xsc_dev.h    | 131 +++++++++++++++++++++++++
 drivers/net/xsc/xsc_ethdev.c |  16 +++-
 drivers/net/xsc/xsc_ethdev.h |   3 +
 6 files changed, 347 insertions(+), 1 deletion(-)
 create mode 100644 drivers/net/xsc/xsc_dev.c
 create mode 100644 drivers/net/xsc/xsc_dev.h
drivers/net/xsc/meson.build +1 -0
index 84a09a23de..683a1f6632 100644
@@ -8,4 +8,5 @@ endif
 
 sources = files(
         'xsc_ethdev.c',
+        'xsc_dev.c',
 )
drivers/net/xsc/xsc_defs.h +16 -0
index 7c91d3443f..60244425cd 100644
@@ -12,4 +12,20 @@
 #define XSC_PCI_DEV_ID_MVHVF		0x1152
 #define XSC_PCI_DEV_ID_MVS		0x1153
 
+#define XSC_VFREP_BASE_LOGICAL_PORT	1081
+
+enum xsc_nic_mode {
+	XSC_NIC_MODE_LEGACY,
+	XSC_NIC_MODE_SWITCHDEV,
+	XSC_NIC_MODE_SOC,
+};
+
+enum xsc_pph_type {
+	XSC_PPH_NONE	= 0,
+	XSC_RX_PPH	= 0x1,
+	XSC_TX_PPH	= 0x2,
+	XSC_VFREP_PPH	= 0x4,
+	XSC_UPLINK_PPH	= 0x8,
+};
+
 #endif /* XSC_DEFS_H_ */
drivers/net/xsc/xsc_dev.c new file +181 -0

181 lines not on this page · raw message

drivers/net/xsc/xsc_dev.h new file +131 -0

131 lines not on this page · raw message

drivers/net/xsc/xsc_ethdev.c +15 -1
index 14aca98f5f..ff7174bc93 100644
@@ -12,22 +12,32 @@ static int
 xsc_ethdev_init(struct rte_eth_dev *eth_dev)
 {
 	struct xsc_ethdev_priv *priv = TO_XSC_ETHDEV_PRIV(eth_dev);
+	int ret;
 
 	PMD_INIT_FUNC_TRACE();
 
 	priv->eth_dev = eth_dev;
 	priv->pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
 
+	ret = xsc_dev_init(priv->pci_dev, &priv->xdev);
+	if (ret) {
+		PMD_DRV_LOG(ERR, "Failed to initialize xsc device");
+		return ret;
+	}
+	priv->xdev->port_id = eth_dev->data->port_id;
+
 	return 0;
 }
 
 static int
 xsc_ethdev_uninit(struct rte_eth_dev *eth_dev)
 {
-	RTE_SET_USED(eth_dev);
+	struct xsc_ethdev_priv *priv = TO_XSC_ETHDEV_PRIV(eth_dev);
 
 	PMD_INIT_FUNC_TRACE();
 
+	xsc_dev_uninit(priv->xdev);
+
 	return 0;
 }
 
@@ -83,6 +93,10 @@ static struct rte_pci_driver xsc_ethdev_pci_driver = {
 
 RTE_PMD_REGISTER_PCI(net_xsc, xsc_ethdev_pci_driver);
 RTE_PMD_REGISTER_PCI_TABLE(net_xsc, xsc_ethdev_pci_id_map);
+RTE_PMD_REGISTER_PARAM_STRING(net_xsc,
+			      XSC_PPH_MODE_ARG "=<x>"
+			      XSC_NIC_MODE_ARG "=<x>"
+			      XSC_FLOW_MODE_ARG "=<x>");
 
 RTE_LOG_REGISTER_SUFFIX(xsc_logtype_init, init, NOTICE);
 RTE_LOG_REGISTER_SUFFIX(xsc_logtype_driver, driver, NOTICE);
drivers/net/xsc/xsc_ethdev.h +3 -0
index 508f5a86de..05040f8865 100644
@@ -5,9 +5,12 @@
 #ifndef _XSC_ETHDEV_H_
 #define _XSC_ETHDEV_H_
 
+#include "xsc_dev.h"
+
 struct xsc_ethdev_priv {
 	struct rte_eth_dev *eth_dev;
 	struct rte_pci_device *pci_dev;
+	struct xsc_dev *xdev;
 };
 
 #define TO_XSC_ETHDEV_PRIV(dev) ((struct xsc_ethdev_priv *)(dev)->data->dev_private)
Signature · 1 line
2.25.1
#3 lore raw

PATCH v7 3/15 net/xsc: add xsc mailbox

In reply to Renyong Wan

XSC mailbox is a mechanism used for interaction between PMD and firmware.

---

v7:
* Remove the cast of xdev->dev_priv.
* Remove the cast of malloc return value.

---
 drivers/net/xsc/meson.build     |   1 +
 drivers/net/xsc/xsc_cmd.h       | 387 ++++++++++++++++++
 drivers/net/xsc/xsc_defs.h      |   2 +
 drivers/net/xsc/xsc_vfio_mbox.c | 691 ++++++++++++++++++++++++++++++++
 drivers/net/xsc/xsc_vfio_mbox.h | 142 +++++++
 5 files changed, 1223 insertions(+)
 create mode 100644 drivers/net/xsc/xsc_cmd.h
 create mode 100644 drivers/net/xsc/xsc_vfio_mbox.c
 create mode 100644 drivers/net/xsc/xsc_vfio_mbox.h
drivers/net/xsc/meson.build +1 -0
index 683a1f6632..df4c8ea499 100644
@@ -9,4 +9,5 @@ endif
 sources = files(
         'xsc_ethdev.c',
         'xsc_dev.c',
+        'xsc_vfio_mbox.c',
 )
drivers/net/xsc/xsc_cmd.h new file +387 -0

387 lines not on this page · raw message

drivers/net/xsc/xsc_defs.h +2 -0
index 60244425cd..a4b36685a6 100644
@@ -5,6 +5,8 @@
 #ifndef XSC_DEFS_H_
 #define XSC_DEFS_H_
 
+#define XSC_PAGE_SIZE			4096
+
 #define XSC_PCI_VENDOR_ID		0x1f67
 #define XSC_PCI_DEV_ID_MS		0x1111
 #define XSC_PCI_DEV_ID_MSVF		0x1112
drivers/net/xsc/xsc_vfio_mbox.c new file +691 -0

691 lines not on this page · raw message

drivers/net/xsc/xsc_vfio_mbox.h new file +142 -0

142 lines not on this page · raw message

Signature · 1 line
2.25.1
#4 lore raw

PATCH v7 4/15 net/xsc: add xsc dev ops to support VFIO driver

In reply to Renyong Wan

XSC PMD is designed to support both VFIO and private kernel drivers. This commit add xsc dev ops to support VFIO driver.

---

v7:
* Delete the packed attributes of sub structures and unions.

v6:
* Replace __rte_packed with __rte_packed_begin and __rte_packed_end.

v5:
* Using RTE_ETHER_ADDR_LEN instead of numeral 6.
* Initialize some local variables while be defined.
* Fix compilation warnings.

---
 drivers/net/xsc/meson.build |   1 +
 drivers/net/xsc/xsc_defs.h  |   8 +
 drivers/net/xsc/xsc_dev.h   |  32 ++
 drivers/net/xsc/xsc_rxtx.h  | 102 +++++
 drivers/net/xsc/xsc_vfio.c  | 746 ++++++++++++++++++++++++++++++++++++
 5 files changed, 889 insertions(+)
 create mode 100644 drivers/net/xsc/xsc_rxtx.h
 create mode 100644 drivers/net/xsc/xsc_vfio.c
drivers/net/xsc/meson.build +1 -0
index df4c8ea499..4e20b30438 100644
@@ -10,4 +10,5 @@ sources = files(
         'xsc_ethdev.c',
         'xsc_dev.c',
         'xsc_vfio_mbox.c',
+        'xsc_vfio.c',
 )
drivers/net/xsc/xsc_defs.h +8 -0
index a4b36685a6..8fd59133bc 100644
@@ -16,6 +16,14 @@
 
 #define XSC_VFREP_BASE_LOGICAL_PORT	1081
 
+#define XSC_PF_TX_DB_ADDR		0x4802000
+#define XSC_PF_RX_DB_ADDR		0x4804000
+#define XSC_PF_CQ_DB_ADDR		0x2120000
+
+#define XSC_VF_RX_DB_ADDR		0x8d4
+#define XSC_VF_TX_DB_ADDR		0x8d0
+#define XSC_VF_CQ_DB_ADDR		0x8c4
+
 enum xsc_nic_mode {
 	XSC_NIC_MODE_LEGACY,
 	XSC_NIC_MODE_SWITCHDEV,
drivers/net/xsc/xsc_dev.h +32 -0
index fb97bb2230..1274f9287e 100644
@@ -14,6 +14,7 @@
 
 #include "xsc_defs.h"
 #include "xsc_log.h"
+#include "xsc_rxtx.h"
 
 #define XSC_PPH_MODE_ARG	"pph_mode"
 #define XSC_NIC_MODE_ARG	"nic_mode"
@@ -25,6 +26,18 @@
 #define XSC_DEV_PCT_IDX_INVALID	0xFFFFFFFF
 #define XSC_DEV_REPR_ID_INVALID	0x7FFFFFFF
 
+enum xsc_queue_type {
+	XSC_QUEUE_TYPE_RDMA_RC		= 0,
+	XSC_QUEUE_TYPE_RDMA_MAD		= 1,
+	XSC_QUEUE_TYPE_RAW		= 2,
+	XSC_QUEUE_TYPE_VIRTIO_NET	= 3,
+	XSC_QUEUE_TYPE_VIRTIO_BLK	= 4,
+	XSC_QUEUE_TYPE_RAW_TPE		= 5,
+	XSC_QUEUE_TYPE_RAW_TSO		= 6,
+	XSC_QUEUE_TYPE_RAW_TX		= 7,
+	XSC_QUEUE_TYPE_INVALID		= 0xFF,
+};
+
 struct xsc_hwinfo {
 	uint32_t pcie_no; /* pcie number , 0 or 1 */
 	uint32_t func_id; /* pf glb func id */
@@ -120,6 +133,25 @@ struct xsc_dev_ops {
 	enum rte_pci_kernel_driver kdrv;
 	int (*dev_init)(struct xsc_dev *xdev);
 	int (*dev_close)(struct xsc_dev *xdev);
+	int (*get_mac)(struct xsc_dev *xdev, uint8_t *mac);
+	int (*set_link_up)(struct xsc_dev *xdev);
+	int (*set_link_down)(struct xsc_dev *xdev);
+	int (*link_update)(struct xsc_dev *xdev, uint8_t funcid_type, int wait_to_complete);
+	int (*set_mtu)(struct xsc_dev *xdev, uint16_t mtu);
+	int (*destroy_qp)(void *qp);
+	int (*destroy_cq)(void *cq);
+	int (*modify_qp_status)(struct xsc_dev *xdev,
+				uint32_t qpn, int num, int opcode);
+	int (*modify_qp_qostree)(struct xsc_dev *xdev, uint16_t qpn);
+
+	int (*rx_cq_create)(struct xsc_dev *xdev, struct xsc_rx_cq_params *cq_params,
+			    struct xsc_rx_cq_info *cq_info);
+	int (*tx_cq_create)(struct xsc_dev *xdev, struct xsc_tx_cq_params *cq_params,
+			    struct xsc_tx_cq_info *cq_info);
+	int (*tx_qp_create)(struct xsc_dev *xdev, struct xsc_tx_qp_params *qp_params,
+			    struct xsc_tx_qp_info *qp_info);
+	int (*mailbox_exec)(struct xsc_dev *xdev, void *data_in,
+			    int in_len, void *data_out, int out_len);
 };
 
 void xsc_dev_ops_register(struct xsc_dev_ops *new_ops);
drivers/net/xsc/xsc_rxtx.h new file +102 -0

102 lines not on this page · raw message

drivers/net/xsc/xsc_vfio.c new file +746 -0

746 lines not on this page · raw message

Signature · 1 line
2.25.1
#5 lore raw

Re: [PATCH v7 04/15] net/xsc: add xsc dev ops to support VFIO driver

28/01/2025 15:46, Renyong Wan:

Quoted 1 line

XSC PMD is designed to support both VFIO and private kernel drivers.

What's the benefit of private kernel drivers?
Why are they private?

#6 lore raw

Re: [PATCH v7 04/15] net/xsc: add xsc dev ops to support VFIO driver

Quoted 7 lines · Thomas Monjalon

28/01/2025 15:46, Renyong Wan:

Quoted 1 line

XSC PMD is designed to support both VFIO and private kernel drivers.

What's the benefit of private kernel drivers?
Why are they private?

Hello Thomas,

Thanks for your review.

It can support the bifurcation model without unbinding the kernel driver, by utilizing our private kernel driver in conjunction with rdma-core. Currently, our kernel driver is not open-source, so it is considered a private kernel driver. This patch series only supports the VFIO driver. Our kernel driver is currently in the process of being open-sourced on kernel.org, and once it is available there, we also plan to submit the code that supports our kernel driver to DPDK.

Signature · 2 lines
Best regards,
Renyong Wan
#7 lore raw

Re: [PATCH v7 04/15] net/xsc: add xsc dev ops to support VFIO driver

05/02/2025 15:37, Renyong Wan:

Quoted 10 lines · Thomas Monjalon
Quoted 4 lines

28/01/2025 15:46, Renyong Wan:

Quoted 1 line

XSC PMD is designed to support both VFIO and private kernel drivers.

What's the benefit of private kernel drivers?
Why are they private?

Hello Thomas,

Thanks for your review.

Quoted 7 lines

It can support the bifurcation model without unbinding the kernel driver, by utilizing our private kernel driver in conjunction with rdma-core. Currently, our kernel driver is not open-source, so it is considered a private kernel driver. This patch series only supports the VFIO driver. Our kernel driver is currently in the process of being open-sourced on kernel.org, and once it is available there, we also plan to submit the code that supports our kernel driver to DPDK.

OK that's interesting, thank you.

I think it would be the first DPDK driver to support both VFIO or bifurcated model. How will we choose which one to use? With devargs?

#8 lore raw

Re: [PATCH v7 04/15] net/xsc: add xsc dev ops to support VFIO driver

Quoted 18 lines · Thomas Monjalon

05/02/2025 15:37, Renyong Wan:

Quoted 9 lines · Thomas Monjalon
Quoted 3 lines

28/01/2025 15:46, Renyong Wan:

Quoted 1 line

XSC PMD is designed to support both VFIO and private kernel drivers.

What's the benefit of private kernel drivers? Why are they private?

Hello Thomas,

Thanks for your review.

Quoted 7 lines

It can support the bifurcation model without unbinding the kernel driver, by utilizing our private kernel driver in conjunction with rdma-core. Currently, our kernel driver is not open-source, so it is considered a private kernel driver. This patch series only supports the VFIO driver. Our kernel driver is currently in the process of being open-sourced on kernel.org, and once it is available there, we also plan to submit the code that supports our kernel driver to DPDK.

Quoted 5 lines

OK that's interesting, thank you.

I think it would be the first DPDK driver to support both VFIO or bifurcated model.

Not quite the first, but possibly the first net driver? :-). The idxd dmadev driver supports both. It can be used either with VFIO or the kernel idxd driver.

/Bruce

#9 lore raw

Re: [PATCH v7 04/15] net/xsc: add xsc dev ops to support VFIO driver

05/02/2025 15:59, Bruce Richardson:

Quoted 21 lines · Thomas Monjalon
Quoted 20 lines

05/02/2025 15:37, Renyong Wan:

Quoted 9 lines · Thomas Monjalon
Quoted 3 lines

28/01/2025 15:46, Renyong Wan:

Quoted 1 line

XSC PMD is designed to support both VFIO and private kernel drivers.

What's the benefit of private kernel drivers? Why are they private?

Hello Thomas,

Thanks for your review.

Quoted 7 lines

It can support the bifurcation model without unbinding the kernel driver, by utilizing our private kernel driver in conjunction with rdma-core. Currently, our kernel driver is not open-source, so it is considered a private kernel driver. This patch series only supports the VFIO driver. Our kernel driver is currently in the process of being open-sourced on kernel.org, and once it is available there, we also plan to submit the code that supports our kernel driver to DPDK.

OK that's interesting, thank you.

Quoted 7 lines
Quoted 3 lines

I think it would be the first DPDK driver to support both VFIO or bifurcated model.

Not quite the first, but possibly the first net driver? :-). The idxd dmadev driver supports both. It can be used either with VFIO or the kernel idxd driver.

It announces only VFIO:
RTE_PMD_REGISTER_KMOD_DEP(IDXD_PMD_DMADEV_NAME_PCI, "vfio-pci");

How does it work?

#10 lore raw

Re: [PATCH v7 04/15] net/xsc: add xsc dev ops to support VFIO driver

Quoted 26 lines · Thomas Monjalon

05/02/2025 15:59, Bruce Richardson:

Quoted 25 lines · Thomas Monjalon
Quoted 23 lines

05/02/2025 15:37, Renyong Wan:

Quoted 9 lines · Thomas Monjalon
Quoted 3 lines

28/01/2025 15:46, Renyong Wan:

Quoted 1 line

XSC PMD is designed to support both VFIO and private kernel drivers.

What's the benefit of private kernel drivers? Why are they private?

Hello Thomas,

Thanks for your review.

Quoted 7 lines

It can support the bifurcation model without unbinding the kernel driver, by utilizing our private kernel driver in conjunction with rdma-core. Currently, our kernel driver is not open-source, so it is considered a private kernel driver. This patch series only supports the VFIO driver. Our kernel driver is currently in the process of being open-sourced on kernel.org, and once it is available there, we also plan to submit the code that supports our kernel driver to DPDK.

OK that's interesting, thank you.

I think it would be the first DPDK driver to support both VFIO or bifurcated model.

Quoted 9 lines
Quoted 3 lines

Not quite the first, but possibly the first net driver? :-). The idxd dmadev driver supports both. It can be used either with VFIO or the kernel idxd driver.

It announces only VFIO:
RTE_PMD_REGISTER_KMOD_DEP(IDXD_PMD_DMADEV_NAME_PCI, "vfio-pci");

How does it work?

It also has its own bus driver that scans for dev nodes (/dev/dsa/wq*) on probe, and uses those configured for DPDK use. On a system with multiple device instances you can have one device used by DPDK bound to vfio, and use a couple of work queues from another device bound to the idxd kernel driver. More info on the setup is in the docs [1]

/Bruce

[1] https://doc.dpdk.org/guides-24.11/dmadevs/idxd.html#device-setup

#11 lore raw

Re: [PATCH v7 04/15] net/xsc: add xsc dev ops to support VFIO driver

In reply to Thomas Monjalon
Quoted 17 lines · Thomas Monjalon

05/02/2025 15:37, Renyong Wan:

Quoted 9 lines · Thomas Monjalon
Quoted 4 lines

28/01/2025 15:46, Renyong Wan:

Quoted 1 line

XSC PMD is designed to support both VFIO and private kernel drivers.

What's the benefit of private kernel drivers?
Why are they private?

Hello Thomas,

Thanks for your review.

Quoted 7 lines

It can support the bifurcation model without unbinding the kernel driver, by utilizing our private kernel driver in conjunction with rdma-core. Currently, our kernel driver is not open-source, so it is considered a private kernel driver. This patch series only supports the VFIO driver. Our kernel driver is currently in the process of being open-sourced on kernel.org, and once it is available there, we also plan to submit the code that supports our kernel driver to DPDK.

Quoted 6 lines

OK that's interesting, thank you.

I think it would be the first DPDK driver to support both VFIO or bifurcated model. How will we choose which one to use? With devargs?

That's how we designed it.
We designed a low-level device operations framework named xsc_dev_ops to support both VFIO drivers and kernel drivers. Each xsc_dev_ops is registered before the main function runs. During the PCI device probe phase, the XSC PMD selects the corresponding xsc_dev_ops based on rte_pci_device->driver, therefore, there is no need for devargs.

Thank you.

Signature · 2 lines
Best regards,
Renyong Wan
#12 lore raw

Re: [PATCH v7 04/15] net/xsc: add xsc dev ops to support VFIO driver

05/02/2025 16:37, Renyong Wan:

Quoted 24 lines · Thomas Monjalon
Quoted 17 lines

05/02/2025 15:37, Renyong Wan:

Quoted 9 lines · Thomas Monjalon
Quoted 4 lines

28/01/2025 15:46, Renyong Wan:

Quoted 1 line

XSC PMD is designed to support both VFIO and private kernel drivers.

What's the benefit of private kernel drivers?
Why are they private?

Hello Thomas,

Thanks for your review.

Quoted 7 lines

It can support the bifurcation model without unbinding the kernel driver, by utilizing our private kernel driver in conjunction with rdma-core. Currently, our kernel driver is not open-source, so it is considered a private kernel driver. This patch series only supports the VFIO driver. Our kernel driver is currently in the process of being open-sourced on kernel.org, and once it is available there, we also plan to submit the code that supports our kernel driver to DPDK.

Quoted 6 lines

OK that's interesting, thank you.

I think it would be the first DPDK driver to support both VFIO or bifurcated model. How will we choose which one to use? With devargs?

Quoted 6 lines

That's how we designed it.
We designed a low-level device operations framework named xsc_dev_ops to support both VFIO drivers and kernel drivers. Each xsc_dev_ops is registered before the main function runs. During the PCI device probe phase, the XSC PMD selects the corresponding xsc_dev_ops based on rte_pci_device->driver, therefore, there is no need for devargs.

I don't understand.
If both VFIO and the kernel driver are loaded,
we'll scan the device twice?
Will it be probed 2 times?

#13 lore raw

Re: [PATCH v7 04/15] net/xsc: add xsc dev ops to support VFIO driver

Quoted 31 lines · Thomas Monjalon

05/02/2025 16:37, Renyong Wan:

Quoted 24 lines · Thomas Monjalon
Quoted 17 lines

05/02/2025 15:37, Renyong Wan:

Quoted 9 lines · Thomas Monjalon
Quoted 4 lines

28/01/2025 15:46, Renyong Wan:

Quoted 1 line

XSC PMD is designed to support both VFIO and private kernel drivers.

What's the benefit of private kernel drivers?
Why are they private?

Hello Thomas,

Thanks for your review.

Quoted 7 lines

It can support the bifurcation model without unbinding the kernel driver, by utilizing our private kernel driver in conjunction with rdma-core. Currently, our kernel driver is not open-source, so it is considered a private kernel driver. This patch series only supports the VFIO driver. Our kernel driver is currently in the process of being open-sourced on kernel.org, and once it is available there, we also plan to submit the code that supports our kernel driver to DPDK.

Quoted 6 lines

OK that's interesting, thank you.

I think it would be the first DPDK driver to support both VFIO or bifurcated model. How will we choose which one to use? With devargs?

Quoted 6 lines

That's how we designed it.
We designed a low-level device operations framework named xsc_dev_ops to support both VFIO drivers and kernel drivers. Each xsc_dev_ops is registered before the main function runs. During the PCI device probe phase, the XSC PMD selects the corresponding xsc_dev_ops based on rte_pci_device->driver, therefore, there is no need for devargs.

Quoted 6 lines

I don't understand.
If both VFIO and the kernel driver are loaded,
we'll scan the device twice?
Will it be probed 2 times?

No, it won't probe twice.
I suppose that each PCI device will only be bound to either the VFIO driver or a kernel driver. The drv_flags of the xsc_pmd PCI driver will not preset with RTE_PCI_DRV_NEED_MAPPING. Therefore, in the rte_pci_probe_one_driver function, rte_pci_map_device() will not be called. After entering the probe phase of the xsc PMD PCI driver, rte_pci_map_device() will be called in xsc_dev_ops->init() based on whether it is a VFIO driver.

Thank you.

Signature · 2 lines
Best regards,
Renyong Wan
#14 lore raw

Re: [PATCH v7 04/15] net/xsc: add xsc dev ops to support VFIO driver

Quoted 12 lines · Renyong Wan
Quoted 6 lines
Quoted 6 lines

That's how we designed it.
We designed a low-level device operations framework named xsc_dev_ops to support both VFIO drivers and kernel drivers. Each xsc_dev_ops is registered before the main function runs. During the PCI device probe phase, the XSC PMD selects the corresponding xsc_dev_ops based on rte_pci_device->driver, therefore, there is no need for devargs.

Quoted 6 lines

I don't understand.
If both VFIO and the kernel driver are loaded,
we'll scan the device twice?
Will it be probed 2 times?

Quoted 8 lines

No, it won't probe twice.
I suppose that each PCI device will only be bound to either the VFIO driver or a kernel driver. The drv_flags of the xsc_pmd PCI driver will not preset with RTE_PCI_DRV_NEED_MAPPING. Therefore, in the rte_pci_probe_one_driver function, rte_pci_map_device() will not be called. After entering the probe phase of the xsc PMD PCI driver, rte_pci_map_device() will be called in xsc_dev_ops->init() based on whether it is a VFIO driver.

(side note, this means that this driver should probably call rte_pci_unmap_device() in its release path, though I see none)

Signature · 1 line
David Marchand
#15 lore raw

Re: [PATCH v7 04/15] net/xsc: add xsc dev ops to support VFIO driver

Quoted 10 lines · David Marchand
Quoted 8 lines

No, it won't probe twice.
I suppose that each PCI device will only be bound to either the VFIO driver or a kernel driver. The drv_flags of the xsc_pmd PCI driver will not preset with RTE_PCI_DRV_NEED_MAPPING. Therefore, in the rte_pci_probe_one_driver function, rte_pci_map_device() will not be called. After entering the probe phase of the xsc PMD PCI driver, rte_pci_map_device() will be called in xsc_dev_ops->init() based on whether it is a VFIO driver.

(side note, this means that this driver should probably call rte_pci_unmap_device() in its release path, though I see none)

Hello David,

You're absolutely right, thank you very much for the notice, it does seem like an oversight that rte_pci_unmap_device() is missing in the driver's release path, I will fix it in the next submission.

Signature · 2 lines
Best regards,
Renyong Wan
#16 lore raw

PATCH v7 5/15 net/xsc: add PCT interfaces

In reply to Renyong Wan

PCT is the abbreviation of Packet classifier table, which is built in NP to define behavior of various packets.

---

v6:
* Replace __rte_packed with __rte_packed_begin and __rte_packed_end.

---
 drivers/net/xsc/meson.build |   1 +
 drivers/net/xsc/xsc_defs.h  |  29 +++
 drivers/net/xsc/xsc_dev.c   |  19 +-
 drivers/net/xsc/xsc_dev.h   |   3 +
 drivers/net/xsc/xsc_np.c    | 492 ++++++++++++++++++++++++++++++++++++
 drivers/net/xsc/xsc_np.h    | 154 +++++++++++
 6 files changed, 697 insertions(+), 1 deletion(-)
 create mode 100644 drivers/net/xsc/xsc_np.c
 create mode 100644 drivers/net/xsc/xsc_np.h
drivers/net/xsc/meson.build +1 -0
index 4e20b30438..5ee03ea835 100644
@@ -11,4 +11,5 @@ sources = files(
         'xsc_dev.c',
         'xsc_vfio_mbox.c',
         'xsc_vfio.c',
+        'xsc_np.c',
 )
drivers/net/xsc/xsc_defs.h +29 -0
index 8fd59133bc..b1e37a5870 100644
@@ -16,6 +16,26 @@
 
 #define XSC_VFREP_BASE_LOGICAL_PORT	1081
 
+#define XSC_RSS_HASH_KEY_LEN		52
+#define XSC_RSS_HASH_BIT_IPV4_SIP	(1ULL << 0)
+#define XSC_RSS_HASH_BIT_IPV4_DIP	(1ULL << 1)
+#define XSC_RSS_HASH_BIT_IPV6_SIP	(1ULL << 2)
+#define XSC_RSS_HASH_BIT_IPV6_DIP	(1ULL << 3)
+#define XSC_RSS_HASH_BIT_IPV4_SPORT	(1ULL << 4)
+#define XSC_RSS_HASH_BIT_IPV4_DPORT	(1ULL << 5)
+#define XSC_RSS_HASH_BIT_IPV6_SPORT	(1ULL << 6)
+#define XSC_RSS_HASH_BIT_IPV6_DPORT	(1ULL << 7)
+#define XSC_RSS_HASH_BIT_TNL_ID		(1ULL << 8)
+#define XSC_RSS_HASH_BIT_NXT_PRO	(1ULL << 9)
+
+#define XSC_EPAT_VLD_FLAG		(1ULL)
+#define XSC_EPAT_RX_QP_ID_OFST_FLAG	(1ULL << 2)
+#define XSC_EPAT_QP_NUM_FLAG		(1ULL << 3)
+#define XSC_EPAT_RSS_EN_FLAG		(1ULL << 4)
+#define XSC_EPAT_RSS_HASH_TEMPLATE_FLAG	(1ULL << 5)
+#define XSC_EPAT_RSS_HASH_FUNC_FLAG	(1ULL << 6)
+#define XSC_EPAT_HAS_PPH_FLAG		(1ULL << 9)
+
 #define XSC_PF_TX_DB_ADDR		0x4802000
 #define XSC_PF_RX_DB_ADDR		0x4804000
 #define XSC_PF_CQ_DB_ADDR		0x2120000
@@ -38,4 +58,13 @@ enum xsc_pph_type {
 	XSC_UPLINK_PPH	= 0x8,
 };
 
+enum xsc_port_type {
+	XSC_PORT_TYPE_NONE = 0,
+	XSC_PORT_TYPE_UPLINK,
+	XSC_PORT_TYPE_UPLINK_BOND,
+	XSC_PORT_TYPE_PFVF,
+	XSC_PORT_TYPE_PFHPF,
+	XSC_PORT_TYPE_UNKNOWN,
+};
+
 #endif /* XSC_DEFS_H_ */
drivers/net/xsc/xsc_dev.c +18 -1
index b030eb3410..8933f77b8f 100644
@@ -54,8 +54,17 @@ xsc_dev_ops_register(struct xsc_dev_ops *new_ops)
 }
 
 int
-xsc_dev_close(struct xsc_dev *xdev, int __rte_unused repr_id)
+xsc_dev_mailbox_exec(struct xsc_dev *xdev, void *data_in,
+		     int in_len, void *data_out, int out_len)
 {
+	return xdev->dev_ops->mailbox_exec(xdev, data_in, in_len,
+					   data_out, out_len);
+}
+
+int
+xsc_dev_close(struct xsc_dev *xdev, int repr_id)
+{
+	xsc_dev_clear_pct(xdev, repr_id);
 	return xdev->dev_ops->dev_close(xdev);
 }
 
@@ -121,6 +130,7 @@ void
 xsc_dev_uninit(struct xsc_dev *xdev)
 {
 	PMD_INIT_FUNC_TRACE();
+	xsc_dev_pct_uninit();
 	xsc_dev_close(xdev, XSC_DEV_REPR_ID_INVALID);
 	rte_free(xdev);
 }
@@ -159,6 +169,13 @@ xsc_dev_init(struct rte_pci_device *pci_dev, struct xsc_dev **xdev)
 		goto hwinfo_init_fail;
 	}
 
+	ret = xsc_dev_pct_init();
+	if (ret) {
+		PMD_DRV_LOG(ERR, "Failed to init xsc pct");
+		ret = -EINVAL;
+		goto hwinfo_init_fail;
+	}
+
 	*xdev = d;
 
 	return 0;
drivers/net/xsc/xsc_dev.h +3 -0
index 1274f9287e..51cf2d15fe 100644
@@ -15,6 +15,7 @@
 #include "xsc_defs.h"
 #include "xsc_log.h"
 #include "xsc_rxtx.h"
+#include "xsc_np.h"
 
 #define XSC_PPH_MODE_ARG	"pph_mode"
 #define XSC_NIC_MODE_ARG	"nic_mode"
@@ -154,6 +155,8 @@ struct xsc_dev_ops {
 			    int in_len, void *data_out, int out_len);
 };
 
+int xsc_dev_mailbox_exec(struct xsc_dev *xdev, void *data_in,
+			 int in_len, void *data_out, int out_len);
 void xsc_dev_ops_register(struct xsc_dev_ops *new_ops);
 int xsc_dev_init(struct rte_pci_device *pci_dev, struct xsc_dev **dev);
 void xsc_dev_uninit(struct xsc_dev *xdev);
drivers/net/xsc/xsc_np.c new file +492 -0

492 lines not on this page · raw message

drivers/net/xsc/xsc_np.h new file +154 -0

154 lines not on this page · raw message

Signature · 1 line
2.25.1
#17 lore raw

PATCH v7 6/15 net/xsc: initialize xsc representors

In reply to Renyong Wan

For the design of the xsc PMD, each ethdev corresponds to a representor.

---
 drivers/net/xsc/xsc_defs.h   |  11 +++
 drivers/net/xsc/xsc_dev.c    |  95 ++++++++++++++++++++
 drivers/net/xsc/xsc_dev.h    |   3 +
 drivers/net/xsc/xsc_ethdev.c | 170 +++++++++++++++++++++++++++++++++++
 drivers/net/xsc/xsc_ethdev.h |  19 ++++
 5 files changed, 298 insertions(+)
drivers/net/xsc/xsc_defs.h +11 -0
index b1e37a5870..111776f37e 100644
@@ -6,6 +6,7 @@
 #define XSC_DEFS_H_
 
 #define XSC_PAGE_SIZE			4096
+#define XSC_PHY_PORT_NUM		1
 
 #define XSC_PCI_VENDOR_ID		0x1f67
 #define XSC_PCI_DEV_ID_MS		0x1111
@@ -15,6 +16,7 @@
 #define XSC_PCI_DEV_ID_MVS		0x1153
 
 #define XSC_VFREP_BASE_LOGICAL_PORT	1081
+#define XSC_MAX_MAC_ADDRESSES		3
 
 #define XSC_RSS_HASH_KEY_LEN		52
 #define XSC_RSS_HASH_BIT_IPV4_SIP	(1ULL << 0)
@@ -58,6 +60,15 @@ enum xsc_pph_type {
 	XSC_UPLINK_PPH	= 0x8,
 };
 
+enum xsc_funcid_type {
+	XSC_FUNCID_TYPE_INVAL	= 0x0,
+	XSC_EMU_FUNCID		= 0x1,
+	XSC_PHYPORT_MAC_FUNCID	= 0x2,
+	XSC_VF_IOCTL_FUNCID	= 0x3,
+	XSC_PHYPORT_LAG_FUNCID	= 0x4,
+	XSC_FUNCID_TYPE_UNKNOWN	= 0x5,
+};
+
 enum xsc_port_type {
 	XSC_PORT_TYPE_NONE = 0,
 	XSC_PORT_TYPE_UPLINK,
drivers/net/xsc/xsc_dev.c +95 -0

107 lines not on this page · raw message

drivers/net/xsc/xsc_dev.h +3 -0
index 51cf2d15fe..d317ec9d3a 100644
@@ -161,6 +161,9 @@ void xsc_dev_ops_register(struct xsc_dev_ops *new_ops);
 int xsc_dev_init(struct rte_pci_device *pci_dev, struct xsc_dev **dev);
 void xsc_dev_uninit(struct xsc_dev *xdev);
 int xsc_dev_close(struct xsc_dev *xdev, int repr_id);
+int xsc_dev_repr_ports_probe(struct xsc_dev *xdev, int nb_repr_ports, int max_eth_ports);
 bool xsc_dev_is_vf(struct xsc_dev *xdev);
+int xsc_dev_qp_set_id_get(struct xsc_dev *xdev, int repr_id);
+int xsc_dev_get_mac(struct xsc_dev *xdev, uint8_t *mac);
 
 #endif /* _XSC_DEV_H_ */
drivers/net/xsc/xsc_ethdev.c +170 -0

183 lines not on this page · raw message

drivers/net/xsc/xsc_ethdev.h +19 -0
index 05040f8865..7d161bd22e 100644
@@ -11,6 +11,25 @@ struct xsc_ethdev_priv {
 	struct rte_eth_dev *eth_dev;
 	struct rte_pci_device *pci_dev;
 	struct xsc_dev *xdev;
+	struct xsc_repr_port *repr_port;
+	struct xsc_dev_config config;
+	struct rte_eth_dev_data *dev_data;
+	struct rte_ether_addr mac[XSC_MAX_MAC_ADDRESSES];
+	struct rte_eth_rss_conf rss_conf;
+
+	int representor_id;
+	uint32_t ifindex;
+	uint16_t mtu;
+	uint8_t isolated;
+	uint8_t is_representor;
+
+	uint32_t mode:7;
+	uint32_t member_bitmap:8;
+	uint32_t funcid_type:3;
+	uint32_t funcid:14;
+
+	uint16_t eth_type;
+	uint16_t qp_set_id;
 };
 
 #define TO_XSC_ETHDEV_PRIV(dev) ((struct xsc_ethdev_priv *)(dev)->data->dev_private)
Signature · 1 line
2.25.1
#18 lore raw

PATCH v7 7/15 net/xsc: add ethdev configure and RSS ops

In reply to Renyong Wan

Implement xsc ethdev configure and RSS hash functions.

---

v6:
* Use memcpy instead of rte_memcpy.

v5:
* Remove some unnecessary parameter checks.

---
 doc/guides/nics/features/xsc.ini |  3 ++
 drivers/net/xsc/xsc_defs.h       | 15 ++++++
 drivers/net/xsc/xsc_dev.c        | 26 ++++++++++
 drivers/net/xsc/xsc_dev.h        |  1 +
 drivers/net/xsc/xsc_ethdev.c     | 82 ++++++++++++++++++++++++++++++++
 drivers/net/xsc/xsc_ethdev.h     |  7 +++
 6 files changed, 134 insertions(+)
doc/guides/nics/features/xsc.ini +3 -0
index b5c44ce535..bdeb7a984b 100644
@@ -4,6 +4,9 @@
 ; Refer to default.ini for the full list of available PMD features.
 ;
 [Features]
+RSS hash             = Y
+RSS key update       = Y
+RSS reta update      = Y
 Linux                = Y
 ARMv8                = Y
 x86-64               = Y
drivers/net/xsc/xsc_defs.h +15 -0
index 111776f37e..c445eadca1 100644
@@ -78,4 +78,19 @@ enum xsc_port_type {
 	XSC_PORT_TYPE_UNKNOWN,
 };
 
+enum xsc_tbm_cap {
+	XSC_TBM_CAP_HASH_PPH = 0,
+	XSC_TBM_CAP_RSS,
+	XSC_TBM_CAP_PP_BYPASS,
+	XSC_TBM_CAP_PCT_DROP_CONFIG,
+};
+
+enum xsc_rss_hf {
+	XSC_RSS_HASH_KEY_UPDATE = 0,
+	XSC_RSS_HASH_TEMP_UPDATE,
+	XSC_RSS_HASH_FUNC_UPDATE,
+	XSC_RSS_RXQ_UPDATE,
+	XSC_RSS_RXQ_DROP,
+};
+
 #endif /* XSC_DEFS_H_ */
drivers/net/xsc/xsc_dev.c +26 -0
index aaf18bf8e5..74d577c7d0 100644
@@ -19,6 +19,7 @@
 #include "xsc_log.h"
 #include "xsc_defs.h"
 #include "xsc_dev.h"
+#include "xsc_cmd.h"
 
 #define XSC_DEV_DEF_FLOW_MODE	7
 
@@ -74,6 +75,31 @@ xsc_dev_close(struct xsc_dev *xdev, int repr_id)
 	return xdev->dev_ops->dev_close(xdev);
 }
 
+int
+xsc_dev_rss_key_modify(struct xsc_dev *xdev, uint8_t *rss_key, uint8_t rss_key_len)
+{
+	struct xsc_cmd_modify_nic_hca_mbox_in in = {};
+	struct xsc_cmd_modify_nic_hca_mbox_out out = {};
+	uint8_t rss_caps_mask = 0;
+	int ret, key_len = 0;
+
+	in.hdr.opcode = rte_cpu_to_be_16(XSC_CMD_OP_MODIFY_NIC_HCA);
+
+	key_len = RTE_MIN(rss_key_len, XSC_RSS_HASH_KEY_LEN);
+	rte_memcpy(in.rss.hash_key, rss_key, key_len);
+	rss_caps_mask |= RTE_BIT32(XSC_RSS_HASH_KEY_UPDATE);
+
+	in.rss.caps_mask = rss_caps_mask;
+	in.rss.rss_en = 1;
+	in.nic.caps_mask = rte_cpu_to_be_16(RTE_BIT32(XSC_TBM_CAP_RSS));
+	in.nic.caps = in.nic.caps_mask;
+
+	ret = xsc_dev_mailbox_exec(xdev, &in, sizeof(in), &out, sizeof(out));
+	if (ret != 0 || out.hdr.status != 0)
+		return -1;
+	return 0;
+}
+
 static int
 xsc_dev_alloc_vfos_info(struct xsc_dev *xdev)
 {
drivers/net/xsc/xsc_dev.h +1 -0
index d317ec9d3a..36b92a334b 100644
@@ -162,6 +162,7 @@ int xsc_dev_init(struct rte_pci_device *pci_dev, struct xsc_dev **dev);
 void xsc_dev_uninit(struct xsc_dev *xdev);
 int xsc_dev_close(struct xsc_dev *xdev, int repr_id);
 int xsc_dev_repr_ports_probe(struct xsc_dev *xdev, int nb_repr_ports, int max_eth_ports);
+int xsc_dev_rss_key_modify(struct xsc_dev *xdev, uint8_t *rss_key, uint8_t rss_key_len);
 bool xsc_dev_is_vf(struct xsc_dev *xdev);
 int xsc_dev_qp_set_id_get(struct xsc_dev *xdev, int repr_id);
 int xsc_dev_get_mac(struct xsc_dev *xdev, uint8_t *mac);
drivers/net/xsc/xsc_ethdev.c +82 -0

100 lines not on this page · raw message

drivers/net/xsc/xsc_ethdev.h +7 -0
index 7d161bd22e..bc0fc54d50 100644
@@ -30,6 +30,13 @@ struct xsc_ethdev_priv {
 
 	uint16_t eth_type;
 	uint16_t qp_set_id;
+
+	uint16_t num_sq;
+	uint16_t num_rq;
+
+	uint16_t flags;
+	struct xsc_txq_data *(*txqs)[];
+	struct xsc_rxq_data *(*rxqs)[];
 };
 
 #define TO_XSC_ETHDEV_PRIV(dev) ((struct xsc_ethdev_priv *)(dev)->data->dev_private)
Signature · 1 line
2.25.1
#19 lore raw

PATCH v7 8/15 net/xsc: add Rx and Tx queue setup

In reply to Renyong Wan

Implement xsc ethdev Rx and Tx queue setup functions.

---

v7:
* Delete the packed attributes of sub structures and unions.

v6:
* Replace __rte_packed with __rte_packed_begin and __rte_packed_end.

---
 drivers/net/xsc/xsc_defs.h   |  4 ++
 drivers/net/xsc/xsc_ethdev.c | 83 ++++++++++++++++++++++++++++++++++++
 drivers/net/xsc/xsc_rx.h     | 59 +++++++++++++++++++++++++
 drivers/net/xsc/xsc_rxtx.h   | 49 +++++++++++++++++++++
 drivers/net/xsc/xsc_tx.h     | 55 ++++++++++++++++++++++++
 5 files changed, 250 insertions(+)
 create mode 100644 drivers/net/xsc/xsc_rx.h
 create mode 100644 drivers/net/xsc/xsc_tx.h
drivers/net/xsc/xsc_defs.h +4 -0
index c445eadca1..6497b53e1e 100644
@@ -38,6 +38,10 @@
 #define XSC_EPAT_RSS_HASH_FUNC_FLAG	(1ULL << 6)
 #define XSC_EPAT_HAS_PPH_FLAG		(1ULL << 9)
 
+#define XSC_MAX_DESC_NUMBER		1024
+#define XSC_SEND_WQE_DS			3
+#define XSC_ESEG_EXTRA_DATA_SIZE	48u
+
 #define XSC_PF_TX_DB_ADDR		0x4802000
 #define XSC_PF_RX_DB_ADDR		0x4804000
 #define XSC_PF_CQ_DB_ADDR		0x2120000
drivers/net/xsc/xsc_ethdev.c +83 -0

101 lines not on this page · raw message

drivers/net/xsc/xsc_rx.h new file +59 -0

59 lines not on this page · raw message

drivers/net/xsc/xsc_rxtx.h +49 -0

67 lines not on this page · raw message

drivers/net/xsc/xsc_tx.h new file +55 -0

55 lines not on this page · raw message

Signature · 1 line
2.25.1
#20 lore raw

PATCH v7 9/15 net/xsc: add ethdev start

In reply to Renyong Wan

Implement xsc ethdev start function.

---

v5:
* Remove unnecessary call of rte_wmb.

---
 drivers/net/xsc/meson.build  |   2 +
 drivers/net/xsc/xsc_dev.c    |  33 ++++
 drivers/net/xsc/xsc_dev.h    |   8 +
 drivers/net/xsc/xsc_ethdev.c | 172 +++++++++++++++++++++
 drivers/net/xsc/xsc_ethdev.h |  19 +++
 drivers/net/xsc/xsc_rx.c     | 291 +++++++++++++++++++++++++++++++++++
 drivers/net/xsc/xsc_rx.h     |   3 +
 drivers/net/xsc/xsc_rxtx.h   |  27 ++++
 drivers/net/xsc/xsc_tx.c     |  93 +++++++++++
 drivers/net/xsc/xsc_tx.h     |   4 +
 10 files changed, 652 insertions(+)
 create mode 100644 drivers/net/xsc/xsc_rx.c
 create mode 100644 drivers/net/xsc/xsc_tx.c
drivers/net/xsc/meson.build +2 -0
index 5ee03ea835..79664374e3 100644
@@ -12,4 +12,6 @@ sources = files(
         'xsc_vfio_mbox.c',
         'xsc_vfio.c',
         'xsc_np.c',
+        'xsc_rx.c',
+        'xsc_tx.c',
 )
drivers/net/xsc/xsc_dev.c +33 -0
index 74d577c7d0..054a08bf84 100644
@@ -68,6 +68,39 @@ xsc_dev_get_mac(struct xsc_dev *xdev, uint8_t *mac)
 	return xdev->dev_ops->get_mac(xdev, mac);
 }
 
+int
+xsc_dev_modify_qp_status(struct xsc_dev *xdev, uint32_t qpn, int num, int opcode)
+{
+	return xdev->dev_ops->modify_qp_status(xdev, qpn, num, opcode);
+}
+
+int
+xsc_dev_modify_qp_qostree(struct xsc_dev *xdev, uint16_t qpn)
+{
+	return xdev->dev_ops->modify_qp_qostree(xdev, qpn);
+}
+
+int
+xsc_dev_rx_cq_create(struct xsc_dev *xdev, struct xsc_rx_cq_params *cq_params,
+		     struct xsc_rx_cq_info *cq_info)
+{
+	return xdev->dev_ops->rx_cq_create(xdev, cq_params, cq_info);
+}
+
+int
+xsc_dev_tx_cq_create(struct xsc_dev *xdev, struct xsc_tx_cq_params *cq_params,
+		     struct xsc_tx_cq_info *cq_info)
+{
+	return xdev->dev_ops->tx_cq_create(xdev, cq_params, cq_info);
+}
+
+int
+xsc_dev_tx_qp_create(struct xsc_dev *xdev, struct xsc_tx_qp_params *qp_params,
+		     struct xsc_tx_qp_info *qp_info)
+{
+	return xdev->dev_ops->tx_qp_create(xdev, qp_params, qp_info);
+}
+
 int
 xsc_dev_close(struct xsc_dev *xdev, int repr_id)
 {
drivers/net/xsc/xsc_dev.h +8 -0
index 36b92a334b..fafe53f752 100644
@@ -158,6 +158,14 @@ struct xsc_dev_ops {
 int xsc_dev_mailbox_exec(struct xsc_dev *xdev, void *data_in,
 			 int in_len, void *data_out, int out_len);
 void xsc_dev_ops_register(struct xsc_dev_ops *new_ops);
+int xsc_dev_modify_qp_status(struct xsc_dev *xdev, uint32_t qpn, int num, int opcode);
+int xsc_dev_modify_qp_qostree(struct xsc_dev *xdev, uint16_t qpn);
+int xsc_dev_rx_cq_create(struct xsc_dev *xdev, struct xsc_rx_cq_params *cq_params,
+			 struct xsc_rx_cq_info *cq_info);
+int xsc_dev_tx_cq_create(struct xsc_dev *xdev, struct xsc_tx_cq_params *cq_params,
+			 struct xsc_tx_cq_info *cq_info);
+int xsc_dev_tx_qp_create(struct xsc_dev *xdev, struct xsc_tx_qp_params *qp_params,
+			 struct xsc_tx_qp_info *qp_info);
 int xsc_dev_init(struct rte_pci_device *pci_dev, struct xsc_dev **dev);
 void xsc_dev_uninit(struct xsc_dev *xdev);
 int xsc_dev_close(struct xsc_dev *xdev, int repr_id);
drivers/net/xsc/xsc_ethdev.c +172 -0

190 lines not on this page · raw message

drivers/net/xsc/xsc_ethdev.h +19 -0
index bc0fc54d50..0b307c2828 100644
@@ -7,6 +7,9 @@
 
 #include "xsc_dev.h"
 
+#define XSC_FLAG_RX_QUEUE_INIT		0x1
+#define XSC_FLAG_TX_QUEUE_INIT		0x2
+
 struct xsc_ethdev_priv {
 	struct rte_eth_dev *eth_dev;
 	struct rte_pci_device *pci_dev;
@@ -41,4 +44,20 @@ struct xsc_ethdev_priv {
 
 #define TO_XSC_ETHDEV_PRIV(dev) ((struct xsc_ethdev_priv *)(dev)->data->dev_private)
 
+static __rte_always_inline struct xsc_txq_data *
+xsc_txq_get(struct xsc_ethdev_priv *priv, uint16_t idx)
+{
+	if (priv->txqs != NULL && (*priv->txqs)[idx] != NULL)
+		return (*priv->txqs)[idx];
+	return NULL;
+}
+
+static __rte_always_inline struct xsc_rxq_data *
+xsc_rxq_get(struct xsc_ethdev_priv *priv, uint16_t idx)
+{
+	if (priv->rxqs != NULL && (*priv->rxqs)[idx] != NULL)
+		return (*priv->rxqs)[idx];
+	return NULL;
+}
+
 #endif /* _XSC_ETHDEV_H_ */
drivers/net/xsc/xsc_rx.c new file +291 -0

291 lines not on this page · raw message

drivers/net/xsc/xsc_rx.h +3 -0
index 3653c0e335..5a2c4839ce 100644
@@ -56,4 +56,7 @@ struct __rte_cache_aligned xsc_rxq_data {
 	uint16_t rsv1:11;
 };
 
+int xsc_rxq_elts_alloc(struct xsc_rxq_data *rxq_data);
+int xsc_rxq_rss_obj_new(struct xsc_ethdev_priv *priv, uint16_t port_id);
+
 #endif /* _XSC_RX_H_ */
drivers/net/xsc/xsc_rxtx.h +27 -0
index 0388a4ecb5..53d8ef5812 100644
@@ -102,6 +102,24 @@ struct xsc_cqe_u64 {
 	struct xsc_cqe cqe1;
 };
 
+union xsc_cq_doorbell {
+	struct {
+		uint32_t next_cid:16;
+		uint32_t cq_num:15;
+		uint32_t cq_sta:1;
+	};
+	uint32_t cq_data;
+};
+
+union xsc_send_doorbell {
+	struct {
+		uint32_t next_pid:16;
+		uint32_t qp_num:15;
+		uint32_t rsv:1;
+	};
+	uint32_t send_data;
+};
+
 struct xsc_tx_cq_params {
 	uint16_t port_id;
 	uint16_t qp_id;
@@ -134,6 +152,15 @@ struct xsc_tx_qp_info {
 	uint16_t wqe_n;
 };
 
+union xsc_recv_doorbell {
+	struct {
+		uint32_t next_pid:13;
+		uint32_t qp_num:15;
+		uint32_t rsv:4;
+	};
+	uint32_t recv_data;
+};
+
 struct xsc_rx_cq_params {
 	uint16_t port_id;
 	uint16_t qp_id;
drivers/net/xsc/xsc_tx.c new file +93 -0

93 lines not on this page · raw message

drivers/net/xsc/xsc_tx.h +4 -0
index 11e249a4e3..674b65a555 100644
@@ -52,4 +52,8 @@ struct __rte_cache_aligned xsc_txq_data {
 	struct rte_mbuf *elts[]; /* Storage for queued packets, for free */
 };
 
+int xsc_txq_obj_new(struct xsc_dev *xdev, struct xsc_txq_data *txq_data,
+		    uint64_t offloads, uint16_t idx);
+void xsc_txq_elts_alloc(struct xsc_txq_data *txq_data);
+
 #endif /* _XSC_TX_H_ */
Signature · 1 line
2.25.1
#21 lore raw

PATCH v7 10/15 net/xsc: add ethdev stop and close

In reply to Renyong Wan

Implement xsc ethdev close and stop functions.

---
 drivers/net/xsc/xsc_dev.c    |  12 ++++
 drivers/net/xsc/xsc_dev.h    |   2 +
 drivers/net/xsc/xsc_ethdev.c | 108 +++++++++++++++++++++++++++++++++++
 drivers/net/xsc/xsc_rx.c     |  47 +++++++++++++++
 drivers/net/xsc/xsc_rx.h     |   2 +
 drivers/net/xsc/xsc_tx.c     |  33 +++++++++++
 drivers/net/xsc/xsc_tx.h     |   2 +
 7 files changed, 206 insertions(+)
drivers/net/xsc/xsc_dev.c +12 -0
index 054a08bf84..350a1fbc70 100644
@@ -68,6 +68,18 @@ xsc_dev_get_mac(struct xsc_dev *xdev, uint8_t *mac)
 	return xdev->dev_ops->get_mac(xdev, mac);
 }
 
+int
+xsc_dev_destroy_qp(struct xsc_dev *xdev, void *qp)
+{
+	return xdev->dev_ops->destroy_qp(qp);
+}
+
+int
+xsc_dev_destroy_cq(struct xsc_dev *xdev, void *cq)
+{
+	return xdev->dev_ops->destroy_cq(cq);
+}
+
 int
 xsc_dev_modify_qp_status(struct xsc_dev *xdev, uint32_t qpn, int num, int opcode)
 {
drivers/net/xsc/xsc_dev.h +2 -0
index fafe53f752..c0a4d57af7 100644
@@ -158,6 +158,8 @@ struct xsc_dev_ops {
 int xsc_dev_mailbox_exec(struct xsc_dev *xdev, void *data_in,
 			 int in_len, void *data_out, int out_len);
 void xsc_dev_ops_register(struct xsc_dev_ops *new_ops);
+int xsc_dev_destroy_qp(struct xsc_dev *xdev, void *qp);
+int xsc_dev_destroy_cq(struct xsc_dev *xdev, void *cq);
 int xsc_dev_modify_qp_status(struct xsc_dev *xdev, uint32_t qpn, int num, int opcode);
 int xsc_dev_modify_qp_qostree(struct xsc_dev *xdev, uint16_t qpn);
 int xsc_dev_rx_cq_create(struct xsc_dev *xdev, struct xsc_rx_cq_params *cq_params,
drivers/net/xsc/xsc_ethdev.c +108 -0

137 lines not on this page · raw message

drivers/net/xsc/xsc_rx.c +47 -0

50 lines not on this page · raw message

drivers/net/xsc/xsc_rx.h +2 -0
index 5a2c4839ce..e24b1a8829 100644
@@ -58,5 +58,7 @@ struct __rte_cache_aligned xsc_rxq_data {
 
 int xsc_rxq_elts_alloc(struct xsc_rxq_data *rxq_data);
 int xsc_rxq_rss_obj_new(struct xsc_ethdev_priv *priv, uint16_t port_id);
+void xsc_rxq_rss_obj_release(struct xsc_dev *xdev, struct xsc_rxq_data *rxq_data);
+void xsc_rxq_elts_free(struct xsc_rxq_data *rxq_data);
 
 #endif /* _XSC_RX_H_ */
drivers/net/xsc/xsc_tx.c +33 -0
index ba80488010..56daf6b4c6 100644
@@ -91,3 +91,36 @@ xsc_txq_obj_new(struct xsc_dev *xdev, struct xsc_txq_data *txq_data,
 error:
 	return -rte_errno;
 }
+
+void
+xsc_txq_obj_release(struct xsc_dev *xdev, struct xsc_txq_data *txq_data)
+{
+	PMD_DRV_LOG(DEBUG, "Destroy tx queue %u, portid %u",
+		    txq_data->idx, txq_data->port_id);
+	if (txq_data->qp != NULL)
+		xsc_dev_destroy_qp(xdev, txq_data->qp);
+	if (txq_data->cq != NULL)
+		xsc_dev_destroy_cq(xdev, txq_data->cq);
+}
+
+void
+xsc_txq_elts_free(struct xsc_txq_data *txq_data)
+{
+	const uint16_t elts_n = 1 << txq_data->elts_n;
+	const uint16_t elts_m = elts_n - 1;
+	uint16_t elts_head = txq_data->elts_head;
+	uint16_t elts_tail = txq_data->elts_tail;
+	struct rte_mbuf *(*elts)[elts_n] = &txq_data->elts;
+
+	txq_data->elts_head = 0;
+	txq_data->elts_tail = 0;
+	txq_data->elts_comp = 0;
+
+	while (elts_tail != elts_head) {
+		struct rte_mbuf *elt = (*elts)[elts_tail & elts_m];
+
+		rte_pktmbuf_free_seg(elt);
+		++elts_tail;
+	}
+	PMD_DRV_LOG(DEBUG, "Port %u txq %u free elts", txq_data->port_id, txq_data->idx);
+}
drivers/net/xsc/xsc_tx.h +2 -0
index 674b65a555..208f1c8490 100644
@@ -55,5 +55,7 @@ struct __rte_cache_aligned xsc_txq_data {
 int xsc_txq_obj_new(struct xsc_dev *xdev, struct xsc_txq_data *txq_data,
 		    uint64_t offloads, uint16_t idx);
 void xsc_txq_elts_alloc(struct xsc_txq_data *txq_data);
+void xsc_txq_obj_release(struct xsc_dev *xdev, struct xsc_txq_data *txq_data);
+void xsc_txq_elts_free(struct xsc_txq_data *txq_data);
 
 #endif /* _XSC_TX_H_ */
Signature · 1 line
2.25.1
#22 lore raw

PATCH v7 11/15 net/xsc: add ethdev Rx burst

In reply to Renyong Wan

Implement xsc ethdev Rx burst function.

---
 drivers/net/xsc/xsc_ethdev.c |   3 +
 drivers/net/xsc/xsc_rx.c     | 174 +++++++++++++++++++++++++++++++++++
 drivers/net/xsc/xsc_rx.h     |   1 +
 drivers/net/xsc/xsc_rxtx.h   |  13 +++
 4 files changed, 191 insertions(+)
drivers/net/xsc/xsc_ethdev.c +3 -0
index 0f5a6c3ba2..ebc62fd33c 100644
@@ -309,6 +309,9 @@ xsc_ethdev_start(struct rte_eth_dev *dev)
 	}
 
 	dev->data->dev_started = 1;
+
+	dev->rx_pkt_burst = xsc_rx_burst;
+
 	ret = xsc_ethdev_enable(dev);
 
 	return 0;
drivers/net/xsc/xsc_rx.c +174 -0

180 lines not on this page · raw message

drivers/net/xsc/xsc_rx.h +1 -0
index e24b1a8829..90fbb89197 100644
@@ -56,6 +56,7 @@ struct __rte_cache_aligned xsc_rxq_data {
 	uint16_t rsv1:11;
 };
 
+uint16_t xsc_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n);
 int xsc_rxq_elts_alloc(struct xsc_rxq_data *rxq_data);
 int xsc_rxq_rss_obj_new(struct xsc_ethdev_priv *priv, uint16_t port_id);
 void xsc_rxq_rss_obj_release(struct xsc_dev *xdev, struct xsc_rxq_data *rxq_data);
drivers/net/xsc/xsc_rxtx.h +13 -0
index 53d8ef5812..3606c151e6 100644
@@ -175,4 +175,17 @@ struct xsc_rx_cq_info {
 	uint16_t cqe_n;
 };
 
+static __rte_always_inline int
+xsc_check_cqe_own(volatile struct xsc_cqe *cqe, const uint16_t cqe_n, const uint16_t ci)
+{
+	if (unlikely(((cqe->owner & XSC_CQE_OWNER_MASK) != ((ci >> cqe_n) & XSC_CQE_OWNER_MASK))))
+		return XSC_CQE_OWNER_HW;
+
+	rte_io_rmb();
+	if (cqe->msg_len <= 0 && cqe->is_error)
+		return XSC_CQE_OWNER_ERR;
+
+	return XSC_CQE_OWNER_SW;
+}
+
 #endif /* _XSC_RXTX_H_ */
Signature · 1 line
2.25.1
#23 lore raw

PATCH v7 12/15 net/xsc: add ethdev Tx burst

In reply to Renyong Wan

Implement xsc ethdev Tx burst function.

---
 doc/guides/nics/features/xsc.ini |   4 +
 drivers/net/xsc/xsc_ethdev.c     |   1 +
 drivers/net/xsc/xsc_tx.c         | 228 +++++++++++++++++++++++++++++++
 drivers/net/xsc/xsc_tx.h         |   1 +
 4 files changed, 234 insertions(+)
doc/guides/nics/features/xsc.ini +4 -0
index bdeb7a984b..772c6418c4 100644
@@ -7,6 +7,10 @@
 RSS hash             = Y
 RSS key update       = Y
 RSS reta update      = Y
+L3 checksum offload  = Y
+L4 checksum offload  = Y
+Inner L3 checksum    = Y
+Inner L4 checksum    = Y
 Linux                = Y
 ARMv8                = Y
 x86-64               = Y
drivers/net/xsc/xsc_ethdev.c +1 -0
index ebc62fd33c..d344714d79 100644
@@ -311,6 +311,7 @@ xsc_ethdev_start(struct rte_eth_dev *dev)
 	dev->data->dev_started = 1;
 
 	dev->rx_pkt_burst = xsc_rx_burst;
+	dev->tx_pkt_burst = xsc_tx_burst;
 
 	ret = xsc_ethdev_enable(dev);
 
drivers/net/xsc/xsc_tx.c +228 -0

231 lines not on this page · raw message

drivers/net/xsc/xsc_tx.h +1 -0
index 208f1c8490..88419dd3a0 100644
@@ -52,6 +52,7 @@ struct __rte_cache_aligned xsc_txq_data {
 	struct rte_mbuf *elts[]; /* Storage for queued packets, for free */
 };
 
+uint16_t xsc_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n);
 int xsc_txq_obj_new(struct xsc_dev *xdev, struct xsc_txq_data *txq_data,
 		    uint64_t offloads, uint16_t idx);
 void xsc_txq_elts_alloc(struct xsc_txq_data *txq_data);
Signature · 1 line
2.25.1
#24 lore raw

PATCH v7 13/15 net/xsc: add basic stats ops

In reply to Renyong Wan

Implement xsc ethdev basic statatics ops.

---

v6:
* Remove unnecessary paren.
* Add the feature of stats per queue in xsc.ini.

---
 doc/guides/nics/features/xsc.ini |  2 +
 drivers/net/xsc/xsc_ethdev.c     | 75 ++++++++++++++++++++++++++++++++
 2 files changed, 77 insertions(+)
doc/guides/nics/features/xsc.ini +2 -0
index 772c6418c4..56e38a27d8 100644
@@ -11,6 +11,8 @@ L3 checksum offload  = Y
 L4 checksum offload  = Y
 Inner L3 checksum    = Y
 Inner L4 checksum    = Y
+Basic stats          = Y
+Stats per queue      = Y
 Linux                = Y
 ARMv8                = Y
 x86-64               = Y
drivers/net/xsc/xsc_ethdev.c +75 -0

87 lines not on this page · raw message

Signature · 1 line
2.25.1
#25 lore raw

PATCH v7 14/15 net/xsc: add ethdev infos get

In reply to Renyong Wan

Implement xsc ethdev information get ops.

---
 drivers/net/xsc/xsc_ethdev.c | 61 ++++++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)
drivers/net/xsc/xsc_ethdev.c +61 -0
index 63c64ce547..5d548adb2d 100644
@@ -364,6 +364,66 @@ xsc_ethdev_close(struct rte_eth_dev *dev)
 	return 0;
 }
 
+static uint64_t
+xsc_get_rx_queue_offloads(struct rte_eth_dev *dev)
+{
+	struct xsc_ethdev_priv *priv = TO_XSC_ETHDEV_PRIV(dev);
+	struct xsc_dev_config *config = &priv->config;
+	uint64_t offloads = 0;
+
+	if (config->hw_csum)
+		offloads |= (RTE_ETH_RX_OFFLOAD_IPV4_CKSUM |
+			     RTE_ETH_RX_OFFLOAD_UDP_CKSUM |
+			     RTE_ETH_RX_OFFLOAD_TCP_CKSUM);
+
+	return offloads;
+}
+
+static uint64_t
+xsc_get_tx_port_offloads(struct rte_eth_dev *dev)
+{
+	struct xsc_ethdev_priv *priv = TO_XSC_ETHDEV_PRIV(dev);
+	uint64_t offloads = 0;
+	struct xsc_dev_config *config = &priv->config;
+
+	if (config->hw_csum)
+		offloads |= (RTE_ETH_TX_OFFLOAD_IPV4_CKSUM |
+			     RTE_ETH_TX_OFFLOAD_UDP_CKSUM |
+			     RTE_ETH_TX_OFFLOAD_TCP_CKSUM);
+	if (config->tso)
+		offloads |= RTE_ETH_TX_OFFLOAD_TCP_TSO;
+	return offloads;
+}
+
+static int
+xsc_ethdev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
+{
+	struct xsc_ethdev_priv *priv = TO_XSC_ETHDEV_PRIV(dev);
+
+	info->min_rx_bufsize = 64;
+	info->max_rx_pktlen = 65536;
+	info->max_lro_pkt_size = 0;
+	info->max_rx_queues = 256;
+	info->max_tx_queues = 1024;
+	info->rx_desc_lim.nb_max = 4096;
+	info->rx_desc_lim.nb_min = 16;
+	info->tx_desc_lim.nb_max = 8192;
+	info->tx_desc_lim.nb_min = 128;
+
+	info->rx_queue_offload_capa = xsc_get_rx_queue_offloads(dev);
+	info->rx_offload_capa = info->rx_queue_offload_capa;
+	info->tx_offload_capa = xsc_get_tx_port_offloads(dev);
+
+	info->if_index = priv->ifindex;
+	info->speed_capa = priv->xdev->link_speed_capa;
+	info->hash_key_size = XSC_RSS_HASH_KEY_LEN;
+	info->tx_desc_lim.nb_seg_max = 8;
+	info->tx_desc_lim.nb_mtu_seg_max = 8;
+	info->switch_info.name = dev->data->name;
+	info->switch_info.port_id = priv->representor_id;
+	return 0;
+}
+
 static int
 xsc_ethdev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc,
 			  uint32_t socket, const struct rte_eth_rxconf *conf,
@@ -549,6 +609,7 @@ const struct eth_dev_ops xsc_eth_dev_ops = {
 	.dev_close = xsc_ethdev_close,
 	.stats_get = xsc_ethdev_stats_get,
 	.stats_reset = xsc_ethdev_stats_reset,
+	.dev_infos_get = xsc_ethdev_infos_get,
 	.rx_queue_setup = xsc_ethdev_rx_queue_setup,
 	.tx_queue_setup = xsc_ethdev_tx_queue_setup,
 	.rx_queue_release = xsc_ethdev_rxq_release,
Signature · 1 line
2.25.1
#26 lore raw

PATCH v7 15/15 net/xsc: add ethdev link and MTU ops

In reply to Renyong Wan

Implement xsc ethdev link and MTU ops.

---
 doc/guides/nics/features/xsc.ini |  1 +
 drivers/net/xsc/xsc_dev.c        | 33 ++++++++++++++++++
 drivers/net/xsc/xsc_dev.h        |  4 +++
 drivers/net/xsc/xsc_ethdev.c     | 60 ++++++++++++++++++++++++++++++++
 4 files changed, 98 insertions(+)
doc/guides/nics/features/xsc.ini +1 -0
index 56e38a27d8..8d5c292b7f 100644
@@ -4,6 +4,7 @@
 ; Refer to default.ini for the full list of available PMD features.
 ;
 [Features]
+MTU update           = Y
 RSS hash             = Y
 RSS key update       = Y
 RSS reta update      = Y
drivers/net/xsc/xsc_dev.c +33 -0
index 350a1fbc70..c836f2f35a 100644
@@ -62,6 +62,39 @@ xsc_dev_mailbox_exec(struct xsc_dev *xdev, void *data_in,
 					   data_out, out_len);
 }
 
+int
+xsc_dev_set_link_up(struct xsc_dev *xdev)
+{
+	if (xdev->dev_ops->set_link_up == NULL)
+		return -ENOTSUP;
+
+	return xdev->dev_ops->set_link_up(xdev);
+}
+
+int
+xsc_dev_set_link_down(struct xsc_dev *xdev)
+{
+	if (xdev->dev_ops->set_link_down == NULL)
+		return -ENOTSUP;
+
+	return xdev->dev_ops->set_link_down(xdev);
+}
+
+int
+xsc_dev_link_update(struct xsc_dev *xdev, uint8_t funcid_type, int wait_to_complete)
+{
+	if (xdev->dev_ops->link_update == NULL)
+		return -ENOTSUP;
+
+	return xdev->dev_ops->link_update(xdev, funcid_type, wait_to_complete);
+}
+
+int
+xsc_dev_set_mtu(struct xsc_dev *xdev, uint16_t mtu)
+{
+	return xdev->dev_ops->set_mtu(xdev, mtu);
+}
+
 int
 xsc_dev_get_mac(struct xsc_dev *xdev, uint8_t *mac)
 {
drivers/net/xsc/xsc_dev.h +4 -0
index c0a4d57af7..cc5fa8aad8 100644
@@ -158,6 +158,9 @@ struct xsc_dev_ops {
 int xsc_dev_mailbox_exec(struct xsc_dev *xdev, void *data_in,
 			 int in_len, void *data_out, int out_len);
 void xsc_dev_ops_register(struct xsc_dev_ops *new_ops);
+int xsc_dev_set_link_up(struct xsc_dev *xdev);
+int xsc_dev_set_link_down(struct xsc_dev *xde);
+int xsc_dev_link_update(struct xsc_dev *xdev, uint8_t funcid_type, int wait_to_complete);
 int xsc_dev_destroy_qp(struct xsc_dev *xdev, void *qp);
 int xsc_dev_destroy_cq(struct xsc_dev *xdev, void *cq);
 int xsc_dev_modify_qp_status(struct xsc_dev *xdev, uint32_t qpn, int num, int opcode);
@@ -175,6 +178,7 @@ int xsc_dev_repr_ports_probe(struct xsc_dev *xdev, int nb_repr_ports, int max_et
 int xsc_dev_rss_key_modify(struct xsc_dev *xdev, uint8_t *rss_key, uint8_t rss_key_len);
 bool xsc_dev_is_vf(struct xsc_dev *xdev);
 int xsc_dev_qp_set_id_get(struct xsc_dev *xdev, int repr_id);
+int xsc_dev_set_mtu(struct xsc_dev *xdev, uint16_t mtu);
 int xsc_dev_get_mac(struct xsc_dev *xdev, uint8_t *mac);
 
 #endif /* _XSC_DEV_H_ */
drivers/net/xsc/xsc_ethdev.c +60 -0

85 lines not on this page · raw message

Signature · 1 line
2.25.1
#27 lore raw
In reply to Renyong Wan
Quoted 114 lines · On Tue, 28 Jan 2025 22:47:22 +0800 "Renyong Wan" <[email protected]> wrote:

This xsc PMD (**librte_net_xsc**) provides poll mode driver for Yunsilicon metaScale serials NICs.

Features:
---------
- MTU update
- TSO
- RSS hash
- RSS key update
- RSS reta update
- L3 checksum offload
- L4 checksum offload
- Inner L3 checksum
- Inner L4 checksum
- Basic stats
- Stats per queue

Support NICs:
-------------

- metaScale-200S   Single QSFP56 Port 200GE SmartNIC
- metaScale-200    Quad QSFP28 Ports 100GE SmartNIC
- metaScale-50     Dual QSFP28 Port 25GE SmartNIC
- metaScale-100Q   Quad QSFP28 Port 25GE SmartNIC

---

v7:
* Remove the packed attributes of sub structures and unions.
* Remove the cast of xdev->dev_priv.
* Remove the cast of malloc return value.
* Define the size of xdev->name to PCI_PRI_STR_SIZE.
* Change the name of Wanrenyong to Renyong Wan

v6:
* Remove unnecessary paren.
* Add the feature of stats per queue in xsc.ini.
* Use memcpy instead of rte_memcpy in non critical path.
* Rebase from the main branch and merge release notes.
* Replace __rte_packed with __rte_packed_begin and __rte_packed_end.

v5:
* fix compilation errors.
* fix coding style issue with misspelling.
* remove some unnecessary parameter checks.
* remove unnecessary call of rte_wmb.
* Rearrange elements in structure to avoid holes.

v4:
* Based on the review comments from previous versions, reconstruct the xsc PMD to eliminate the dependency on rdma core library and proprietary kernel driver, while adding support for the vfio kernel driver.

v3:
* fix compilation errors

v2:
* fix checkpatch warnings and errors

---
Renyong Wan (15):
net/xsc: add xsc PMD framework
net/xsc: add xsc device initialization
net/xsc: add xsc mailbox
net/xsc: add xsc dev ops to support VFIO driver
net/xsc: add PCT interfaces
net/xsc: initialize xsc representors
net/xsc: add ethdev configure and RSS ops
net/xsc: add Rx and Tx queue setup
net/xsc: add ethdev start
net/xsc: add ethdev stop and close
net/xsc: add ethdev Rx burst
net/xsc: add ethdev Tx burst
net/xsc: add basic stats ops
net/xsc: add ethdev infos get
net/xsc: add ethdev link and MTU ops

 .mailmap                               |   5 +
 MAINTAINERS                            |  10 +
 doc/guides/nics/features/xsc.ini       |  19 +
 doc/guides/nics/index.rst              |   1 +
 doc/guides/nics/xsc.rst                |  31 +
 doc/guides/rel_notes/release_25_03.rst |   4 +
 drivers/net/meson.build                |   1 +
 drivers/net/xsc/meson.build            |  17 +
 drivers/net/xsc/xsc_cmd.h              | 387 +++++++++++
 drivers/net/xsc/xsc_defs.h             | 100 +++
 drivers/net/xsc/xsc_dev.c              | 397 +++++++++++
 drivers/net/xsc/xsc_dev.h              | 184 +++++
 drivers/net/xsc/xsc_ethdev.c           | 917 +++++++++++++++++++++++++
 drivers/net/xsc/xsc_ethdev.h           |  63 ++
 drivers/net/xsc/xsc_log.h              |  24 +
 drivers/net/xsc/xsc_np.c               | 492 +++++++++++++
 drivers/net/xsc/xsc_np.h               | 154 +++++
 drivers/net/xsc/xsc_rx.c               | 512 ++++++++++++++
 drivers/net/xsc/xsc_rx.h               |  65 ++
 drivers/net/xsc/xsc_rxtx.h             | 191 +++++
 drivers/net/xsc/xsc_tx.c               | 354 ++++++++++
 drivers/net/xsc/xsc_tx.h               |  62 ++
 drivers/net/xsc/xsc_vfio.c             | 746 ++++++++++++++++++++
 drivers/net/xsc/xsc_vfio_mbox.c        | 691 +++++++++++++++++++
 drivers/net/xsc/xsc_vfio_mbox.h        | 142 ++++
 25 files changed, 5569 insertions(+)
 create mode 100644 doc/guides/nics/features/xsc.ini
 create mode 100644 doc/guides/nics/xsc.rst
 create mode 100644 drivers/net/xsc/meson.build
 create mode 100644 drivers/net/xsc/xsc_cmd.h
 create mode 100644 drivers/net/xsc/xsc_defs.h
 create mode 100644 drivers/net/xsc/xsc_dev.c
 create mode 100644 drivers/net/xsc/xsc_dev.h
 create mode 100644 drivers/net/xsc/xsc_ethdev.c
 create mode 100644 drivers/net/xsc/xsc_ethdev.h
 create mode 100644 drivers/net/xsc/xsc_log.h
 create mode 100644 drivers/net/xsc/xsc_np.c
 create mode 100644 drivers/net/xsc/xsc_np.h
Quoted 9 lines
 create mode 100644 drivers/net/xsc/xsc_rx.c
 create mode 100644 drivers/net/xsc/xsc_rx.h
 create mode 100644 drivers/net/xsc/xsc_rxtx.h
 create mode 100644 drivers/net/xsc/xsc_tx.c
 create mode 100644 drivers/net/xsc/xsc_tx.h
 create mode 100644 drivers/net/xsc/xsc_vfio.c
 create mode 100644 drivers/net/xsc/xsc_vfio_mbox.c
 create mode 100644 drivers/net/xsc/xsc_vfio_mbox.h

Did minor conflict resolution on release notes and applied to dpdk-next-net (for-main).

author
#28 lore raw
Quoted 126 lines · Stephen Hemminger
Quoted 114 lines · On Tue, 28 Jan 2025 22:47:22 +0800 "Renyong Wan" <[email protected]> wrote:

This xsc PMD (**librte_net_xsc**) provides poll mode driver for Yunsilicon metaScale serials NICs.

Features:
---------
- MTU update
- TSO
- RSS hash
- RSS key update
- RSS reta update
- L3 checksum offload
- L4 checksum offload
- Inner L3 checksum
- Inner L4 checksum
- Basic stats
- Stats per queue

Support NICs:
-------------

- metaScale-200S   Single QSFP56 Port 200GE SmartNIC
- metaScale-200    Quad QSFP28 Ports 100GE SmartNIC
- metaScale-50     Dual QSFP28 Port 25GE SmartNIC
- metaScale-100Q   Quad QSFP28 Port 25GE SmartNIC

---

v7:
* Remove the packed attributes of sub structures and unions.
* Remove the cast of xdev->dev_priv.
* Remove the cast of malloc return value.
* Define the size of xdev->name to PCI_PRI_STR_SIZE.
* Change the name of Wanrenyong to Renyong Wan

v6:
* Remove unnecessary paren.
* Add the feature of stats per queue in xsc.ini.
* Use memcpy instead of rte_memcpy in non critical path.
* Rebase from the main branch and merge release notes.
* Replace __rte_packed with __rte_packed_begin and __rte_packed_end.

v5:
* fix compilation errors.
* fix coding style issue with misspelling.
* remove some unnecessary parameter checks.
* remove unnecessary call of rte_wmb.
* Rearrange elements in structure to avoid holes.

v4:
* Based on the review comments from previous versions, reconstruct the xsc PMD to eliminate the dependency on rdma core library and proprietary kernel driver, while adding support for the vfio kernel driver.

v3:
* fix compilation errors

v2:
* fix checkpatch warnings and errors

---
Renyong Wan (15):
net/xsc: add xsc PMD framework
net/xsc: add xsc device initialization net/xsc: add xsc mailbox
net/xsc: add xsc dev ops to support VFIO driver net/xsc: add PCT interfaces
net/xsc: initialize xsc representors net/xsc: add ethdev configure and RSS ops net/xsc: add Rx and Tx queue setup net/xsc: add ethdev start
net/xsc: add ethdev stop and close net/xsc: add ethdev Rx burst
net/xsc: add ethdev Tx burst
net/xsc: add basic stats ops
net/xsc: add ethdev infos get
net/xsc: add ethdev link and MTU ops

  .mailmap                               |   5 +
  MAINTAINERS                            |  10 +
  doc/guides/nics/features/xsc.ini       |  19 +
  doc/guides/nics/index.rst              |   1 +
  doc/guides/nics/xsc.rst                |  31 +
  doc/guides/rel_notes/release_25_03.rst |   4 +
  drivers/net/meson.build                |   1 +
  drivers/net/xsc/meson.build            |  17 +
  drivers/net/xsc/xsc_cmd.h              | 387 +++++++++++
  drivers/net/xsc/xsc_defs.h             | 100 +++
  drivers/net/xsc/xsc_dev.c              | 397 +++++++++++
  drivers/net/xsc/xsc_dev.h              | 184 +++++
  drivers/net/xsc/xsc_ethdev.c           | 917 +++++++++++++++++++++++++
  drivers/net/xsc/xsc_ethdev.h           |  63 ++
  drivers/net/xsc/xsc_log.h              |  24 +
  drivers/net/xsc/xsc_np.c               | 492 +++++++++++++
  drivers/net/xsc/xsc_np.h               | 154 +++++
  drivers/net/xsc/xsc_rx.c               | 512 ++++++++++++++
  drivers/net/xsc/xsc_rx.h               |  65 ++
  drivers/net/xsc/xsc_rxtx.h             | 191 +++++
  drivers/net/xsc/xsc_tx.c               | 354 ++++++++++
  drivers/net/xsc/xsc_tx.h               |  62 ++
  drivers/net/xsc/xsc_vfio.c             | 746 ++++++++++++++++++++
  drivers/net/xsc/xsc_vfio_mbox.c        | 691 +++++++++++++++++++
  drivers/net/xsc/xsc_vfio_mbox.h        | 142 ++++
  25 files changed, 5569 insertions(+)

create mode 100644 doc/guides/nics/features/xsc.ini create mode 100644 doc/guides/nics/xsc.rst create mode 100644 drivers/net/xsc/meson.build create mode 100644 drivers/net/xsc/xsc_cmd.h create mode 100644 drivers/net/xsc/xsc_defs.h create mode 100644 drivers/net/xsc/xsc_dev.c create mode 100644 drivers/net/xsc/xsc_dev.h create mode 100644 drivers/net/xsc/xsc_ethdev.c create mode 100644 drivers/net/xsc/xsc_ethdev.h create mode 100644 drivers/net/xsc/xsc_log.h create mode 100644 drivers/net/xsc/xsc_np.c create mode 100644 drivers/net/xsc/xsc_np.h

Quoted 9 lines

create mode 100644 drivers/net/xsc/xsc_rx.c create mode 100644 drivers/net/xsc/xsc_rx.h create mode 100644 drivers/net/xsc/xsc_rxtx.h create mode 100644 drivers/net/xsc/xsc_tx.c create mode 100644 drivers/net/xsc/xsc_tx.h create mode 100644 drivers/net/xsc/xsc_vfio.c create mode 100644 drivers/net/xsc/xsc_vfio_mbox.c create mode 100644 drivers/net/xsc/xsc_vfio_mbox.h

Quoted 2 lines

Did minor conflict resolution on release notes and applied to dpdk-next-net (for-main).

OK, thank you very much Stephen.

Signature · 2 lines
Best regards,
WanRenyong
#29 lore raw
In reply to Renyong Wan
Quoted 114 lines · On Tue, 28 Jan 2025 22:47:22 +0800 "Renyong Wan" <[email protected]> wrote:

This xsc PMD (**librte_net_xsc**) provides poll mode driver for Yunsilicon metaScale serials NICs.

Features:
---------
- MTU update
- TSO
- RSS hash
- RSS key update
- RSS reta update
- L3 checksum offload
- L4 checksum offload
- Inner L3 checksum
- Inner L4 checksum
- Basic stats
- Stats per queue

Support NICs:
-------------

- metaScale-200S   Single QSFP56 Port 200GE SmartNIC
- metaScale-200    Quad QSFP28 Ports 100GE SmartNIC
- metaScale-50     Dual QSFP28 Port 25GE SmartNIC
- metaScale-100Q   Quad QSFP28 Port 25GE SmartNIC

---

v7:
* Remove the packed attributes of sub structures and unions.
* Remove the cast of xdev->dev_priv.
* Remove the cast of malloc return value.
* Define the size of xdev->name to PCI_PRI_STR_SIZE.
* Change the name of Wanrenyong to Renyong Wan

v6:
* Remove unnecessary paren.
* Add the feature of stats per queue in xsc.ini.
* Use memcpy instead of rte_memcpy in non critical path.
* Rebase from the main branch and merge release notes.
* Replace __rte_packed with __rte_packed_begin and __rte_packed_end.

v5:
* fix compilation errors.
* fix coding style issue with misspelling.
* remove some unnecessary parameter checks.
* remove unnecessary call of rte_wmb.
* Rearrange elements in structure to avoid holes.

v4:
* Based on the review comments from previous versions, reconstruct the xsc PMD to eliminate the dependency on rdma core library and proprietary kernel driver, while adding support for the vfio kernel driver.

v3:
* fix compilation errors

v2:
* fix checkpatch warnings and errors

---
Renyong Wan (15):
net/xsc: add xsc PMD framework
net/xsc: add xsc device initialization
net/xsc: add xsc mailbox
net/xsc: add xsc dev ops to support VFIO driver
net/xsc: add PCT interfaces
net/xsc: initialize xsc representors
net/xsc: add ethdev configure and RSS ops
net/xsc: add Rx and Tx queue setup
net/xsc: add ethdev start
net/xsc: add ethdev stop and close
net/xsc: add ethdev Rx burst
net/xsc: add ethdev Tx burst
net/xsc: add basic stats ops
net/xsc: add ethdev infos get
net/xsc: add ethdev link and MTU ops

 .mailmap                               |   5 +
 MAINTAINERS                            |  10 +
 doc/guides/nics/features/xsc.ini       |  19 +
 doc/guides/nics/index.rst              |   1 +
 doc/guides/nics/xsc.rst                |  31 +
 doc/guides/rel_notes/release_25_03.rst |   4 +
 drivers/net/meson.build                |   1 +
 drivers/net/xsc/meson.build            |  17 +
 drivers/net/xsc/xsc_cmd.h              | 387 +++++++++++
 drivers/net/xsc/xsc_defs.h             | 100 +++
 drivers/net/xsc/xsc_dev.c              | 397 +++++++++++
 drivers/net/xsc/xsc_dev.h              | 184 +++++
 drivers/net/xsc/xsc_ethdev.c           | 917 +++++++++++++++++++++++++
 drivers/net/xsc/xsc_ethdev.h           |  63 ++
 drivers/net/xsc/xsc_log.h              |  24 +
 drivers/net/xsc/xsc_np.c               | 492 +++++++++++++
 drivers/net/xsc/xsc_np.h               | 154 +++++
 drivers/net/xsc/xsc_rx.c               | 512 ++++++++++++++
 drivers/net/xsc/xsc_rx.h               |  65 ++
 drivers/net/xsc/xsc_rxtx.h             | 191 +++++
 drivers/net/xsc/xsc_tx.c               | 354 ++++++++++
 drivers/net/xsc/xsc_tx.h               |  62 ++
 drivers/net/xsc/xsc_vfio.c             | 746 ++++++++++++++++++++
 drivers/net/xsc/xsc_vfio_mbox.c        | 691 +++++++++++++++++++
 drivers/net/xsc/xsc_vfio_mbox.h        | 142 ++++
 25 files changed, 5569 insertions(+)
 create mode 100644 doc/guides/nics/features/xsc.ini
 create mode 100644 doc/guides/nics/xsc.rst
 create mode 100644 drivers/net/xsc/meson.build
 create mode 100644 drivers/net/xsc/xsc_cmd.h
 create mode 100644 drivers/net/xsc/xsc_defs.h
 create mode 100644 drivers/net/xsc/xsc_dev.c
 create mode 100644 drivers/net/xsc/xsc_dev.h
 create mode 100644 drivers/net/xsc/xsc_ethdev.c
 create mode 100644 drivers/net/xsc/xsc_ethdev.h
 create mode 100644 drivers/net/xsc/xsc_log.h
 create mode 100644 drivers/net/xsc/xsc_np.c
 create mode 100644 drivers/net/xsc/xsc_np.h
Quoted 9 lines
 create mode 100644 drivers/net/xsc/xsc_rx.c
 create mode 100644 drivers/net/xsc/xsc_rx.h
 create mode 100644 drivers/net/xsc/xsc_rxtx.h
 create mode 100644 drivers/net/xsc/xsc_tx.c
 create mode 100644 drivers/net/xsc/xsc_tx.h
 create mode 100644 drivers/net/xsc/xsc_vfio.c
 create mode 100644 drivers/net/xsc/xsc_vfio_mbox.c
 create mode 100644 drivers/net/xsc/xsc_vfio_mbox.h

Now that XSC is merged to main, there are a number of possible problems reported by PVS studio.

The Vxxx value is the PVS studio error code.

xsc_dev.c (292)
V576 Incorrect format. Consider checking the fifth actual argument of the 'rte_log' function. The UNSIGNED integer type argument is expected.
xsc_dev.c (292)
V576 Incorrect format. Consider checking the sixth actual argument of the 'rte_log' function. The UNSIGNED integer type argument is expected.
xsc_ethdev.c (724)
V547 Expression 'config->tso' is always true.
xsc_ethdev.c (728)
V547 Expression is always false.
xsc_ethdev.c (729)
V547 Expression 'priv->is_representor' is always true.
xsc_ethdev.c (316)
V1001 The 'ret' variable is assigned but is not used by the end of the function.
xsc_ethdev.c (141)
V522 There might be dereferencing of a potential null pointer 'rxq'.
xsc_ethdev.c (165)
V522 There might be dereferencing of a potential null pointer 'txq'.
xsc_ethdev.c (650)
V526 The 'memcmp' function returns 0 if corresponding buffers are equal. Consider examining the condition for mistakes.
xsc_ethdev.c (825)
V1027 Pointer to an object of the 'rte_device' class is cast to unrelated 'rte_pci_device' class.
xsc_np.c (175)
V595 The 'in' pointer was utilized before it was verified against nullptr. Check lines: 175, 176.
xsc_np.c (140)
V560 A part of conditional expression is always false: (rss_conf->rss_hf & (0UL << 50)).
xsc_np.c (175)
V575 The potential null pointer is passed into 'memset' function. Inspect the first argument. Check lines: 175, 174.
xsc_np.c (142)
V1048 The 'outer' variable was assigned the same value.
xsc_np.c (192)
V1027 Pointer to an object of the 'xsc_np_mbox_in' class is cast to unrelated 'xsc_np_mbox_out' class.
xsc_rx.c (296)
V595 The 'in' pointer was utilized before it was verified against nullptr. Check lines: 296, 297.
xsc_rx.c (45)
V560 A part of conditional expression is always false: ret == - 1.
xsc_rx.c (45)
V560 A part of conditional expression is always false: ret == 0x2.
xsc_rx.c (296)
V575 The potential null pointer is passed into 'memset' function. Inspect the first argument. Check lines: 296, 295.
xsc_rx.c (284)
V522 There might be dereferencing of a potential null pointer 'rxq_data'.
xsc_rx.c (391)
V522 There might be dereferencing of a potential null pointer 'rxq_data'.
xsc_rx.c (430)
V522 Dereferencing of the null pointer might take place. The potential null pointer is passed into 'xsc_rxq_elts_alloc' function. Inspect the first argument. Check lines: 'xsc_rx.c:430', 'xsc_ethdev.c:274'.
xsc_rx.c (361)
V576 Incorrect format. Consider checking the fifth actual argument of the 'rte_log' function. The UNSIGNED integer type argument is expected.
xsc_rx.c (361)
V576 Incorrect format. Consider checking the ninth actual argument of the 'rte_log' function. The SIGNED integer type argument is expected.
xsc_rx.c (410)
V576 Incorrect format. Consider checking the ninth actual argument of the 'rte_log' function. The SIGNED integer type argument is expected.
xsc_rx.c (447)
V656 Variables '(mbuf)->data_len', '(mbuf)->pkt_len' are initialized through the call to the same function. It's probably an error or un-optimized code. Check lines: 445, 447.
xsc_rx.c (335)
V1027 Pointer to an object of the 'xsc_cmd_create_multiqp_mbox_in' class is cast to unrelated 'xsc_cmd_create_multiqp_mbox_out' class.
xsc_tx.c (18)
V522 Dereferencing of the null pointer might take place. The potential null pointer is passed into 'xsc_txq_elts_alloc' function. Inspect the first argument. Check lines: 'xsc_tx.c:18', 'xsc_ethdev.c:232'.
xsc_tx.c (55)
V576 Incorrect format. Consider checking the eighth actual argument of the 'rte_log' function. The SIGNED integer type argument is expected.
xsc_tx.c (86)
V576 Incorrect format. Consider checking the eighth actual argument of the 'rte_log' function. The SIGNED integer type argument is expected.
xsc_tx.c (218)
V1048 The 'cs->has_pph' variable was assigned the same value.
xsc_vfio.c (434)
V595 The 'in' pointer was utilized before it was verified against nullptr. Check lines: 434, 435.
xsc_vfio.c (434)
V575 The potential null pointer is passed into 'memset' function. Inspect the first argument. Check lines: 434, 433.
xsc_vfio.c (340)
V576 Incorrect format. Consider checking the fifth actual argument of the 'rte_log' function. The SIGNED integer type argument is expected.
xsc_vfio.c (486)
V576 Incorrect format. Consider checking the seventh actual argument of the 'rte_log' function. The SIGNED integer type argument is expected.
xsc_vfio.c (88)
V1027 Pointer to an object of the 'xsc_cmd_query_hca_cap_mbox_in' class is cast to unrelated 'xsc_cmd_query_hca_cap_mbox_out' class.
xsc_vfio.c (207)
V1027 Pointer to an object of the 'xsc_cmd_destroy_qp_mbox_in' class is cast to unrelated 'xsc_cmd_destroy_qp_mbox_out' class.
xsc_vfio.c (248)
V1027 Pointer to an object of the 'xsc_cmd_destroy_cq_mbox_in' class is cast to unrelated 'xsc_cmd_destroy_cq_mbox_out' class.
xsc_vfio.c (330)
V1027 Pointer to an object of the 'xsc_cmd_modify_qp_mbox_in' class is cast to unrelated 'xsc_cmd_modify_qp_mbox_out' class.
xsc_vfio.c (380)
V1027 Pointer to an object of the 'xsc_cmd_modify_raw_qp_mbox_in' class is cast to unrelated 'xsc_cmd_modify_raw_qp_mbox_out' class.
xsc_vfio.c (463)
V1027 Pointer to an object of the 'xsc_cmd_create_cq_mbox_in' class is cast to unrelated 'xsc_cmd_create_cq_mbox_out' class.
xsc_vfio.c (560)
V1027 Pointer to an object of the 'xsc_cmd_create_cq_mbox_in' class is cast to unrelated 'xsc_cmd_create_cq_mbox_out' class.
xsc_vfio.c (666)
V1027 Pointer to an object of the 'xsc_cmd_create_qp_mbox_in' class is cast to unrelated 'xsc_cmd_create_qp_mbox_out' class.
xsc_vfio_mbox.c (517)
V576 Incorrect format. Consider checking the seventh actual argument of the 'rte_log' function. The UNSIGNED integer type argument is expected.
xsc_vfio_mbox.c (575)
V1048 The 'size' variable was assigned the same value.

#30 lore raw
Quoted 213 lines · Stephen Hemminger
Quoted 114 lines · On Tue, 28 Jan 2025 22:47:22 +0800 "Renyong Wan" <[email protected]> wrote:

This xsc PMD (**librte_net_xsc**) provides poll mode driver for Yunsilicon metaScale serials NICs.

Features:
---------
- MTU update
- TSO
- RSS hash
- RSS key update
- RSS reta update
- L3 checksum offload
- L4 checksum offload
- Inner L3 checksum
- Inner L4 checksum
- Basic stats
- Stats per queue

Support NICs:
-------------

- metaScale-200S   Single QSFP56 Port 200GE SmartNIC
- metaScale-200    Quad QSFP28 Ports 100GE SmartNIC
- metaScale-50     Dual QSFP28 Port 25GE SmartNIC
- metaScale-100Q   Quad QSFP28 Port 25GE SmartNIC

---

v7:
* Remove the packed attributes of sub structures and unions.
* Remove the cast of xdev->dev_priv.
* Remove the cast of malloc return value.
* Define the size of xdev->name to PCI_PRI_STR_SIZE.
* Change the name of Wanrenyong to Renyong Wan

v6:
* Remove unnecessary paren.
* Add the feature of stats per queue in xsc.ini.
* Use memcpy instead of rte_memcpy in non critical path.
* Rebase from the main branch and merge release notes.
* Replace __rte_packed with __rte_packed_begin and __rte_packed_end.

v5:
* fix compilation errors.
* fix coding style issue with misspelling.
* remove some unnecessary parameter checks.
* remove unnecessary call of rte_wmb.
* Rearrange elements in structure to avoid holes.

v4:
* Based on the review comments from previous versions, reconstruct the xsc PMD to eliminate the dependency on rdma core library and proprietary kernel driver, while adding support for the vfio kernel driver.

v3:
* fix compilation errors

v2:
* fix checkpatch warnings and errors

---
Renyong Wan (15):
net/xsc: add xsc PMD framework
net/xsc: add xsc device initialization net/xsc: add xsc mailbox
net/xsc: add xsc dev ops to support VFIO driver net/xsc: add PCT interfaces
net/xsc: initialize xsc representors net/xsc: add ethdev configure and RSS ops net/xsc: add Rx and Tx queue setup net/xsc: add ethdev start
net/xsc: add ethdev stop and close net/xsc: add ethdev Rx burst
net/xsc: add ethdev Tx burst
net/xsc: add basic stats ops
net/xsc: add ethdev infos get
net/xsc: add ethdev link and MTU ops

  .mailmap                               |   5 +
  MAINTAINERS                            |  10 +
  doc/guides/nics/features/xsc.ini       |  19 +
  doc/guides/nics/index.rst              |   1 +
  doc/guides/nics/xsc.rst                |  31 +
  doc/guides/rel_notes/release_25_03.rst |   4 +
  drivers/net/meson.build                |   1 +
  drivers/net/xsc/meson.build            |  17 +
  drivers/net/xsc/xsc_cmd.h              | 387 +++++++++++
  drivers/net/xsc/xsc_defs.h             | 100 +++
  drivers/net/xsc/xsc_dev.c              | 397 +++++++++++
  drivers/net/xsc/xsc_dev.h              | 184 +++++
  drivers/net/xsc/xsc_ethdev.c           | 917 +++++++++++++++++++++++++
  drivers/net/xsc/xsc_ethdev.h           |  63 ++
  drivers/net/xsc/xsc_log.h              |  24 +
  drivers/net/xsc/xsc_np.c               | 492 +++++++++++++
  drivers/net/xsc/xsc_np.h               | 154 +++++
  drivers/net/xsc/xsc_rx.c               | 512 ++++++++++++++
  drivers/net/xsc/xsc_rx.h               |  65 ++
  drivers/net/xsc/xsc_rxtx.h             | 191 +++++
  drivers/net/xsc/xsc_tx.c               | 354 ++++++++++
  drivers/net/xsc/xsc_tx.h               |  62 ++
  drivers/net/xsc/xsc_vfio.c             | 746 ++++++++++++++++++++
  drivers/net/xsc/xsc_vfio_mbox.c        | 691 +++++++++++++++++++
  drivers/net/xsc/xsc_vfio_mbox.h        | 142 ++++
  25 files changed, 5569 insertions(+)

create mode 100644 doc/guides/nics/features/xsc.ini create mode 100644 doc/guides/nics/xsc.rst create mode 100644 drivers/net/xsc/meson.build create mode 100644 drivers/net/xsc/xsc_cmd.h create mode 100644 drivers/net/xsc/xsc_defs.h create mode 100644 drivers/net/xsc/xsc_dev.c create mode 100644 drivers/net/xsc/xsc_dev.h create mode 100644 drivers/net/xsc/xsc_ethdev.c create mode 100644 drivers/net/xsc/xsc_ethdev.h create mode 100644 drivers/net/xsc/xsc_log.h create mode 100644 drivers/net/xsc/xsc_np.c create mode 100644 drivers/net/xsc/xsc_np.h

Quoted 9 lines

create mode 100644 drivers/net/xsc/xsc_rx.c create mode 100644 drivers/net/xsc/xsc_rx.h create mode 100644 drivers/net/xsc/xsc_rxtx.h create mode 100644 drivers/net/xsc/xsc_tx.c create mode 100644 drivers/net/xsc/xsc_tx.h create mode 100644 drivers/net/xsc/xsc_vfio.c create mode 100644 drivers/net/xsc/xsc_vfio_mbox.c create mode 100644 drivers/net/xsc/xsc_vfio_mbox.h

Now that XSC is merged to main, there are a number of possible problems reported by PVS studio.

The Vxxx value is the PVS studio error code.

xsc_dev.c (292)
V576 Incorrect format. Consider checking the fifth actual argument of the 'rte_log' function. The UNSIGNED integer type argument is expected.
xsc_dev.c (292)
V576 Incorrect format. Consider checking the sixth actual argument of the 'rte_log' function. The UNSIGNED integer type argument is expected.
xsc_ethdev.c (724)
V547 Expression 'config->tso' is always true.
xsc_ethdev.c (728)
V547 Expression is always false.
xsc_ethdev.c (729)
V547 Expression 'priv->is_representor' is always true.
xsc_ethdev.c (316)
V1001 The 'ret' variable is assigned but is not used by the end of the function.
xsc_ethdev.c (141)
V522 There might be dereferencing of a potential null pointer 'rxq'.
xsc_ethdev.c (165)
V522 There might be dereferencing of a potential null pointer 'txq'.
xsc_ethdev.c (650)
V526 The 'memcmp' function returns 0 if corresponding buffers are equal. Consider examining the condition for mistakes.
xsc_ethdev.c (825)
V1027 Pointer to an object of the 'rte_device' class is cast to unrelated 'rte_pci_device' class.
xsc_np.c (175)
V595 The 'in' pointer was utilized before it was verified against nullptr. Check lines: 175, 176.
xsc_np.c (140)
V560 A part of conditional expression is always false: (rss_conf->rss_hf & (0UL << 50)).
xsc_np.c (175)
V575 The potential null pointer is passed into 'memset' function. Inspect the first argument. Check lines: 175, 174.
xsc_np.c (142)
V1048 The 'outer' variable was assigned the same value.
xsc_np.c (192)
V1027 Pointer to an object of the 'xsc_np_mbox_in' class is cast to unrelated 'xsc_np_mbox_out' class.
xsc_rx.c (296)
V595 The 'in' pointer was utilized before it was verified against nullptr. Check lines: 296, 297.
xsc_rx.c (45)
V560 A part of conditional expression is always false: ret == - 1.
xsc_rx.c (45)
V560 A part of conditional expression is always false: ret == 0x2.
xsc_rx.c (296)
V575 The potential null pointer is passed into 'memset' function. Inspect the first argument. Check lines: 296, 295.
xsc_rx.c (284)
V522 There might be dereferencing of a potential null pointer 'rxq_data'.
xsc_rx.c (391)
V522 There might be dereferencing of a potential null pointer 'rxq_data'.
xsc_rx.c (430)
V522 Dereferencing of the null pointer might take place. The potential null pointer is passed into 'xsc_rxq_elts_alloc' function. Inspect the first argument. Check lines: 'xsc_rx.c:430', 'xsc_ethdev.c:274'.
xsc_rx.c (361)
V576 Incorrect format. Consider checking the fifth actual argument of the 'rte_log' function. The UNSIGNED integer type argument is expected.
xsc_rx.c (361)
V576 Incorrect format. Consider checking the ninth actual argument of the 'rte_log' function. The SIGNED integer type argument is expected.
xsc_rx.c (410)
V576 Incorrect format. Consider checking the ninth actual argument of the 'rte_log' function. The SIGNED integer type argument is expected.
xsc_rx.c (447)
V656 Variables '(mbuf)->data_len', '(mbuf)->pkt_len' are initialized through the call to the same function. It's probably an error or un-optimized code. Check lines: 445, 447.
xsc_rx.c (335)
V1027 Pointer to an object of the 'xsc_cmd_create_multiqp_mbox_in' class is cast to unrelated 'xsc_cmd_create_multiqp_mbox_out' class.
xsc_tx.c (18)
V522 Dereferencing of the null pointer might take place. The potential null pointer is passed into 'xsc_txq_elts_alloc' function. Inspect the first argument. Check lines: 'xsc_tx.c:18', 'xsc_ethdev.c:232'.
xsc_tx.c (55)
V576 Incorrect format. Consider checking the eighth actual argument of the 'rte_log' function. The SIGNED integer type argument is expected.
xsc_tx.c (86)
V576 Incorrect format. Consider checking the eighth actual argument of the 'rte_log' function. The SIGNED integer type argument is expected.
xsc_tx.c (218)
V1048 The 'cs->has_pph' variable was assigned the same value.
xsc_vfio.c (434)
V595 The 'in' pointer was utilized before it was verified against nullptr. Check lines: 434, 435.
xsc_vfio.c (434)
V575 The potential null pointer is passed into 'memset' function. Inspect the first argument. Check lines: 434, 433.
xsc_vfio.c (340)
V576 Incorrect format. Consider checking the fifth actual argument of the 'rte_log' function. The SIGNED integer type argument is expected.
xsc_vfio.c (486)
V576 Incorrect format. Consider checking the seventh actual argument of the 'rte_log' function. The SIGNED integer type argument is expected.
xsc_vfio.c (88)
V1027 Pointer to an object of the 'xsc_cmd_query_hca_cap_mbox_in' class is cast to unrelated 'xsc_cmd_query_hca_cap_mbox_out' class.
xsc_vfio.c (207)
V1027 Pointer to an object of the 'xsc_cmd_destroy_qp_mbox_in' class is cast to unrelated 'xsc_cmd_destroy_qp_mbox_out' class.
xsc_vfio.c (248)
V1027 Pointer to an object of the 'xsc_cmd_destroy_cq_mbox_in' class is cast to unrelated 'xsc_cmd_destroy_cq_mbox_out' class.
xsc_vfio.c (330)
V1027 Pointer to an object of the 'xsc_cmd_modify_qp_mbox_in' class is cast to unrelated 'xsc_cmd_modify_qp_mbox_out' class.
xsc_vfio.c (380)
V1027 Pointer to an object of the 'xsc_cmd_modify_raw_qp_mbox_in' class is cast to unrelated 'xsc_cmd_modify_raw_qp_mbox_out' class.
xsc_vfio.c (463)
V1027 Pointer to an object of the 'xsc_cmd_create_cq_mbox_in' class is cast to unrelated 'xsc_cmd_create_cq_mbox_out' class.

Quoted 8 lines

xsc_vfio.c (560)
V1027 Pointer to an object of the 'xsc_cmd_create_cq_mbox_in' class is cast to unrelated 'xsc_cmd_create_cq_mbox_out' class.
xsc_vfio.c (666)
V1027 Pointer to an object of the 'xsc_cmd_create_qp_mbox_in' class is cast to unrelated 'xsc_cmd_create_qp_mbox_out' class.
xsc_vfio_mbox.c (517)
V576 Incorrect format. Consider checking the seventh actual argument of the 'rte_log' function. The UNSIGNED integer type argument is expected.
xsc_vfio_mbox.c (575)
V1048 The 'size' variable was assigned the same value.

Hello Stephen,

Thank you for providing the detailed PVS Studio report, these issues will be addressed in the upcoming 25.03-rc2, as well as the defects reported in the Coverity Scan email you forwarded earlier.

Signature · 2 lines
Best regards,
Renyong Wan