From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9E6D3FF8873 for ; Thu, 30 Apr 2026 17:02:48 +0000 (UTC) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AAC5140647; Thu, 30 Apr 2026 19:02:47 +0200 (CEST) Received: from mail-dy1-f170.google.com (mail-dy1-f170.google.com [74.125.82.170]) by mails.dpdk.org (Postfix) with ESMTP id 25117400D6 for ; Thu, 30 Apr 2026 19:02:47 +0200 (CEST) Received: by mail-dy1-f170.google.com with SMTP id 5a478bee46e88-2d8fa0fadfeso745600eec.1 for ; Thu, 30 Apr 2026 10:02:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20251104.gappssmtp.com; s=20251104; t=1777568566; x=1778173366; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=7nz2R4ZretarJ9Ag8+0WMCLkfMAEwMMZdkFxdCcSGDQ=; b=FIS0WIG30PiLLh2dRizejaoR7Ih0B/r7kJsk/DGM9iUAZ3oIs25A8NdmvOyeeLIQVv C4C2KwEzjxWieT2QBy0LhcBQu9jwKUowaap8hOavpbjnGw/hiOJ8jbZIjbtQVrK2o6qM WahyWj39f+9tWEXtA3krZc29rwM1+oyFLcCJrLOtozHnaC25PMc6F/MgF3GWp8J2Px7s F7Cj1IYywM5YpQ162/n2blpciVypHzyavQj4Koe98iIu841AETwLfUZEvymoqlQq4QQn pUgwCEwerFAT51fMAXQMnS7OAT9vthF0PspC9C4drhJB7X7nb6MgPKL6aK6rt6V3PU8u +ksA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777568566; x=1778173366; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=7nz2R4ZretarJ9Ag8+0WMCLkfMAEwMMZdkFxdCcSGDQ=; b=kagfpi9Gbv1W7XiyIkS/AmbRRMywnjazTCikdojPJTmsM2/C3I6RIyDDAbUiQcWvXH URNX5kRJywwOQkeyFVGyDmPcK1uXtbRdFS3i/6c5R8xFiGKL+Gze70wGpV+DqtdAii7r /4QhtVzrTvGflXWx+lFq+k1YyRbyOIeKnsNkdCvvtHV6E7ECelGUQd/CH9FSs9w9vx/j PJ3lTn3pAMDiFoPWJke1ZPzLgRsssb9+S+6V92BSJjlx3/8sF3AtI+jxreFnoirZYfhl myfjOyMr8h6o09kazA60rp3GDIu3zRjPn3PjPJ9+6gptqB8d31RjRFyxYCTWW7F8y+j7 Q0HA== X-Gm-Message-State: AOJu0Ywm2B6Hbb9ce42P6gV827OwSNFSAUruuIo0+YgWzV9ZHCrLSN+/ tPGzeRWATwLyp6+DysfhvrUvgoSJ3Ct5GcqW+034Y3fWIDWfScb39Q93/Ec7M3Nuhev76xTIC4m WCN6v X-Gm-Gg: AeBDietUjdjxrWbFJKQ5YzkjUu1nzd7ziwf3mCzoOml//hJ5CPOtJIpADjy6dpMrkiG 5D/rukoafM6XfQBf5zGhR3A52jpkxvgbw6xURkZIAY65G1Tf2DbsJ5gQ5oWzEaDR/ho8ceHhS/r fqfpO/ZIKIMT4UHklqXwBy215aJXeNuRvTAPrwGFwyyqAlc2NsKd7PmLu2E/jMGad8/vMyKAzyw wOi/CC5R1qb5T7fXfC1Gwa7dDVrSBZBWSaKCIaQEkNe2Cg65w/WOhwl626LCuWKe9YO04OubrPk SBdlxg6VHJQkfQYQw6HSB7LktmMx6kxLwOCv8BNIbgGUxP3UXgyyYDeAlUHB/qHI5MEH+jVFCcP HMbQKlFbtYeRCnrHygD23/VFGLnKyDwVbKifkvFRV13Iq8M7yfdMhjz2ivOGuY47jQtgAmv3h56 DExnp76wEAoKSuSg9L9z/oDpwHCI/eE60xamcpr2rh0Pa7Tw== X-Received: by 2002:a05:7300:d70d:b0:2be:9c19:b34b with SMTP id 5a478bee46e88-2ed4d514c35mr1553016eec.4.1777568565405; Thu, 30 Apr 2026 10:02:45 -0700 (PDT) Received: from phoenix.local ([104.202.41.210]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2ee393578f1sm740079eec.13.2026.04.30.10.02.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Apr 2026 10:02:44 -0700 (PDT) Date: Thu, 30 Apr 2026 10:02:42 -0700 From: Stephen Hemminger To: liujie5@linkdatatechnology.com Cc: dev@dpdk.org Subject: Re: [PATCH v3 0/9] net/sxe2: added Linkdata sxe2 ethernet driver Message-ID: <20260430100242.439b4306@phoenix.local> In-Reply-To: <20260430101819.4094628-1-liujie5@linkdatatechnology.com> References: <20260430092231.4068642-10-liujie5@linkdatatechnology.com> <20260430101819.4094628-1-liujie5@linkdatatechnology.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Thu, 30 Apr 2026 18:18:08 +0800 liujie5@linkdatatechnology.com wrote: > From: Jie Liu >=20 > This patch set implements core functionality for the SXE PMD,=20 > which is a Linkdata sxe2 ethernet driver. >=20 > V3: Addressed AI comments >=20 > Jie Liu (9): > mailmap: add Jie Liu > doc: add sxe2 guide and release notes > drivers: add sxe2 basic structures > common/sxe2: add base driver skeleton > drivers: add base driver probe skeleton > drivers: support PCI BAR mapping > common/sxe2: add ioctl interface for DMA map and unmap > net/sxe2: support queue setup and control > net/sxe2: add data path for Rx and Tx >=20 > .mailmap | 1 + > doc/guides/nics/features/sxe2.ini | 11 + > doc/guides/nics/index.rst | 1 + > doc/guides/nics/sxe2.rst | 23 + > doc/guides/rel_notes/release_26_07.rst | 3 + > drivers/common/sxe2/meson.build | 15 + > drivers/common/sxe2/sxe2_common.c | 684 +++++++++++++++ > drivers/common/sxe2/sxe2_common.h | 86 ++ > drivers/common/sxe2/sxe2_common_log.c | 75 ++ > drivers/common/sxe2/sxe2_common_log.h | 263 ++++++ > drivers/common/sxe2/sxe2_errno.h | 110 +++ > drivers/common/sxe2/sxe2_host_regs.h | 707 +++++++++++++++ > drivers/common/sxe2/sxe2_internal_ver.h | 33 + > drivers/common/sxe2/sxe2_ioctl_chnl.c | 326 +++++++ > drivers/common/sxe2/sxe2_ioctl_chnl.h | 141 +++ > drivers/common/sxe2/sxe2_ioctl_chnl_func.h | 63 ++ > drivers/common/sxe2/sxe2_osal.h | 582 ++++++++++++ > drivers/common/sxe2/sxe2_type.h | 64 ++ > drivers/meson.build | 1 + > drivers/net/meson.build | 1 + > drivers/net/sxe2/meson.build | 26 + > drivers/net/sxe2/sxe2_cmd_chnl.c | 319 +++++++ > drivers/net/sxe2/sxe2_cmd_chnl.h | 33 + > drivers/net/sxe2/sxe2_drv_cmd.h | 398 +++++++++ > drivers/net/sxe2/sxe2_ethdev.c | 975 +++++++++++++++++++++ > drivers/net/sxe2/sxe2_ethdev.h | 316 +++++++ > drivers/net/sxe2/sxe2_irq.h | 49 ++ > drivers/net/sxe2/sxe2_queue.c | 39 + > drivers/net/sxe2/sxe2_queue.h | 227 +++++ > drivers/net/sxe2/sxe2_rx.c | 579 ++++++++++++ > drivers/net/sxe2/sxe2_rx.h | 34 + > drivers/net/sxe2/sxe2_tx.c | 447 ++++++++++ > drivers/net/sxe2/sxe2_tx.h | 32 + > drivers/net/sxe2/sxe2_txrx.c | 249 ++++++ > drivers/net/sxe2/sxe2_txrx.h | 21 + > drivers/net/sxe2/sxe2_txrx_common.h | 541 ++++++++++++ > drivers/net/sxe2/sxe2_txrx_poll.c | 782 +++++++++++++++++ > drivers/net/sxe2/sxe2_txrx_poll.h | 16 + > drivers/net/sxe2/sxe2_vsi.c | 211 +++++ > drivers/net/sxe2/sxe2_vsi.h | 205 +++++ > 40 files changed, 8689 insertions(+) > create mode 100644 doc/guides/nics/features/sxe2.ini > create mode 100644 doc/guides/nics/sxe2.rst > create mode 100644 drivers/common/sxe2/meson.build > create mode 100644 drivers/common/sxe2/sxe2_common.c > create mode 100644 drivers/common/sxe2/sxe2_common.h > create mode 100644 drivers/common/sxe2/sxe2_common_log.c > create mode 100644 drivers/common/sxe2/sxe2_common_log.h > create mode 100644 drivers/common/sxe2/sxe2_errno.h > create mode 100644 drivers/common/sxe2/sxe2_host_regs.h > create mode 100644 drivers/common/sxe2/sxe2_internal_ver.h > create mode 100644 drivers/common/sxe2/sxe2_ioctl_chnl.c > create mode 100644 drivers/common/sxe2/sxe2_ioctl_chnl.h > create mode 100644 drivers/common/sxe2/sxe2_ioctl_chnl_func.h > create mode 100644 drivers/common/sxe2/sxe2_osal.h > create mode 100644 drivers/common/sxe2/sxe2_type.h > create mode 100644 drivers/net/sxe2/meson.build > create mode 100644 drivers/net/sxe2/sxe2_cmd_chnl.c > create mode 100644 drivers/net/sxe2/sxe2_cmd_chnl.h > create mode 100644 drivers/net/sxe2/sxe2_drv_cmd.h > create mode 100644 drivers/net/sxe2/sxe2_ethdev.c > create mode 100644 drivers/net/sxe2/sxe2_ethdev.h > create mode 100644 drivers/net/sxe2/sxe2_irq.h > create mode 100644 drivers/net/sxe2/sxe2_queue.c > create mode 100644 drivers/net/sxe2/sxe2_queue.h > create mode 100644 drivers/net/sxe2/sxe2_rx.c > create mode 100644 drivers/net/sxe2/sxe2_rx.h > create mode 100644 drivers/net/sxe2/sxe2_tx.c > create mode 100644 drivers/net/sxe2/sxe2_tx.h > create mode 100644 drivers/net/sxe2/sxe2_txrx.c > create mode 100644 drivers/net/sxe2/sxe2_txrx.h > create mode 100644 drivers/net/sxe2/sxe2_txrx_common.h > create mode 100644 drivers/net/sxe2/sxe2_txrx_poll.c > create mode 100644 drivers/net/sxe2/sxe2_txrx_poll.h > create mode 100644 drivers/net/sxe2/sxe2_vsi.c > create mode 100644 drivers/net/sxe2/sxe2_vsi.h >=20 Since this is a large patch series turned to command line use of AGENTS.md for AI review and cot this nice summary. Lots to fix here. =E2=97=8F Deep Dive Analysis of bundle-1856.mbox DPDK Patch Series Executive Summary This patch series introduces the SXE2 Poll Mode Driver (PMD) for DPDK, su= bmitted by Jie Liu from Linkdata Technology (formerly Wuxi Stars Micro System Technologies Co., Ltd.). The driver provides support f= or 10/25/50/100/200 Gbps Network Adapters with embedded switch functionality, Physical Functions (PF), and SR-IOV Virtual Functions (VF= ). --- Patch Series Overview The series consists of 9 patches (v3 revision): 1. Patch 1/9: Mailmap update - adds contributor entry 2. Patch 2/9: Documentation - guide and release notes for SXE2 PMD 3. Patch 3/9: Basic structures - common library infrastructure (1959 line= s) 4. Patch 4/9: Base driver skeleton - core functionality 5. Patch 5/9: Probe skeleton - PCI device initialization 6. Patch 6/9: PCI BAR mapping support 7. Patch 7/9: DMA mapping via ioctl interface 8. Patch 8/9: Queue setup and control (1161 lines) 9. Patch 9/9: Data path implementation for Rx/Tx (1076 lines) --- Technical Architecture Analysis 1. Driver Structure - Common library (drivers/common/sxe2/) - shared functionality - Network driver (drivers/net/sxe2/) - ethernet-specific implementation - Uses DPDK's standard PMD framework with proper eth_dev_ops callbacks 2. Key Components - OSAL (OS Abstraction Layer): Platform-independent interface - Logging system: Dual logging to console and file (/var/log/sxe2pmd.log.= *) - Command channel: Communication with hardware via ioctl - DMA mapping: User-space to device memory mapping 3. Hardware Interface - Supports multiple speeds: 10/25/50/100/200 Gbps - Virtual memory address handling for security - Embedded switch support - SR-IOV capability --- Code Quality Issues Identified Critical Issues 1. License Header Inconsistency - Line 355: # Copyright (c) 2023 Corigine, Inc. in meson.build - All other files show 2025 Wuxi/Linkdata copyright - Impact: Legal/compliance issue - appears to be copy-pasted from anoth= er driver 2. Custom Type Definitions - Lines 2327-2339: Defines custom types (u8, u16, u32, u64, s8, etc.) - Problem: Goes against DPDK coding standards which prefer standard typ= es - Recommendation: Use uint8_t, uint16_t, etc. directly 3. Debug Logging to File System - Lines 386-427: Creates log files in /var/log/ during debug mode - Issues: - No permission checking - No disk space validation - Could fail in containerized environments - Security concern: world-readable logs Moderate Issues 4. Excessive Macro Complexity - Lines 514-652: Complex nested logging macros - Multiple levels of macro expansion - Makes debugging difficult 5. Missing Error Handling - Line 421: goto l_end pattern used but incomplete error paths - Some functions don't check all allocation failures 6. Documentation Quality - Line 191: Missing newline at end of sxe2.ini file - Minimal driver documentation in sxe2.rst - No performance tuning guidance Minor Issues 7. Code Style - Inconsistent use of tabs vs spaces - Non-standard label naming (l_end: instead of descriptive names) - Mixed naming conventions (snake_case and camelCase) 8. Thread ID Portability - Lines 495-498: Windows/Linux compatibility code seems incomplete - pthread_self() cast to uint64_t may cause issues on some platforms --- Security Considerations 1. DMA Mapping Interface - Patch 7/9 implements ioctl-based DMA mapping - Positive: Includes proper IOVA mode checking - Concern: No apparent validation of user-provided addresses/sizes 2. Memory Safety - Uses rte_memcpy and safe string functions - No obvious buffer overflows detected 3. Virtual Memory Handling - Claims to only work with virtual addresses for security - Good design choice for isolation --- Performance Considerations 1. Data Path - Patch 9/9 mentions "loop unrolling and prefetching" - Standard PMD burst interface implementation - No vector instructions optimization visible 2. Queue Management - Proper separation of Rx/Tx queue setup - Hardware tail pointer updates for efficiency --- Recommendations Must Fix Before Merge 1. Remove or correct the Corigine copyright in meson.build 2. Replace custom type definitions with standard DPDK types 3. Add proper error handling for file operations 4. Validate DMA mapping parameters Should Improve 1. Enhance documentation with usage examples 2. Simplify logging macro hierarchy 3. Add performance tuning guide 4. Include test cases Nice to Have 1. Vector PMD implementation for better performance 2. More comprehensive feature set in sxe2.ini 3. Debugging/troubleshooting guide --- Overall Assessment The SXE2 PMD shows a structured approach to DPDK driver development with = proper separation of concerns between common and network-specific code. However, several code quality and compliance issue= s need addressing before the patch series is ready for merge. Rating: 6/10 - Functional but needs significant cleanup