From: "Xia, Chenbo" <chenbo.xia@intel.com>
To: "Coquelin, Maxime" <maxime.coquelin@redhat.com>,
"dev@dpdk.org" <dev@dpdk.org>,
"david.marchand@redhat.com" <david.marchand@redhat.com>,
"eperezma@redhat.com" <eperezma@redhat.com>
Cc: "stable@dpdk.org" <stable@dpdk.org>
Subject: RE: [PATCH v1 12/21] net/virtio-user: fix device starting failure handling
Date: Tue, 31 Jan 2023 05:20:59 +0000 [thread overview]
Message-ID: <SN6PR11MB350406F6A823602956F407DC9CD09@SN6PR11MB3504.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20221130155639.150553-13-maxime.coquelin@redhat.com>
> -----Original Message-----
> From: Maxime Coquelin <maxime.coquelin@redhat.com>
> Sent: Wednesday, November 30, 2022 11:57 PM
> To: dev@dpdk.org; Xia, Chenbo <chenbo.xia@intel.com>;
> david.marchand@redhat.com; eperezma@redhat.com
> Cc: Maxime Coquelin <maxime.coquelin@redhat.com>; stable@dpdk.org
> Subject: [PATCH v1 12/21] net/virtio-user: fix device starting failure
> handling
>
> If the device fails to start, read the status from the
> device and return early.
>
> Fixes: 57912824615f ("net/virtio-user: support vhost status setting")
> Cc: stable@dpdk.org
>
> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> ---
> drivers/net/virtio/virtio_user_ethdev.c | 11 ++++++++---
> 1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/virtio/virtio_user_ethdev.c
> b/drivers/net/virtio/virtio_user_ethdev.c
> index d32abec327..78b1ed9ace 100644
> --- a/drivers/net/virtio/virtio_user_ethdev.c
> +++ b/drivers/net/virtio/virtio_user_ethdev.c
> @@ -90,10 +90,15 @@ virtio_user_set_status(struct virtio_hw *hw, uint8_t
> status)
> if (status & VIRTIO_CONFIG_STATUS_FEATURES_OK &&
> ~old_status & VIRTIO_CONFIG_STATUS_FEATURES_OK)
> virtio_user_dev_set_features(dev);
> - if (status & VIRTIO_CONFIG_STATUS_DRIVER_OK)
> - virtio_user_start_device(dev);
> - else if (status == VIRTIO_CONFIG_STATUS_RESET)
> +
> + if (status & VIRTIO_CONFIG_STATUS_DRIVER_OK) {
> + if (virtio_user_start_device(dev)) {
> + virtio_user_dev_update_status(dev);
> + return;
> + }
> + } else if (status == VIRTIO_CONFIG_STATUS_RESET) {
> virtio_user_reset(hw);
> + }
>
> virtio_user_dev_set_status(dev, status);
> }
> --
> 2.38.1
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
prev parent reply other threads:[~2023-01-31 5:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20221130155639.150553-1-maxime.coquelin@redhat.com>
2022-11-30 15:56 ` Maxime Coquelin
2023-01-31 5:20 ` Xia, Chenbo [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=SN6PR11MB350406F6A823602956F407DC9CD09@SN6PR11MB3504.namprd11.prod.outlook.com \
--to=chenbo.xia@intel.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=eperezma@redhat.com \
--cc=maxime.coquelin@redhat.com \
--cc=stable@dpdk.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).