<div data-ntes="ntes_mail_body_root" style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><div id="spnEditorContent"><div style="margin: 0;"><br></div><div style="margin: 0;"><br></div><div style="margin: 0;"><br></div><div style="margin: 0;"><br></div><div style="margin: 0;"><br></div></div><div style="position:relative;zoom:1"></div><div id="divNeteaseMailCard"></div><div style="margin: 0;"><br></div><pre><br>Hi Stephen,<br><br>Thanks for the review. Points will be addressed in v4: the series will be<br>reordered so that every commit builds, the SP230 masking will be split out<br>of the interrupt setup, the copy path will start every segment copy at its<br>own source offset, the IPv6 extension-header walk will be dropped, and the<br>copy pool will be capped. One warning I still did not take, the compact<br>CQE Rx interrupt one: my v3 reply was based on a misreading of a firmware<br>comment; after re-reading the code and testing it, I believe it is<br>supported, and I explain why below.<br><br>At 2026-10-20 00:52:41, "Stephen Hemminger" <stephen@networkplumber.org> wrote:<br>>On Mon, 19 Oct 2026 23:19:02 +0800<br>>Jiacheng Ye <yejiacheng4@h-partners.com> wrote:<br>><br>>> This series fixes offload capability advertisement, cmdq/compact CQE<br>>> configuration, and several defects found during review, and adds NIC<br>>> type identification, FEC, CIR drop statistics, VF LAG/link state, COS<br>>> mask/map, mbox recording, RSS hash configuration, compact CQE Rx/Tx<br>>> paths, TSO segment expansion, Tx burst mode reporting, queue statistics,<br>>> pseudo-header checksum, per-tile cmdq ops, SP560 NIC support, and device<br>>> kvargs tunables.<br>>> <br>>> v3:<br>>> - Move the ethertype-flow TCAM index leak fix out of the flow-refactor<br>>>   patch into its own patch with a Fixes tag and a stable Cc tag.<br>>> - Set burst function pointers and tx_pkt_prepare for both primary and<br>>>   secondary processes, and select the Tx path on its own feature bit.<br>>> - Zero the RQ/SQ context buffers and honour dp_intr_en for the STN CEQ<br>>>   attribute in compact CQE mode.<br>>> - Return the number of Tx packets consumed instead of the doorbell<br>>>   count, and guard the Tx prefetch against overreading the array.<br>>> - Validate device kvargs and reject values above the hardware field<br>>>   width; document the real defaults and units.<br>>> - Reject mismatched queue depths and reset saved depths in<br>>>   dev_configure(), and size the TSO copy pool per port.<br>>> - Report FEC capabilities per supported speed regardless of link state.<br>>> - Route the private dump through fprintf() on the provided FILE*.<br>>> - Derive the pseudo-header L4 protocol from the offload flags and fail<br>>>   shared or indirect mbufs; add Fixes and stable Cc tags.<br>>> - Drop stable Cc tags where the Fixes target is not in an LTS release<br>>>   and remove dead code and unused definitions.<br>><br>>Still lots of AI feedback, biggest issue is the bisect break.<br>>You should run semi-automated incremental builds on any large<br>>patch series like this. CI does that.<br>><br>><br>>Subject: Re: [PATCH 00/27] net/hinic3: fixes and new features<br>><br>>This is v3 of the series; please mark it as such in the subject, and<br>>put a changelog in the cover letter so reviewers can see what changed.<br>><br>[Jiacheng] Accepted. It is a regression on my side: the per-commit build<br>has been part of the series work since v1, but I never wrote it down as a<br>standing rule, so when the assistant's working context was compacted for v3<br>that step was dropped, and the version tag went with it. From v4 on both<br>will be written down and checked before sending: applied and built one<br>commit at a time on current main, and the version in every subject.<br><br>>Applies to main (26.11-rc1). Tip builds with -Dwerror=true. Most of<br>>the v2 comments are addressed: Tx burst return value, prefetch, kvargs<br>>error and bounds, secondary process burst setup, RQ/SQ context memset,<br>>queue depth checks, per-port copy pool, priv_dump to FILE, TCAM leak<br>>split out, Fixes/Cc tags.<br>><br>><br>>Errors<br>>======<br>><br>>Series: bisect broken at 20 through 26.<br>><br>>[PATCH 20/27] sets tx_pkt_prepare = hinic3_prep_pkts, which is not<br>>defined until 27/27, and uses hinic3_xmit_pkts_compact_cqe, which<br>>arrives in 22/27.<br>>[PATCH 21/27] uses nic_dev->txq_depth, which is added in 23/27.<br>><br>>Every commit must build. Move 27/27 ahead of 20 (it is a Fixes: patch<br>>anyway), select only hinic3_xmit_pkts in 20 and add the compact<br>>choice in 22, and add txq_depth in 21 or move the pool sizing to 23.<br>><br>[Jiacheng] Accepted. Reordered along the lines you described. The Fixes:<br>patch (pseudo-header checksum) will be 08/27, right after the NIC type<br>identification patch it depends on. hinic3_prep_pkts() is defined before<br>the Tx burst split, which installs only hinic3_xmit_pkts; the compact<br>choice follows in the compact CQE patch. txq_depth will land with the<br>queue depth patch, ahead of the copy pool sizing that reads it, so no<br>patch uses a field that arrives later.<br><br>>[PATCH 08/27] net/hinic3: add SP230 Rx queue interrupt handling<br>><br>>On SP230 hinic3_init_rxq_intr() now runs the full Rx interrupt setup<br>>even when intr_conf.rxq is 0. That path requires<br>>rte_intr_cap_multiple(), so on igb_uio or uio_pci_generic dev_start<br>>fails with -ENOTSUP for an application that never asked for<br>>interrupts. It also creates eventfds and sets rxq->dp_intr_en = 1,<br>>so the RQ context is programmed with the CEQ interrupt enabled.<br>><br>>Split the SP230 masking out of the interrupt setup:<br>><br>>        if (!dev->data->dev_conf.intr_conf.rxq) {<br>>           if (HINIC3_IS_SP230_NIC(nic_dev))<br>>                 return hinic3_sp230_mask_rxq_msix(dev);<br>>           return 0;<br>> }<br>><br>>where the helper only programs coalescing/auto-mask on vectors<br>>i + HINIC3_RX_VEC_START, with no efd, no intr_vec and no dp_intr_en.<br>><br>[Jiacheng] Accepted. Fixed exactly as suggested, so dev_start keeps<br>working on igb_uio/uio_pci_generic when Rx interrupts are disabled.<br><br>>[PATCH 21/27] net/hinic3: expand TSO from 127 to 255 segments<br>><br>>hinic3_copy_tx_mbuf_multi() always copies from the start of the source<br>>segment:<br>><br>>  rte_memcpy((uint8_t *)cur_mbuf->buf_addr + copy_offset,<br>>                   (uint8_t *)mbuf->buf_addr + mbuf->data_off,<br>>                 copy_size);<br>><br>>When a source segment spans two copy mbufs, the second copy repeats<br>>the first bytes of that segment, and the packet goes out corrupted.<br>>This was also in v2; I missed it there.<br>><br>> uint32_t src_off = mbuf->data_len - remaining_len;<br>><br>>       rte_memcpy((uint8_t *)cur_mbuf->buf_addr + copy_offset,<br>>                   rte_pktmbuf_mtod_offset(mbuf, uint8_t *, src_off),<br>>                copy_size);<br>><br>[Jiacheng] Accepted. Fixed alike:<br><br>     uint32_t src_off = mbuf->data_len - remaining_len;<br><br>       rte_memcpy((uint8_t *)cur_mbuf->buf_addr + copy_offset,<br>               rte_pktmbuf_mtod_offset(mbuf, uint8_t *, src_off),<br>            copy_size);<br><br>The same path also built the copy chain without maintaining nb_segs and<br>pkt_len; both will be fixed in the same patch.<br><br>>Warnings<br>>========<br>><br>>[PATCH 18/27] net/hinic3: add SP560 NIC type identification and<br>>  handling<br>><br>>The STN op still forces EN=1 (interrupt disabled) with SW compact CQE,<br>>and the commit marks Rx interrupt as "P". An application that sets<br>>intr_conf.rxq still gets success from configure and start, and then<br>>never gets an interrupt. Reject it:<br>><br>>    if (dev->data->dev_conf.intr_conf.rxq &&<br>>        nic_dev->config.rx_cqe_compact_en &&<br>>           HINIC3_SUPPORT_RX_SW_COMPACT_CQE(nic_dev))<br>>            return -ENOTSUP;<br>><br>[Jiacheng] My earlier reply on this point was wrong: I argued from a<br>firmware comment and misread what it applies to, so I re-read the code and<br>tested the combination instead.<br><br>On SP560 the compact CQE path does raise Rx interrupts. In compact WQE<br>mode the CEQ enable bit has to stay set for the CEQ attribute to take<br>effect at all, so EN=1 does not mean "interrupt enabled". Whether an<br>interrupt is actually raised is controlled separately by the CEQ<br>interrupt number: with Rx interrupts disabled the driver programs an<br>invalid vector (0x1FF) and the hardware stays silent. ceq_intr is<br>therefore an independent switch, and the two settings do not conflict.<br><br>SP620 has no compact path; there the interrupt is controlled by the<br>intr_disable bit of the RQ context directly.<br><br>So instead of returning -ENOTSUP the driver programs the combination<br>correctly, and hinic3.ini keeps "Rx interrupt = Y".<br><br>>[PATCH 21/27] net/hinic3: expand TSO from 127 to 255 segments<br>><br>>The copy pool is now num_sqs * txq_depth 4 KB mbufs, created at every<br>>dev_start. With 16 queues of 4096 descriptors that is about 280 MB of<br>>hugepage memory per port, for a slow path that only fires on packets<br>>with too many segments. Cap it, for example:<br>><br>>      depth = nic_dev->num_sqs * RTE_MIN(nic_dev->txq_depth, 256u);<br>><br>[Jiacheng] Accepted. The cap will be in place as you wrote it. The<br>HINIC3_COPY_MEMPOOL_DEPTH floor is kept, so shallow queue configurations<br>are unaffected, and failing to allocate a copy mbuf is already a<br>per-packet drop that bumps offload_errors rather than a hard failure.<br><br>>[PATCH 27/27] net/hinic3: add pseudo-header checksum calculation<br>><br>>For IPv6 the L4 offset still comes from walking extension headers,<br>>while the descriptor (hinic3_get_tx_offload) uses mbuf->l3_len. When<br>>the two disagree, software writes the checksum in one place and the<br>>hardware computes it at another. mbuf->l3_len is the application's<br>>contract and includes extension headers; use it, and drop<br>>hinic3_get_ipv6_len_proto().<br>><br>[Jiacheng] Accepted. hinic3_get_ipv6_len_proto() will be gone; the L4<br>offset will come from mbuf->l3_len, the same value hinic3_get_tx_offload()<br>uses for the descriptor.<br>>Info<br>>====<br>><br>>[PATCH 27/27] "l4_proto = (uint32_t)proto << 24" is only correct on<br>>little endian. The old rte_cpu_to_be_16(proto) was fine, since the<br>>ones' complement sum ignores word position. Use<br>>rte_cpu_to_be_32(proto).<br>><br>[Jiacheng] Accepted. rte_cpu_to_be_32() will be used.<br><br>>[PATCH 27/27] Has Cc: stable, but it depends on NIC type<br>>identification from 07/27. Put it right after 07, so the stable<br>>backport is the pair.<br>><br>[Jiacheng] Accepted. In v4 the patch is 08/27, right after NIC type<br>identification from 07/27.<br><br>Thanks again for the review.<br><br>Regards,<br>Jiacheng<br><br></pre></div>