From: netdev-bot+sashiko@kernel.org
To: daniel.zahka@gmail.com
Cc: alexanderduyck@fb.com, kuba@kernel.org, kernel-team@meta.com,
andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org,
pabeni@redhat.com, dimitri.daskalakis1@gmail.com,
mohsin.bashr@gmail.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v2 1/6] eth: mpnic: Tx checksum offload
Date: Thu, 12 Nov 2026 10:08:54 +0000 [thread overview]
Message-ID: <179447813438.2199510.8203457737182862437@kernel.org> (raw)
In-Reply-To: <20261110-mpnic-lso-v2-1-ccd37b051d08@gmail.com>
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] The new per-queue Tx counter `twq.csum_partial`, which reaches
userspace as the qstats `tx-needs-csum` value, goes up too early.
--
eth: mpnic: Tx checksum offload
This adds generic Tx checksum offload (NETIF_F_HW_CSUM) to mpnic, including
for encapsulated skbs via hw_enc_features. It adds mpnic_features_check() to
make sure the skb header layout fits the Tx descriptor fields. CSO frames are
counted and reported through the netdev qstats needs_csum counter.
> diff --git a/drivers/net/ethernet/meta/mpnic/mpnic_txrx.c b/drivers/net/ethernet/meta/mpnic/mpnic_txrx.c
> index 93abdec44642f..65de6d999d548 100644
> --- a/drivers/net/ethernet/meta/mpnic/mpnic_txrx.c
> +++ b/drivers/net/ethernet/meta/mpnic/mpnic_txrx.c
[ ... ]
> +static void
> +mpnic_tx_offloads(struct mpnic_ring *ring, struct sk_buff *skb, __le64 *meta)
> +{
> + struct mpnic_tx_hdrs hdrs = {};
> +
> + if (skb->ip_summed != CHECKSUM_PARTIAL)
> + return;
> +
> + mpnic_tx_fill_hdrs(skb, &hdrs);
> +
> + *meta |= cpu_to_le64(FIELD_PREP(MPNIC_TWD_CSUM_OFFSET,
> + skb->csum_offset / 2) |
> + MPNIC_TWD_FLAG_REQ_CSO);
> +
> + u64_stats_update_begin(&ring->stats.syncp);
> + u64_stats_inc(&ring->stats.twq.csum_partial);
> + u64_stats_update_end(&ring->stats.syncp);
[Severity: Low]
Should this counter be bumped only after the frame is actually queued to
the hardware?
mpnic_tx_offloads() increments twq.csum_partial for every CHECKSUM_PARTIAL
skb before mpnic_xmit_frame_ring() calls mpnic_tx_map():
> @@ -230,6 +263,8 @@ static netdev_tx_t mpnic_xmit_frame_ring(struct sk_buff *skb,
> MPNIC_XMIT_CB(skb)->bytecount = skb->len;
> MPNIC_XMIT_CB(skb)->desc_count = 0;
>
> + mpnic_tx_offloads(ring, skb, meta);
> +
> if (mpnic_tx_map(ring, skb, meta))
> goto err_free;
mpnic_tx_map() can fail in two ways. One is dma_map_single() or
skb_frag_dma_map() returning a mapping error. The other is the head or a
fragment being larger than FIELD_MAX(MPNIC_TWD_LEN). In either case the
error path frees the skb and counts it as dropped:
mpnic_xmit_frame_ring() {
...
err_free:
dev_kfree_skb_any(skb);
ring->tx_buf[tail] = NULL;
ring->tail = tail;
err_drop:
mpnic_tx_flush_doorbell(ring);
u64_stats_update_begin(&ring->stats.syncp);
u64_stats_inc(&ring->stats.twq.dropped);
u64_stats_update_end(&ring->stats.syncp);
...
}
The csum_partial increment is never undone. mpnic_get_queue_stats_tx()
then reports it as tx->needs_csum, so the same packet shows up as both
dropped and checksummed by the device, even though it never reached the
hardware.
The same ordering is still there later in the series. mpnic_tx_offloads()
also bumps hw_gso_wire through mpnic_tx_lso() before mpnic_tx_map() runs.
One option is to have mpnic_tx_offloads() report which offload it used,
and update the stats only after mpnic_tx_map() succeeds. Note that fbnic
uses the same count-before-map pattern in fbnic_tx_offloads().
> +
> + *meta |= cpu_to_le64(FIELD_PREP(MPNIC_TWD_L2_HLEN,
> + skb_mac_header_len(skb) / 2) |
> + FIELD_PREP(MPNIC_TWD_L3_IHLEN, hdrs.i3len / 2));
> +}
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261110-mpnic-lso-v2-0-ccd37b051d08%40gmail.com
next prev parent reply other threads:[~2026-11-12 10:08 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-10 22:06 [PATCH net-next v2 0/6] eth: mpnic: checksum and segmentation offloads Daniel Zahka
2026-11-10 22:06 ` [PATCH net-next v2 1/6] eth: mpnic: Tx checksum offload Daniel Zahka
2026-11-12 10:08 ` netdev-bot+sashiko [this message]
2026-11-10 22:06 ` [PATCH net-next v2 2/6] eth: mpnic: Rx " Daniel Zahka
2026-11-10 22:06 ` [PATCH net-next v2 3/6] eth: mpnic: TCP segmentation offload Daniel Zahka
2026-11-12 10:08 ` netdev-bot+sashiko
2026-11-10 22:06 ` [PATCH net-next v2 4/6] eth: mpnic: UDP " Daniel Zahka
2026-11-12 10:08 ` netdev-bot+sashiko
2026-11-10 22:06 ` [PATCH net-next v2 5/6] eth: mpnic: IPv4 and IPv6 in IPv6 tunnel segmentation Daniel Zahka
2026-11-12 10:08 ` netdev-bot+sashiko
2026-11-10 22:06 ` [PATCH net-next v2 6/6] eth: mpnic: add GSO_PARTIAL for other tunnels Daniel Zahka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179447813438.2199510.8203457737182862437@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=alexanderduyck@fb.com \
--cc=andrew+netdev@lunn.ch \
--cc=daniel.zahka@gmail.com \
--cc=davem@davemloft.net \
--cc=dimitri.daskalakis1@gmail.com \
--cc=edumazet@kernel.org \
--cc=kernel-team@meta.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mohsin.bashr@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox