As doc mentioned, promisc and multicast are by-default supported in virtio pmd. Mac/vlan filter are supported by best effort. These control messages should return success.
Fixes: f9b9d1a55775 ("net/virtio-user: add multiple queues in device emulation") Cc: sta...@dpdk.org Signed-off-by: Marvin Liu <yong....@intel.com> --- .../net/virtio/virtio_user/virtio_user_dev.c | 24 +++++++++++++++++++ drivers/net/virtio/virtio_user_ethdev.c | 4 ++++ 2 files changed, 28 insertions(+) diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c index 1c575d0cd..dc0007b7c 100644 --- a/drivers/net/virtio/virtio_user/virtio_user_dev.c +++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c @@ -613,6 +613,18 @@ 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) { + if (hdr->cmd == VIRTIO_NET_CTRL_RX_PROMISC || + hdr->cmd == VIRTIO_NET_CTRL_RX_ALLMULTI) { + uint8_t setting; + setting = *(uint8_t *)(uintptr_t) + vring->desc[idx_data].addr; + if (setting) + status = 0; + } + } else if (hdr->class == VIRTIO_NET_CTRL_MAC || + hdr->class == VIRTIO_NET_CTRL_VLAN) { + status = 0; } /* Update status */ @@ -664,6 +676,18 @@ 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) { + if (hdr->cmd == VIRTIO_NET_CTRL_RX_PROMISC || + hdr->cmd == VIRTIO_NET_CTRL_RX_ALLMULTI) { + uint8_t setting; + setting = *(uint8_t *)(uintptr_t) + vring->desc[idx_data].addr; + if (setting) + status = 0; + } + } else if (hdr->class == VIRTIO_NET_CTRL_MAC || + hdr->class == VIRTIO_NET_CTRL_VLAN) { + status = 0; } /* Update status */ diff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c index 3fc172573..18caf5e88 100644 --- a/drivers/net/virtio/virtio_user_ethdev.c +++ b/drivers/net/virtio/virtio_user_ethdev.c @@ -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, -- 2.17.1