From: Miao Yan <yanmiaobest@gmail.com>
To: P J P <ppandit@redhat.com>
Cc: Dmitry Fleytman <dmitry@daynix.com>,
Jason Wang <jasowang@redhat.com>, QEMU <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH 1/3] net/vmxnet3: return 1 on device activation failure
Date: Tue, 22 Dec 2015 10:56:36 +0800 [thread overview]
Message-ID: <CAPc5xaPS+pmemPCJo7v=S3XMHy9HBZL_9U2w6E=UyxqLYOmefw@mail.gmail.com> (raw)
In-Reply-To: <alpine.LFD.2.20.1512212337060.26574@wniryva>
2015-12-22 2:15 GMT+08:00 P J P <ppandit@redhat.com>:
> +-- On Mon, 21 Dec 2015, Miao Yan wrote --+
> | So return 1 on device activation failure instead of -1;
> |
> | Signed-off-by: Miao Yan <yanmiaobest@gmail.com>
> | ---
> | hw/net/vmxnet3.c | 2 +-
> | 1 file changed, 1 insertion(+), 1 deletion(-)
> |
> | diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c
> | index e168285..9185408 100644
> | --- a/hw/net/vmxnet3.c
> | +++ b/hw/net/vmxnet3.c
> | @@ -1652,7 +1652,7 @@ static uint64_t vmxnet3_get_command_status(VMXNET3State *s)
> |
> | switch (s->last_command) {
> | case VMXNET3_CMD_ACTIVATE_DEV:
> | - ret = (s->device_active) ? 0 : -1;
> | + ret = (s->device_active) ? 0 : 1;
> | VMW_CFPRN("Device active: %" PRIx64, ret);
> | break;
>
> It seems okay. Considering that the function returns 'uint64_t', -1 would
> become an extremely large value. I wonder if that is intended.
>
> If '1' indicates the error, the 'default:' case in the same switch needs to be
> updated too.
'1' indicates an error on device activation. Not sure
about the 'unknown command' case.
>
> default:
> VMW_WRPRN("Received request for unknown command: %x", s->last_command);
> ret = -1;
> break;
>
>
> Why does the function return 'uint64_t' type? All return values from other
> cases seem to be within uint32_t type.
Linux driver uses VXMNET3_READ_BAR1_REG() which calls readl().
That should be an indication that the driver expects 32bit values.
But the prototype in MemoryRegionOps requires uint64_t.
>
> --
> Prasad J Pandit / Red Hat Product Security Team
> 47AF CE69 3A90 54AA 9045 1053 DD13 3D32 FE5B 041F
next prev parent reply other threads:[~2015-12-22 2:56 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-21 11:06 [Qemu-devel] [PATCH 0/3] correct some register return values for vxmnet3 Miao Yan
2015-12-21 11:06 ` [Qemu-devel] [PATCH 1/3] net/vmxnet3: return 1 on device activation failure Miao Yan
2015-12-21 18:15 ` P J P
2015-12-22 2:56 ` Miao Yan [this message]
2015-12-22 9:06 ` P J P
2015-12-22 9:26 ` Miao Yan
2015-12-22 9:33 ` Dmitry Fleytman
2015-12-21 11:06 ` [Qemu-devel] [PATCH 2/3] net/vmxnet3: return correct value for VMXNET3_CMD_GET_DID_* command Miao Yan
2015-12-21 11:06 ` [Qemu-devel] [PATCH 3/3] net/vmxnet3: return correct value for VMXNET3_CMD_GET_DEV_EXTRA_INFO Miao Yan
2015-12-21 17:19 ` [Qemu-devel] [PATCH 0/3] correct some register return values for vxmnet3 Dmitry Fleytman
2015-12-22 2:44 ` Miao Yan
2015-12-22 7:05 ` Dmitry Fleytman
2015-12-23 2:15 ` Jason Wang
2015-12-23 3:12 ` Miao Yan
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='CAPc5xaPS+pmemPCJo7v=S3XMHy9HBZL_9U2w6E=UyxqLYOmefw@mail.gmail.com' \
--to=yanmiaobest@gmail.com \
--cc=dmitry@daynix.com \
--cc=jasowang@redhat.com \
--cc=ppandit@redhat.com \
--cc=qemu-devel@nongnu.org \
/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).