From: Petr Machata <petrm@nvidia.com>
To: Taylor Bates <tmbates12@gmail.com>
Cc: <idosch@nvidia.com>, <petrm@nvidia.com>,
Andrew Lunn <andrew+netdev@lunn.ch>, <davem@davemloft.net>,
<edumazet@google.com>, <kuba@kernel.org>, <pabeni@redhat.com>,
<amcohen@nvidia.com>, <netdev@vger.kernel.org>
Subject: Re: [PATCH net] mlxsw: spectrum_ptp: Fix napi_gro_receive() call from GC workqueue context
Date: Thu, 3 Sep 2026 11:30:24 +0200 [thread overview]
Message-ID: <87mrtyznpr.fsf@pmachata.org> (raw)
In-Reply-To: <20260902024949.2273997-1-tmbates12@gmail.com> (Taylor Bates's message of "Tue, 1 Sep 2026 22:49:46 -0400")
Taylor Bates <tmbates12@gmail.com> writes:
> This patch adds an ingress-delivery helper for the PTP packet_finish()
> path that calls netif_receive_skb() instead of napi_gro_receive().
> netif_receive_skb(), unlike napi_gro_receive(), can be called from outside
> of the NAPI instance's poll context, which can occur at the call site for
> this path. RX stats accounting and the skb->dev assignment are still
> preserved; the only change is the delivery call itself.
>
> This removes GRO batching for any PTP event traffic received by the mlxsw
> trap, but given the relatively low volume of traffic characteristic of the
> protocol, and impact limited to only Spectrum-1 ASICs, this is an
> acceptable solution.
>
> Fixes: 1ba06ca96ca2 ("mlxsw: Switch to napi_gro_receive()")
> Signed-off-by: Taylor Bates <tmbates12@gmail.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
> ---
> .../ethernet/mellanox/mlxsw/spectrum_ptp.c | 34 ++++++++++++++++++-
> 1 file changed, 33 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c
> index 9939749c47bc..9c5862f4e16a 100644
> --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c
> +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c
> @@ -572,6 +572,38 @@ mlxsw_sp1_ptp_unmatched_remove(struct mlxsw_sp *mlxsw_sp,
> +static void mlxsw_sp1_ptp_rx_finish(struct mlxsw_sp_port *mlxsw_sp_port,
> + struct sk_buff *skb)
> +{
> + struct mlxsw_sp_port_pcpu_stats *pcpu_stats;
> +
> + skb->dev = mlxsw_sp_port->dev;
> +
> + pcpu_stats = this_cpu_ptr(mlxsw_sp_port->pcpu_stats);
> + u64_stats_update_begin(&pcpu_stats->syncp);
> + pcpu_stats->rx_packets++;
> + pcpu_stats->rx_bytes += skb->len;
> + u64_stats_update_end(&pcpu_stats->syncp);
> +
> + skb->protocol = eth_type_trans(skb, skb->dev);
> + netif_receive_skb(skb);
> +}
Not entirely happy with inlining like this, but there are at least two
copies of this block already. We could factor out the commonality at
some point, but the code is mechanical and I think it's OK.
> +
> /* This function is called in the following scenarios:
> *
> * 1) When a packet is matched with its timestamp.
next prev parent reply other threads:[~2026-09-03 9:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-02 2:49 [PATCH net] mlxsw: spectrum_ptp: Fix napi_gro_receive() call from GC workqueue context Taylor Bates
2026-09-03 9:30 ` Petr Machata [this message]
2026-09-04 0:10 ` patchwork-bot+netdevbpf
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=87mrtyznpr.fsf@pmachata.org \
--to=petrm@nvidia.com \
--cc=amcohen@nvidia.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=idosch@nvidia.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=tmbates12@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.