Re: [PATCH net] hinic3: Fix SKB linearization mismatch and silent TX drops
From: Simon Horman
Date: Tue Aug 11 2026 - 05:37:09 EST
On Mon, Aug 10, 2026 at 08:57:32AM +0800, Fan Gong wrote:
> Previously, hinic3_send_one_skb() cached the SKB fragment count before
> calling hinic3_tx_offload(). If hinic3_tx_csum() falls back to
> skb_checksum_help() for unsupported tunnel packets, the SKB may be
> linearized. Continuing to build the TX descriptor with the stale
> fragment count leads to a descriptor mismatch, which can trigge
> out-of-bounds DMA reads or IOMMU faults.
>
> Furthermore, the old code ignored the return value of skb_checksum_help(),
> transmitting corrupted packets with incomplete checksums upon failure. It
> also failed to increment drop statistics across various TX error paths,
> causing packets to be dropped silently without notifying the user.
>
> Fix this by:
> 1. Moving the hinic3_tx_offload() call before calculating 'num_sge' to
> ensure the correct fragment count is used if the SKB is linearized.
> 2. Propagating skb_checksum_help() errors and returning
> HINIC3_TX_OFFLOAD_INVALID to properly drop the skb.
> 3. Adding missing statistics increments (dropped, map_frag_err,
> unknown_tunnel_pkt, skb_pad_err) across the TX error paths so these
> events are correctly reflected in interface statistics.
Did part 3 go missing?
I'm not seeing it in the patch.
>
> Fixes: 17fcb3dc12bb ("hinic3: module initialization and tx/rx logic")
> Co-developed-by: Teng Peisen <tengpeisen@xxxxxxxxxx>
> Signed-off-by: Teng Peisen <tengpeisen@xxxxxxxxxx>
> Co-developed-by: Wu Di <wudi234@xxxxxxxxxx>
> Signed-off-by: Wu Di <wudi234@xxxxxxxxxx>
> Signed-off-by: Fan Gong <gongfan1@xxxxxxxxxx>
Also, this seems to be v3 of this patch.
For reference, that should be noted in the subject like this:
Subject: [PATCH v3 net] ...