From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id D1A29A04DD; Tue, 20 Oct 2020 12:33:39 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A50D4AA2C; Tue, 20 Oct 2020 12:33:38 +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 BE35BAA0C for ; Tue, 20 Oct 2020 12:33:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603190015; 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: in-reply-to:in-reply-to:references:references; bh=nO7DbLyUkmGVAHsUFsV20Dhy3SjmpzaNp+3UkbDpqQM=; b=gYlpkgazZAY+wU5+v+hmc/Y1TIR3oHTpYbQDVoaikvh4pD7EorbUVc4QzJdRTmBPcOEQ4y lXFmcWtMccB1xDCnq2TlKtZ3qekO3jpllH3mx9jstkKW/gbcrKKbTchfDuACxl7Ms2HHY2 7nIJQFcKc8ElEHwTgms941xOJ71ZpdA= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-585-tS_FS5_GMyiB4j4ZI8lSMw-1; Tue, 20 Oct 2020 06:33:33 -0400 X-MC-Unique: tS_FS5_GMyiB4j4ZI8lSMw-1 Received: by mail-wr1-f70.google.com with SMTP id n14so642145wrp.1 for ; Tue, 20 Oct 2020 03:33:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=nO7DbLyUkmGVAHsUFsV20Dhy3SjmpzaNp+3UkbDpqQM=; b=PzQ1bUJSze7NPvQBe+Gm3cN+l9fFFxhhntbpadJ6w/ZaG0UFHlT0PTULUzsUM13LMg wcy0x8Tfg4Ni9iw3SOVPBgvP61ajTF17QRAmtQ8CyLYciabtSmdeoLceV1beMscXFMiE 69ui8Y/9xG3cSAF2MwK89yfwZWWu7J1+L3fpdmsJSjrHgs+fj+JtWX+KeENSXqAfg19Y ELHubeffVvLkkNcYfLdxfH0/tB/HtQ6qXhP1CUDo1178ejEXon/MgduJ2LZtj/4Bo3B+ MpCzEKukasz/KFXtyvCfNn+5dB/0zAug65lZZIQgyQ4UAvygzq9uwhhfNbQi9eRsvYSD PhKg== X-Gm-Message-State: AOAM533xPZ9fJaDePsqKTeeEds5+qBBrtnKPZAOQP2rV8bUXfOoB/Beg hePiWCP73AcRU3JvPc44IdK3T9/so6aDE1ig/QQvX9MNAbZoIdoWU/Q8ecNJcf4nPsyj75fH5K8 3iuE= X-Received: by 2002:adf:f584:: with SMTP id f4mr2599549wro.383.1603190012530; Tue, 20 Oct 2020 03:33:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwhvE7k0KIgMLhqna8F+8mhSBXeeYG8EkGtXuIA7X80wZt+iNN4hmfIpSDeQFi5/AtwsTvByw== X-Received: by 2002:adf:f584:: with SMTP id f4mr2599522wro.383.1603190012290; Tue, 20 Oct 2020 03:33:32 -0700 (PDT) Received: from amorenoz.users.ipa.redhat.com ([94.73.56.18]) by smtp.gmail.com with ESMTPSA id p9sm1994030wmm.4.2020.10.20.03.33.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 20 Oct 2020 03:33:31 -0700 (PDT) To: Maxime Coquelin , Kevin Traynor , dev@dpdk.org Cc: yinan.wang@intel.com, patrick.fu@intel.com, stable@dpdk.org, Chenbo Xia , Zhihong Wang References: <20201020071628.323641-1-amorenoz@redhat.com> <525cba16-8f46-fc7e-47ec-1f0ec45c00e2@redhat.com> <7aa64791-d71f-c195-f2d6-6262afc29fe7@redhat.com> <34c221fb-f44b-251b-6183-c6606b0b29b6@redhat.com> From: Adrian Moreno Message-ID: <6f37177a-66d6-f564-6459-bbd784919f9e@redhat.com> Date: Tue, 20 Oct 2020 12:33:30 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1 MIME-Version: 1.0 In-Reply-To: <34c221fb-f44b-251b-6183-c6606b0b29b6@redhat.com> 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 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [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" On 10/20/20 11:55 AM, Maxime Coquelin wrote: > > > On 10/20/20 11:38 AM, Kevin Traynor wrote: >> On 20/10/2020 10:11, Maxime Coquelin wrote: >>> >>> >>> On 10/20/20 11:01 AM, Kevin Traynor wrote: >>>> On 20/10/2020 08:16, Adrian Moreno wrote: >>>>> 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 >>>>> --- >>>>> 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)); >>>> >>>> It may be accurate, but a 'fail' in the logs can be confusing for users >>>> when it is an INFO log and normal operation. Suggest to reword to >>>> something softer like 'Unable to stat' or 'Not able to get file status' >>> >>> >>> We may want to: >>> - only return VIRTIO_USER_BACKEND_VHOST_USER if -ENOENT, and log that >>> we assume this is Vhost-user backend in server mode at INFO level. >> >> It will mean that sometimes the backend type is logged and sometimes >> not, but maybe you make a distinction because there is an assumption >> being made in this case? > > I agree it would make sense to log at INFO level for all backend types. > >>> - return VIRTIO_USER_BACKEND_UNKNOWN otherwise and print an error >>> message with the strerror(errno). >>> >> >> yes, it seems better like that. >> Thanks Maxime and Kevin for your feedback and Jiang for testing. I'll send a v2 addressing the comments. >>> What do you think? >>> >>>>> - return VIRTIO_USER_BACKEND_UNKNOWN; >>>>> + /* Must be vhost-user in server mode */ >>>>> + return VIRTIO_USER_BACKEND_VHOST_USER; >>>>> } >>>>> >>>>> if (S_ISSOCK(sb.st_mode)) { >>>>> >>>> >> > -- Adrián Moreno