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] [day] [month] [year] [list]
Message-ID: <ZXxmvsqfMFIF0OWQ@hoboy.vegasvil.org>
Date: Fri, 15 Dec 2023 06:46:22 -0800
From: Richard Cochran <richardcochran@...il.com>
To: Min Li <min.li.xe@...esas.com>
Cc: Min Li <lnimi@...mail.com>, "lee@...nel.org" <lee@...nel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next v3 1/2] ptp: introduce PTP_CLOCK_EXTOFF event
 for the measured external offset

On Thu, Dec 14, 2023 at 09:59:32PM +0000, Min Li wrote:

> Would it be Ok if I use the flags to differentiate extts events from extoff?

That makes sense to me.  We can return the relevant
ptp_extts_request.flags.  Something like:

#define PTP_EXTTS_FLAGS_VALID	PTP_ENABLE_FEATURE

Then you can return

	ptp_extts_event.flags = PTP_EXTTS_FLAGS_VALID | PTP_EXT_OFFSET;

Later on, other drivers can indicate PTP_[RISING|FALLING]_EDGE, if
they can tell which one happened.

>  struct ptp_extts_event {
> -       struct ptp_clock_time t; /* Time event occured. */
> +       union {
> +               struct ptp_clock_time t; /* Time event occurred. */
> +               __s64 offset_ns;         /* Offset event occurred. */

BTW, please don't make a union here.  Instead just add text to the
comment of `struct ptp_clock_time t`.

The `struct ptp_clock_time t` can be a postive or a negative value
(see comment at the top of the file), and so you can put an offset in
there as well.

Thanks,
Richard

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ