All of lore.kernel.org
 help / color / mirror / Atom feed
From: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
To: virtualization@lists.linux-foundation.org, netdev@vger.kernel.org
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
	Jason Wang <jasowang@redhat.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Jesper Dangaard Brouer <hawk@kernel.org>,
	John Fastabend <john.fastabend@gmail.com>,
	bpf@vger.kernel.org
Subject: [PATCH v3 10/17] virtio_pci: queue_reset: update struct virtio_pci_common_cfg and option functions
Date: Wed, 26 Jan 2022 15:35:26 +0800	[thread overview]
Message-ID: <20220126073533.44994-11-xuanzhuo@linux.alibaba.com> (raw)
In-Reply-To: <20220126073533.44994-1-xuanzhuo@linux.alibaba.com>

Add queue_reset in virtio_pci_common_cfg, and add related operation
functions.

Signed-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
---
 drivers/virtio/virtio_pci_modern_dev.c | 28 ++++++++++++++++++++++++++
 include/linux/virtio_pci_modern.h      |  2 ++
 include/uapi/linux/virtio_pci.h        |  1 +
 3 files changed, 31 insertions(+)

diff --git a/drivers/virtio/virtio_pci_modern_dev.c b/drivers/virtio/virtio_pci_modern_dev.c
index e11ed748e661..be02f812a2f6 100644
--- a/drivers/virtio/virtio_pci_modern_dev.c
+++ b/drivers/virtio/virtio_pci_modern_dev.c
@@ -463,6 +463,34 @@ void vp_modern_set_status(struct virtio_pci_modern_device *mdev,
 }
 EXPORT_SYMBOL_GPL(vp_modern_set_status);
 
+/*
+ * vp_modern_get_queue_reset - get the queue reset status
+ * @mdev: the modern virtio-pci device
+ * @index: queue index
+ */
+int vp_modern_get_queue_reset(struct virtio_pci_modern_device *mdev, u16 index)
+{
+	struct virtio_pci_common_cfg __iomem *cfg = mdev->common;
+
+	vp_iowrite16(index, &cfg->queue_select);
+	return vp_ioread16(&cfg->queue_reset);
+}
+EXPORT_SYMBOL_GPL(vp_modern_get_queue_reset);
+
+/*
+ * vp_modern_set_queue_reset - reset the queue
+ * @mdev: the modern virtio-pci device
+ * @index: queue index
+ */
+void vp_modern_set_queue_reset(struct virtio_pci_modern_device *mdev, u16 index)
+{
+	struct virtio_pci_common_cfg __iomem *cfg = mdev->common;
+
+	vp_iowrite16(index, &cfg->queue_select);
+	vp_iowrite16(1, &cfg->queue_reset);
+}
+EXPORT_SYMBOL_GPL(vp_modern_set_queue_reset);
+
 /*
  * vp_modern_queue_vector - set the MSIX vector for a specific virtqueue
  * @mdev: the modern virtio-pci device
diff --git a/include/linux/virtio_pci_modern.h b/include/linux/virtio_pci_modern.h
index eb2bd9b4077d..cc4154dd7b28 100644
--- a/include/linux/virtio_pci_modern.h
+++ b/include/linux/virtio_pci_modern.h
@@ -106,4 +106,6 @@ void __iomem * vp_modern_map_vq_notify(struct virtio_pci_modern_device *mdev,
 				       u16 index, resource_size_t *pa);
 int vp_modern_probe(struct virtio_pci_modern_device *mdev);
 void vp_modern_remove(struct virtio_pci_modern_device *mdev);
+int vp_modern_get_queue_reset(struct virtio_pci_modern_device *mdev, u16 index);
+void vp_modern_set_queue_reset(struct virtio_pci_modern_device *mdev, u16 index);
 #endif
diff --git a/include/uapi/linux/virtio_pci.h b/include/uapi/linux/virtio_pci.h
index 492c89f56c6a..bf10f349087f 100644
--- a/include/uapi/linux/virtio_pci.h
+++ b/include/uapi/linux/virtio_pci.h
@@ -165,6 +165,7 @@ struct virtio_pci_common_cfg {
 	__le32 queue_used_lo;		/* read-write */
 	__le32 queue_used_hi;		/* read-write */
 	__le16 queue_notify_data;	/* read-write */
+	__le16 queue_reset;		/* read-write */
 };
 
 /* Fields in VIRTIO_PCI_CAP_PCI_CFG: */
-- 
2.31.0


WARNING: multiple messages have this Message-ID (diff)
From: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
To: virtualization@lists.linux-foundation.org, netdev@vger.kernel.org
Cc: Jesper Dangaard Brouer <hawk@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	John Fastabend <john.fastabend@gmail.com>,
	Alexei Starovoitov <ast@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>,
	bpf@vger.kernel.org, "David S. Miller" <davem@davemloft.net>
Subject: [PATCH v3 10/17] virtio_pci: queue_reset: update struct virtio_pci_common_cfg and option functions
Date: Wed, 26 Jan 2022 15:35:26 +0800	[thread overview]
Message-ID: <20220126073533.44994-11-xuanzhuo@linux.alibaba.com> (raw)
In-Reply-To: <20220126073533.44994-1-xuanzhuo@linux.alibaba.com>

Add queue_reset in virtio_pci_common_cfg, and add related operation
functions.

Signed-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
---
 drivers/virtio/virtio_pci_modern_dev.c | 28 ++++++++++++++++++++++++++
 include/linux/virtio_pci_modern.h      |  2 ++
 include/uapi/linux/virtio_pci.h        |  1 +
 3 files changed, 31 insertions(+)

diff --git a/drivers/virtio/virtio_pci_modern_dev.c b/drivers/virtio/virtio_pci_modern_dev.c
index e11ed748e661..be02f812a2f6 100644
--- a/drivers/virtio/virtio_pci_modern_dev.c
+++ b/drivers/virtio/virtio_pci_modern_dev.c
@@ -463,6 +463,34 @@ void vp_modern_set_status(struct virtio_pci_modern_device *mdev,
 }
 EXPORT_SYMBOL_GPL(vp_modern_set_status);
 
+/*
+ * vp_modern_get_queue_reset - get the queue reset status
+ * @mdev: the modern virtio-pci device
+ * @index: queue index
+ */
+int vp_modern_get_queue_reset(struct virtio_pci_modern_device *mdev, u16 index)
+{
+	struct virtio_pci_common_cfg __iomem *cfg = mdev->common;
+
+	vp_iowrite16(index, &cfg->queue_select);
+	return vp_ioread16(&cfg->queue_reset);
+}
+EXPORT_SYMBOL_GPL(vp_modern_get_queue_reset);
+
+/*
+ * vp_modern_set_queue_reset - reset the queue
+ * @mdev: the modern virtio-pci device
+ * @index: queue index
+ */
+void vp_modern_set_queue_reset(struct virtio_pci_modern_device *mdev, u16 index)
+{
+	struct virtio_pci_common_cfg __iomem *cfg = mdev->common;
+
+	vp_iowrite16(index, &cfg->queue_select);
+	vp_iowrite16(1, &cfg->queue_reset);
+}
+EXPORT_SYMBOL_GPL(vp_modern_set_queue_reset);
+
 /*
  * vp_modern_queue_vector - set the MSIX vector for a specific virtqueue
  * @mdev: the modern virtio-pci device
diff --git a/include/linux/virtio_pci_modern.h b/include/linux/virtio_pci_modern.h
index eb2bd9b4077d..cc4154dd7b28 100644
--- a/include/linux/virtio_pci_modern.h
+++ b/include/linux/virtio_pci_modern.h
@@ -106,4 +106,6 @@ void __iomem * vp_modern_map_vq_notify(struct virtio_pci_modern_device *mdev,
 				       u16 index, resource_size_t *pa);
 int vp_modern_probe(struct virtio_pci_modern_device *mdev);
 void vp_modern_remove(struct virtio_pci_modern_device *mdev);
+int vp_modern_get_queue_reset(struct virtio_pci_modern_device *mdev, u16 index);
+void vp_modern_set_queue_reset(struct virtio_pci_modern_device *mdev, u16 index);
 #endif
diff --git a/include/uapi/linux/virtio_pci.h b/include/uapi/linux/virtio_pci.h
index 492c89f56c6a..bf10f349087f 100644
--- a/include/uapi/linux/virtio_pci.h
+++ b/include/uapi/linux/virtio_pci.h
@@ -165,6 +165,7 @@ struct virtio_pci_common_cfg {
 	__le32 queue_used_lo;		/* read-write */
 	__le32 queue_used_hi;		/* read-write */
 	__le16 queue_notify_data;	/* read-write */
+	__le16 queue_reset;		/* read-write */
 };
 
 /* Fields in VIRTIO_PCI_CAP_PCI_CFG: */
-- 
2.31.0

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

  parent reply	other threads:[~2022-01-26  7:36 UTC|newest]

Thread overview: 78+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-26  7:35 [PATCH v3 00/17] virtio pci support VIRTIO_F_RING_RESET Xuan Zhuo
2022-01-26  7:35 ` Xuan Zhuo
2022-01-26  7:35 ` [PATCH v3 01/17] virtio_pci: struct virtio_pci_common_cfg add queue_notify_data Xuan Zhuo
2022-01-26  7:35   ` Xuan Zhuo
2022-02-07  3:41   ` Jason Wang
2022-02-07  3:41     ` Jason Wang
2022-02-07  6:04     ` Xuan Zhuo
2022-02-07  8:06       ` Jason Wang
2022-02-07  8:06         ` Jason Wang
2022-02-08  2:17         ` Xuan Zhuo
2022-02-08  3:03           ` Jason Wang
2022-02-08  3:03             ` Jason Wang
2022-02-08  3:18             ` Xuan Zhuo
2022-02-08  3:24               ` Jason Wang
2022-02-08  3:24                 ` Jason Wang
2022-02-08  3:25                 ` Xuan Zhuo
2022-02-08  3:36                   ` Jason Wang
2022-02-08  3:36                     ` Jason Wang
2022-01-26  7:35 ` [PATCH v3 02/17] virtio: queue_reset: add VIRTIO_F_RING_RESET Xuan Zhuo
2022-01-26  7:35   ` Xuan Zhuo
2022-01-26  7:35 ` [PATCH v3 03/17] virtio: queue_reset: struct virtio_config_ops add callbacks for queue_reset Xuan Zhuo
2022-01-26  7:35   ` Xuan Zhuo
2022-02-07  6:45   ` Jason Wang
2022-02-07  6:45     ` Jason Wang
2022-02-07  7:19     ` Xuan Zhuo
2022-02-08  2:58       ` Jason Wang
2022-02-08  2:58         ` Jason Wang
2022-02-08  3:00         ` Xuan Zhuo
2022-01-26  7:35 ` [PATCH v3 04/17] virtio: queue_reset: add helper Xuan Zhuo
2022-01-26  7:35   ` Xuan Zhuo
2022-01-26  7:35 ` [PATCH v3 05/17] vritio_ring: queue_reset: extract the release function of the vq ring Xuan Zhuo
2022-01-26  7:35   ` Xuan Zhuo
2022-01-26  7:35 ` [PATCH v3 06/17] virtio_ring: queue_reset: split: add __vring_init_virtqueue() Xuan Zhuo
2022-01-26  7:35   ` Xuan Zhuo
2022-01-26  7:35 ` [PATCH v3 07/17] virtio_ring: queue_reset: split: support enable reset queue Xuan Zhuo
2022-01-26  7:35   ` Xuan Zhuo
2022-01-26  7:35 ` [PATCH v3 08/17] virtio_ring: queue_reset: packed: " Xuan Zhuo
2022-01-26  7:35   ` Xuan Zhuo
2022-01-26  7:35 ` [PATCH v3 09/17] virtio_ring: queue_reset: add vring_reset_virtqueue() Xuan Zhuo
2022-01-26  7:35   ` Xuan Zhuo
2022-01-26  7:35 ` Xuan Zhuo [this message]
2022-01-26  7:35   ` [PATCH v3 10/17] virtio_pci: queue_reset: update struct virtio_pci_common_cfg and option functions Xuan Zhuo
2022-01-26  7:35 ` [PATCH v3 11/17] virtio_pci: queue_reset: release vq by vp_dev->vqs Xuan Zhuo
2022-01-26  7:35   ` Xuan Zhuo
2022-01-26  7:35 ` [PATCH v3 12/17] virtio_pci: queue_reset: setup_vq use vring_setup_virtqueue() Xuan Zhuo
2022-01-26  7:35   ` Xuan Zhuo
2022-01-26  7:35 ` [PATCH v3 13/17] virtio_pci: queue_reset: support VIRTIO_F_RING_RESET Xuan Zhuo
2022-01-26  7:35   ` Xuan Zhuo
2022-02-07  6:57   ` Jason Wang
2022-02-07  6:57     ` Jason Wang
2022-02-07  7:59     ` Xuan Zhuo
2022-02-08  2:55       ` Jason Wang
2022-02-08  2:55         ` Jason Wang
2022-02-08  6:47         ` xuanzhuo
2022-02-08  6:47           ` xuanzhuo
2022-02-08  7:35         ` Xuan Zhuo
2022-02-09  5:44           ` Jason Wang
2022-02-09  5:44             ` Jason Wang
2022-02-09  6:05             ` Xuan Zhuo
2022-02-09  6:05               ` Xuan Zhuo
2022-01-26  7:35 ` [PATCH v3 14/17] virtio_net: virtnet_tx_timeout() fix style Xuan Zhuo
2022-01-26  7:35   ` Xuan Zhuo
2022-01-26  7:35 ` [PATCH v3 15/17] virtio_net: virtnet_tx_timeout() stop ref sq->vq Xuan Zhuo
2022-01-26  7:35   ` Xuan Zhuo
2022-01-26  7:35 ` [PATCH v3 16/17] virtio_net: split free_unused_bufs() Xuan Zhuo
2022-01-26  7:35   ` Xuan Zhuo
2022-01-26  7:35 ` [PATCH v3 17/17] virtio_net: support pair disable/enable Xuan Zhuo
2022-01-26  7:35   ` Xuan Zhuo
2022-02-07  3:39 ` [PATCH v3 00/17] virtio pci support VIRTIO_F_RING_RESET Jason Wang
2022-02-07  3:39   ` Jason Wang
2022-02-07  6:02   ` Xuan Zhuo
2022-02-08  2:59     ` Jason Wang
2022-02-08  2:59       ` Jason Wang
2022-02-08  3:14       ` Xuan Zhuo
2022-02-08  7:51         ` Xuan Zhuo
2022-02-08  7:51           ` Xuan Zhuo
2022-02-09  5:39           ` Jason Wang
2022-02-09  5:39             ` Jason Wang

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=20220126073533.44994-11-xuanzhuo@linux.alibaba.com \
    --to=xuanzhuo@linux.alibaba.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=hawk@kernel.org \
    --cc=jasowang@redhat.com \
    --cc=john.fastabend@gmail.com \
    --cc=kuba@kernel.org \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=virtualization@lists.linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.