Skip to contentSkip to conversation

0001-vhost-optimize-vhost-user-get-protocol-features

DISCUSSION Applied [email protected] 2 participants 3 messages Dec 5, 2023 – Jun 12, 2024 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

From 4cf72842a07b2270876939fd2bb2367efaad95f4 Mon Sep 17 00:00:00 2001
From: Yuan Zhiyuan <[email protected]>
Date: Fri, 1 Dec 2023 11:27:51 +0000
Subject: [PATCH] vhost: optimize vhost user get protocol features

variable features is unused in vhost_user_get_protocol_features.

---
 lib/vhost/vhost_user.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
lib/vhost/vhost_user.c +1 -2
index e36312181a..3e737eaf12 100644
@@ -2243,9 +2243,8 @@ vhost_user_get_protocol_features(struct virtio_net **pdev,
  int main_fd __rte_unused)
 {
  struct virtio_net *dev = *pdev;
- uint64_t features, protocol_features;
+ uint64_t protocol_features;
 
- rte_vhost_driver_get_features(dev->ifname, &features);
  rte_vhost_driver_get_protocol_features(dev->ifname, &protocol_features);
 
  ctx->msg.payload.u64 = protocol_features;
Signature · 1 line
2.34.1
Reviewed-by
#2 lore raw

Hello Yuan,

Quoted 4 lines · On 12/5/23 12:01, [email protected] wrote:

From 4cf72842a07b2270876939fd2bb2367efaad95f4 Mon Sep 17 00:00:00 2001 From: Yuan Zhiyuan <[email protected]>
Date: Fri, 1 Dec 2023 11:27:51 +0000
Subject: [PATCH] vhost: optimize vhost user get protocol features

Thanks for your contribution.

For the next time, I suggest you follow the contributions guidelines in the documentation. This patch is not properly formatted.

For this time, I will reword the subject and commit message as follow:

vhost: remove unnecessary features fetch

vhost_user_get_protocol_features() does not need to know about Virtio features, but only about Vhost-user protocol features.

With this change:

Thanks,
Maxime

Quoted 25 lines

variable features is unused in vhost_user_get_protocol_features.

---
  lib/vhost/vhost_user.c | 3 +--

 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c
index e36312181a..3e737eaf12 100644
--- a/lib/vhost/vhost_user.c
+++ b/lib/vhost/vhost_user.c
@@ -2243,9 +2243,8 @@ vhost_user_get_protocol_features(struct virtio_net **pdev, int main_fd __rte_unused)
 {
struct virtio_net *dev = *pdev;

lib/vhost/vhost_user.c +1 -2
-uint64_t features, protocol_features;
+uint64_t protocol_features;
 
-rte_vhost_driver_get_features(dev->ifname, &features);

rte_vhost_driver_get_protocol_features(dev->ifname, &protocol_features);

ctx->msg.payload.u64 = protocol_features;

Signature · 1 line
2.34.1
#3 lore raw
In reply to [email protected]
Quoted 26 lines · On 12/5/23 12:01, [email protected] wrote:

From 4cf72842a07b2270876939fd2bb2367efaad95f4 Mon Sep 17 00:00:00 2001 From: Yuan Zhiyuan <[email protected]>
Date: Fri, 1 Dec 2023 11:27:51 +0000
Subject: [PATCH] vhost: optimize vhost user get protocol features

variable features is unused in vhost_user_get_protocol_features.

---
  lib/vhost/vhost_user.c | 3 +--

 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c
index e36312181a..3e737eaf12 100644
--- a/lib/vhost/vhost_user.c
+++ b/lib/vhost/vhost_user.c
@@ -2243,9 +2243,8 @@ vhost_user_get_protocol_features(struct virtio_net **pdev, int main_fd __rte_unused)
 {
struct virtio_net *dev = *pdev;

lib/vhost/vhost_user.c +1 -2
-uint64_t features, protocol_features;
+uint64_t protocol_features;
 
-rte_vhost_driver_get_features(dev->ifname, &features);

rte_vhost_driver_get_protocol_features(dev->ifname, &protocol_features);

Quoted 4 lines

ctx->msg.payload.u64 = protocol_features;

Signature · 1 line
2.34.1

With suggested changes done:

Applied to next-virtio/for-next-net.

Thanks,
Maxime