linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Gavin Shan <gwshan@linux.vnet.ibm.com>
To: Alex Williamson <alex.williamson@redhat.com>
Cc: "aik@ozlabs.ru" <aik@ozlabs.ru>, Alexander Graf <agraf@suse.de>,
	"kvm-ppc@vger.kernel.org" <kvm-ppc@vger.kernel.org>,
	Gavin Shan <gwshan@linux.vnet.ibm.com>,
	"qiudayu@linux.vnet.ibm.com" <qiudayu@linux.vnet.ibm.com>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>
Subject: Re: [PATCH v6 2/3] drivers/vfio: EEH support for VFIO PCI device
Date: Sat, 24 May 2014 11:37:54 +1000	[thread overview]
Message-ID: <20140524013754.GA4636@shangw> (raw)
In-Reply-To: <1400856559.3289.460.camel@ul30vt.home>

On Fri, May 23, 2014 at 08:49:19AM -0600, Alex Williamson wrote:
>On Fri, 2014-05-23 at 14:30 +0200, Alexander Graf wrote:
>> On 23.05.14 13:58, Gavin Shan wrote:
>> > On Fri, May 23, 2014 at 08:52:23AM +0200, Alexander Graf wrote:
>> >>> Am 23.05.2014 um 05:23 schrieb Alex Williamson <alex.williamson@redhat.com>:
>> >>>> On Fri, 2014-05-23 at 10:37 +1000, Gavin Shan wrote:
>> >>>>> On Fri, May 23, 2014 at 10:17:30AM +1000, Gavin Shan wrote:
>> >>>>>> On Thu, May 22, 2014 at 11:55:29AM +0200, Alexander Graf wrote:
>> >>>>>> On 22.05.14 10:23, Gavin Shan wrote:

.../...

>
>If there's a reason to use something other than _IO+argsz+flags, we can
>discuss it, but this is not it.
>

If I just need a command, need I define a struct for the command, or I
should pass "NULL" for the 3rd parameter of ioctl() ?

struct foo {
	uint32_t argsz;
	uint32_t flags;
};

>> >   Also, I need keep the return value from
>> > ioctl() less or equal to 0 ? :-)
>> 
>> Usually return values are
>> 
>>    < 0 means error
>>    == 0 means success
>>    > 0 means return payload
>
>Agree, >0 only makes sense if the return value of the ioctl can be
>expressed as a positive int, ex. VFIO_EEH_ERROR_COUNT (if such a thing
>was needed).  Thanks,
>

What if I have to return "0" ? For "0", I need have a field in the
data struct to carry it. For "> 0", to carry it with return value
from ioctl(). Why not make it unified to have additional field in
the data struct to carry the return values. In this case, ioctl()
just returns:

<  0: error
== 0: success, check return value from the data struct.

Thanks,
Gavin

  reply	other threads:[~2014-05-24  1:38 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-22  8:23 [PATCH v6 0/3] EEH Support for VFIO PCI device Gavin Shan
2014-05-22  8:23 ` [PATCH v6 1/3] powerpc/eeh: Flags for passed device and PE Gavin Shan
2014-05-22  8:23 ` [PATCH v6 2/3] drivers/vfio: EEH support for VFIO PCI device Gavin Shan
2014-05-22  9:55   ` Alexander Graf
2014-05-23  0:17     ` Gavin Shan
2014-05-23  0:37       ` Gavin Shan
2014-05-23  3:23         ` Alex Williamson
2014-05-23  6:52           ` Alexander Graf
2014-05-23 11:58             ` Gavin Shan
2014-05-23 12:30               ` Alexander Graf
2014-05-23 14:49                 ` Alex Williamson
2014-05-24  1:37                   ` Gavin Shan [this message]
2014-05-23 12:51             ` Alex Williamson
2014-05-23 13:24               ` Alexander Graf
2014-05-23  3:10   ` Alex Williamson
2014-05-23  4:37     ` Gavin Shan
2014-05-23  5:00       ` Benjamin Herrenschmidt
2014-05-23 14:36         ` Alex Williamson
2014-05-23  6:55       ` Alexander Graf
2014-05-23  7:37         ` Gavin Shan
2014-05-23  9:58           ` Alexander Graf
2014-05-23 11:55             ` Gavin Shan
2014-05-23 11:58               ` Alexander Graf
2014-05-23 12:43                 ` Gavin Shan
2014-05-23 12:49                   ` Alexander Graf
2014-05-24  1:46                     ` Gavin Shan
2014-05-23 14:29       ` Alex Williamson
2014-05-24  2:06         ` Gavin Shan
2014-05-27 17:39           ` Alex Williamson
2014-05-22  8:23 ` [PATCH v6 3/3] powerpc/eeh: Avoid event on passed PE Gavin Shan
2014-05-22  9:55   ` Alexander Graf
2014-05-23  0:01     ` Gavin Shan

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=20140524013754.GA4636@shangw \
    --to=gwshan@linux.vnet.ibm.com \
    --cc=agraf@suse.de \
    --cc=aik@ozlabs.ru \
    --cc=alex.williamson@redhat.com \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=qiudayu@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).