From patchwork Tue Oct 20 07:16:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Moreno X-Patchwork-Id: 81431 X-Patchwork-Delegate: maxime.coquelin@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0AE9EA04DC; Tue, 20 Oct 2020 09:16:52 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 38883BADE; Tue, 20 Oct 2020 09:16:50 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by dpdk.org (Postfix) with ESMTP id CE6C5AD6A for ; Tue, 20 Oct 2020 09:16:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603178206; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SHpfC2V+oy0HlAXn3IgnyQ5TNMWNvo5cnKwRVv4GYEs=; b=EGtf7jLWq0Jssrg/n6SbKUn+XUyKBpgy1uHsn42gOEhMKPsBp1zU5jOdpKmDPglQto14yi EkGN7abJ+7dzffVJRdsU+jw9ysvzNLJwB6V5ABDZq3LGWmCvrrczFNpzAkZZO4OWtKUslN 2SpSZ2fzCey/QXOAkHma3/LRb3kmz9E= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-527-OaelgQdbPGq5-UR9NuIRMw-1; Tue, 20 Oct 2020 03:16:44 -0400 X-MC-Unique: OaelgQdbPGq5-UR9NuIRMw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0DB6A64089; Tue, 20 Oct 2020 07:16:43 +0000 (UTC) Received: from amorenoz.users.ipa.redhat.com (ovpn-112-202.ams2.redhat.com [10.36.112.202]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2BED55D9D2; Tue, 20 Oct 2020 07:16:37 +0000 (UTC) From: Adrian Moreno To: dev@dpdk.org Cc: yinan.wang@intel.com, patrick.fu@intel.com, amorenoz@redhat.com, stable@dpdk.org, Maxime Coquelin , Chenbo Xia , Zhihong Wang Date: Tue, 20 Oct 2020 09:16:27 +0200 Message-Id: <20201020071628.323641-1-amorenoz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=amorenoz@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [dpdk-dev] [PATCH] virtio-user: fix backend selection if stat fails X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" If stat fails it means the backend must be vhost-user in server mode Bugzilla ID: 559 Fixes: f908b22ea47a ("net/virtio: move backend type selection to ethdev") Cc: stable@dpdk.org Signed-off-by: Adrian Moreno Tested-by: JiangYuX --- drivers/net/virtio/virtio_user_ethdev.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c index 042665bc0..ce74d08ab 100644 --- a/drivers/net/virtio/virtio_user_ethdev.c +++ b/drivers/net/virtio/virtio_user_ethdev.c @@ -560,9 +560,10 @@ virtio_user_backend_type(const char *path) struct stat sb; if (stat(path, &sb) == -1) { - PMD_INIT_LOG(ERR, "Stat fails: %s (%s)\n", path, + PMD_INIT_LOG(INFO, "Stat fails: %s (%s)\n", path, strerror(errno)); - return VIRTIO_USER_BACKEND_UNKNOWN; + /* Must be vhost-user in server mode */ + return VIRTIO_USER_BACKEND_VHOST_USER; } if (S_ISSOCK(sb.st_mode)) {