[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <b6779c36-c969-42dd-9395-6c34de55a5d9@bootlin.com>
Date: Fri, 16 Jan 2026 08:08:48 +0100
From: Bastien Curutchet <bastien.curutchet@...tlin.com>
To: Maxime Chevallier <maxime.chevallier@...tlin.com>,
Woojung Huh <woojung.huh@...rochip.com>, UNGLinuxDriver@...rochip.com,
Andrew Lunn <andrew@...n.ch>, Vladimir Oltean <olteanv@...il.com>,
"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Richard Cochran <richardcochran@...il.com>, Simon Horman <horms@...nel.org>
Cc: Pascal Eberhard <pascal.eberhard@...com>,
Miquèl Raynal <miquel.raynal@...tlin.com>,
Thomas Petazzoni <thomas.petazzoni@...tlin.com>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next 5/8] net: dsa: microchip: Add KSZ8463 tail tag
handling
Hi Maxime,
On 1/15/26 6:05 PM, Maxime Chevallier wrote:
> Hi Bastien,
>
> On 15/01/2026 16:57, Bastien Curutchet (Schneider Electric) wrote:
>> KSZ8463 uses the KSZ9893 DSA TAG driver. However, the KSZ8463 doesn't
>> use the tail tag to convey timestamps to the host as KSZ9893 does. It
>> uses the reserved fields in the PTP header instead.
>
> [ ... ]
>
>> +static struct sk_buff *ksz8463_rcv(struct sk_buff *skb, struct net_device *dev)
>> +{
>> + unsigned int len = KSZ_EGRESS_TAG_LEN;
>> + struct ptp_header *ptp_hdr;
>> + unsigned int ptp_class;
>> + unsigned int port;
>> + ktime_t tstamp;
>> + u8 *tag;
>> +
>> + if (skb_linearize(skb))
>> + return NULL;
>> +
>> + /* Tag decoding */
>> + tag = skb_tail_pointer(skb) - KSZ_EGRESS_TAG_LEN;
>> + port = tag[0] & KSZ8463_TAIL_TAG_EG_PORT_M;
>> +
>> + __skb_push(skb, ETH_HLEN);
>> + ptp_class = ptp_classify_raw(skb);
>> + __skb_pull(skb, ETH_HLEN);
>> + if (ptp_class == PTP_CLASS_NONE)
>> + goto common_rcv;
>> +
>> + ptp_hdr = ptp_parse_header(skb, ptp_class);
>> + if (ptp_hdr) {
>> + tstamp = ksz_decode_tstamp(get_unaligned_be32(&ptp_hdr->reserved2));
>> + KSZ_SKB_CB(skb)->tstamp = tstamp;
>
> As it is using a reserved field, is it OK to leave this field as-is when forwarding
> this skb to userspace, or should it be zeroed first ?
>
It doesn't seem to hurt, at least on my test setup (I'm using ptp4l in
userspace btw), but I agree with you: it feels safer to zero it first.
I'll do it in next iteration.
Best regards,
Bastien
Powered by blists - more mailing lists