git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
net/virtio: check protocol feature in user backend
[dpdk.git]
/
drivers
/
net
/
virtio
/
virtio_user
/
vhost_user.c
diff --git
a/drivers/net/virtio/virtio_user/vhost_user.c
b/drivers/net/virtio/virtio_user/vhost_user.c
index
337e511
..
ef290c3
100644
(file)
--- a/
drivers/net/virtio/virtio_user/vhost_user.c
+++ b/
drivers/net/virtio/virtio_user/vhost_user.c
@@
-277,6
+277,11
@@
vhost_user_sock(struct virtio_user_dev *dev,
msg.size = 0;
switch (req) {
msg.size = 0;
switch (req) {
+ case VHOST_USER_GET_STATUS:
+ if (!(dev->protocol_features &
+ (1ULL << VHOST_USER_PROTOCOL_F_STATUS)))
+ return 0;
+ /* Fallthrough */
case VHOST_USER_GET_FEATURES:
case VHOST_USER_GET_PROTOCOL_FEATURES:
need_reply = 1;
case VHOST_USER_GET_FEATURES:
case VHOST_USER_GET_PROTOCOL_FEATURES:
need_reply = 1;
@@
-373,6
+378,7
@@
vhost_user_sock(struct virtio_user_dev *dev,
switch (req) {
case VHOST_USER_GET_FEATURES:
switch (req) {
case VHOST_USER_GET_FEATURES:
+ case VHOST_USER_GET_STATUS:
case VHOST_USER_GET_PROTOCOL_FEATURES:
if (msg.size != sizeof(m.payload.u64)) {
PMD_DRV_LOG(ERR, "Received bad msg size");
case VHOST_USER_GET_PROTOCOL_FEATURES:
if (msg.size != sizeof(m.payload.u64)) {
PMD_DRV_LOG(ERR, "Received bad msg size");