DPDK patches and discussions
 help / color / mirror / Atom feed
From: Nobuhiro MIKI <nmiki@yahoo-corp.jp>
To: maxime.coquelin@redhat.com, chenbo.xia@intel.com
Cc: dev@dpdk.org, stephen@networkplumber.org,
	Nobuhiro MIKI <nmiki@yahoo-corp.jp>
Subject: [PATCH v2 1/2] vhost: fix constants to follow new naming convention
Date: Thu,  9 Mar 2023 14:16:42 +0900	[thread overview]
Message-ID: <20230309051643.70171-2-nmiki@yahoo-corp.jp> (raw)
In-Reply-To: <20230309051643.70171-1-nmiki@yahoo-corp.jp>

DPDK apps (e.g. dpdk-skeleton) output this name
during negotiation. But, it is not consistent when
debugging using QEMU as a front-end, for example.
This is because QEMU already follows new naming convention [1].

Some type names and variable names, such as VhostUserSlaveRequest,
are still in old naming convention. But, in this patch we
only focus on constants.

[1] https://qemu-project.gitlab.io/qemu/interop/vhost-user.html

Signed-off-by: Nobuhiro MIKI <nmiki@yahoo-corp.jp>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
---
 .mailmap                        |  2 +-
 drivers/vdpa/ifc/ifcvf_vdpa.c   |  4 ++--
 drivers/vdpa/mlx5/mlx5_vdpa.c   |  4 ++--
 drivers/vdpa/sfc/sfc_vdpa_ops.c |  4 ++--
 lib/vhost/rte_vhost.h           |  8 ++++----
 lib/vhost/vhost_user.c          | 14 +++++++-------
 lib/vhost/vhost_user.h          | 14 +++++++-------
 7 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/.mailmap b/.mailmap
index 8e7d78f37eef..3400241a6908 100644
--- a/.mailmap
+++ b/.mailmap
@@ -980,7 +980,7 @@ Nithin Dabilpuram <ndabilpuram@marvell.com> <nithin.dabilpuram@caviumnetworks.co
 Nitin Saxena <nitin.saxena@caviumnetworks.com>
 Nitzan Weller <nitzanwe@mellanox.com>
 Noa Ezra <noae@mellanox.com>
-Nobuhiro Miki <nmiki@yahoo-corp.jp>
+Nobuhiro MIKI <nmiki@yahoo-corp.jp>
 Norbert Ciosek <norbertx.ciosek@intel.com>
 Odi Assli <odia@nvidia.com>
 Ognjen Joldzic <ognjen.joldzic@gmail.com>
diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c
index 4a87673682fc..fe4d278c5380 100644
--- a/drivers/vdpa/ifc/ifcvf_vdpa.c
+++ b/drivers/vdpa/ifc/ifcvf_vdpa.c
@@ -1315,8 +1315,8 @@ ifcvf_get_vdpa_features(struct rte_vdpa_device *vdev, uint64_t *features)
 
 #define VDPA_SUPPORTED_PROTOCOL_FEATURES \
 		(1ULL << VHOST_USER_PROTOCOL_F_REPLY_ACK | \
-		 1ULL << VHOST_USER_PROTOCOL_F_SLAVE_REQ | \
-		 1ULL << VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD | \
+		 1ULL << VHOST_USER_PROTOCOL_F_BACKEND_REQ | \
+		 1ULL << VHOST_USER_PROTOCOL_F_BACKEND_SEND_FD | \
 		 1ULL << VHOST_USER_PROTOCOL_F_HOST_NOTIFIER | \
 		 1ULL << VHOST_USER_PROTOCOL_F_LOG_SHMFD | \
 		 1ULL << VHOST_USER_PROTOCOL_F_MQ | \
diff --git a/drivers/vdpa/mlx5/mlx5_vdpa.c b/drivers/vdpa/mlx5/mlx5_vdpa.c
index f8dfa9513311..f1737f82a8ae 100644
--- a/drivers/vdpa/mlx5/mlx5_vdpa.c
+++ b/drivers/vdpa/mlx5/mlx5_vdpa.c
@@ -37,8 +37,8 @@
 			    (1ULL << VIRTIO_NET_F_MTU))
 
 #define MLX5_VDPA_PROTOCOL_FEATURES \
-			    ((1ULL << VHOST_USER_PROTOCOL_F_SLAVE_REQ) | \
-			     (1ULL << VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD) | \
+			    ((1ULL << VHOST_USER_PROTOCOL_F_BACKEND_REQ) | \
+			     (1ULL << VHOST_USER_PROTOCOL_F_BACKEND_SEND_FD) | \
 			     (1ULL << VHOST_USER_PROTOCOL_F_HOST_NOTIFIER) | \
 			     (1ULL << VHOST_USER_PROTOCOL_F_LOG_SHMFD) | \
 			     (1ULL << VHOST_USER_PROTOCOL_F_MQ) | \
diff --git a/drivers/vdpa/sfc/sfc_vdpa_ops.c b/drivers/vdpa/sfc/sfc_vdpa_ops.c
index 6401d4e16f25..e88c7eeaa609 100644
--- a/drivers/vdpa/sfc/sfc_vdpa_ops.c
+++ b/drivers/vdpa/sfc/sfc_vdpa_ops.c
@@ -21,8 +21,8 @@
 /* These protocol features are needed to enable notifier ctrl */
 #define SFC_VDPA_PROTOCOL_FEATURES \
 		((1ULL << VHOST_USER_PROTOCOL_F_REPLY_ACK) | \
-		 (1ULL << VHOST_USER_PROTOCOL_F_SLAVE_REQ) | \
-		 (1ULL << VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD) | \
+		 (1ULL << VHOST_USER_PROTOCOL_F_BACKEND_REQ) | \
+		 (1ULL << VHOST_USER_PROTOCOL_F_BACKEND_SEND_FD) | \
 		 (1ULL << VHOST_USER_PROTOCOL_F_HOST_NOTIFIER) | \
 		 (1ULL << VHOST_USER_PROTOCOL_F_LOG_SHMFD) | \
 		 (1ULL << VHOST_USER_PROTOCOL_F_MQ))
diff --git a/lib/vhost/rte_vhost.h b/lib/vhost/rte_vhost.h
index a395843fe96d..ed255fc6c51f 100644
--- a/lib/vhost/rte_vhost.h
+++ b/lib/vhost/rte_vhost.h
@@ -80,8 +80,8 @@ extern "C" {
 #define VHOST_USER_PROTOCOL_F_NET_MTU	4
 #endif
 
-#ifndef VHOST_USER_PROTOCOL_F_SLAVE_REQ
-#define VHOST_USER_PROTOCOL_F_SLAVE_REQ	5
+#ifndef VHOST_USER_PROTOCOL_F_BACKEND_REQ
+#define VHOST_USER_PROTOCOL_F_BACKEND_REQ	5
 #endif
 
 #ifndef VHOST_USER_PROTOCOL_F_CRYPTO_SESSION
@@ -96,8 +96,8 @@ extern "C" {
 #define VHOST_USER_PROTOCOL_F_CONFIG 9
 #endif
 
-#ifndef VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD
-#define VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD 10
+#ifndef VHOST_USER_PROTOCOL_F_BACKEND_SEND_FD
+#define VHOST_USER_PROTOCOL_F_BACKEND_SEND_FD 10
 #endif
 
 #ifndef VHOST_USER_PROTOCOL_F_HOST_NOTIFIER
diff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c
index 9e361082dc9b..cd4104ea5ce0 100644
--- a/lib/vhost/vhost_user.c
+++ b/lib/vhost/vhost_user.c
@@ -2846,7 +2846,7 @@ VHOST_MESSAGE_HANDLER(VHOST_USER_GET_QUEUE_NUM, vhost_user_get_queue_num, false)
 VHOST_MESSAGE_HANDLER(VHOST_USER_SET_VRING_ENABLE, vhost_user_set_vring_enable, false) \
 VHOST_MESSAGE_HANDLER(VHOST_USER_SEND_RARP, vhost_user_send_rarp, false) \
 VHOST_MESSAGE_HANDLER(VHOST_USER_NET_SET_MTU, vhost_user_net_set_mtu, false) \
-VHOST_MESSAGE_HANDLER(VHOST_USER_SET_SLAVE_REQ_FD, vhost_user_set_req_fd, true) \
+VHOST_MESSAGE_HANDLER(VHOST_USER_SET_BACKEND_REQ_FD, vhost_user_set_req_fd, true) \
 VHOST_MESSAGE_HANDLER(VHOST_USER_IOTLB_MSG, vhost_user_iotlb_msg, false) \
 VHOST_MESSAGE_HANDLER(VHOST_USER_GET_CONFIG, vhost_user_get_config, false) \
 VHOST_MESSAGE_HANDLER(VHOST_USER_SET_CONFIG, vhost_user_set_config, false) \
@@ -3143,7 +3143,7 @@ vhost_user_msg_handler(int vid, int fd)
 	case VHOST_USER_SET_VRING_ENABLE:
 	case VHOST_USER_SEND_RARP:
 	case VHOST_USER_NET_SET_MTU:
-	case VHOST_USER_SET_SLAVE_REQ_FD:
+	case VHOST_USER_SET_BACKEND_REQ_FD:
 		if (!(dev->flags & VIRTIO_DEV_VDPA_CONFIGURED)) {
 			vhost_user_lock_all_queue_pairs(dev);
 			unlock_required = 1;
@@ -3307,7 +3307,7 @@ vhost_user_iotlb_miss(struct virtio_net *dev, uint64_t iova, uint8_t perm)
 	int ret;
 	struct vhu_msg_context ctx = {
 		.msg = {
-			.request.slave = VHOST_USER_SLAVE_IOTLB_MSG,
+			.request.slave = VHOST_USER_BACKEND_IOTLB_MSG,
 			.flags = VHOST_USER_VERSION,
 			.size = sizeof(ctx.msg.payload.iotlb),
 			.payload.iotlb = {
@@ -3334,7 +3334,7 @@ rte_vhost_slave_config_change(int vid, bool need_reply)
 {
 	struct vhu_msg_context ctx = {
 		.msg = {
-			.request.slave = VHOST_USER_SLAVE_CONFIG_CHANGE_MSG,
+			.request.slave = VHOST_USER_BACKEND_CONFIG_CHANGE_MSG,
 			.flags = VHOST_USER_VERSION,
 			.size = 0,
 		}
@@ -3366,7 +3366,7 @@ static int vhost_user_slave_set_vring_host_notifier(struct virtio_net *dev,
 	int ret;
 	struct vhu_msg_context ctx = {
 		.msg = {
-			.request.slave = VHOST_USER_SLAVE_VRING_HOST_NOTIFIER_MSG,
+			.request.slave = VHOST_USER_BACKEND_VRING_HOST_NOTIFIER_MSG,
 			.flags = VHOST_USER_VERSION | VHOST_USER_NEED_REPLY,
 			.size = sizeof(ctx.msg.payload.area),
 			.payload.area = {
@@ -3410,9 +3410,9 @@ int rte_vhost_host_notifier_ctrl(int vid, uint16_t qid, bool enable)
 	if (!(dev->features & (1ULL << VIRTIO_F_VERSION_1)) ||
 	    !(dev->features & (1ULL << VHOST_USER_F_PROTOCOL_FEATURES)) ||
 	    !(dev->protocol_features &
-			(1ULL << VHOST_USER_PROTOCOL_F_SLAVE_REQ)) ||
+			(1ULL << VHOST_USER_PROTOCOL_F_BACKEND_REQ)) ||
 	    !(dev->protocol_features &
-			(1ULL << VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD)) ||
+			(1ULL << VHOST_USER_PROTOCOL_F_BACKEND_SEND_FD)) ||
 	    !(dev->protocol_features &
 			(1ULL << VHOST_USER_PROTOCOL_F_HOST_NOTIFIER)))
 		return -ENOTSUP;
diff --git a/lib/vhost/vhost_user.h b/lib/vhost/vhost_user.h
index 8ecca6859707..8e418414ba94 100644
--- a/lib/vhost/vhost_user.h
+++ b/lib/vhost/vhost_user.h
@@ -18,9 +18,9 @@
 					 (1ULL << VHOST_USER_PROTOCOL_F_RARP) | \
 					 (1ULL << VHOST_USER_PROTOCOL_F_REPLY_ACK) | \
 					 (1ULL << VHOST_USER_PROTOCOL_F_NET_MTU) | \
-					 (1ULL << VHOST_USER_PROTOCOL_F_SLAVE_REQ) | \
+					 (1ULL << VHOST_USER_PROTOCOL_F_BACKEND_REQ) | \
 					 (1ULL << VHOST_USER_PROTOCOL_F_CRYPTO_SESSION) | \
-					 (1ULL << VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD) | \
+					 (1ULL << VHOST_USER_PROTOCOL_F_BACKEND_SEND_FD) | \
 					 (1ULL << VHOST_USER_PROTOCOL_F_HOST_NOTIFIER) | \
 					 (1ULL << VHOST_USER_PROTOCOL_F_PAGEFAULT) | \
 					 (1ULL << VHOST_USER_PROTOCOL_F_STATUS))
@@ -47,7 +47,7 @@ typedef enum VhostUserRequest {
 	VHOST_USER_SET_VRING_ENABLE = 18,
 	VHOST_USER_SEND_RARP = 19,
 	VHOST_USER_NET_SET_MTU = 20,
-	VHOST_USER_SET_SLAVE_REQ_FD = 21,
+	VHOST_USER_SET_BACKEND_REQ_FD = 21,
 	VHOST_USER_IOTLB_MSG = 22,
 	VHOST_USER_GET_CONFIG = 24,
 	VHOST_USER_SET_CONFIG = 25,
@@ -63,10 +63,10 @@ typedef enum VhostUserRequest {
 } VhostUserRequest;
 
 typedef enum VhostUserSlaveRequest {
-	VHOST_USER_SLAVE_NONE = 0,
-	VHOST_USER_SLAVE_IOTLB_MSG = 1,
-	VHOST_USER_SLAVE_CONFIG_CHANGE_MSG = 2,
-	VHOST_USER_SLAVE_VRING_HOST_NOTIFIER_MSG = 3,
+	VHOST_USER_BACKEND_NONE = 0,
+	VHOST_USER_BACKEND_IOTLB_MSG = 1,
+	VHOST_USER_BACKEND_CONFIG_CHANGE_MSG = 2,
+	VHOST_USER_BACKEND_VRING_HOST_NOTIFIER_MSG = 3,
 } VhostUserSlaveRequest;
 
 typedef struct VhostUserMemoryRegion {
-- 
2.31.1


  reply	other threads:[~2023-03-09  5:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-09  5:16 [PATCH v2 0/2] vhost: fix names " Nobuhiro MIKI
2023-03-09  5:16 ` Nobuhiro MIKI [this message]
2023-03-09  5:36   ` [PATCH v2 1/2] vhost: fix constants " Xia, Chenbo
2023-03-09 16:33   ` Maxime Coquelin
2023-03-09  5:16 ` [PATCH v2 2/2] vhost: refactor " Nobuhiro MIKI
2023-03-09  5:36   ` Xia, Chenbo
2023-03-09 16:33   ` Maxime Coquelin
2023-03-16 14:47 ` [PATCH v2 0/2] vhost: fix names " 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=20230309051643.70171-2-nmiki@yahoo-corp.jp \
    --to=nmiki@yahoo-corp.jp \
    --cc=chenbo.xia@intel.com \
    --cc=dev@dpdk.org \
    --cc=maxime.coquelin@redhat.com \
    --cc=stephen@networkplumber.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).