Message ID | 1739374368-4949-1-git-send-email-caowenbo@mucse.com (mailing list archive) |
---|---|
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C7AD246204; Wed, 12 Feb 2025 16:33:13 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 613974279D; Wed, 12 Feb 2025 16:33:13 +0100 (CET) Received: from localhost.localdomain (unknown [103.233.162.252]) by mails.dpdk.org (Postfix) with ESMTP id 22DFE42789 for <dev@dpdk.org>; Wed, 12 Feb 2025 16:33:12 +0100 (CET) Received: by localhost.localdomain (Postfix, from userid 0) id 3F9F4A3648; Wed, 12 Feb 2025 23:33:11 +0800 (CST) From: Wenbo Cao <caowenbo@mucse.com> To: thomas@monjalon.net Cc: stephen@networkplumber.org, dev@dpdk.org, ferruh.yigit@amd.com, andrew.rybchenko@oktetlabs.ru, yaojun@mucse.com, Wenbo Cao <caowenbo@mucse.com> Subject: [PATCH v12 00/28] [v12]drivers/net Add Support mucse N10 Pmd Driver Date: Wed, 12 Feb 2025 23:32:20 +0800 Message-Id: <1739374368-4949-1-git-send-email-caowenbo@mucse.com> X-Mailer: git-send-email 1.8.3.1 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions <dev.dpdk.org> List-Unsubscribe: <https://mails.dpdk.org/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://mails.dpdk.org/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <https://mails.dpdk.org/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org |
Series |
drivers/net Add Support mucse N10 Pmd Driver
|
|
Message
11
Feb. 12, 2025, 3:32 p.m. UTC
For This patchset just to support the basic chip init work and user can just found the eth_dev, but can't control more. For Now just support 2*10g nic,the chip can support 2*10g,4*10g,4*1g,8*1g,8*10g. The Feature rx side can support rx-cksum-offload,rss,vlan-filter flow_clow,uncast_filter,mcast_filter,1588,Jumbo-frame The Feature tx side can support tx-cksum-offload,tso,vxlan-tso flow director base on ntuple pattern of tcp/udp/ip/ eth_hdr->type for sriov is also support. Because of the chip design defect, for multiple-port mode one pci-bdf will have multiple-port (max can have four ports) so this code must be care of one bdf init multiple-port. v12: * fixed __rte_packed __deprecated__ compile issue. v11: * fixed array-bounds issue when used rte_memcpy src addr is * not enough to hold align dst. * improve efficient_code advised by Stephen v10: * fixed mingw windows meson issue * rnp not support windows for now. v9: * fixed commit log format check by devtools. * fixed code compile issue. v8: * fixed codespell issue. * fixed MAINTAINERS file v7: * add support nic basic feature such as rss vlan strip/filter, * mtu-change recv/send scater-recv/mutltiple-send. * fixed code rationality, advised by Ferruh Yigit. v6: * fixed the doc(rst) format problem advise by Thomas Monjalon v5: * fixed the symbol name require by the style documentation v4: * one patch has been forgot to upload :( v3: * fixed http://dpdk.org/patch/129830 FreeBSD 13 compile Issue * change iobar type to void suggest by Stephen Hemminger * add KMOD_DEP support for vfio-pci * change run-cmd argument parse check for invalid extra_args v2: * fixed MAINTAIN maillist fullname format * fixed driver/net/meson the order issue of new driver to driver list * improve virtual point function usage suggest by Stephen Hemminger Wenbo Cao (28): net/rnp: add skeleton net/rnp: add ethdev probe and remove net/rnp: add log net/rnp: support mailbox basic operate net/rnp: add device init and uninit net/rnp: add get device information operation net/rnp: add support MAC promisc mode net/rnp: add queue setup and release operations net/rnp: add queue stop and start operations net/rnp: add support device start stop operations net/rnp: add RSS support operations net/rnp: add support link update operations net/rnp: add support link setup operations net/rnp: add Rx burst simple support net/rnp: add Tx burst simple support net/rnp: add MTU set operation net/rnp: add Rx scatter segment version net/rnp: add Tx multiple segment version net/rnp: add support basic stats operation net/rnp: add support xstats operation net/rnp: add unicast MAC filter operation net/rnp: add supported packet types net/rnp: add support Rx checksum offload net/rnp: add support Tx TSO offload net/rnp: support VLAN offloads net/rnp: add support VLAN filters operations net/rnp: add queue info operation net/rnp: support Rx/Tx burst mode info .mailmap | 1 + MAINTAINERS | 6 + doc/guides/nics/features/rnp.ini | 33 + doc/guides/nics/index.rst | 1 + doc/guides/nics/rnp.rst | 101 ++ drivers/net/meson.build | 1 + drivers/net/rnp/base/meson.build | 17 + drivers/net/rnp/base/rnp_bdq_if.c | 398 ++++++ drivers/net/rnp/base/rnp_bdq_if.h | 154 +++ drivers/net/rnp/base/rnp_bitrev.h | 64 + drivers/net/rnp/base/rnp_common.c | 103 ++ drivers/net/rnp/base/rnp_common.h | 17 + drivers/net/rnp/base/rnp_crc32.c | 37 + drivers/net/rnp/base/rnp_crc32.h | 10 + drivers/net/rnp/base/rnp_dma_regs.h | 68 + drivers/net/rnp/base/rnp_eth_regs.h | 90 ++ drivers/net/rnp/base/rnp_fw_cmd.c | 162 +++ drivers/net/rnp/base/rnp_fw_cmd.h | 357 ++++++ drivers/net/rnp/base/rnp_hw.h | 136 ++ drivers/net/rnp/base/rnp_mac.c | 366 ++++++ drivers/net/rnp/base/rnp_mac.h | 34 + drivers/net/rnp/base/rnp_mac_regs.h | 207 +++ drivers/net/rnp/base/rnp_mbx.c | 512 ++++++++ drivers/net/rnp/base/rnp_mbx.h | 58 + drivers/net/rnp/base/rnp_mbx_fw.c | 499 ++++++++ drivers/net/rnp/base/rnp_mbx_fw.h | 24 + drivers/net/rnp/base/rnp_osdep.h | 169 +++ drivers/net/rnp/meson.build | 27 + drivers/net/rnp/rnp.h | 258 ++++ drivers/net/rnp/rnp_ethdev.c | 1841 +++++++++++++++++++++++++++ drivers/net/rnp/rnp_link.c | 439 +++++++ drivers/net/rnp/rnp_link.h | 38 + drivers/net/rnp/rnp_logs.h | 36 + drivers/net/rnp/rnp_rss.c | 367 ++++++ drivers/net/rnp/rnp_rss.h | 43 + drivers/net/rnp/rnp_rxtx.c | 1815 ++++++++++++++++++++++++++ drivers/net/rnp/rnp_rxtx.h | 162 +++ 37 files changed, 8651 insertions(+) create mode 100644 doc/guides/nics/features/rnp.ini create mode 100644 doc/guides/nics/rnp.rst create mode 100644 drivers/net/rnp/base/meson.build create mode 100644 drivers/net/rnp/base/rnp_bdq_if.c create mode 100644 drivers/net/rnp/base/rnp_bdq_if.h create mode 100644 drivers/net/rnp/base/rnp_bitrev.h create mode 100644 drivers/net/rnp/base/rnp_common.c create mode 100644 drivers/net/rnp/base/rnp_common.h create mode 100644 drivers/net/rnp/base/rnp_crc32.c create mode 100644 drivers/net/rnp/base/rnp_crc32.h create mode 100644 drivers/net/rnp/base/rnp_dma_regs.h create mode 100644 drivers/net/rnp/base/rnp_eth_regs.h create mode 100644 drivers/net/rnp/base/rnp_fw_cmd.c create mode 100644 drivers/net/rnp/base/rnp_fw_cmd.h create mode 100644 drivers/net/rnp/base/rnp_hw.h create mode 100644 drivers/net/rnp/base/rnp_mac.c create mode 100644 drivers/net/rnp/base/rnp_mac.h create mode 100644 drivers/net/rnp/base/rnp_mac_regs.h create mode 100644 drivers/net/rnp/base/rnp_mbx.c create mode 100644 drivers/net/rnp/base/rnp_mbx.h create mode 100644 drivers/net/rnp/base/rnp_mbx_fw.c create mode 100644 drivers/net/rnp/base/rnp_mbx_fw.h create mode 100644 drivers/net/rnp/base/rnp_osdep.h create mode 100644 drivers/net/rnp/meson.build create mode 100644 drivers/net/rnp/rnp.h create mode 100644 drivers/net/rnp/rnp_ethdev.c create mode 100644 drivers/net/rnp/rnp_link.c create mode 100644 drivers/net/rnp/rnp_link.h create mode 100644 drivers/net/rnp/rnp_logs.h create mode 100644 drivers/net/rnp/rnp_rss.c create mode 100644 drivers/net/rnp/rnp_rss.h create mode 100644 drivers/net/rnp/rnp_rxtx.c create mode 100644 drivers/net/rnp/rnp_rxtx.h
Comments
On Wed, 12 Feb 2025 23:32:20 +0800 Wenbo Cao <caowenbo@mucse.com> wrote: > For This patchset just to support the basic chip init work > and user can just found the eth_dev, but can't control more. > For Now just support 2*10g nic,the chip can support > 2*10g,4*10g,4*1g,8*1g,8*10g. > The Feature rx side can support rx-cksum-offload,rss,vlan-filter > flow_clow,uncast_filter,mcast_filter,1588,Jumbo-frame > The Feature tx side can support tx-cksum-offload,tso,vxlan-tso > flow director base on ntuple pattern of tcp/udp/ip/ eth_hdr->type > for sriov is also support. > > Because of the chip design defect, for multiple-port mode > one pci-bdf will have multiple-port (max can have four ports) > so this code must be care of one bdf init multiple-port. The driver is getting very close to being ready to merge but still see some things. Mostly the issues are around the documentation now. Review checklist for rnp v12 patches: Mark items with: ✔ passed ✘ Failed Basic hygiene ✔ Look at CI results in patchwork ✔ Merge cleanly with git am; look for missing newline at EOF etc ✘ Run checkpatches; warnings are ok, but look more carefully. Lots of warnings from base code (allowed but not preferred). Fix these by making it an inline function? #1143: FILE: drivers/net/rnp/rnp.h:62: +#define RNP_PF_OWN_PORTS(id) (((id) == 0) ? 1 : (((id) == 1) ? 2 : 4)) +#define RNP_LINK_SPEED_CODE(sp, n) \ + (((sp) & RTE_GENMASK32((11) + ((4) * (n)), \ + (8) + ((4) * (n)))) >> (8 + 4 * (n))) This warning could be fixed with either a temporary variable or longer line WARNING:MULTILINE_DEREFERENCE: Avoid multiple line dereference - prefer 'rte_eth_devices[rxq->attr.port_id].data->rx_mbuf_alloc_failed' #63: FILE: drivers/net/rnp/rnp_rxtx.c:849: + rte_eth_devices[rxq->attr.port_id].data-> + rx_mbuf_alloc_failed++; ✔ Run check-git-log ✔ Run check-symbol-maps.sh ✔ Run check-doc-vs-code ✔ Run check-spdk-tag Builds ✔ Normal Gcc build ✔ Use latest experimental Gcc 15 to catch new warnings ✔ Clang build using current version (clang-19) ✔ Build for 32 bit x86 ✔ Doc build; works but needs editing The wording in rnp.rst is not grammatically correct. Missing articles and some punctuation issues. Need to mention big-endian limitations. Windows limitation not mentioned. Suggest using svg diagram (looks better) rather than ASCII art. ✘ Check feature matrix versus code The driver doc says it supports queue start/stop but no rx_queue_start or tx_queue_start operations are listed. ✔ Debug build ✔ Enable asserts ✔ Test meson builds Experimental builds: Enable address sanitizer ✘ Enable extra warnings (edit meson.build) for -Wvla, -Wformat-truncation, -Waddress-of-packed-member The issue here is that name is limited to RTE_ETH_NAME_MAX_LEN and hw->device_name is RTE_DEV_NAME_MAX_LEN is also 64 so adding a suffix could potentially overflow the name. One way to avoid compiler warning is a a check on length of hw->device_name in this code like: if (strlen(hw->device_name) + 4 > sizeof(name)) return -EINVAL ../drivers/net/rnp/rnp_ethdev.c: In function ‘rnp_eth_dev_init’: ../drivers/net/rnp/rnp_ethdev.c:1705:45: warning: ‘%d’ directive output may be truncated writing 1 byte into a region of size between 0 and 63 [-Wformat-truncation=] 1705 | "%s_%d", hw->device_name, p_id); | ^~ ../drivers/net/rnp/rnp_ethdev.c:1705:41: note: directive argument in the range [1, 4] 1705 | "%s_%d", hw->device_name, p_id); | ^~~~~~~ ../drivers/net/rnp/rnp_ethdev.c:1704:25: note: ‘snprintf’ output between 3 and 66 bytes into a destination of size 64 1704 | snprintf(name, sizeof(name), | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1705 | "%s_%d", hw->device_name, p_id); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Look for anti-patterns: ✔ Driver must not disable warnings with compiler flags or pragma's ✔ Driver must not use thread and signal ✔ Apply coccinelle scripts; look that for example null free checks ✔ Review use of memcpy/rte_memcpy ✔ Review use of malloc ✔ Review locking ✘ Review use of memset Use of memset before snprintf is unnecessary. ✘ Handling of deferred start If driver supports deferred start then it has to have a queue start/stop operation. Otherwise ignore the flag. ✘ Review whitespace Unneeded indents in meson.build sources = files( 'rnp_ethdev.c', ... vs. sources = files( 'ixgbe_82599_bypass.c', ... Other 1. The xstat names are long and have spaces in them. I don't see this in other drivers. Suggest using similar naming pattern as virtio 2. Handling of queue counters This code would look much cleaner with temp variable. No need for useless init of i. and it is unsigned. Don't need to cast void * pointer diff --git a/drivers/net/rnp/rnp_ethdev.c b/drivers/net/rnp/rnp_ethdev.c index a295982780..1305d7e0dc 100644 --- a/drivers/net/rnp/rnp_ethdev.c +++ b/drivers/net/rnp/rnp_ethdev.c @@ -1254,48 +1254,36 @@ rnp_dev_stats_get(struct rte_eth_dev *dev, struct rnp_eth_port *port = RNP_DEV_TO_PORT(dev); struct rnp_hw_eth_stats *eth_stats = &port->eth_stats; struct rte_eth_dev_data *data = dev->data; - int i = 0; + uint16_t i; PMD_INIT_FUNC_TRACE(); rnp_get_hw_stats(dev); + for (i = 0; i < data->nb_rx_queues; i++) { - if (!data->rx_queues[i]) + const struct rnp_rx_queue *rxq = dev->data->rx_queues[i]; + if (!rxq) continue; + + stats->ipackets += rxq->stats.ipackets; + stats->ibytes += rxq->stats.ibytes; if (i < RTE_ETHDEV_QUEUE_STAT_CNTRS) { - stats->q_ipackets[i] = ((struct rnp_rx_queue **) - (data->rx_queues))[i]->stats.ipackets; - stats->q_ibytes[i] = ((struct rnp_rx_queue **) - (data->rx_queues))[i]->stats.ibytes; - stats->ipackets += stats->q_ipackets[i]; - stats->ibytes += stats->q_ibytes[i]; - } else { - stats->ipackets += ((struct rnp_rx_queue **) - (data->rx_queues))[i]->stats.ipackets; - stats->ibytes += ((struct rnp_rx_queue **) - (data->rx_queues))[i]->stats.ibytes; + stats->q_ipackets[i] = rxq->stats.ipackets; + stats->q_ibytes[i] = rxq->stats.ibytes; } } for (i = 0; i < data->nb_tx_queues; i++) { - if (!data->tx_queues[i]) + const struct rnp_tx_queue *txq = dev->data->tx_queues[i]; + if (!txq) continue; - if (i < RTE_ETHDEV_QUEUE_STAT_CNTRS) { - stats->q_opackets[i] = ((struct rnp_tx_queue **) - (data->tx_queues))[i]->stats.opackets; - stats->q_obytes[i] = ((struct rnp_tx_queue **) - (data->tx_queues))[i]->stats.obytes; - stats->oerrors += ((struct rnp_tx_queue **) - (data->tx_queues))[i]->stats.errors; - stats->opackets += stats->q_opackets[i]; - stats->obytes += stats->q_obytes[i]; - } else { - stats->opackets += ((struct rnp_tx_queue **) - (data->tx_queues))[i]->stats.opackets; - stats->obytes += ((struct rnp_tx_queue **) - (data->tx_queues))[i]->stats.obytes; - stats->oerrors += ((struct rnp_tx_queue **) - (data->tx_queues))[i]->stats.errors; + stats->opackets += txq->stats.opackets; + stats->obytes += txq->stats.obytes; + stats->oerrors += txq->stats.errors; + + if (i < RTE_ETHDEV_QUEUE_STAT_CNTRS) { + stats->q_opackets[i] = txq->stats.opackets; + stats->q_obytes[i] = txq->stats.obytes; } } stats->imissed = eth_stats->rx_trans_drop + eth_stats->rx_trunc_drop; @@ -1308,22 +1296,18 @@ rnp_dev_stats_reset(struct rte_eth_dev *dev) { struct rnp_eth_port *port = RNP_DEV_TO_PORT(dev); struct rnp_hw_eth_stats *eth_stats = &port->eth_stats; - struct rnp_rx_queue *rxq; - struct rnp_tx_queue *txq; uint16_t idx; PMD_INIT_FUNC_TRACE(); memset(eth_stats, 0, sizeof(*eth_stats)); for (idx = 0; idx < dev->data->nb_rx_queues; idx++) { - rxq = ((struct rnp_rx_queue **) - (dev->data->rx_queues))[idx]; + struct rnp_rx_queue *rxq = dev->data->rx_queues[i]; if (!rxq) continue; memset(&rxq->stats, 0, sizeof(struct rnp_queue_stats)); } for (idx = 0; idx < dev->data->nb_tx_queues; idx++) { - txq = ((struct rnp_tx_queue **) - (dev->data->tx_queues))[idx]; + struct rnp_tx_queue *txq = dev->data->tx_queues[idx]; if (!txq) continue; memset(&txq->stats, 0, sizeof(struct rnp_queue_stats));
I ran this driver through the evaluation copy of PVS studio and it reported many warnings you should address. Not all of them are valid, the tool seems to have a lot of false positives. MESSAGES LocationCodeMessage Fails/Info rnp_mac.c (258) V610 <https://pvs-studio.com/en/docs/warnings/v610/> Undefined behavior. Check the shift operator '>>'. The right operand ('....' = [0x0..0xFFFFFFFFFFFFFFFF]) is greater than or equal to the length in bits of the promoted left operand. rnp_mac.c (81) V1037 <https://pvs-studio.com/en/docs/warnings/v1037/> Two or more case-branches perform the same actions. Check lines: 81, 84 rnp_mac.c (205) V525 <https://pvs-studio.com/en/docs/warnings/v525/> The code contains the collection of similar blocks. Check items 'flt_reg', 'vlan_reg', 'vlan_reg' in lines 205, 206, 207. rnp_mac.c (209) V525 <https://pvs-studio.com/en/docs/warnings/v525/> The code contains the collection of similar blocks. Check items 'flt_reg', 'vlan_reg', 'vlan_reg' in lines 209, 210, 211. rnp_mbx.c (398) V547 <https://pvs-studio.com/en/docs/warnings/v547/> Expression '!ret_val' is always true. rnp_mbx_fw.c (259) V530 <https://pvs-studio.com/en/docs/warnings/v530/> The return value of function 'rte_fls_u32' is required to be utilized. rnp_mbx_fw.c (256) V519 <https://pvs-studio.com/en/docs/warnings/v519/> The 'is_sgmii_bits' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 255, 256. rnp_mbx_fw.c (177) V1086 <https://pvs-studio.com/en/docs/warnings/v1086/> A call of the 'memcpy' function will lead to underflow of the buffer 'cookie->priv'. rnp_mbx_fw.c (332) V1086 <https://pvs-studio.com/en/docs/warnings/v1086/> A call of the 'memcpy' function will lead to underflow of the buffer 'mac->addrs[nr_lane].mac'. rnp_mbx_fw.c (271) V576 <https://pvs-studio.com/en/docs/warnings/v576/> Incorrect format. Consider checking the 15th actual argument of the 'rte_log' function. The SIGNED integer type argument is expected. rnp_mbx_fw.c (389) V1048 <https://pvs-studio.com/en/docs/warnings/v1048/> The 'phy_meta->link_autoneg' variable was assigned the same value. rnp_osdep.h (126) V576 <https://pvs-studio.com/en/docs/warnings/v576/> Incorrect format. Consider checking the fourth actual argument of the 'snprintf' function. The memsize type argument is expected. rnp_osdep.h (32) V677 <https://pvs-studio.com/en/docs/warnings/v677/> Custom declaration of a standard 'dma_addr_t' type. The declaration from system header files should be used instead. rnp_ethdev.c (750) V530 <https://pvs-studio.com/en/docs/warnings/v530/> The return value of function 'rte_fls_u32' is required to be utilized. rnp_ethdev.c (1386) V519 <https://pvs-studio.com/en/docs/warnings/v519/> The 'reg' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 1381, 1386. rnp_ethdev.c (1003) V547 <https://pvs-studio.com/en/docs/warnings/v547/> Expression 'frame_size < 64' is always false. rnp_ethdev.c (1003) V649 <https://pvs-studio.com/en/docs/warnings/v649/> There are two 'if' statements with identical conditional expressions. The first 'if' statement contains function return. This means that the second 'if' statement is senseless. Check lines: 988, 1003. rnp_ethdev.c (583) V684 <https://pvs-studio.com/en/docs/warnings/v684/> A value of the variable 'cvlan_ctrl' is not modified. Consider inspecting the expression. It is possible that '1' should be present instead of '0'. rnp_ethdev.c (598) V684 <https://pvs-studio.com/en/docs/warnings/v684/> A value of the variable 'svlan_ctrl' is not modified. Consider inspecting the expression. It is possible that '1' should be present instead of '0'. rnp_ethdev.c (618) V684 <https://pvs-studio.com/en/docs/warnings/v684/> A value of the variable 'ctrl' is not modified. Consider inspecting the expression. It is possible that '1' should be present instead of '0'. rnp_ethdev.c (106) V1032 <https://pvs-studio.com/en/docs/warnings/v1032/> The pointer 'msgbuf' is cast to a more strictly aligned pointer type. rnp_ethdev.c (254) V1051 <https://pvs-studio.com/en/docs/warnings/v1051/> Consider checking for misprints. It's possible that the 'dma_ctrl' should be checked here. rnp_ethdev.c (1348) V525 <https://pvs-studio.com/en/docs/warnings/v525/> The code contains the collection of similar blocks. Check items 'mac_stats', 'mac_stats', 'eth_stats' in lines 1348, 1354, 1360. rnp_ethdev.c (1444) V576 <https://pvs-studio.com/en/docs/warnings/v576/> Incorrect format. Consider checking the fifth actual argument of the 'rte_log' function. The SIGNED integer type argument is expected. rnp_ethdev.c (1458) V576 <https://pvs-studio.com/en/docs/warnings/v576/> Incorrect format. Consider checking the fifth actual argument of the 'rte_log' function. The SIGNED integer type argument is expected. rnp_ethdev.c (110) V641 <https://pvs-studio.com/en/docs/warnings/v641/> The size of the 'msgbuf' buffer is not a multiple of the element size of the type 'struct rnp_mbx_fw_cmd_reply'. rnp_ethdev.c (113) V641 <https://pvs-studio.com/en/docs/warnings/v641/> The size of the 'msgbuf' buffer is not a multiple of the element size of the type 'struct rnp_mbx_fw_cmd_req'. rnp_ethdev.c (718) V1027 <https://pvs-studio.com/en/docs/warnings/v1027/> Pointer to an object of the 'rte_device' class is cast to unrelated 'rte_pci_device' class. rnp_ethdev.c (1637) V1027 <https://pvs-studio.com/en/docs/warnings/v1027/> Pointer to an object of the 'rte_device' class is cast to unrelated 'rte_pci_device' class. rnp_ethdev.c (1766) V1027 <https://pvs-studio.com/en/docs/warnings/v1027/> Pointer to an object of the 'rte_device' class is cast to unrelated 'rte_pci_device' class. rnp_link.c (192) V519 <https://pvs-studio.com/en/docs/warnings/v519/> The 'link.link_autoneg' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 186, 192. rnp_link.c (359) V547 <https://pvs-studio.com/en/docs/warnings/v547/> Expression '!port->attr.link_ready' is always true. rnp_link.c (113) V1048 <https://pvs-studio.com/en/docs/warnings/v1048/> The 'lane' variable was assigned the same value. rnp_rss.c (218) V547 <https://pvs-studio.com/en/docs/warnings/v547/> Expression 'rss_hash_level == (2UL << 50)' is always false. rnp_rxtx.c (1409) V684 <https://pvs-studio.com/en/docs/warnings/v684/> A value of the variable 'txbd->d.cmd' is not modified. Consider inspecting the expression. It is possible that '1' should be present instead of '0'. rnp_rxtx.c (253) V576 <https://pvs-studio.com/en/docs/warnings/v576/> Incorrect format. Consider checking the tenth actual argument of the 'rte_log' function. The SIGNED integer type argument is expected. rnp_rxtx.c (461) V576 <https://pvs-studio.com/en/docs/warnings/v576/> Incorrect format. Consider checking the tenth actual argument of the 'rte_log' function. The SIGNED integer type argument is expected. rnp_rxtx.c (1224) V1027 <https://pvs-studio.com/en/docs/warnings/v1027/> Pointer to an object of the 'rte_ether_hdr' class is cast to unrelated 'rte_vlan_hdr' class. On Wed, Feb 12, 2025 at 7:34 AM Wenbo Cao <caowenbo@mucse.com> wrote: > For This patchset just to support the basic chip init work > and user can just found the eth_dev, but can't control more. > For Now just support 2*10g nic,the chip can support > 2*10g,4*10g,4*1g,8*1g,8*10g. > The Feature rx side can support rx-cksum-offload,rss,vlan-filter > flow_clow,uncast_filter,mcast_filter,1588,Jumbo-frame > The Feature tx side can support tx-cksum-offload,tso,vxlan-tso > flow director base on ntuple pattern of tcp/udp/ip/ eth_hdr->type > for sriov is also support. > > Because of the chip design defect, for multiple-port mode > one pci-bdf will have multiple-port (max can have four ports) > so this code must be care of one bdf init multiple-port. > v12: > * fixed __rte_packed __deprecated__ compile issue. > > v11: > * fixed array-bounds issue when used rte_memcpy src addr is > * not enough to hold align dst. > * improve efficient_code advised by Stephen > > v10: > * fixed mingw windows meson issue > * rnp not support windows for now. > > v9: > * fixed commit log format check by devtools. > * fixed code compile issue. > > v8: > * fixed codespell issue. > * fixed MAINTAINERS file > > v7: > * add support nic basic feature such as rss vlan strip/filter, > * mtu-change recv/send scater-recv/mutltiple-send. > * fixed code rationality, advised by Ferruh Yigit. > v6: > * fixed the doc(rst) format problem advise by Thomas Monjalon > > v5: > * fixed the symbol name require by the style documentation > > v4: > * one patch has been forgot to upload :( > > v3: > * fixed http://dpdk.org/patch/129830 FreeBSD 13 compile Issue > * change iobar type to void suggest by Stephen Hemminger > * add KMOD_DEP support for vfio-pci > * change run-cmd argument parse check for invalid extra_args > > v2: > * fixed MAINTAIN maillist fullname format > * fixed driver/net/meson the order issue of new driver to driver list > * improve virtual point function usage suggest by Stephen Hemminger > > Wenbo Cao (28): > net/rnp: add skeleton > net/rnp: add ethdev probe and remove > net/rnp: add log > net/rnp: support mailbox basic operate > net/rnp: add device init and uninit > net/rnp: add get device information operation > net/rnp: add support MAC promisc mode > net/rnp: add queue setup and release operations > net/rnp: add queue stop and start operations > net/rnp: add support device start stop operations > net/rnp: add RSS support operations > net/rnp: add support link update operations > net/rnp: add support link setup operations > net/rnp: add Rx burst simple support > net/rnp: add Tx burst simple support > net/rnp: add MTU set operation > net/rnp: add Rx scatter segment version > net/rnp: add Tx multiple segment version > net/rnp: add support basic stats operation > net/rnp: add support xstats operation > net/rnp: add unicast MAC filter operation > net/rnp: add supported packet types > net/rnp: add support Rx checksum offload > net/rnp: add support Tx TSO offload > net/rnp: support VLAN offloads > net/rnp: add support VLAN filters operations > net/rnp: add queue info operation > net/rnp: support Rx/Tx burst mode info > > .mailmap | 1 + > MAINTAINERS | 6 + > doc/guides/nics/features/rnp.ini | 33 + > doc/guides/nics/index.rst | 1 + > doc/guides/nics/rnp.rst | 101 ++ > drivers/net/meson.build | 1 + > drivers/net/rnp/base/meson.build | 17 + > drivers/net/rnp/base/rnp_bdq_if.c | 398 ++++++ > drivers/net/rnp/base/rnp_bdq_if.h | 154 +++ > drivers/net/rnp/base/rnp_bitrev.h | 64 + > drivers/net/rnp/base/rnp_common.c | 103 ++ > drivers/net/rnp/base/rnp_common.h | 17 + > drivers/net/rnp/base/rnp_crc32.c | 37 + > drivers/net/rnp/base/rnp_crc32.h | 10 + > drivers/net/rnp/base/rnp_dma_regs.h | 68 + > drivers/net/rnp/base/rnp_eth_regs.h | 90 ++ > drivers/net/rnp/base/rnp_fw_cmd.c | 162 +++ > drivers/net/rnp/base/rnp_fw_cmd.h | 357 ++++++ > drivers/net/rnp/base/rnp_hw.h | 136 ++ > drivers/net/rnp/base/rnp_mac.c | 366 ++++++ > drivers/net/rnp/base/rnp_mac.h | 34 + > drivers/net/rnp/base/rnp_mac_regs.h | 207 +++ > drivers/net/rnp/base/rnp_mbx.c | 512 ++++++++ > drivers/net/rnp/base/rnp_mbx.h | 58 + > drivers/net/rnp/base/rnp_mbx_fw.c | 499 ++++++++ > drivers/net/rnp/base/rnp_mbx_fw.h | 24 + > drivers/net/rnp/base/rnp_osdep.h | 169 +++ > drivers/net/rnp/meson.build | 27 + > drivers/net/rnp/rnp.h | 258 ++++ > drivers/net/rnp/rnp_ethdev.c | 1841 +++++++++++++++++++++++++++ > drivers/net/rnp/rnp_link.c | 439 +++++++ > drivers/net/rnp/rnp_link.h | 38 + > drivers/net/rnp/rnp_logs.h | 36 + > drivers/net/rnp/rnp_rss.c | 367 ++++++ > drivers/net/rnp/rnp_rss.h | 43 + > drivers/net/rnp/rnp_rxtx.c | 1815 ++++++++++++++++++++++++++ > drivers/net/rnp/rnp_rxtx.h | 162 +++ > 37 files changed, 8651 insertions(+) > create mode 100644 doc/guides/nics/features/rnp.ini > create mode 100644 doc/guides/nics/rnp.rst > create mode 100644 drivers/net/rnp/base/meson.build > create mode 100644 drivers/net/rnp/base/rnp_bdq_if.c > create mode 100644 drivers/net/rnp/base/rnp_bdq_if.h > create mode 100644 drivers/net/rnp/base/rnp_bitrev.h > create mode 100644 drivers/net/rnp/base/rnp_common.c > create mode 100644 drivers/net/rnp/base/rnp_common.h > create mode 100644 drivers/net/rnp/base/rnp_crc32.c > create mode 100644 drivers/net/rnp/base/rnp_crc32.h > create mode 100644 drivers/net/rnp/base/rnp_dma_regs.h > create mode 100644 drivers/net/rnp/base/rnp_eth_regs.h > create mode 100644 drivers/net/rnp/base/rnp_fw_cmd.c > create mode 100644 drivers/net/rnp/base/rnp_fw_cmd.h > create mode 100644 drivers/net/rnp/base/rnp_hw.h > create mode 100644 drivers/net/rnp/base/rnp_mac.c > create mode 100644 drivers/net/rnp/base/rnp_mac.h > create mode 100644 drivers/net/rnp/base/rnp_mac_regs.h > create mode 100644 drivers/net/rnp/base/rnp_mbx.c > create mode 100644 drivers/net/rnp/base/rnp_mbx.h > create mode 100644 drivers/net/rnp/base/rnp_mbx_fw.c > create mode 100644 drivers/net/rnp/base/rnp_mbx_fw.h > create mode 100644 drivers/net/rnp/base/rnp_osdep.h > create mode 100644 drivers/net/rnp/meson.build > create mode 100644 drivers/net/rnp/rnp.h > create mode 100644 drivers/net/rnp/rnp_ethdev.c > create mode 100644 drivers/net/rnp/rnp_link.c > create mode 100644 drivers/net/rnp/rnp_link.h > create mode 100644 drivers/net/rnp/rnp_logs.h > create mode 100644 drivers/net/rnp/rnp_rss.c > create mode 100644 drivers/net/rnp/rnp_rss.h > create mode 100644 drivers/net/rnp/rnp_rxtx.c > create mode 100644 drivers/net/rnp/rnp_rxtx.h > > -- > 2.48.1 > >