<div dir="auto">Please put this in a bugzilla report.<div dir="auto"><br></div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Mon, Oct 6, 2025, 12:00 bloodyevil <<a href="mailto:bloodyevil@163.com">bloodyevil@163.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="line-height:1.7;color:rgb(0,0,0);font-size:14px;font-family:Arial"><div style="margin:0px"><p style="white-space:normal;color:rgb(0,0,0);font-family:Arial;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial;word-break:break-word"><strong style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">Dear DPDK Development Team and Chelsio Support Team,</span></strong></p><p style="white-space:normal;color:rgb(0,0,0);font-family:Arial;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial;word-break:break-word"><span style="white-space:normal;word-break:break-word">We are writing to report two severe, fundamental issues we've encountered while using Chelsio T5/T6 series NICs (with the<span> </span></span><code style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">cxgbe</span></code><span style="white-space:normal;word-break:break-word"><span> </span>PMD) in our high-performance real-time audio streaming application. These problems prevent us from leveraging core DPDK features and require your urgent attention.</span></p><p style="white-space:normal;color:rgb(0,0,0);font-family:Arial;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial;word-break:break-word"><strong style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">Issue #1: Complete Failure to Transmit Zero-Copy (Multi-Segment) Packets</span></strong></p><p style="white-space:normal;color:rgb(0,0,0);font-family:Arial;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial;word-break:break-word"><span style="white-space:normal;word-break:break-word">To achieve the lowest latency, we are using the standard DPDK zero-copy mechanism: attaching an external shared memory buffer (from<span> </span></span><code style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">rte_memzone</span></code><span style="white-space:normal;word-break:break-word">) containing our audio payload to an mbuf header using<span> </span></span><code style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">rte_pktmbuf_attach_extbuf</span></code><span style="white-space:normal;word-break:break-word">. This correctly creates a<span> </span></span><strong style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">multi-segment mbuf</span></strong><span style="white-space:normal;word-break:break-word"><span> </span>(</span><code style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">nb_segs > 1</span></code><span style="white-space:normal;word-break:break-word">).</span></p><p style="white-space:normal;color:rgb(0,0,0);font-family:Arial;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial;word-break:break-word"><span style="white-space:normal;word-break:break-word">However, we have found that the<span> </span></span><strong style="white-space:normal;word-break:break-word"><code style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">cxgbe</span></code><span style="white-space:normal;word-break:break-word"><span> </span>driver is completely unable to transmit these multi-segment mbufs</span></strong><span style="white-space:normal;word-break:break-word">. Any attempt to send such a packet via<span> </span></span><code style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">rte_eth_tx_burst</span></code><span style="white-space:normal;word-break:break-word"><span> </span>fails (returns 0 or results in silent packet drops), regardless of whether hardware offloads are enabled or disabled. The<span> </span></span><code style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">cxgbe</span></code><span style="white-space:normal;word-break:break-word"><span> </span>PMD's capability report (</span><code style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">tx_offload_capa</span></code><span style="white-space:normal;word-break:break-word">) correctly<span> </span></span><strong style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">does not include</span></strong><span style="white-space:normal;word-break:break-word"><span> </span>the<span> </span></span><code style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">RTE_ETH_TX_OFFLOAD_MULTI_SEGS</span></code><span style="white-space:normal;word-break:break-word"><span> </span>flag.</span></p><p style="white-space:normal;color:rgb(0,0,0);font-family:Arial;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial;word-break:break-word"><span style="white-space:normal;word-break:break-word">This means that for the<span> </span></span><code style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">cxgbe</span></code><span style="white-space:normal;word-break:break-word"><span> </span>driver, the standard zero-copy path in DPDK is entirely non-functional.</span></p><p style="white-space:normal;color:rgb(0,0,0);font-family:Arial;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial;word-break:break-word"><strong style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">Issue #2: Incomplete Hardware Checksum Offload</span></strong></p><p style="white-space:normal;color:rgb(0,0,0);font-family:Arial;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial;word-break:break-word"><span style="white-space:normal;word-break:break-word">Forced to abandon zero-copy, we implemented a "single-copy" workaround by using<span> </span></span><code style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">rte_memcpy</span></code><span style="white-space:normal;word-break:break-word"><span> </span>to create a contiguous, single-segment mbuf. While this allows packets to be transmitted, we discovered a second critical issue:<span> </span></span><strong style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">the hardware checksum offload functionality is incomplete</span></strong><span style="white-space:normal;word-break:break-word">.</span></p><p style="white-space:normal;color:rgb(0,0,0);font-family:Arial;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial;word-break:break-word"><span style="white-space:normal;word-break:break-word">Specifically:</span></p><ol style="white-space:normal;color:rgb(0,0,0);font-family:Arial;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial;word-break:break-word"><li style="white-space:normal;word-break:break-word"><p style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">We set the full offload flags on the mbuf:<span> </span></span><code style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">m->ol_flags |= RTE_MBUF_F_TX_IPV4 | RTE_MBUF_F_TX_IP_CKSUM | RTE_MBUF_F_TX_UDP_CKSUM;</span></code><span style="white-space:normal;word-break:break-word">.</span></p></li><li style="white-space:normal;word-break:break-word"><p style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">We zero out both the IP and UDP checksum fields in their respective headers before transmission.</span></p></li><li style="white-space:normal;word-break:break-word"><p style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">Packet captures reveal that only the<span> </span></span><strong style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">UDP checksum</span></strong><span style="white-space:normal;word-break:break-word"><span> </span>is correctly calculated and filled in by the hardware. The<span> </span></span><strong style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">IP checksum</span></strong><span style="white-space:normal;word-break:break-word"><span> </span>field remains zeroed, causing the packet to be treated as invalid and dropped by the network.</span></p></li><li style="white-space:normal;word-break:break-word"><p style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">For the packet to be transmitted successfully, we are forced to<span> </span></span><strong style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">manually calculate the IP checksum in software</span></strong><span style="white-space:normal;word-break:break-word"><span> </span>(</span><code style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">ip_h->hdr_checksum = rte_ipv4_cksum(ip_h);</span></code><span style="white-space:normal;word-break:break-word">) while keeping the UDP checksum field zeroed for hardware offload.</span></p></li></ol><p style="white-space:normal;color:rgb(0,0,0);font-family:Arial;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial;word-break:break-word"><span style="white-space:normal;word-break:break-word">This proves that although the<span> </span></span><code style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">cxgbe</span></code><span style="white-space:normal;word-break:break-word"><span> </span>PMD reports support for<span> </span></span><code style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">RTE_ETH_TX_OFFLOAD_IPV4_CKSUM</span></code><span style="white-space:normal;word-break:break-word">, it<span> </span></span><strong style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">does not actually perform IP checksum offloading</span></strong><span style="white-space:normal;word-break:break-word"><span> </span>in practice.</span></p><p style="white-space:normal;color:rgb(0,0,0);font-family:Arial;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial;word-break:break-word"><span style="white-space:normal;word-break:break-word">For contrast, we must emphasize that both of the core functionalities we've described—zero-copy (multi-segment mbuf) transmission and full (IP+UDP) hardware checksum offloading—work perfectly on the same testbed when using NICs from Intel (igc/i40e) and onboard Realtek(RTL8125) controllers. This strongly suggests that the issues are specific to the Chelsio cxgbe PMD.</span></p><p style="white-space:normal;color:rgb(0,0,0);font-family:Arial;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial;word-break:break-word"><strong style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">Our Dilemma</span></strong></p><p style="white-space:normal;color:rgb(0,0,0);font-family:Arial;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial;word-break:break-word"><span style="white-space:normal;word-break:break-word">These two issues leave us in an untenable position:</span></p><ul style="white-space:normal;color:rgb(0,0,0);font-family:Arial;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial;word-break:break-word"><li style="white-space:normal;word-break:break-word"><p style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">The ideal<span> </span></span><strong style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">zero-copy path is completely broken</span></strong><span style="white-space:normal;word-break:break-word">, preventing us from realizing a primary performance benefit of DPDK.</span></p></li><li style="white-space:normal;word-break:break-word"><p style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">The fallback<span> </span></span><strong style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">single-copy path is highly inefficient</span></strong><span style="white-space:normal;word-break:break-word">, as it not only incurs the CPU cost of a<span> </span></span><code style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">memcpy</span></code><span style="white-space:normal;word-break:break-word"><span> </span>but also requires the additional CPU overhead of software IP checksum calculation, largely defeating the purpose of hardware offloads.</span></p></li></ul><p style="white-space:normal;color:rgb(0,0,0);font-family:Arial;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial;word-break:break-word"><strong style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">Our Questions</span></strong></p><p style="white-space:normal;color:rgb(0,0,0);font-family:Arial;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial;word-break:break-word"><span style="white-space:normal;word-break:break-word">We urgently need your help to clarify the following:</span></p><ol style="white-space:normal;color:rgb(0,0,0);font-family:Arial;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial;word-break:break-word"><ul style="white-space:normal;word-break:break-word"><li style="white-space:normal;word-break:break-word"></li><li><p><span>Is this behavior from the </span><code><span>cxgbe</span></code><span> PMD (offloading only UDP checksum) consistent with the design expectations for a PMD in DPDK?</span></p></li><li><p><span>Does the DPDK framework provide any debugging mechanisms to trace why an explicitly set offload flag (</span><code><span>RTE_MBUF_F_TX_IP_CKSUM</span></code><span>) would be ignored by a PMD without reporting an error?</span></p></li></ul></ol><span style="white-space:normal;color:rgb(0,0,0);font-family:Arial;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial;word-break:break-word"><br style="white-space:normal;word-break:break-word"><p style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">Resolving these issues is critical to the success of our project. Any information or guidance you can provide would be greatly appreciated.</span></p><p style="white-space:normal;word-break:break-word"><strong style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">Our Environment</span></strong></p><ul style="white-space:normal;word-break:break-word"><li style="white-space:normal;word-break:break-word"><p style="white-space:normal;word-break:break-word"><strong style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">DPDK Version:</span></strong><span style="white-space:normal;word-break:break-word"> 25.07</span></p></li><li style="white-space:normal;word-break:break-word"><p style="white-space:normal;word-break:break-word"><strong style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">NIC Model:</span></strong><span style="white-space:normal;word-break:break-word"><span> </span></span><code style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">Chelsio T520-CR</span></code></p></li><li style="white-space:normal;word-break:break-word"><p style="white-space:normal;word-break:break-word"><strong style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">OS & Kernel:</span></strong><span style="white-space:normal;word-break:break-word"> <font face="monospace" style="white-space:normal;word-break:break-word">Tinycore64 16.0 kernel 6.6.63</font></span></p></li></ul><p style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">Thank you for your time and attention to this urgent matter. We look forward to your response.</span></p><p style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">Best regards,</span></p><p style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word"><br style="white-space:normal;word-break:break-word"><br style="white-space:normal;word-break:break-word"><br style="white-space:normal;word-break:break-word"></span></p><p style="white-space:normal;word-break:break-word"><strong style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">尊敬的 DPDK 开发团队和 Chelsio 技术支持团队:</span></strong></p><p style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">您们好!</span></p><p style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">我们正在开发一个对性能要求极高的实时音频流项目,但目前在使用 Chelsio T5/T6 系列网卡(</span><code style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">cxgbe</span></code><span style="white-space:normal;word-break:break-word"><span> </span>PMD)时,遇到了两个严重的底层功能障碍,导致 DPDK 的核心优势无法发挥。我们恳请您们的紧急援助。</span></p><p style="white-space:normal;word-break:break-word"><strong style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">【核心问题一:零拷贝(多段 mbuf)数据包完全无法发送】</span></strong></p><p style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">为了实现最低延迟,我们采用 DPDK 标准的零拷贝机制:通过<span> </span></span><code style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">rte_pktmbuf_attach_extbuf</span></code><span style="white-space:normal;word-break:break-word"><span> </span>函数,将外部共享内存(</span><code style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">rte_memzone</span></code><span style="white-space:normal;word-break:break-word">)中的音频数据附加到 mbuf 头部之后。此操作会创建一个</span><strong style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">多段 mbuf</span></strong><span style="white-space:normal;word-break:break-word"><span> </span>(</span><code style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">nb_segs > 1</span></code><span style="white-space:normal;word-break:break-word">)。</span></p><p style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">然而,我们发现<span> </span></span><strong style="white-space:normal;word-break:break-word"><code style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">cxgbe</span></code><span style="white-space:normal;word-break:break-word"><span> </span>驱动完全无法发送这种多段 mbuf</span></strong><span style="white-space:normal;word-break:break-word">。一旦调用<span> </span></span><code style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">rte_eth_tx_burst</span></code><span style="white-space:normal;word-break:break-word"><span> </span>发送此类数据包,无论是否开启硬件卸载,发送都会失败(返回值为 0 或导致丢包),数据包无法出现在网络上。</span><code style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">cxgbe</span></code><span style="white-space:normal;word-break:break-word"><span> </span>PMD 的能力报告(</span><code style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">tx_offload_capa</span></code><span style="white-space:normal;word-break:break-word">)也确实</span><strong style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">不包含</span></strong><span style="white-space:normal;word-break:break-word"><span> </span></span><code style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">RTE_ETH_TX_OFFLOAD_MULTI_SEGS</span></code><span style="white-space:normal;word-break:break-word"><span> </span>标志。</span></p><p style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">这表明,对于<span> </span></span><code style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">cxgbe</span></code><span style="white-space:normal;word-break:break-word"><span> </span>驱动而言,DPDK 的标准零拷贝机制是完全不可用的。</span></p><p style="white-space:normal;word-break:break-word"><strong style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">【核心问题二:硬件校验和卸载功能不完整】</span></strong></p><p style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">为了绕过上述问题,我们被迫采用“单拷贝”的妥协方案:手动<span> </span></span><code style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">rte_memcpy</span></code><span style="white-space:normal;word-break:break-word"><span> </span>数据到一个大的、连续的单段 mbuf 中。虽然这种方式可以成功发包,但我们发现了第二个严重问题:</span><strong style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">硬件卸载功能是残缺的</span></strong><span style="white-space:normal;word-break:break-word">。</span></p><p style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">具体表现为:</span></p><ol style="white-space:normal;word-break:break-word"><li style="white-space:normal;word-break:break-word"><p style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">我们为 mbuf 设置了完整的卸载标志:</span><code style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">m->ol_flags |= RTE_MBUF_F_TX_IPV4 | RTE_MBUF_F_TX_IP_CKSUM | RTE_MBUF_F_TX_UDP_CKSUM;</span></code><span style="white-space:normal;word-break:break-word">。</span></p></li><li style="white-space:normal;word-break:break-word"><p style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">在发包前,我们将 IP 和 UDP 头部中的校验和字段都清零。</span></p></li><li style="white-space:normal;word-break:break-word"><p style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">抓包分析后发现,只有<span> </span></span><strong style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">UDP 校验和</span></strong><span style="white-space:normal;word-break:break-word">被硬件正确计算并填充了。而<span> </span></span><strong style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">IP 校验和</span></strong><span style="white-space:normal;word-break:break-word">字段依然是 0,导致该包在网络中被视为无效数据包而被丢弃。</span></p></li><li style="white-space:normal;word-break:break-word"><p style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">我们必须在软件中手动计算 IP 校验和(</span><code style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">ip_h->hdr_checksum = rte_ipv4_cksum(ip_h);</span></code><span style="white-space:normal;word-break:break-word">),同时保持 UDP 校验和为 0,才能让数据包正确发送并被接收端验证。</span></p></li></ol><p style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">这证实了<span> </span></span><code style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">cxgbe</span></code><span style="white-space:normal;word-break:break-word"><span> </span>PMD 虽然声称支持<span> </span></span><code style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">RTE_ETH_TX_OFFLOAD_IPV4_CKSUM</span></code><span style="white-space:normal;word-break:break-word">,但在实际工作中</span><strong style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">并未执行 IP 校验和的硬件卸载</span></strong><span style="white-space:normal;word-break:break-word">。</span></p><p style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">作为对比,我们需要强调的是:我们描述的这两项核心功能——即零拷贝(多段 mbuf)发送和完整的硬件校验和卸载(IP+UDP),在我们的同一测试平台上,使用 Intel (igc/i40e) 和 Realtek (RTL8125) 的板载网卡时,都完全正常工作。这使我们确信,问题是特定于 Chelsio cxgbe PMD 的。</span></p><p style="white-space:normal;word-break:break-word"><strong style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">【我们的困境】</span></strong></p><p style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">这两个问题使我们陷入了绝境:</span></p><ul style="white-space:normal;word-break:break-word"><li style="white-space:normal;word-break:break-word"><p style="white-space:normal;word-break:break-word"><strong style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">理想的零拷贝路径完全不通</span></strong><span style="white-space:normal;word-break:break-word">,导致 DPDK 的核心性能优势无法体现。</span></p></li><li style="white-space:normal;word-break:break-word"><p style="white-space:normal;word-break:break-word"><strong style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">妥协的单拷贝路径效率低下</span></strong><span style="white-space:normal;word-break:break-word">,不仅引入了<span> </span></span><code style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">memcpy</span></code><span style="white-space:normal;word-break:break-word"><span> </span>的 CPU 开销,还必须额外承担 IP 校验和的软件计算开销,使得硬件卸载的价值大打折扣。</span></p></li></ul><p style="white-space:normal;word-break:break-word"><strong style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">【我们的问题】</span></strong></p><p style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">我们急需您的帮助来澄清以下问题:</span></p><ol style="white-space:normal;word-break:break-word"><ul style="white-space:normal;word-break:break-word"><li style="white-space:normal;word-break:break-word"></li><li><p><code><span>cxgbe</span></code><span> 驱动的这种行为(只卸载 UDP 校验和)是否符合 DPDK 对 PMD 的设计预期?</span></p></li><li><p><span>DPDK 框架是否有调试机制,可以追踪为何一个明确设置的卸载标志(</span><code><span>RTE_MBUF_F_TX_IP_CKSUM</span></code><span>)会被 PMD 忽略且不报告任何错</span></p></li></ul></ol><b style="white-space:normal;word-break:break-word"><br style="white-space:normal;word-break:break-word"></b><p style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">解决这些问题对于我们的项目能否成功至关重要。任何能够帮助我们前进的建议或信息,我们将不胜感激。</span></p><p style="white-space:normal;word-break:break-word"><strong style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">【我们的环境信息】</span></strong></p><ul style="white-space:normal;word-break:break-word"><li style="white-space:normal;word-break:break-word"><p style="white-space:normal;word-break:break-word"><strong style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">DPDK 版本:25.07</span></strong></p></li><li style="white-space:normal;word-break:break-word"><p style="white-space:normal;word-break:break-word"><strong style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">网卡型号:</span></strong><code style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">Chelsio T520-CR</span></code></p></li><li style="white-space:normal;word-break:break-word"><p style="white-space:normal;word-break:break-word"><strong style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">操作系统与内核版本:Tinycore64 16.0  kernel 6.6.63</span></strong></p></li></ul><p style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">感谢您的时间和关注,我们急切地期待您的回复!</span></p><p style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">此致,</span></p><p style="white-space:normal;word-break:break-word"><span style="white-space:normal;word-break:break-word">敬礼!</span></p></span><br></div></div></blockquote></div>