DPDK patches and discussions
 help / color / mirror / Atom feed
From: <skoteshwar@marvell.com>
To: Maxime Coquelin <maxime.coquelin@redhat.com>,
	Chenbo Xia <chenbox@nvidia.com>
Cc: <dev@dpdk.org>, Satha Rao <skoteshwar@marvell.com>
Subject: [PATCH 3/5] net/virtio: add set config callback
Date: Mon, 7 Oct 2024 20:34:01 +0530	[thread overview]
Message-ID: <20241007150403.1680983-3-skoteshwar@marvell.com> (raw)
In-Reply-To: <20241007150403.1680983-1-skoteshwar@marvell.com>

From: Satha Rao <skoteshwar@marvell.com>

This patch enables the set config callback handler.

Signed-off-by: Satha Rao <skoteshwar@marvell.com>
---
 drivers/net/virtio/virtio_user/vhost.h      |  1 +
 drivers/net/virtio/virtio_user/vhost_vdpa.c | 10 ++++++++++
 2 files changed, 11 insertions(+)

diff --git a/drivers/net/virtio/virtio_user/vhost.h b/drivers/net/virtio/virtio_user/vhost.h
index eee3a4bc47..45ae56e3b5 100644
--- a/drivers/net/virtio/virtio_user/vhost.h
+++ b/drivers/net/virtio/virtio_user/vhost.h
@@ -92,6 +92,7 @@ struct virtio_user_backend_ops {
 	int (*get_intr_fd)(struct virtio_user_dev *dev);
 	int (*map_notification_area)(struct virtio_user_dev *dev);
 	int (*unmap_notification_area)(struct virtio_user_dev *dev);
+	int (*set_config_call)(struct virtio_user_dev *dev, int fd);
 };
 
 extern struct virtio_user_backend_ops virtio_ops_user;
diff --git a/drivers/net/virtio/virtio_user/vhost_vdpa.c b/drivers/net/virtio/virtio_user/vhost_vdpa.c
index bc3e2a9af5..5c610664b6 100644
--- a/drivers/net/virtio/virtio_user/vhost_vdpa.c
+++ b/drivers/net/virtio/virtio_user/vhost_vdpa.c
@@ -48,6 +48,7 @@ struct vhost_vdpa_data {
 #define VHOST_VDPA_SET_VRING_ENABLE _IOW(VHOST_VIRTIO, 0x75, struct vhost_vring_state)
 #define VHOST_SET_BACKEND_FEATURES _IOW(VHOST_VIRTIO, 0x25, __u64)
 #define VHOST_GET_BACKEND_FEATURES _IOR(VHOST_VIRTIO, 0x26, __u64)
+#define VHOST_SET_CONFIG_CALL      _IOW(VHOST_VIRTIO, 0x77, int)
 
 /* no alignment requirement */
 struct vhost_iotlb_msg {
@@ -509,6 +510,14 @@ vhost_vdpa_set_config(struct virtio_user_dev *dev, const uint8_t *data, uint32_t
 	return ret;
 }
 
+static int
+vhost_vdpa_set_config_call(struct virtio_user_dev *dev, int fd)
+{
+	struct vhost_vdpa_data *data = dev->backend_data;
+
+	return vhost_vdpa_ioctl(data->vhostfd, VHOST_SET_CONFIG_CALL, &fd);
+}
+
 /**
  * Set up environment to talk with a vhost vdpa backend.
  *
@@ -706,6 +715,7 @@ struct virtio_user_backend_ops virtio_ops_vdpa = {
 	.set_status = vhost_vdpa_set_status,
 	.get_config = vhost_vdpa_get_config,
 	.set_config = vhost_vdpa_set_config,
+	.set_config_call = vhost_vdpa_set_config_call,
 	.cvq_enable = vhost_vdpa_cvq_enable,
 	.enable_qp = vhost_vdpa_enable_queue_pair,
 	.dma_map = vhost_vdpa_dma_map_batch,
-- 
2.25.1


  parent reply	other threads:[~2024-10-07 15:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-07 15:03 [PATCH 1/5] interrupts: fix number of bytes read for vdev skoteshwar
2024-10-07 15:04 ` [PATCH 2/5] net/virtio-user: get link duplex and speed skoteshwar
2024-10-07 15:04 ` skoteshwar [this message]
2024-10-07 15:04 ` [PATCH 4/5] net/virtio: implement update link state API skoteshwar
2024-10-07 15:04 ` [PATCH 5/5] net/virtio-user: support vDPA configuration callback skoteshwar
2024-10-09  4:01 ` [PATCH 1/5] interrupts: fix number of bytes read for vdev Stephen Hemminger

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=20241007150403.1680983-3-skoteshwar@marvell.com \
    --to=skoteshwar@marvell.com \
    --cc=chenbox@nvidia.com \
    --cc=dev@dpdk.org \
    --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).