mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: Ravi Gunasekaran <r-gunasekaran@ti.com>,
	s-vadapalli@ti.com,  rogerq@kernel.org
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	 richardcochran@gmail.com, jreeder@ti.com,
	netdev@vger.kernel.org,  linux-kernel@vger.kernel.org,
	srk@ti.com
Subject: Re: [PATCH net] net: ethernet: ti: am65-cpts: Fix PTPv1 message type on TX packets
Date: Tue, 23 Apr 2024 13:44:48 +0200	[thread overview]
Message-ID: <1349286d7f93aabec3b7b43aba9089f96214944e.camel@redhat.com> (raw)
In-Reply-To: <52c7352f-a91b-3604-5ae0-88d7bb814e51@ti.com>

On Tue, 2024-04-23 at 16:36 +0530, Ravi Gunasekaran wrote:
> On 4/23/24 3:31 PM, Paolo Abeni wrote:
> > On Fri, 2024-04-19 at 13:35 +0530, Ravi Gunasekaran wrote:
> > > From: Jason Reeder <jreeder@ti.com>
> > > 
> > > The CPTS, by design, captures the messageType (Sync, Delay_Req, etc.)
> > > field from the second nibble of the PTP header which is defined in the
> > > PTPv2 (1588-2008) specification. In the PTPv1 (1588-2002) specification
> > > the first two bytes of the PTP header are defined as the versionType
> > > which is always 0x0001. This means that any PTPv1 packets that are
> > > tagged for TX timestamping by the CPTS will have their messageType set
> > > to 0x0 which corresponds to a Sync message type. This causes issues
> > > when a PTPv1 stack is expecting a Delay_Req (messageType: 0x1)
> > > timestamp that never appears.
> > > 
> > > Fix this by checking if the ptp_class of the timestamped TX packet is
> > > PTP_CLASS_V1 and then matching the PTP sequence ID to the stored
> > > sequence ID in the skb->cb data structure. If the sequence IDs match
> > > and the packet is of type PTPv1 then there is a chance that the
> > > messageType has been incorrectly stored by the CPTS so overwrite the
> > > messageType stored by the CPTS with the messageType from the skb->cb
> > > data structure. This allows the PTPv1 stack to receive TX timestamps
> > > for Delay_Req packets which are necessary to lock onto a PTP Leader.
> > > 
> > > Signed-off-by: Jason Reeder <jreeder@ti.com>
> > > Signed-off-by: Ravi Gunasekaran <r-gunasekaran@ti.com>
> > 
> > Please provide a suitable fixes tag, thanks!
> 
> am65_cpts_match_tx_ts() was added in the very first commit of the file.
> Would that be a suitable fixes tag? 

It looks like it is, since such function exposed the buggy behaviour
since the beginning.

> I understand that the purpose of
> the fixes tag is to know to which all previous kernels, the fix needs to
> be applied. 

Yes, it's used by stable team(s) to filter fixes relevant for a given
stable tree. A correct hash allow to do that automatically.


Cheers,

Paolo


      reply	other threads:[~2024-04-23 11:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-19  8:05 Ravi Gunasekaran
2024-04-19 17:03 ` Jason Reeder
2024-04-23 10:01 ` Paolo Abeni
2024-04-23 11:06   ` Ravi Gunasekaran
2024-04-23 11:44     ` Paolo Abeni [this message]

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=1349286d7f93aabec3b7b43aba9089f96214944e.camel@redhat.com \
    --to=pabeni@redhat.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jreeder@ti.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=r-gunasekaran@ti.com \
    --cc=richardcochran@gmail.com \
    --cc=rogerq@kernel.org \
    --cc=s-vadapalli@ti.com \
    --cc=srk@ti.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

all inboxes | Powered by JetHome®