Skip to content

Commit 8a50571

Browse files
ls-zhumstsirkin
authored andcommitted
vDPA: check VIRTIO_NET_F_RSS for max_virtqueue_paris's presence
virtio 1.2 spec says: max_virtqueue_pairs only exists if VIRTIO_NET_F_MQ or VIRTIO_NET_F_RSS is set. So when reporint MQ to userspace, it should check both VIRTIO_NET_F_MQ and VIRTIO_NET_F_RSS. unused parameter struct vdpa_device *vdev is removed Signed-off-by: Zhu Lingshan <lingshan.zhu@intel.com> Acked-by: Jason Wang <jasowang@redhat.com> Message-Id: <20220929014555.112323-4-lingshan.zhu@intel.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
1 parent c6dac2e commit 8a50571

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/vdpa/vdpa.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -804,13 +804,13 @@ static int vdpa_nl_cmd_dev_get_dumpit(struct sk_buff *msg, struct netlink_callba
804804
return msg->len;
805805
}
806806

807-
static int vdpa_dev_net_mq_config_fill(struct vdpa_device *vdev,
808-
struct sk_buff *msg, u64 features,
807+
static int vdpa_dev_net_mq_config_fill(struct sk_buff *msg, u64 features,
809808
const struct virtio_net_config *config)
810809
{
811810
u16 val_u16;
812811

813-
if ((features & BIT_ULL(VIRTIO_NET_F_MQ)) == 0)
812+
if ((features & BIT_ULL(VIRTIO_NET_F_MQ)) == 0 &&
813+
(features & BIT_ULL(VIRTIO_NET_F_RSS)) == 0)
814814
return 0;
815815

816816
val_u16 = le16_to_cpu(config->max_virtqueue_pairs);

0 commit comments

Comments
 (0)