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>
Subject: RE: [PATCH v1 02/21] net/virtio: introduce notify callback for control queue
Date: Mon, 30 Jan 2023 07:51:17 +0000 [thread overview]
Message-ID: <SN6PR11MB350445166D28478CA9203F339CD39@SN6PR11MB3504.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20221130155639.150553-3-maxime.coquelin@redhat.com>
> -----Original Message-----
> From: Maxime Coquelin <maxime.coquelin@redhat.com>
> Sent: Wednesday, November 30, 2022 11:56 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>
> Subject: [PATCH v1 02/21] net/virtio: introduce notify callback for
> control queue
>
> This patch introduces a notification callback for the control
> virtqueue as preliminary work to add shadow control virtqueue
> support.
>
> This new callback is required so that the shadow control queue
> implemented in Virtio-user does not call the notifciation op
> implemented for the driver layer.
>
> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> ---
> drivers/net/virtio/virtio_cvq.c | 4 ++--
> drivers/net/virtio/virtio_cvq.h | 4 ++++
> drivers/net/virtio/virtio_ethdev.c | 7 +++++++
> 3 files changed, 13 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/virtio/virtio_cvq.c
> b/drivers/net/virtio/virtio_cvq.c
> index de4299a2a7..cd25614df8 100644
> --- a/drivers/net/virtio/virtio_cvq.c
> +++ b/drivers/net/virtio/virtio_cvq.c
> @@ -76,7 +76,7 @@ virtio_send_command_packed(struct virtnet_ctl *cvq,
> vq->hw->weak_barriers);
>
> virtio_wmb(vq->hw->weak_barriers);
> - virtqueue_notify(vq);
> + cvq->notify_queue(vq, cvq->notify_cookie);
>
> /* wait for used desc in virtqueue
> * desc_is_used has a load-acquire or rte_io_rmb inside
> @@ -155,7 +155,7 @@ virtio_send_command_split(struct virtnet_ctl *cvq,
>
> PMD_INIT_LOG(DEBUG, "vq->vq_queue_index = %d", vq->vq_queue_index);
>
> - virtqueue_notify(vq);
> + cvq->notify_queue(vq, cvq->notify_cookie);
>
> while (virtqueue_nused(vq) == 0)
> usleep(100);
> diff --git a/drivers/net/virtio/virtio_cvq.h
> b/drivers/net/virtio/virtio_cvq.h
> index 139e813ffb..224dc81422 100644
> --- a/drivers/net/virtio/virtio_cvq.h
> +++ b/drivers/net/virtio/virtio_cvq.h
> @@ -7,6 +7,8 @@
>
> #include <rte_ether.h>
>
> +struct virtqueue;
> +
> /**
> * Control the RX mode, ie. promiscuous, allmulti, etc...
> * All commands require an "out" sg entry containing a 1 byte
> @@ -110,6 +112,8 @@ struct virtnet_ctl {
> uint16_t port_id; /**< Device port identifier. */
> const struct rte_memzone *mz; /**< mem zone to populate CTL ring.
> */
> rte_spinlock_t lock; /**< spinlock for control queue.
> */
> + void (*notify_queue)(struct virtqueue *vq, void *cookie); /**<
> notify ops. */
> + void *notify_cookie; /**< cookie for notify ops */
> };
>
> #define VIRTIO_MAX_CTRL_DATA 2048
> diff --git a/drivers/net/virtio/virtio_ethdev.c
> b/drivers/net/virtio/virtio_ethdev.c
> index d553f89a0d..8db8771f4d 100644
> --- a/drivers/net/virtio/virtio_ethdev.c
> +++ b/drivers/net/virtio/virtio_ethdev.c
> @@ -253,6 +253,12 @@ virtio_init_vring(struct virtqueue *vq)
> virtqueue_disable_intr(vq);
> }
>
> +static void
> +virtio_control_queue_notify(struct virtqueue *vq, __rte_unused void
> *cookie)
> +{
> + virtqueue_notify(vq);
> +}
> +
> static int
> virtio_init_queue(struct rte_eth_dev *dev, uint16_t queue_idx)
> {
> @@ -421,6 +427,7 @@ virtio_init_queue(struct rte_eth_dev *dev, uint16_t
> queue_idx)
> memset(cvq->virtio_net_hdr_mz->addr, 0, rte_mem_page_size());
>
> hw->cvq = cvq;
> + vq->cq.notify_queue = &virtio_control_queue_notify;
> }
>
> if (hw->use_va)
> --
> 2.38.1
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
next prev parent reply other threads:[~2023-01-30 7:51 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-30 15:56 [PATCH v1 00/21] Add control queue & MQ support to Virtio-user vDPA Maxime Coquelin
2022-11-30 15:56 ` [PATCH v1 01/21] net/virtio: move CVQ code into a dedicated file Maxime Coquelin
2023-01-30 7:50 ` Xia, Chenbo
2022-11-30 15:56 ` [PATCH v1 02/21] net/virtio: introduce notify callback for control queue Maxime Coquelin
2023-01-30 7:51 ` Xia, Chenbo [this message]
2022-11-30 15:56 ` [PATCH v1 03/21] net/virtio: virtqueue headers alloc refactoring Maxime Coquelin
2023-01-30 7:51 ` Xia, Chenbo
2022-11-30 15:56 ` [PATCH v1 04/21] net/virtio: remove port ID info from Rx queue Maxime Coquelin
2023-01-30 7:51 ` Xia, Chenbo
2022-11-30 15:56 ` [PATCH v1 05/21] net/virtio: remove unused fields in Tx queue struct Maxime Coquelin
2023-01-30 7:51 ` Xia, Chenbo
2022-11-30 15:56 ` [PATCH v1 06/21] net/virtio: remove unused queue ID field in Rx queue Maxime Coquelin
2023-01-30 7:52 ` Xia, Chenbo
2022-11-30 15:56 ` [PATCH v1 07/21] net/virtio: remove unused Port ID in control queue Maxime Coquelin
2023-01-30 7:52 ` Xia, Chenbo
2022-11-30 15:56 ` [PATCH v1 08/21] net/virtio: move vring memzone to virtqueue struct Maxime Coquelin
2023-01-30 7:52 ` Xia, Chenbo
2022-11-30 15:56 ` [PATCH v1 09/21] net/virtio: refactor indirect desc headers init Maxime Coquelin
2023-01-30 7:52 ` Xia, Chenbo
2022-11-30 15:56 ` [PATCH v1 10/21] net/virtio: alloc Rx SW ring only if vectorized path Maxime Coquelin
2023-01-30 7:49 ` Xia, Chenbo
2023-02-07 10:12 ` Maxime Coquelin
2022-11-30 15:56 ` [PATCH v1 11/21] net/virtio: extract virtqueue init from virtio queue init Maxime Coquelin
2023-01-30 7:53 ` Xia, Chenbo
2022-11-30 15:56 ` [PATCH v1 12/21] net/virtio-user: fix device starting failure handling Maxime Coquelin
2023-01-31 5:20 ` Xia, Chenbo
2022-11-30 15:56 ` [PATCH v1 13/21] net/virtio-user: simplify queues setup Maxime Coquelin
2023-01-31 5:21 ` Xia, Chenbo
2022-11-30 15:56 ` [PATCH v1 14/21] net/virtio-user: use proper type for number of queue pairs Maxime Coquelin
2023-01-31 5:21 ` Xia, Chenbo
2022-11-30 15:56 ` [PATCH v1 15/21] net/virtio-user: get max number of queue pairs from device Maxime Coquelin
2023-01-31 5:21 ` Xia, Chenbo
2022-11-30 15:56 ` [PATCH v1 16/21] net/virtio-user: allocate shadow control queue Maxime Coquelin
2023-01-31 5:21 ` Xia, Chenbo
2022-11-30 15:56 ` [PATCH v1 17/21] net/virtio-user: send shadow virtqueue info to the backend Maxime Coquelin
2023-01-31 5:22 ` Xia, Chenbo
2022-11-30 15:56 ` [PATCH v1 18/21] net/virtio-user: add new callback to enable control queue Maxime Coquelin
2023-01-31 5:22 ` Xia, Chenbo
2022-11-30 15:56 ` [PATCH v1 19/21] net/virtio-user: forward control messages to shadow queue Maxime Coquelin
2022-11-30 16:54 ` Stephen Hemminger
2022-12-06 12:58 ` Maxime Coquelin
2022-11-30 15:56 ` [PATCH v1 20/21] net/virtio-user: advertize control VQ support with vDPA Maxime Coquelin
2023-01-31 5:24 ` Xia, Chenbo
2022-11-30 15:56 ` [PATCH v1 21/21] net/virtio-user: remove max queues limitation Maxime Coquelin
2023-01-31 5:19 ` Xia, Chenbo
2023-02-07 14:14 ` Maxime Coquelin
2023-01-30 5:57 ` [PATCH v1 00/21] Add control queue & MQ support to Virtio-user vDPA Xia, Chenbo
2023-02-07 10:08 ` Maxime Coquelin
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=SN6PR11MB350445166D28478CA9203F339CD39@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 \
/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).