Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp253662rdd; Tue, 9 Jan 2024 03:11:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IHWObYuVaB1keWwFSSn+A6WLe0Rjiq2AR5BF97xBPYX9mbI1A+MRHwdhw1edM0KnJ+2Wdpu X-Received: by 2002:a50:d788:0:b0:557:2165:fa95 with SMTP id w8-20020a50d788000000b005572165fa95mr2248331edi.82.1704798676273; Tue, 09 Jan 2024 03:11:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704798676; cv=none; d=google.com; s=arc-20160816; b=0csI83/D/tV4LCqMwxVnHz6UNpV6CVqvOx+NTj/PH5XlIWTWdAGdK0haDeX6wWH5a3 xIOGZ7Z5G2ezllcLvBMMjUuaZI09bIiXTKSuEjEacfzqhtQqh9q2ehCGbLoD4W1kU7BU LE3EKLdmwW8G7pBXy1o97vKsNPMeKAhNsY/WxKPCbbh+Gi1kCEr+p/Q352VMK6zG75E+ 8FLF2q5EfM/KON1ywfYmEF3OMjiUsjNTUVn6KHE6ziO8DudEr+tWG8CVgQIwKYIoh5Ba qJ/c7Fz7h6Ld/NGxSZdb9l9uHADojb1WkJmH88VFPSuUQNrPfNxwDFw7nZtvrvHazUyr nOWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=yiFLDt6JZCuOrzbfaqayxRzUmPMlKKOFGuVamAlGo7c=; fh=+YAWGNokPfoHg1oXKIXy6skWlEnaUutNlHrvMBZ3/ec=; b=rhfKc7sI2wI6xQS5TWEdeLRYI/k2oTnnomEHvDCAWogY9jC0C2RoX0L5bJtpniO6W+ SwzLYTCJHyjZ5Vckvb7TXbYioGoBmvh1ClzXOifUbZIE3MHRZeIxqnOwTD4bayNRZ3Du fUy3tckstmKNr3P6XYM/22OvMeJgq5SIoAerfMDoxvyyhohD48IMYuC1FD+rokxy8C64 F2OIHjLw5/00zI9zOF/d87sybvoj17O34UcF2Kd8t9I5C9fS8LiLE29NT1AaDEu6s5dx GVOfcBWDSN1NRwQe72YnkjBCNLXi6YRK8EGPdq96B7uV63bZ4lYQGN81DlvyZ2iSUHJm VEkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MRUW+bGn; spf=pass (google.com: domain of linux-kernel+bounces-20747-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-20747-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id f24-20020a50a6d8000000b005536bd5c5a4si674180edc.413.2024.01.09.03.11.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 03:11:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-20747-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MRUW+bGn; spf=pass (google.com: domain of linux-kernel+bounces-20747-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-20747-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id F1E8C1F253A1 for ; Tue, 9 Jan 2024 11:11:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4F31D374D4; Tue, 9 Jan 2024 11:10:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="MRUW+bGn" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2F92437160 for ; Tue, 9 Jan 2024 11:10:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704798639; 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=yiFLDt6JZCuOrzbfaqayxRzUmPMlKKOFGuVamAlGo7c=; b=MRUW+bGnCTU+Nz9DCiy2x5O7SOcxxQWgOUvtOOG72R6J78bZOTWg4KPxzJkb1Hp1PMcZ5b JlsXgWcJvKBOjgFjZVbSuhKdTFo38LdepoIuBF5nLr2lTmEH89BU8V9qsModwNg9/YtUf9 j1OtnSsRcryeinPdJwzW6q8DB8MsRM0= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-384-5SSujEQiMWe-y5D1a8AYHQ-1; Tue, 09 Jan 2024 06:10:35 -0500 X-MC-Unique: 5SSujEQiMWe-y5D1a8AYHQ-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3EEAF3806735; Tue, 9 Jan 2024 11:10:35 +0000 (UTC) Received: from max-p1.redhat.com (unknown [10.39.208.21]) by smtp.corp.redhat.com (Postfix) with ESMTP id 66ECE492BE6; Tue, 9 Jan 2024 11:10:33 +0000 (UTC) From: Maxime Coquelin To: mst@redhat.com, jasowang@redhat.com, xuanzhuo@linux.alibaba.com, xieyongji@bytedance.com, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, david.marchand@redhat.com, lulu@redhat.com Cc: Maxime Coquelin Subject: [PATCH v7 2/3] vduse: Temporarily fail if control queue feature requested Date: Tue, 9 Jan 2024 12:10:24 +0100 Message-ID: <20240109111025.1320976-3-maxime.coquelin@redhat.com> In-Reply-To: <20240109111025.1320976-1-maxime.coquelin@redhat.com> References: <20240109111025.1320976-1-maxime.coquelin@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 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 fail features check if control-queue feature is requested. Signed-off-by: Maxime Coquelin --- drivers/vdpa/vdpa_user/vduse_dev.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/vdpa/vdpa_user/vduse_dev.c b/drivers/vdpa/vdpa_user/vduse_dev.c index a5af6d4077b8..00f3f562ab5d 100644 --- a/drivers/vdpa/vdpa_user/vduse_dev.c +++ b/drivers/vdpa/vdpa_user/vduse_dev.c @@ -8,6 +8,7 @@ * */ +#include "linux/virtio_net.h" #include #include #include @@ -28,6 +29,7 @@ #include #include #include +#include #include #include "iova_domain.h" @@ -1680,6 +1682,9 @@ static bool features_is_valid(struct vduse_dev_config *config) if ((config->device_id == VIRTIO_ID_BLOCK) && (config->features & BIT_ULL(VIRTIO_BLK_F_CONFIG_WCE))) return false; + else if ((config->device_id == VIRTIO_ID_NET) && + (config->features & BIT_ULL(VIRTIO_NET_F_CTRL_VQ))) + return false; return true; } -- 2.43.0