[v5] net/virtio: fix multicast and promisc mode enable failure
Checks
Commit Message
As doc mentioned, Rx/Mac/vlan filters are all supported by best effort.
These control commands should return pass. Promisc and all multicast
modes are always enabled in virio-user, initialize related values in
ethernet data.
Fixes: f9b9d1a55775 ("net/virtio-user: add multiple queues in device emulation")
Cc: stable@dpdk.org
Signed-off-by: Marvin Liu <yong.liu@intel.com>
---
drivers/net/virtio/virtio_user/virtio_user_dev.c | 8 ++++++++
drivers/net/virtio/virtio_user_ethdev.c | 4 ++++
2 files changed, 12 insertions(+)
@@ -613,6 +613,10 @@ virtio_user_handle_ctrl_msg(struct virtio_user_dev *dev, struct vring *vring,
queues = *(uint16_t *)(uintptr_t)vring->desc[idx_data].addr;
status = virtio_user_handle_mq(dev, queues);
+ } else if (hdr->class == VIRTIO_NET_CTRL_RX ||
+ hdr->class == VIRTIO_NET_CTRL_MAC ||
+ hdr->class == VIRTIO_NET_CTRL_VLAN) {
+ status = 0;
}
/* Update status */
@@ -664,6 +668,10 @@ virtio_user_handle_ctrl_msg_packed(struct virtio_user_dev *dev,
queues = *(uint16_t *)(uintptr_t)
vring->desc[idx_data].addr;
status = virtio_user_handle_mq(dev, queues);
+ } else if (hdr->class == VIRTIO_NET_CTRL_RX ||
+ hdr->class == VIRTIO_NET_CTRL_MAC ||
+ hdr->class == VIRTIO_NET_CTRL_VLAN) {
+ status = 0;
}
/* Update status */
@@ -660,6 +660,10 @@ virtio_user_pmd_probe(struct rte_vdev_device *dev)
goto end;
}
+ /* multicast and promisc mode are always enabled */
+ eth_dev->data->promiscuous = 1;
+ eth_dev->data->all_multicast = 1;
+
hw = eth_dev->data->dev_private;
if (virtio_user_dev_init(hw->virtio_user_dev, path, queues, cq,
queue_size, mac_addr, &ifname, server_mode,