Skip to contentSkip to conversation

vhost: enable CONFIG feature

PATCH Superseded Hao Chen 3 participants 5 messages Sep 13, 2022 – Oct 8, 2022

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Hao Chen

author
#0 lore raw

PATCH 1/1 vhost: enable CONFIG feature

Enable this feature, so that libvirt or qemu can call vdpa vendor driver's ops '.get_config' through 'vhost_net_get_config' to get the mac address of the vdpa hardware without manual configuration.

---
 lib/vhost/vhost_user.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
lib/vhost/vhost_user.h +2 -1
index 8ecca68597..12e8d116f3 100644
@@ -23,7 +23,8 @@
 					 (1ULL << VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD) | \
 					 (1ULL << VHOST_USER_PROTOCOL_F_HOST_NOTIFIER) | \
 					 (1ULL << VHOST_USER_PROTOCOL_F_PAGEFAULT) | \
-					 (1ULL << VHOST_USER_PROTOCOL_F_STATUS))
+					 (1ULL << VHOST_USER_PROTOCOL_F_STATUS) | \
+					 (1ULL << VHOST_USER_PROTOCOL_F_CONFIG))
 
 typedef enum VhostUserRequest {
 	VHOST_USER_NONE = 0,
Signature · 1 line
2.34.1
#1 lore raw
Quoted 24 lines · Hao Chen

From: Hao Chen

Date: 2022-09-13 17:55

To: maxime.coquelin; chenbo.xia

CC dev; houyl; zy; Hao Chen

Subject: [PATCH] vhost: enable CONFIG feature

Enable this feature, so that libvirt or qemu can call vdpa vendor

Quoted 5 lines

driver's ops '.get_config' through 'vhost_net_get_config' to get

the mac address of the vdpa hardware without manual configuration.

Quoted 8 lines

---

Quoted 5 lines

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

1 file changed, 2 insertions(+), 1 deletion(-)

Quoted 48 lines
lib/vhost/vhost_user.h +0 -0

index 8ecca68597..12e8d116f3 100644

--- a/lib/vhost/vhost_user.h

+++ b/lib/vhost/vhost_user.h

lib/vhost/vhost_user.h +0 -0
@@ -23,7 +23,8 @@
 
 
 
 (1ULL << VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD) | \
 
 
 

(1ULL << VHOST_USER_PROTOCOL_F_HOST_NOTIFIER) | \

(1ULL << VHOST_USER_PROTOCOL_F_PAGEFAULT) | \

- (1ULL << VHOST_USER_PROTOCOL_F_STATUS))

+ (1ULL << VHOST_USER_PROTOCOL_F_STATUS) | \

+ (1ULL << VHOST_USER_PROTOCOL_F_CONFIG))

typedef enum VhostUserRequest {

Quoted 5 lines

VHOST_USER_NONE = 0,

--

Yusur (YUSUR Technology Co., Ltd.) focuses on the research and development of special data processors. The independently developed international leading DPU series products can be widely used in ultra-low latency network, big data processing, 5G edge computing, high-speed storage and other scenarios, helping computing power become the new productivity of the digital era.

The company put forward innovative Software Defined Accelerator technology and independently developed the chip architecture KPU(Kernel Processing Unit) and agile heterogeneous Software stack (HADOS) for domain-specific computing (DSA).

Now, adding the feature of obtain vdpa device's mac address automatically for DPDK vDPA path.

#2 lore raw
In reply to Hao Chen
Quoted 11 lines

-----Original Message-----
From: Hao Chen <[email protected]>
Sent: Tuesday, September 13, 2022 5:55 PM
To: [email protected]; Xia, Chenbo <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Hao Chen <[email protected]>
Subject: [PATCH] vhost: enable CONFIG feature

Enable this feature, so that libvirt or qemu can call vdpa vendor driver's ops '.get_config' through 'vhost_net_get_config' to get the mac address of the vdpa hardware without manual configuration.

I think we should add this in vendor's vdpa driver, not in common library. Because some hardware and the sw back-end can't support get/set config.

Thanks,
Chenbo

Quoted 25 lines
---
 lib/vhost/vhost_user.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
lib/vhost/vhost_user.h +2 -1
index 8ecca68597..12e8d116f3 100644
@@ -23,7 +23,8 @@
 					 (1ULL <<
 VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD) | \
 					 (1ULL <<
 VHOST_USER_PROTOCOL_F_HOST_NOTIFIER) | \
 					 (1ULL << VHOST_USER_PROTOCOL_F_PAGEFAULT) |
 \
-					 (1ULL << VHOST_USER_PROTOCOL_F_STATUS))
+					 (1ULL << VHOST_USER_PROTOCOL_F_STATUS) | \
+					 (1ULL << VHOST_USER_PROTOCOL_F_CONFIG))

typedef enum VhostUserRequest {
VHOST_USER_NONE = 0,
--
2.34.1

author
#3 lore raw
Quoted 8 lines · Chenbo
Quoted 8 lines

-----Original Message-----
From: Hao Chen <[email protected]>
Sent: Tuesday, September 13, 2022 5:55 PM
To: [email protected]; Xia, Chenbo <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Hao Chen <[email protected]>
Subject: [PATCH] vhost: enable CONFIG feature

Quoted 8 lines
Quoted 3 lines

Enable this feature, so that libvirt or qemu can call vdpa vendor driver's ops '.get_config' through 'vhost_net_get_config' to get the mac address of the vdpa hardware without manual configuration.

I think we should add this in vendor's vdpa driver, not in common library. Because some hardware and the sw back-end can't support get/set config.

Thanks,
Chenbo

In function 'rte_vhost_driver_get_protocol_features' at lib/vhost/socket.c, "*protocol_features = vsocket->protocol_features & vdpa_protocol_features". If you want vdpa driver to support VHOST_ USER_ PROTOCOL_ F_ CONFIG, we need to add this feature here, and we also need the vdpa driver to support VHOST_ USER_ PROTOCOL_ F_ CONFIG in rte_ vdpa_ dev_ ops's get_ features,  only add this in vendor's vdpa driver is invalid.

Thanks.

Quoted 24 lines
Quoted 24 lines
---
  lib/vhost/vhost_user.h | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
lib/vhost/vhost_user.h +2 -1
index 8ecca68597..12e8d116f3 100644
@@ -23,7 +23,8 @@
  					 (1ULL <<
 VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD) | \
  					 (1ULL <<
 VHOST_USER_PROTOCOL_F_HOST_NOTIFIER) | \
  					 (1ULL << VHOST_USER_PROTOCOL_F_PAGEFAULT) |
 \
-					 (1ULL << VHOST_USER_PROTOCOL_F_STATUS))
+					 (1ULL << VHOST_USER_PROTOCOL_F_STATUS) | \
+					 (1ULL << VHOST_USER_PROTOCOL_F_CONFIG))

typedef enum VhostUserRequest {
VHOST_USER_NONE = 0,
--
2.34.1

author
#4 lore raw
In reply to Xia, Chenbo
Quoted 8 lines · Chenbo
Quoted 8 lines

-----Original Message-----
From: Hao Chen <[email protected]>
Sent: Tuesday, September 13, 2022 5:55 PM
To: [email protected]; Xia, Chenbo <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Hao Chen <[email protected]>
Subject: [PATCH] vhost: enable CONFIG feature

Quoted 8 lines
Quoted 3 lines

Enable this feature, so that libvirt or qemu can call vdpa vendor driver's ops '.get_config' through 'vhost_net_get_config' to get the mac address of the vdpa hardware without manual configuration.

I think we should add this in vendor's vdpa driver, not in common library. Because some hardware and the sw back-end can't support get/set config.

Thanks,
Chenbo

Yeah, maybe add "if (vdpa_protocol_features & (1ULL << VHOST_USER_PROTOCOL_F_CONFIG))   *protocol_features |= (1ULL << VHOST_USER_PROTOCOL_F_CONFIG);" at the end of function 'rte_vhost_driver_get_protocol_features' will be better. I will send patch v2.

Thanks.

Quoted 24 lines
Quoted 24 lines
---
  lib/vhost/vhost_user.h | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
lib/vhost/vhost_user.h +2 -1
index 8ecca68597..12e8d116f3 100644
@@ -23,7 +23,8 @@
  					 (1ULL <<
 VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD) | \
  					 (1ULL <<
 VHOST_USER_PROTOCOL_F_HOST_NOTIFIER) | \
  					 (1ULL << VHOST_USER_PROTOCOL_F_PAGEFAULT) |
 \
-					 (1ULL << VHOST_USER_PROTOCOL_F_STATUS))
+					 (1ULL << VHOST_USER_PROTOCOL_F_STATUS) | \
+					 (1ULL << VHOST_USER_PROTOCOL_F_CONFIG))

typedef enum VhostUserRequest {
VHOST_USER_NONE = 0,
--
2.34.1