Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp27932207rwd; Tue, 4 Jul 2023 09:54:08 -0700 (PDT) X-Google-Smtp-Source: APBJJlEQvHULpxQeDEDL5dOJqyS/5q+UJPq/QXEHWHA/J9cex/xK2dRlk12eLcS/q+MCeH9bplPJ X-Received: by 2002:a05:6870:be88:b0:177:ad57:cb36 with SMTP id nx8-20020a056870be8800b00177ad57cb36mr14227273oab.27.1688489648537; Tue, 04 Jul 2023 09:54:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688489648; cv=none; d=google.com; s=arc-20160816; b=b2lTw33yvwok8pIaPSLfudWvot2ncm59yMoeFA14fYL+2qzq6CL9LvdrauCJfIXmEy ltZTA12gLGRvIctmOPDloixV5ARY3z38woyWBF4o7nTelffnbokMKyKd4wSP1DcPtujY 8yhSxuRjU+lIKKvoxI1LYbe5Xjs3DChpxMehAjERAduNQNuzjWIybZoqMyQsJUUrGDu3 DvpvD491YcMx2LVWz5IrYu+0TiH2vB3bPIrwAYA+ziht9XGfpI6XhfCDIzcjBCHmp+RC /ccfO8m93R0wGk/zqvxnv2ama2aaFgsBAm88qc/g+xaHMfUUAWkVrIqscvwWWCfcSBAj Ivjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=h3fmV53fwhiWk7sQEChyplGv7CVi08pMxUVWbzUrLYY=; fh=S1rZK6DPg0mAED4KjNm0cP4EEY87q6FXHFEeosELg0E=; b=w1NajABiU30PNoaPUCFR0i3m9NPp9nqtS9enj08FTrfT5DIpeCGKup19gHvmcWB1XX dbXWBB1+0QTSk5l0lmHto2cFhR/Wi/HijX3f9AYp3neF41RTVYUzWt5ww6+uyuP2bnqK ISjx5e3SsJiY+R7jPOIQ7D2BOp4p0Iu+VZ3YLJsihF30NhfTpYZM22IIkl9s9G/9xCzH jYXUn1mwuPTR1iwjaFzWvUmcriTggqdB9YqW/KnzQOP0v/tqC+HoVKprx1ROm1ZytvU7 /335OYnbwHUtRrHx7tj/ZuudGh8Tpf8T3LFL90Kghl1WMX9OewfFUjrPJwhWO3reKBwV 41BQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SQD7+wgt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x14-20020a17090a788e00b0025ee198e6f7si22527996pjk.168.2023.07.04.09.53.53; Tue, 04 Jul 2023 09:54:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SQD7+wgt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231497AbjGDQmI (ORCPT + 99 others); Tue, 4 Jul 2023 12:42:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231794AbjGDQly (ORCPT ); Tue, 4 Jul 2023 12:41:54 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8CB2910D8 for ; Tue, 4 Jul 2023 09:41:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1688488863; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=h3fmV53fwhiWk7sQEChyplGv7CVi08pMxUVWbzUrLYY=; b=SQD7+wgtnB08hvcp5lUn9+VuXakI+kxin56HYjkAD/jbUUB9ReSu/SL6egDQa5+ADC/aGi 0Z5rhilu43C5TSTqvayTpwB/xMfrW3oVkDLWiVQEKx2hoSaAqC+Nrl0hsR3ucBFGhENH7A 5XGtFL2XpGYC3vr7mLx/4mZP702ReV4= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-261-eJ42uQqnNNqHjT5-jlVUrw-1; Tue, 04 Jul 2023 12:40:59 -0400 X-MC-Unique: eJ42uQqnNNqHjT5-jlVUrw-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2B6FE38008B2; Tue, 4 Jul 2023 16:40:59 +0000 (UTC) Received: from max-t490s.redhat.com (unknown [10.39.208.32]) by smtp.corp.redhat.com (Postfix) with ESMTP id F0A1E492B02; Tue, 4 Jul 2023 16:40:56 +0000 (UTC) From: Maxime Coquelin To: xieyongji@bytedance.com, jasowang@redhat.com, mst@redhat.com, david.marchand@redhat.com, lulu@redhat.com Cc: linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, xuanzhuo@linux.alibaba.com, eperezma@redhat.com, Maxime Coquelin Subject: [PATCH v2 3/3] vduse: Temporarily disable control queue features Date: Tue, 4 Jul 2023 18:40:45 +0200 Message-ID: <20230704164045.39119-4-maxime.coquelin@redhat.com> In-Reply-To: <20230704164045.39119-1-maxime.coquelin@redhat.com> References: <20230704164045.39119-1-maxime.coquelin@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Virtio-net driver control queue implementation is not safe when used with VDUSE. If the VDUSE application does not reply to control queue messages, it currently ends up hanging the kernel thread sending this command. Some work is on-going to make the control queue implementation robust with VDUSE. Until it is completed, let's disable control virtqueue and features that depend on it. Signed-off-by: Maxime Coquelin --- drivers/vdpa/vdpa_user/vduse_dev.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/drivers/vdpa/vdpa_user/vduse_dev.c b/drivers/vdpa/vdpa_user/vduse_dev.c index 1271c9796517..04367a53802b 100644 --- a/drivers/vdpa/vdpa_user/vduse_dev.c +++ b/drivers/vdpa/vdpa_user/vduse_dev.c @@ -1778,6 +1778,25 @@ static struct attribute *vduse_dev_attrs[] = { ATTRIBUTE_GROUPS(vduse_dev); +static void vduse_dev_features_fixup(struct vduse_dev_config *config) +{ + if (config->device_id == VIRTIO_ID_NET) { + /* + * Temporarily disable control virtqueue and features that + * depend on it while CVQ is being made more robust for VDUSE. + */ + config->features &= ~((1ULL << VIRTIO_NET_F_CTRL_VQ) | + (1ULL << VIRTIO_NET_F_CTRL_RX) | + (1ULL << VIRTIO_NET_F_CTRL_VLAN) | + (1ULL << VIRTIO_NET_F_GUEST_ANNOUNCE) | + (1ULL << VIRTIO_NET_F_MQ) | + (1ULL << VIRTIO_NET_F_CTRL_MAC_ADDR) | + (1ULL << VIRTIO_NET_F_RSS) | + (1ULL << VIRTIO_NET_F_HASH_REPORT) | + (1ULL << VIRTIO_NET_F_NOTF_COAL)); + } +} + static int vduse_create_dev(struct vduse_dev_config *config, void *config_buf, u64 api_version) { @@ -1793,6 +1812,8 @@ static int vduse_create_dev(struct vduse_dev_config *config, if (!dev) goto err; + vduse_dev_features_fixup(config); + dev->api_version = api_version; dev->device_features = config->features; dev->device_id = config->device_id; -- 2.41.0