public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Vinicius Costa Gomes <vinicius.gomes@intel•com>
To: Xabier Marquiegui <reibax@gmail•com>
Cc: alex.maftei@amd•com, chrony-dev@chrony•tuxfamily.org,
	davem@davemloft•net, horms@kernel•org, mlichvar@redhat•com,
	netdev@vger•kernel.org, ntp-lists@mattcorallo•com,
	reibax@gmail•com, richardcochran@gmail•com,
	rrameshbabu@nvidia•com, shuah@kernel•org
Subject: Re: [PATCH net-next v3 3/3] ptp: support event queue reader channel masks
Date: Mon, 02 Oct 2023 15:54:42 -0700	[thread overview]
Message-ID: <87wmw43aa5.fsf@intel.com> (raw)
In-Reply-To: <20230930080155.936-1-reibax@gmail.com>

Xabier Marquiegui <reibax@gmail•com> writes:

> Vinicius Costa Gomes <vinicius.gomes@intel•com> writes:
>
>> Looking below, at the usability of the API, it feels too complicated, I
>> was trying to think, "how an application would change the mask for
>> itself": first it would need to know the PID of the process that created
>> the fd, then it would have to find the OID associated with that PID, and
>> then build the request.
>> 
>> And it has the problem of being error prone, for example, it's easy for
>> an application to override the mask of another, either by mistake or
>> else.
>> 
>> My suggestion is to keep things simple, the "SET" only receives the
>> 'mask', and it only changes the mask for that particular fd (which you
>> already did the hard work of allowing that). Seems to be less error prone.
>> 
>> At least in my mental model, I don't think much else is needed (we
>> expose only a "SET" operation), at least from the UAPI side of things.
>> 
>> For "debugging", i.e. discovering which applications have what masks,
>> then perhaps we could do it "on the side", for example, a debugfs entry
>> that lists all open file descriptors and their masks. Just an idea.
>> 
>> What do you think?
>
> Thank you very much for your input Vinicius. I really appreciate it.
>
> I totally agree with your observations. I had already thought about that angle
> myself, but I decided to go this route anyway because it was the only way I
> could think of meeting all of Richard's requirements at that time.
>
> Even if being error prone, being able to externally manipulate the channel
> masks is the only way I can think of to make this feature backwards compatible
> with existing software. One example of a piece of software that would need to
> be updated to support multiple channels is linuxptp. If you try to start ts2phc
> with multiple channels enabled and no masks, it refuses to work stating that
> unwanted channels are present. This would be easy to fix, incorporating the
> SET operation you mention, but it is still something that needs to be changed.
>

I never looked at this a lot, so, as always, I could be missing stuff.

But from the way I see things, the solution that seems better has two
parts:

1. Fix ts2phc to ignore events from channels that it cannot/doesn't want
   to handle. (Is this possible?)
2. Add the "set mask ioctl/alternative ideas, is then more like a
   optimization, to avoid waking up applications that don't want some
   events;

So we have 'ts2phc' working on "old" kernels and on "new" kernels it is
"just" more efficient.

> Now that I think of it, it is true that nothing prevents us from having both
> methods available: the simple and safe, and the complicated and unsafe.
>
> Even with that option, I also think that going exclusively with the safe
> and simple route is better.
>
> So, I wonder: Can we just do it and require changes in software that relies
> on this driver, or should we maintain compatibility at all cost?
>
> Thank you very much for sharing your knowledge and experience.


Cheers,
-- 
Vinicius

  reply	other threads:[~2023-10-02 22:54 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-28 13:35 [PATCH net-next v3 0/3] ptp: Support for multiple filtered timestamp event queue readers Xabier Marquiegui
2023-09-28 13:35 ` [PATCH net-next v3 1/3] ptp: Replace timestamp event queue with linked list Xabier Marquiegui
2023-09-30 21:44   ` Richard Cochran
2023-09-28 13:35 ` [PATCH net-next v3 2/3] ptp: support multiple timestamp event readers Xabier Marquiegui
2023-09-29 23:43   ` Vinicius Costa Gomes
2023-09-30 21:57   ` Richard Cochran
2023-09-30 22:05   ` Richard Cochran
2023-09-30 22:10   ` Richard Cochran
2023-10-01 15:06   ` Simon Horman
2023-09-28 13:35 ` [PATCH net-next v3 3/3] ptp: support event queue reader channel masks Xabier Marquiegui
2023-09-30  0:03   ` Vinicius Costa Gomes
2023-09-30  8:01     ` Xabier Marquiegui
2023-10-02 22:54       ` Vinicius Costa Gomes [this message]
2023-09-30 22:37   ` Richard Cochran
2023-10-01 15:12   ` Simon Horman
2023-10-01 18:51     ` Richard Cochran
2023-09-29 23:39 ` [PATCH net-next v3 0/3] ptp: Support for multiple filtered timestamp event queue readers Vinicius Costa Gomes
2023-09-30 21:38 ` Richard Cochran

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=87wmw43aa5.fsf@intel.com \
    --to=vinicius.gomes@intel$(echo .)com \
    --cc=alex.maftei@amd$(echo .)com \
    --cc=chrony-dev@chrony$(echo .)tuxfamily.org \
    --cc=davem@davemloft$(echo .)net \
    --cc=horms@kernel$(echo .)org \
    --cc=mlichvar@redhat$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=ntp-lists@mattcorallo$(echo .)com \
    --cc=reibax@gmail$(echo .)com \
    --cc=richardcochran@gmail$(echo .)com \
    --cc=rrameshbabu@nvidia$(echo .)com \
    --cc=shuah@kernel$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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