linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Philippe Bergheaud <felix@linux.vnet.ibm.com>
To: Vaibhav Jain <vaibhav@linux.vnet.ibm.com>
Cc: linuxppc-dev@lists.ozlabs.org, mikey@neuling.org,
	mrochs@linux.vnet.ibm.com, imunsie@au1.ibm.com,
	manoj@linux.vnet.ibm.com
Subject: Re: [v6, 1/2] cxl: Add mechanism for delivering AFU driver specific events
Date: Wed, 22 Jun 2016 16:02:55 +0200	[thread overview]
Message-ID: <576A9A8F.1080602@linux.vnet.ibm.com> (raw)
In-Reply-To: <87k2hkgs6v.fsf@vajain21.in.ibm.com>

> Should also check against the length of user-buffer (count) provided in the read
> call.Ideally this condition check should be moved to the read call where
> you have access to the count variable.
> 
> Right now libcxl is using a harcoded value of CXL_READ_MIN_SIZE to
> issue the read call and in kernel code we have a check to ensure that
> read buffer is atleast CXL_READ_MIN_SIZE in size.
> 
> But it might be a good idea to decouple driver from
> CXL_MAX_EVENT_DATA_SIZE. Ideally the maximum event size that we can
> support should be dependent on the amount user buffer we receive in the
> read call. That way future libcxl can support larger event_data without
> needing a change to the cxl.h
> 
[...]
>>+#define CXL_MAX_EVENT_DATA_SIZE 128
>>+
> 
> 
> Agree with Matt's earlier comments. 128 is very small and I would prefer
> for atleast a page size (4k/64K) limit.
> 

afu_read() enforces a minimum buffer size of CXL_READ_MIN_SIZE = 4K, as documented in Documentation/powerpc/cxl.txt. This information is missing from the man pages of the libcxl functions cxl_read_event/cxl_read_expected_event. I will fix these.

Regarding the maximum event size, as afu_read returns one event per call, and as there is no API to tell userland the maximum size of a cxl event, I think that we should simply use (and document) the same value (4K) as the maximum cxl event size.

Philippe

      parent reply	other threads:[~2016-06-22 14:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-16 14:13 [v6, 1/2] cxl: Add mechanism for delivering AFU driver specific events Philippe Bergheaud
2016-06-16 14:13 ` [v6,2/2] cxl: Add set and get private data to context struct Philippe Bergheaud
2016-06-17 16:21 ` [v6, 1/2] cxl: Add mechanism for delivering AFU driver specific events Matthew R. Ochs
2016-06-20  8:50 ` Vaibhav Jain
2016-06-21  4:49   ` Ian Munsie
2016-06-21 10:34     ` Vaibhav Jain
2016-06-21 13:27       ` Matthew R. Ochs
2016-06-22 14:02         ` Philippe Bergheaud
2016-06-22 14:02   ` Philippe Bergheaud [this message]

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=576A9A8F.1080602@linux.vnet.ibm.com \
    --to=felix@linux.vnet.ibm.com \
    --cc=imunsie@au1.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=manoj@linux.vnet.ibm.com \
    --cc=mikey@neuling.org \
    --cc=mrochs@linux.vnet.ibm.com \
    --cc=vaibhav@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).