From: Eli Cohen Date: Mon, 14 Nov 2022 13:17:53 +0000 (+0200) Subject: vdpa/mlx5: Return error on vlan ctrl commands if not supported X-Git-Tag: v6.1.8~181 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6dbffca77f120cb70e0d5326571a81038282b309;p=platform%2Fkernel%2Flinux-starfive.git vdpa/mlx5: Return error on vlan ctrl commands if not supported [ Upstream commit 5aec804936bbff182081f1cdc271fcb76af1a4ff ] Check if VIRTIO_NET_F_CTRL_VLAN is negotiated and return error if control VQ command is received. Signed-off-by: Eli Cohen Message-Id: <20221114131759.57883-3-elic@nvidia.com> Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang Acked-by: Eugenio PĂ©rez Signed-off-by: Sasha Levin --- diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c index 444d657..b06260a 100644 --- a/drivers/vdpa/mlx5/net/mlx5_vnet.c +++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c @@ -1823,6 +1823,9 @@ static virtio_net_ctrl_ack handle_ctrl_vlan(struct mlx5_vdpa_dev *mvdev, u8 cmd) size_t read; u16 id; + if (!(ndev->mvdev.actual_features & BIT_ULL(VIRTIO_NET_F_CTRL_VLAN))) + return status; + switch (cmd) { case VIRTIO_NET_CTRL_VLAN_ADD: read = vringh_iov_pull_iotlb(&cvq->vring, &cvq->riov, &vlan, sizeof(vlan));