From: Jakub Kicinski <kuba@kernel.org>
To: sukhdeeps@marvell.com
Cc: Jakub Kicinski <kuba@kernel.org>,
netdev@vger.kernel.org, andrew+netdev@lunn.ch,
davem@davemloft.net, edumazet@google.com, pabeni@redhat.com,
linux-kernel@vger.kernel.org, horms@kernel.org,
vadim.fedorenko@linux.dev
Subject: Re: [PATCH net-next v4 11/12] net: atlantic: add AQC113 TX timestamp polling and PTP TX classification
Date: Thu, 4 Jun 2026 19:38:39 -0700 [thread overview]
Message-ID: <20260605023839.3629209-1-kuba@kernel.org> (raw)
In-Reply-To: <20260602135452.516-12-sukhdeeps@marvell.com>
This is an AI-generated review of your patch. The human sending this
email has considered the AI review valid, or at least plausible.
---
net: atlantic: add AQC113 TX timestamp polling and PTP TX classification
This patch wires PTP TX timestamp polling into aq_ring_tx_clean(), adds
IPv6 PTP packet classification in aq_ndev_start_xmit(), and moves the
RX-flow and VLAN filter reapply calls from aq_ndev_open() into
aq_nic_start().
> diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_main.c b/drivers/net/ethernet/aquantia/atlantic/aq_main.c
> index 4ef4fe64b8ac..1da14786fe5c 100644
> --- a/drivers/net/ethernet/aquantia/atlantic/aq_main.c
> +++ b/drivers/net/ethernet/aquantia/atlantic/aq_main.c
> @@ -68,14 +70,6 @@ int aq_ndev_open(struct net_device *ndev)
> if (err < 0)
> goto err_exit;
>
> - err = aq_reapply_rxnfc_all_rules(aq_nic);
> - if (err < 0)
> - goto err_exit;
> -
> - err = aq_filters_vlans_update(aq_nic);
> - if (err < 0)
> - goto err_exit;
> -
> err = aq_nic_start(aq_nic);
[Low]
The commit message bullet says:
Remove stale aq_ndev_open() PTP call that was moved to aq_nic_start().
The lines actually removed from aq_ndev_open() are
aq_reapply_rxnfc_all_rules() and aq_filters_vlans_update(), which are
RX-flow-classifier and VLAN-filter helpers rather than PTP calls. Should
this bullet be reworded to describe the filter helpers that were actually
moved?
Also, aq_nic_start() is invoked from atl_resume_common() in aq_pci_func.c
in addition to aq_ndev_open(). Moving these helpers into aq_nic_start()
means RX-flow and VLAN filters will now be reapplied on every PM resume,
which is a behavioral change beyond plain deduplication. Should the
changelog call this resume-path side effect out explicitly?
[ ... ]
> diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_ring.c b/drivers/net/ethernet/aquantia/atlantic/aq_ring.c
> index e270327e47fd..dd1af3deb2d1 100644
> --- a/drivers/net/ethernet/aquantia/atlantic/aq_ring.c
> +++ b/drivers/net/ethernet/aquantia/atlantic/aq_ring.c
> @@ -311,6 +311,27 @@ bool aq_ring_tx_clean(struct aq_ring_s *self)
> if (likely(!buff->is_eop))
> goto out;
>
> + if (unlikely(buff->request_ts) &&
> + self->aq_nic->aq_hw_ops->hw_ring_tx_ptp_get_ts) {
> + u64 ts = self->aq_nic->aq_hw_ops->hw_ring_tx_ptp_get_ts(self);
> +
> + if (!ts) {
> + if (time_after(jiffies,
> + self->ptp_ts_deadline)) {
> + /* Timeout: free skb, unblock ring */
> + buff->request_ts = 0;
> + dev_kfree_skb_any(buff->skb);
> + buff->skb = NULL;
> + goto out;
[Medium]
Can the timeout branch desynchronize aq_ptp->skb_ring from buff_ring?
aq_ptp_xmit() pushes every PTP TX skb into aq_ptp->skb_ring via
aq_ptp_skb_put() (which holds its own reference via skb_get()), and
aq_ptp_tx_hwtstamp() consumes them in strict FIFO order:
aq_ptp.c:aq_ptp_tx_hwtstamp() {
struct sk_buff *skb = aq_ptp_skb_get(&aq_ptp->skb_ring);
...
skb_tstamp_tx(skb, &hwtstamp);
dev_kfree_skb_any(skb);
}
The new timeout branch frees buff->skb and advances sw_head, but does not
dequeue the matching entry from aq_ptp->skb_ring. After a timeout, the
stale skb pointer remains at the head of skb_ring while the buff_ring
moves on.
When the next PTP TX timestamp arrives, would aq_ptp_tx_hwtstamp() pop
that stale skb and call skb_tstamp_tx() with the timestamp belonging to
a later, unrelated packet? Every subsequent PTP packet would then have
its TX timestamp misattributed by one slot until aq_ptp_tx_timeout_check()
calls aq_ptp_skb_ring_clean() to fully drain skb_ring (~10s later).
Should the timeout branch also dequeue and drop the head of skb_ring,
e.g. via aq_ptp_skb_get() followed by dev_kfree_skb_any() of the returned
skb, to keep skb_ring and buff_ring in lockstep?
> + } else {
> + buff->is_mapped = 0;
> + buff->pa = 0U;
> + break;
> + }
> + }
> +
> + aq_ptp_tx_hwtstamp(self->aq_nic, ts);
> + }
> if (buff->skb) {
> u64_stats_update_begin(&self->stats.tx.syncp);
> ++self->stats.tx.packets;
[ ... ]
next prev parent reply other threads:[~2026-06-05 2:38 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-02 13:54 [PATCH net-next v4 0/12] net: atlantic: add PTP support for AQC113 (Antigua) sukhdeeps
2026-06-02 13:54 ` [PATCH net-next v4 1/12] net: atlantic: correct L3L4 filter flow_type masking and IPv6 handling sukhdeeps
2026-06-02 13:54 ` [PATCH net-next v4 2/12] net: atlantic: move active_ipv4/ipv6 bitmap updates after HW write sukhdeeps
2026-06-02 13:54 ` [PATCH net-next v4 3/12] net: atlantic: decouple aq_set_data_fl3l4() from driver internals sukhdeeps
2026-06-02 13:54 ` [PATCH net-next v4 4/12] net: atlantic: add AQC113 hardware register definitions and accessors sukhdeeps
2026-06-02 13:54 ` [PATCH net-next v4 5/12] net: atlantic: add AQC113 filter data structures and firmware query sukhdeeps
2026-06-05 2:38 ` Jakub Kicinski
2026-06-02 13:54 ` [PATCH net-next v4 6/12] net: atlantic: fix AQC113 HW init: ART, L2 filter slot, MAC address sukhdeeps
2026-06-05 2:38 ` Jakub Kicinski
2026-06-02 13:54 ` [PATCH net-next v4 7/12] net: atlantic: implement AQC113 L2/L3/L4 RX filter ops sukhdeeps
2026-06-05 2:38 ` Jakub Kicinski
2026-06-02 13:54 ` [PATCH net-next v4 8/12] net: atlantic: add AQC113 PTP traffic class and TX path setup sukhdeeps
2026-06-02 13:54 ` [PATCH net-next v4 9/12] net: atlantic: extend hw_ops and TX descriptor for AQC113 PTP sukhdeeps
2026-06-02 13:54 ` [PATCH net-next v4 10/12] net: atlantic: add AQC113 PTP hardware ops in hw_atl2 sukhdeeps
2026-06-05 2:38 ` Jakub Kicinski
2026-06-02 13:54 ` [PATCH net-next v4 11/12] net: atlantic: add AQC113 TX timestamp polling and PTP TX classification sukhdeeps
2026-06-05 2:38 ` Jakub Kicinski [this message]
2026-06-02 13:54 ` [PATCH net-next v4 12/12] net: atlantic: add AQC113 PTP support in aq_ptp and driver core sukhdeeps
2026-06-05 2:38 ` Jakub Kicinski
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=20260605023839.3629209-1-kuba@kernel.org \
--to=kuba@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sukhdeeps@marvell.com \
--cc=vadim.fedorenko@linux.dev \
/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