Message ID | 20230215110755.33bb9436@kmaincent-XPS-13-7390 (mailing list archive) |
---|---|
State | RFC |
Headers | show |
Series | net: phy: broadcom: error in rxtstamp callback? | expand |
The code is correct - see Documentation/networking/timestamping.rst The function returns true/false to indicate whether a deferral is needed in order to receive the timestamp. For this chip, a deferral is never required - the timestamp is inline if it is present. — Jonathan On 15 Feb 2023, at 2:07, Köry Maincent wrote: > Hello, > > I am new to PTP API. I am currently adding the support of PTP to a PHY driver. > I looked at the other PTP supports to do it and I figured out there might be an > issue with the broadcom driver. As I am only beginner in PTP I may have wrong > and if it is the case could you explain me why. > I also don't have such broadcom PHY to test it, but I want to report it if the > issue is real. > The issue is on the rxtstamp callback, it never return true nor deliver the > skb. > > Here is the patch that may fix it: > > diff --git a/drivers/net/phy/bcm-phy-ptp.c b/drivers/net/phy/bcm-phy-ptp.c > index ef00d6163061..57bb63bd98c7 100644 > --- a/drivers/net/phy/bcm-phy-ptp.c > +++ b/drivers/net/phy/bcm-phy-ptp.c > @@ -412,7 +412,9 @@ static bool bcm_ptp_rxtstamp(struct mii_timestamper *mii_ts, > __pskb_trim(skb, skb->len - 8); > } > > - return false; > + netif_rx(skb); > + > + return true; > } > > static bool bcm_ptp_get_tstamp(struct bcm_ptp_private *priv, > -- > 2.25.1 > > > Regards,
Hello Jonathan, On Wed, 15 Feb 2023 11:39:02 -0800 Jonathan Lemon <jlemon@flugsvamp.com> wrote: > The code is correct - see Documentation/networking/timestamping.rst > > The function returns true/false to indicate whether a deferral is needed > in order to receive the timestamp. For this chip, a deferral is never > required - the timestamp is inline if it is present. Alright, thanks for your reply. Regards,
diff --git a/drivers/net/phy/bcm-phy-ptp.c b/drivers/net/phy/bcm-phy-ptp.c index ef00d6163061..57bb63bd98c7 100644 --- a/drivers/net/phy/bcm-phy-ptp.c +++ b/drivers/net/phy/bcm-phy-ptp.c @@ -412,7 +412,9 @@ static bool bcm_ptp_rxtstamp(struct mii_timestamper *mii_ts, __pskb_trim(skb, skb->len - 8); } - return false; + netif_rx(skb); + + return true; } static bool bcm_ptp_get_tstamp(struct bcm_ptp_private *priv,