DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/virtio: fix promisc mode enable failure
@ 2019-10-28 15:40 Marvin Liu
  2019-10-28 16:24 ` [dpdk-dev] [PATCH v2] net/virtio: fix multicast and " Marvin Liu
  0 siblings, 1 reply; 10+ messages in thread
From: Marvin Liu @ 2019-10-28 15:40 UTC (permalink / raw)
  To: maxime.coquelin, tiwei.bie, zhihong.wang; +Cc: dev, Marvin Liu, stable

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 pass.

Fixes: f9b9d1a55775 ("net/virtio-user: add multiple queues in device emulation")
Cc: stable@dpdk.org

Signed-off-by: Marvin Liu <yong.liu@intel.com>
---
 .../net/virtio/virtio_user/virtio_user_dev.c    | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c
index 1c575d0cd..d7588e920 100644
--- a/drivers/net/virtio/virtio_user/virtio_user_dev.c
+++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c
@@ -587,7 +587,7 @@ static uint32_t
 virtio_user_handle_ctrl_msg(struct virtio_user_dev *dev, struct vring *vring,
 			    uint16_t idx_hdr)
 {
-	struct virtio_net_ctrl_hdr *hdr;
+	struct virtio_pmd_ctrl *ctrl;
 	virtio_net_ctrl_ack status = ~0;
 	uint16_t i, idx_data, idx_status;
 	uint32_t n_descs = 0;
@@ -606,13 +606,22 @@ virtio_user_handle_ctrl_msg(struct virtio_user_dev *dev, struct vring *vring,
 	idx_status = i;
 	n_descs++;
 
-	hdr = (void *)(uintptr_t)vring->desc[idx_hdr].addr;
-	if (hdr->class == VIRTIO_NET_CTRL_MQ &&
-	    hdr->cmd == VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET) {
+	ctrl = (void *)(uintptr_t)vring->desc[idx_hdr].addr;
+	if (ctrl->hdr.class == VIRTIO_NET_CTRL_MQ &&
+	    ctrl->hdr.cmd == VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET) {
 		uint16_t queues;
 
 		queues = *(uint16_t *)(uintptr_t)vring->desc[idx_data].addr;
 		status = virtio_user_handle_mq(dev, queues);
+	} else if (ctrl->hdr.class == VIRTIO_NET_CTRL_RX) {
+		if (ctrl->hdr.cmd == VIRTIO_NET_CTRL_RX_PROMISC ||
+		    ctrl->hdr.cmd == VIRTIO_NET_CTRL_RX_ALLMULTI) {
+			if (ctrl->data[0])
+				status = 0;
+		}
+	} else if (ctrl->hdr.class == VIRTIO_NET_CTRL_MAC ||
+		   ctrl->hdr.class == VIRTIO_NET_CTRL_VLAN) {
+		status = 0;
 	}
 
 	/* Update status */
-- 
2.17.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-11-06 21:00 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-28 15:40 [dpdk-dev] [PATCH] net/virtio: fix promisc mode enable failure Marvin Liu
2019-10-28 16:24 ` [dpdk-dev] [PATCH v2] net/virtio: fix multicast and " Marvin Liu
2019-10-28 16:42   ` [dpdk-dev] [PATCH v3] " Marvin Liu
2019-10-29 12:27     ` Tiwei Bie
2019-10-30  2:41       ` Liu, Yong
2019-10-30 10:30     ` [dpdk-dev] [PATCH v4] " Marvin Liu
2019-10-30 15:25       ` [dpdk-dev] [PATCH v5] " Marvin Liu
2019-11-06  9:02         ` [dpdk-dev] [PATCH v6] net/virtio-user: fix failures when setting filters Marvin Liu
2019-11-06 19:54           ` Maxime Coquelin
2019-11-06 21:00           ` Maxime Coquelin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).