public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Vinicius Costa Gomes <vinicius.gomes@intel•com>
To: Richard Cochran <richardcochran@gmail•com>
Cc: Xabier Marquiegui <xabier.marquiegui@gmail•com>,
	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, rrameshbabu@nvidia•com, shuah@kernel•org
Subject: Re: [PATCH net-next v2 2/3] ptp: support multiple timestamp event readers
Date: Thu, 14 Sep 2023 10:12:54 -0700	[thread overview]
Message-ID: <87jzssel0p.fsf@intel.com> (raw)
In-Reply-To: <ZQMiKE6x/euOv3Hc@hoboy.vegasvil.org>

Hi Richard,

Richard Cochran <richardcochran@gmail•com> writes:

> On Wed, Sep 13, 2023 at 02:25:48PM -0700, Vinicius Costa Gomes wrote:
>
>> Taking a quick look, it seems that you would have to change 'struct
>> posix_clock_file_operations' to also pass around the 'struct file' of
>> the file being used.
>
> And let drivers compare struct file pointers from different consumers?
>

That was the first idea, not very good I admit.

What you said below sounds better, more "final product".

>> That way we can track each user/"open()". And if one program decides
>> that it needs to have have multiple fds with different masks, and so
>> different queues, it should just work.
>> 
>> What do you think?
>
> See posix-clock.c : posix_clock_open()
>
> When the file is opened, the fp->private_data is used to track the
> posix_clock that was registered as a character device by the ptp
> clock instance.
>
> That character device may be opened multiple times, each time there is
> a unique fp, but fp->private_data points to the same ptp clock instance.
>
> So the information of which fp is being read() is lost.

yeah, that's the core issue.

>
> Looks like you will have to re-work posix-clock.c to allow drivers to
> provide their own "private" data populated during posix_clock_operations::open()
>
> Needs thought...
>


Cheers,
-- 
Vinicius

  reply	other threads:[~2023-09-14 17:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-12 22:02 [PATCH net-next v2 1/3] ptp: Replace timestamp event queue with linked list Xabier Marquiegui
2023-09-12 22:02 ` [PATCH net-next v2 2/3] ptp: support multiple timestamp event readers Xabier Marquiegui
2023-09-13  0:10   ` Vinicius Costa Gomes
2023-09-13  8:57     ` Xabier Marquiegui
2023-09-13 21:25       ` Vinicius Costa Gomes
2023-09-14 10:02         ` Xabier Marquiegui
2023-09-14 15:09         ` Richard Cochran
2023-09-14 17:12           ` Vinicius Costa Gomes [this message]
2023-09-19 15:15   ` kernel test robot
2023-09-12 22:02 ` [PATCH net-next v2 3/3] ptp: support event queue reader channel masks Xabier Marquiegui
2023-09-13  0:05 ` [PATCH net-next v2 1/3] ptp: Replace timestamp event queue with linked list Vinicius Costa Gomes
2023-09-13  7:56 ` Jiri Pirko
2023-09-14 14:21 ` Richard Cochran
2023-09-20 15:40 ` kernel test robot

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=87jzssel0p.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 \
    --cc=xabier.marquiegui@gmail$(echo .)com \
    /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