lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <B04768ED-4E00-46AD-87A0-8AF89479A87F@flugsvamp.com>
Date:   Wed, 15 Feb 2023 11:39:02 -0800
From:   Jonathan Lemon <jlemon@...gsvamp.com>
To:     Köry Maincent <kory.maincent@...tlin.com>
Cc:     Jonathan Lemon <jonathan.lemon@...il.com>,
        Richard Cochran <richardcochran@...il.com>,
        Florian Fainelli <f.fainelli@...il.com>,
        netdev@...r.kernel.org,
        Maxime Chevallier <maxime.chevallier@...tlin.com>,
        Thomas Petazzoni <thomas.petazzoni@...tlin.com>
Subject: Re: net: phy: broadcom: error in rxtstamp callback?

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,

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ