<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 style="margin: 0;"><br></div><div style="margin: 0;"><br></div><div style="margin: 0;">At 2026-11-20 23:43:18, "Stephen Hemminger" <stephen@networkplumber.org> wrote:</div><div style="margin: 0;">>On Tue, 17 Nov 2026 23:56:41 +0800</div><div style="margin: 0;">>Jiacheng Ye <yejiacheng4@h-partners.com> wrote:</div><div style="margin: 0;">></div><div style="margin: 0;">>> net/hinic3: add PMD features and fixes</div><div style="margin: 0;">>> </div><div style="margin: 0;">>> This series fixes offload capability advertisement, cmdq/compact CQE</div><div style="margin: 0;">>> configuration, and a handful of driver defects, and adds NIC</div><div style="margin: 0;">>> type identification, FEC, CIR drop statistics, VF LAG/link state, COS</div><div style="margin: 0;">>> mask/map, mbox recording, RSS hash configuration, compact CQE Rx/Tx</div><div style="margin: 0;">>> paths, TSO segment expansion, Tx burst mode reporting, queue statistics,</div><div style="margin: 0;">>> pseudo-header checksum, per-tile cmdq ops, SP560 NIC support, and device</div><div style="margin: 0;">>> kvargs tunables.</div><div style="margin: 0;">>> </div><div style="margin: 0;">>> Changes in v7:</div><div style="margin: 0;">></div><div style="margin: 0;">>Need to resolve the last warning.</div><div style="margin: 0;">></div><div style="margin: 0;">>Subject: Re: [PATCH v7 00/29] net/hinic3 series</div><div style="margin: 0;">></div><div style="margin: 0;">>All 29 patches apply to main and every commit builds with</div><div style="margin: 0;">>-Dwerror=true. The open items from v6 are resolved: SP230 no longer</div><div style="margin: 0;">>allocates eventfds or enables the Rx vectors when intr_conf.rxq is</div><div style="margin: 0;">>off, dev_start honours admin_down, set_link_down restores admin_down</div><div style="margin: 0;">>on failure, the Fixes: hashes are 12 characters, and rss_en now</div><div style="margin: 0;">>tracks rss_type.</div><div style="margin: 0;">></div><div style="margin: 0;">>Two warnings remain, both about documentation rather than code.</div><div style="margin: 0;">></div><div style="margin: 0;">></div><div style="margin: 0;">>Warning</div><div style="margin: 0;">>=======</div><div style="margin: 0;">></div><div style="margin: 0;">>[PATCH 20/29] net/hinic3: refactor flow rule parsing</div><div style="margin: 0;">></div><div style="margin: 0;">>The patch drops every vlan_flag mask/value pair from the TCAM key,</div><div style="margin: 0;">>e.g.:</div><div style="margin: 0;">></div><div style="margin: 0;">> -       tcam_key->key_mask.vlan_flag = 1;</div><div style="margin: 0;">>    -       tcam_key->key_info.vlan_flag = 0;</div><div style="margin: 0;">></div><div style="margin: 0;">>Before, FDIR rules matched only untagged packets. Now they match</div><div style="margin: 0;">>tagged and untagged packets alike. That is a behaviour change, and</div><div style="margin: 0;">>the commit message does not mention it. If it is intended, add a</div><div style="margin: 0;">>sentence such as:</div><div style="margin: 0;">></div><div style="margin: 0;">> FDIR rules no longer match on the VLAN flag, so a rule now</div><div style="margin: 0;">>      hits both tagged and untagged packets.</div><div style="margin: 0;">></div><div style="margin: 0;">>If it is not intended, restore the vlan_flag lines.</div><div style="margin: 0;"><br></div><div style="margin: 0;">[Jiacheng] Intended, and the commit message now says so. The TCAM does not</div><div style="margin: 0;">support VLAN matching, so the vlan_flag mask/value pairs in the key were</div><div style="margin: 0;">meaningless and all of them are removed. A rule now matches both tagged and</div><div style="margin: 0;">untagged packets. Added to the commit message:</div><div style="margin: 0;"><br></div><div style="margin: 0;"> The TCAM does not support VLAN matching, so the vlan_flag mask/value</div><div style="margin: 0;"> pairs in the key were meaningless and are removed. A rule now matches</div><div style="margin: 0;"> both tagged and untagged packets.</div><div style="margin: 0;"><br></div><div style="margin: 0;">Code unchanged.</div><div style="margin: 0;">></div><div style="margin: 0;">></div><div style="margin: 0;">>[PATCH 22/29] net/hinic3: add device kvargs parameters support</div><div style="margin: 0;">>[PATCH 23/29] net/hinic3: add compact CQE Rx path and ptype table</div><div style="margin: 0;">></div><div style="margin: 0;">>The new "Runtime Configuration" section uses a bullet list of</div><div style="margin: 0;">>term/description pairs. Make it a definition list:</div><div style="margin: 0;">></div><div style="margin: 0;">>       ``tx_pending_limit`` (default ``2``)</div><div style="margin: 0;">>       Tx completion coalescing pending limit, in units of 8</div><div style="margin: 0;">>           packets.</div><div style="margin: 0;">></div><div style="margin: 0;">>     ``tx_coalescing_time`` (default ``2``)</div><div style="margin: 0;">>     Tx completion coalescing time, in microseconds.</div><div style="margin: 0;">></div><div style="margin: 0;">>      ``rx_cqe_compact_en`` (default ``1``)</div><div style="margin: 0;">>      Enable (``1``) or disable (``0``) compact CQE mode.</div><div style="margin: 0;">>     Ignored on NICs without compact CQE support.</div><div style="margin: 0;">></div><div style="margin: 0;">> ``rx_cqe_coalesce_num`` (default ``7``)</div><div style="margin: 0;">>    Rx CQE coalescing count, in units of 8 packets.</div><div style="margin: 0;">></div><div style="margin: 0;">>      ``rx_cqe_timer_loop`` (default ``5``)</div><div style="margin: 0;">>      Rx CQE coalescing timer, in microseconds.</div><div style="margin: 0;">></div><div style="margin: 0;">>The rx_cqe_compact_en entry belongs in 23/29 and the rest in 22/29.</div><div style="margin: 0;"><br></div><div style="margin: 0;">[Jiacheng] Fixed. Adopted your definition-list layout: the term on its own line</div><div style="margin: 0;">and the description indented by three spaces, defaults and units included.</div><div style="margin: 0;">Ownership is split the way you asked -- rx_cqe_compact_en is in 22/28 (the</div><div style="margin: 0;">compact CQE patch, old 23/29) and tx_pending_limit, tx_coalescing_time,</div><div style="margin: 0;">rx_cqe_coalesce_num and rx_cqe_timer_loop are in 21/28 (the kvargs patch, old</div><div style="margin: 0;">22/29).</div><div style="margin: 0;"><br></div><div style="margin: 0;">One wording change: the rx_cqe_compact_en description no longer keeps the</div><div style="margin: 0;">sentence that was in the patch. That sentence said the option is "Ignored on</div><div style="margin: 0;">NICs without compact CQE support", but the driver does more than ignore it. The</div><div style="margin: 0;">Rx burst is chosen from the requested mode, while the RQ context, the CEQ</div><div style="margin: 0;">attributes and the vport flag are built from the compact CQE capability</div><div style="margin: 0;">bits, so on a NIC that has the SW compact CQE bit the two must agree. The</div><div style="margin: 0;">entry now reads:</div><div style="margin: 0;"><br></div><div style="margin: 0;"> ``rx_cqe_compact_en`` (default ``1``)</div><div style="margin: 0;">    Enable (``1``) or disable (``0``) compact CQE mode. The SP230 reports the</div><div style="margin: 0;">    HW compact CQE feature bit and always uses the compact Rx mode; the SP560</div><div style="margin: 0;">    reports the SW compact CQE feature bit and follows this setting; the SP620</div><div style="margin: 0;">    reports neither.</div><div style="margin: 0;"><br></div><div style="margin: 0;">The layout you asked for, the defaults and the units are unchanged; only the</div><div style="margin: 0;">description text differs from the earlier wording.</div><div style="margin: 0;">></div><div style="margin: 0;">></div><div style="margin: 0;">>Info</div><div style="margin: 0;">>====</div><div style="margin: 0;">></div><div style="margin: 0;">>[PATCH 06/29] rte_atomic_thread_fence() orders memory between CPUs,</div><div style="margin: 0;">>not between the CPU and the device. If the cleared rq_ci has to be</div><div style="margin: 0;">>ordered before the device runs again, use rte_io_wmb(). Otherwise</div><div style="margin: 0;">>drop the fence.</div><div style="margin: 0;"><br></div><div style="margin: 0;">[Jiacheng] Agreed, and the fence is deleted. hinic3_reset_rx_queue() runs from</div><div style="margin: 0;">dev_start(), before the RQ is started, so the device is not running at that</div><div style="margin: 0;">point and there is no CPU-to-device ordering for the fence to provide. The</div><div style="margin: 0;">clear itself stays.</div><div style="margin: 0;">></div><div style="margin: 0;">>[PATCH 07/29] dev_private is always present in a secondary process,</div><div style="margin: 0;">>so this check is dead code, and the message and -ENOMEM do not match</div><div style="margin: 0;">>what it tests:</div><div style="margin: 0;">></div><div style="margin: 0;">> if (nic_dev == NULL) {</div><div style="margin: 0;">>          PMD_DRV_LOG(ERR, "nic_dev hwdev is NULL, dev_name: %s",</div><div style="margin: 0;">></div><div style="margin: 0;">>Drop it.</div><div style="margin: 0;"><br></div><div style="margin: 0;">[Jiacheng] Dropped. The mismatched ERR message and the -ENOMEM return are gone</div><div style="margin: 0;">with it; the nic_dev assignment that the following code uses is kept.</div><div style="margin: 0;">></div><div style="margin: 0;">>[PATCH 10/29] This patch has Cc: stable, but it uses</div><div style="margin: 0;">>HINIC3_IS_SP230_NIC() from 09/29, which is not tagged. Either tag</div><div style="margin: 0;">>09/29 as well, or name the dependency so 25.11 backporters can find</div><div style="margin: 0;">>it.</div><div style="margin: 0;"><br></div><div style="margin: 0;">[Jiacheng] Fixed by folding 09/29 into 10/29. The merged commit keeps the</div><div style="margin: 0;">Fixes: tag and the Cc: stable@dpdk.org of the old 10/29, so</div><div style="margin: 0;">HINIC3_IS_SP230_NIC() and its only user are in the same backportable commit.</div><div style="margin: 0;">The NIC identification added by the old 09/29 is used in exactly one place, so</div><div style="margin: 0;">the subject is now "net/hinic3: fix pseudo-header checksum and identify NIC</div><div style="margin: 0;">type" and the body covers that part as well. Measured: the merged commit</div><div style="margin: 0;">cherry-picks onto the base and builds with -Dwerror=true on its own. Eight</div><div style="margin: 0;">later commits use the nic_type mechanism, but none of them carries Cc: stable,</div><div style="margin: 0;">so there is no other tagged commit that depends on untagged code. The series is</div><div style="margin: 0;">28 patches from here on, and the later numbering is one lower than in v7.</div><div style="margin: 0;">></div><div style="margin: 0;">>[PATCH 11/29] The explanation in the v6 reply checks out:</div><div style="margin: 0;">>disable_all_msix() turns off every vector at hwif init, and</div><div style="margin: 0;">>hinic3_dev_rx_queue_intr_enable() returns before</div><div style="margin: 0;">>hinic3_set_msix_state(..., HINIC3_MSIX_ENABLE) on SP230 when</div><div style="margin: 0;">>intr_conf.rxq is off. One gap remains. Nothing compares</div><div style="margin: 0;">>nb_rx_queues + HINIC3_RX_VEC_START against hwif->attr.num_irqs, so</div><div style="margin: 0;">>on a function with fewer vectors than queues, INTR names a vector</div><div style="margin: 0;">>that does not exist. The intr_conf.rxq path has the same gap. Reject</div><div style="margin: 0;">>that configuration in dev_configure, or skip the SP230 branch when</div><div style="margin: 0;">>there are not enough vectors.</div><div style="margin: 0;"><br></div><div style="margin: 0;">[Jiacheng] Fixed. Added hinic3_check_rxq_intr_vec(), which checks</div><div style="margin: 0;">HINIC3_RX_VEC_START + nb_rx_queues - 1 < num_irqs and returns -EINVAL with an</div><div style="margin: 0;">ERR log otherwise. It is called from both the intr_conf.rxq == 0 SP230 branch</div><div style="margin: 0;">and the intr_conf.rxq == 1 path, ahead of rte_intr_efd_enable().</div><div style="margin: 0;"><br></div><div style="margin: 0;">We tested this during v6: with the typical configurations the vector count was</div><div style="margin: 0;">always sufficient and the overflow did not occur. We still add the check as</div><div style="margin: 0;">hardening.</div><div style="margin: 0;">></div><div style="margin: 0;">>[PATCH 15/29] hinic3_dump_aeq_mbox_info() prints all</div><div style="margin: 0;">>HINIC3_MBOX_SAVE_NUM slots even when fewer messages were recorded,</div><div style="margin: 0;">>so empty slots appear as cmd 0, mod 0. Loop to save_mbox->count</div><div style="margin: 0;">>instead.</div><div style="margin: 0;"><br></div><div style="margin: 0;">[Jiacheng] Fixed. The loop now runs to save_mbox->count and indexes from</div><div style="margin: 0;">save_mbox->start, so empty slots are no longer printed as cmd 0, mod 0.</div><div style="margin: 0;">></div><div style="margin: 0;">>[PATCH 17/29] hinic3_dev_set_link_up() clears admin_down before the</div><div style="margin: 0;">>vport and port enable, but unlike set_link_down it does not restore</div><div style="margin: 0;">>it on failure. If either call fails, admin_down stays cleared, and</div><div style="margin: 0;">>the next PF link-up event enables the vport. Restore it on the error</div><div style="margin: 0;">>paths, as set_link_down does.</div><div style="margin: 0;"><br></div><div style="margin: 0;">[Jiacheng] Accepted. Both error paths -- vport enable failure and port enable</div><div style="margin: 0;">failure -- now restore nic_dev->admin_down = 1, matching set_link_down().</div><div style="margin: 0;">></div><div style="margin: 0;">>[PATCH 25/29] The hinic3_copy_mempool_init() comment says the pool</div><div style="margin: 0;">>"must be able to cover a full ring of in-flight packets", but the</div><div style="margin: 0;">>pool is capped at 256 mbufs per queue. Reword the comment to say the</div><div style="margin: 0;">>cap is deliberate, and that when the pool runs out the burst stops at</div><div style="margin: 0;">>that packet.</div><div style="margin: 0;"><br></div><div style="margin: 0;">[Jiacheng] Reworded. The comment no longer claims the pool covers a full ring.</div><div style="margin: 0;">It now says the 256 mbufs per queue cap is deliberate (it bounds how much</div><div style="margin: 0;">hugepage memory one port can pin) and that when the pool runs out the burst</div><div style="margin: 0;">stops at that packet and is returned to the caller. Checked against the code:</div><div style="margin: 0;">hinic3_copy_tx_mbuf_multi() returns NULL when the allocation fails, and the</div><div style="margin: 0;">call site in hinic3_tx.c returns -EINVAL there.</div><div style="margin: 0;">></div><div style="margin: 0;">>[PATCH 26/29] Before this patch, every NIC got TCPUDP_CS set for</div><div style="margin: 0;">>VXLAN, VXLAN-GPE and GENEVE packets:</div><div style="margin: 0;">></div><div style="margin: 0;">> SQ_CTRL_QUEUE_INFO_SET(queue_info->udp_dp_en, TCPUDP_CS) |</div><div style="margin: 0;">></div><div style="margin: 0;">>The new scalar path builds queue_info from TSO, PLDOFF, MSS and UC</div><div style="margin: 0;">>only, so NICs without TX_WQE_COMPACT_TASK no longer set the bit. The</div><div style="margin: 0;">>commit message does not mention this.</div><div style="margin: 0;"><br></div><div style="margin: 0;">[Jiacheng] Commit message only, code unchanged. Your description is exact: the</div><div style="margin: 0;">scalar path builds queue_info from TSO, PLDOFF, MSS and UC only, so NICs</div><div style="margin: 0;">without TX_WQE_COMPACT_TASK no longer set TCPUDP_CS, while the compact task</div><div style="margin: 0;">path still sets it. That is the intended behaviour of the new path and is now</div><div style="margin: 0;">stated in the commit message.</div><div style="margin: 0;">></div><div style="margin: 0;">>[PATCH 26/29, 28/29] The Tx path is selected by</div><div style="margin: 0;">>NIC_F_TX_WQE_COMPACT_TASK and has no CQE, yet the function is named</div><div style="margin: 0;">>hinic3_xmit_pkts_compact_cqe() and burst mode reports "compact CQE".</div><div style="margin: 0;">>"compact task" would match what it does. In the scalar burst,</div><div style="margin: 0;">>hinic3_get_sq_wqe() never returns NULL, so the !sq_wqe branch is dead</div><div style="margin: 0;">>code.</div><div style="margin: 0;"><br></div><div style="margin: 0;">[Jiacheng] Fixed. Renamed to hinic3_xmit_pkts_compact_task() (definition,</div><div style="margin: 0;">header prototype and the assignment all updated), burst mode now reports</div><div style="margin: 0;">"compact task", and the dead !sq_wqe branch is removed.</div><div style="margin: 0;"><br></div><div style="margin: 0;">[Jiacheng] One more point: on a NIC that reports the SW compact CQE bit, asking</div><div style="margin: 0;">for the separate mode now clears that bit as well, so the module parameter, the</div><div style="margin: 0;">RQ context, the CEQ attributes and the vport flag cannot disagree.</div><div style="margin: 0;"><br></div><div style="margin: 0;">[PS] The SP230 and the SP560 actually support both Rx modes and both Tx modes.</div><div style="margin: 0;">We prefer the native pairing and, to avoid extra changes, restricted the path</div><div style="margin: 0;">selection above. The SP560 works perfectly with the old separate Rx, so both</div><div style="margin: 0;">Rx paths are left open for it.</div><div style="margin: 0;">></div><div style="margin: 0;">>Review-Result: WARNING</div></div></div>