From: sashiko-bot@kernel.org
To: wei.fang@oss.nxp.com
Cc: imx@lists.linux.dev, Frank.Li@kernel.org
Subject: Re: [PATCH v7 net-next 8/9] net: dsa: netc: add PTP two-step timestamping support
Date: Thu, 12 Nov 2026 06:24:13 +0000 [thread overview]
Message-ID: <sashiko-outbox-210520@kernel.org> (raw)
In-Reply-To: <20261111062753.1397582-9-wei.fang@oss.nxp.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] net: dsa: netc: incomplete IPFT_FAF_L4_CODE mask in
netc_build_ptp_ipft_keye()
--
commit 3f2860d50cc9cac6dd4199f17906d6ee10ebd675
Author: Wei Fang <wei.fang@nxp.com>
net: dsa: netc: add PTP two-step timestamping support
This commit adds RX hardware timestamping via ingress port filter table
(IPFT) rules and two-step TX hardware timestamping support to the NXP NETC
DSA switch driver and tagger.
> diff --git a/drivers/net/dsa/netc/netc_ptp.c b/drivers/net/dsa/netc/netc_ptp.c
> new file mode 100644
> index 0000000000000..0bcc01ebf01de
> --- /dev/null
> +++ b/drivers/net/dsa/netc/netc_ptp.c
[ ... ]
> +static int netc_build_ptp_ipft_keye(struct ipft_keye_data *keye, int port,
> + enum netc_ptp_type type)
> +{
> + u16 src_port, frm_attr_flags;
> +
> + keye->precedence = cpu_to_le16(NETC_IPFT_PTP_PRECEDENCE);
> + src_port = FIELD_PREP(IPFT_SRC_PORT, port);
> + src_port |= IPFT_SRC_PORT_MASK;
> + keye->src_port = cpu_to_le16(src_port);
> +
> + switch (type) {
> + case NETC_PTP_L2:
> + keye->ethertype = htons(ETH_P_1588);
> + keye->ethertype_mask = htons(0xffff);
> + break;
> + case NETC_PTP_L4_IPV4_EVENT:
> + case NETC_PTP_L4_IPV4_GENERAL:
> + case NETC_PTP_L4_IPV6_EVENT:
> + case NETC_PTP_L4_IPV6_GENERAL:
> + frm_attr_flags = IPFT_FAF_IP_HDR | FIELD_PREP(IPFT_FAF_L4_CODE,
> + IPFT_FAF_UDP_HDR);
> + if (type == NETC_PTP_L4_IPV6_EVENT ||
> + type == NETC_PTP_L4_IPV6_GENERAL)
> + frm_attr_flags |= IPFT_FAF_IP_VER6;
> +
> + keye->frm_attr_flags = cpu_to_le16(frm_attr_flags);
> +
> + /* Set IP version bit in flags_mask to match IPv4 or IPv6
> + * packets
> + */
> + frm_attr_flags |= IPFT_FAF_IP_VER6;
> + keye->frm_attr_flags_mask = cpu_to_le16(frm_attr_flags);
[Severity: Low]
Does reusing frm_attr_flags for keye->frm_attr_flags_mask leave the lower
bit of IPFT_FAF_L4_CODE unmasked?
In include/linux/fsl/ntmp.h, IPFT_FAF_L4_CODE is GENMASK(11, 10) and
IPFT_FAF_UDP_HDR is 2, so FIELD_PREP(IPFT_FAF_L4_CODE, IPFT_FAF_UDP_HDR)
only sets bit 11. Without ORing IPFT_FAF_L4_CODE into frm_attr_flags_mask,
bit 10 is left wildcarded in the frame attribute flags check (matching both
IPFT_FAF_UDP_HDR and IPFT_FAF_SCTP_HDR, though keye->ip_protocol still
restricts the rule to IPPROTO_UDP).
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261111062753.1397582-1-wei.fang@oss.nxp.com?part=8
next prev parent reply other threads:[~2026-11-12 6:24 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-11 6:27 [PATCH v7 net-next 0/9] net: dsa: netc: add PTP support for NETC switch wei.fang
2026-11-11 6:27 ` [PATCH v7 net-next 1/9] ptp: netc: use ioread64_lo_hi/iowrite64_lo_hi for 64-bit register access wei.fang
2026-11-11 6:27 ` [PATCH v7 net-next 2/9] ptp: netc: remove unnecessary pcie_flr() call in probe wei.fang
2026-11-11 6:27 ` [PATCH v7 net-next 3/9] ptp: netc: export netc_timer_get_current_time() for cross-driver use wei.fang
2026-11-11 6:27 ` [PATCH v7 net-next 4/9] net: dsa: netc: tie setup resources and reset to DSA setup/teardown wei.fang
2026-11-11 6:27 ` [PATCH v7 net-next 5/9] net: dsa: netc: use entry ID instead of pointer to track host flood rule wei.fang
2026-11-11 6:27 ` [PATCH v7 net-next 6/9] net: dsa: netc: check return value of ntmp_ipft_delete_entry() wei.fang
2026-11-11 6:27 ` [PATCH v7 net-next 7/9] net: dsa: netc: enable ingress port filtering lookup by default wei.fang
2026-11-11 6:27 ` [PATCH v7 net-next 8/9] net: dsa: netc: add PTP two-step timestamping support wei.fang
2026-11-12 6:24 ` sashiko-bot [this message]
2026-11-12 8:24 ` Wei Fang (OSS)
2026-11-11 6:27 ` [PATCH v7 net-next 9/9] net: dsa: netc: add PTP one-step " wei.fang
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=sashiko-outbox-210520@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=Frank.Li@kernel.org \
--cc=imx@lists.linux.dev \
--cc=sashiko-reviews@lists.linux.dev \
--cc=wei.fang@oss.nxp.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.