qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Cao jin <caoj.fnst@cn.fujitsu.com>
To: qemu-devel@nongnu.org
Cc: dmitry@daynix.com, Jason Wang <jasowang@redhat.com>,
	jiri@resnulli.us, "Michael S. Tsirkin" <mst@redhat.com>,
	Markus Armbruster <armbru@redhat.com>,
	Marcel Apfelbaum <marcel@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v9 04/11] msix: check msix_init's return value
Date: Tue, 17 Jan 2017 14:50:38 +0800	[thread overview]
Message-ID: <587DBEBE.4070409@cn.fujitsu.com> (raw)
In-Reply-To: <1484633936-25344-5-git-send-email-caoj.fnst@cn.fujitsu.com>

forget to cc maintainers in this new patch

On 01/17/2017 02:18 PM, Cao jin wrote:
> Doesn't do it for megasas & hcd-xhci, later patches will fix them.
> 
> Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
> ---
>  hw/net/e1000e.c        |  4 ++++
>  hw/net/rocker/rocker.c |  5 +++++
>  hw/net/vmxnet3.c       |  6 +++++-
>  hw/virtio/virtio-pci.c | 13 +++++++------
>  4 files changed, 21 insertions(+), 7 deletions(-)
> 
> diff --git a/hw/net/e1000e.c b/hw/net/e1000e.c
> index ed04adce061c..74cbbef30366 100644
> --- a/hw/net/e1000e.c
> +++ b/hw/net/e1000e.c
> @@ -294,6 +294,10 @@ e1000e_init_msix(E1000EState *s)
>                          E1000E_MSIX_IDX, E1000E_MSIX_PBA,
>                          0xA0, NULL);
>  
> +    /* Any error other than -ENOTSUP(board's MSI support is broken)
> +     * is a programming error. Fall back to INTx silently on -ENOTSUP */
> +    assert(!res || res == -ENOTSUP);
> +
>      if (res < 0) {
>          trace_e1000e_msix_init_fail(res);
>      } else {
> diff --git a/hw/net/rocker/rocker.c b/hw/net/rocker/rocker.c
> index 6e70fddee36b..e394fd61fe64 100644
> --- a/hw/net/rocker/rocker.c
> +++ b/hw/net/rocker/rocker.c
> @@ -1264,6 +1264,11 @@ static int rocker_msix_init(Rocker *r)
>                      &r->msix_bar,
>                      ROCKER_PCI_MSIX_BAR_IDX, ROCKER_PCI_MSIX_PBA_OFFSET,
>                      0, &local_err);
> +
> +    /* Any error other than -ENOTSUP(board's MSI support is broken)
> +     * is a programming error. */
> +    assert(!err || err == -ENOTSUP);
> +
>      if (err) {
>          error_report_err(local_err);
>          return err;
> diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c
> index 7b2971fe5902..a433cc017cb1 100644
> --- a/hw/net/vmxnet3.c
> +++ b/hw/net/vmxnet3.c
> @@ -2193,8 +2193,12 @@ vmxnet3_init_msix(VMXNET3State *s)
>                          VMXNET3_MSIX_BAR_IDX, VMXNET3_OFF_MSIX_PBA(s),
>                          VMXNET3_MSIX_OFFSET(s), NULL);
>  
> +    /* Any error other than -ENOTSUP(board's MSI support is broken)
> +     * is a programming error. Fall back to INTx on -ENOTSUP */
> +    assert(!res || res == -ENOTSUP);
> +
>      if (0 > res) {
> -        VMW_WRPRN("Failed to initialize MSI-X, error %d", res);
> +        VMW_WRPRN("Failed to initialize MSI-X, board's MSI support is broken");
>          s->msix_used = false;
>      } else {
>          if (!vmxnet3_use_msix_vectors(s, VMXNET3_MAX_INTRS)) {
> diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
> index 4c2c4941d245..2417c78c477e 100644
> --- a/hw/virtio/virtio-pci.c
> +++ b/hw/virtio/virtio-pci.c
> @@ -1670,13 +1670,14 @@ static void virtio_pci_device_plugged(DeviceState *d, Error **errp)
>  
>      if (proxy->nvectors) {
>          int err = msix_init_exclusive_bar(&proxy->pci_dev, proxy->nvectors,
> -                                          proxy->msix_bar_idx, NULL);
> +                                          proxy->msix_bar_idx, errp);
> +
> +        /* Any error other than -ENOTSUP(board's MSI support is broken)
> +         * is a programming error. */
> +        assert(!err || err == -ENOTSUP);
> +
>          if (err) {
> -            /* Notice when a system that supports MSIx can't initialize it */
> -            if (err != -ENOTSUP) {
> -                error_report("unable to init msix vectors to %" PRIu32,
> -                             proxy->nvectors);
> -            }
> +            error_report_err(*errp);
>              proxy->nvectors = 0;
>          }
>      }
> 

-- 
Sincerely,
Cao jin

  reply	other threads:[~2017-01-17  6:45 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-17  6:18 [Qemu-devel] [PATCH v9 00/11] Convert msix_init() to error Cao jin
2017-01-17  6:18 ` [Qemu-devel] [PATCH v9 01/11] msix: Follow CODING_STYLE Cao jin
2017-01-17  6:18 ` [Qemu-devel] [PATCH v9 02/11] hcd-xhci: check & correct param before using it Cao jin
2017-01-17  6:18 ` [Qemu-devel] [PATCH v9 03/11] pci: Convert msix_init() to Error and fix callers Cao jin
2017-01-18  8:56   ` Hannes Reinecke
2017-01-17  6:18 ` [Qemu-devel] [PATCH v9 04/11] msix: check msix_init's return value Cao jin
2017-01-17  6:50   ` Cao jin [this message]
2017-01-17 16:01     ` Michael S. Tsirkin
2017-01-18  6:29       ` Cao jin
2017-01-18 15:21         ` Michael S. Tsirkin
2017-01-19 12:25           ` Cao jin
2017-01-24 18:18       ` Paolo Bonzini
2017-01-24 19:43         ` Michael S. Tsirkin
2017-01-17  6:18 ` [Qemu-devel] [PATCH v9 05/11] megasas: change behaviour of msix switch Cao jin
2017-01-18  8:56   ` Hannes Reinecke
2017-01-17  6:18 ` [Qemu-devel] [PATCH v9 06/11] hcd-xhci: " Cao jin
2017-01-17  6:18 ` [Qemu-devel] [PATCH v9 07/11] megasas: undo the overwrites of msi user configuration Cao jin
2017-01-18  8:56   ` Hannes Reinecke
2017-01-17  6:18 ` [Qemu-devel] [PATCH v9 08/11] vmxnet3: fix reference leak issue Cao jin
2017-01-17  6:18 ` [Qemu-devel] [PATCH v9 09/11] vmxnet3: remove unnecessary internal msix flag Cao jin
2017-01-17  6:18 ` [Qemu-devel] [PATCH v9 10/11] msi_init: convert assert to return -errno Cao jin
2017-01-17  6:18 ` [Qemu-devel] [PATCH v9 11/11] megasas: remove unnecessary megasas_use_msix() Cao jin
2017-01-24 17:00 ` [Qemu-devel] [PATCH v9 00/11] Convert msix_init() to error Michael S. Tsirkin

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=587DBEBE.4070409@cn.fujitsu.com \
    --to=caoj.fnst@cn.fujitsu.com \
    --cc=armbru@redhat.com \
    --cc=dmitry@daynix.com \
    --cc=jasowang@redhat.com \
    --cc=jiri@resnulli.us \
    --cc=marcel@redhat.com \
    --cc=mst@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).