From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A27CAA00C2; Fri, 17 Jun 2022 05:05:14 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 857F640698; Fri, 17 Jun 2022 05:05:14 +0200 (CEST) Received: from mail-pg1-f177.google.com (mail-pg1-f177.google.com [209.85.215.177]) by mails.dpdk.org (Postfix) with ESMTP id 1D26340689 for ; Fri, 17 Jun 2022 05:05:13 +0200 (CEST) Received: by mail-pg1-f177.google.com with SMTP id r5so2935691pgr.3 for ; Thu, 16 Jun 2022 20:05:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bbX8eaAvcorEtqwA82xqu+rmA1CUJCUhdvIgVL71UM0=; b=u1njxCy3q2YQvg7l7adhZ86I7sPVtN4+uln0cRkqbL3MREGoAgdybSIyYgqchzd6n/ 5FtxLV2E7TvXKgVyoDck8/iLBkpKCF/O94Yd7iZpJf1I528N83ukP2RnvntCXJI1AXt0 NBYzSCylmVLmrIAAlTGKuhNwNUhc0tZzwR6F8hDMTfSkeaIBPM6hdDfe0H7Sew90F/BJ eYhhhrvDCP+23jWadE8iQIq0QkgTTcI+PZ5FCgIeYn0Qb36yPkaplOHi+dSkMN6E/hU2 O3qnoE3+2sG+DvAaM+9AM7xJqJtJNZrO54Bjs2dC8aRjWK2g3FHmJq6qL5ORd4/L3g5V CuMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bbX8eaAvcorEtqwA82xqu+rmA1CUJCUhdvIgVL71UM0=; b=ebYoLrwAPPaAymOO0J8QHXYOwsXSV9yzXk/6w9J54XMem3Er8XKUKyuyI9DXi+vM06 2KrrXL4koO9h2IPX/LtIqtg1tUU5fp8JQgMpO+npSDvpDwwUN9SlpaxFR6zTjJrC56hq 09HfySe4TZ1oh9X0rj1ZYziuJM0Zc7WlypubHEYadU+2b1P4a+SA6SLgZ8glfVLmHm1c QWo5TjQGla7dkwnyg18WCQ0APM+MZFYDMyFQY+Dn4uKKT7Sti1IfbH0CFJxSzV2VAyt9 RTOf58KawyDwtuNk32bSae2KzP4upq7WQOSwVOVeE5uG058X4xjl1EIJFylwwKMmfyjg GpFg== X-Gm-Message-State: AJIora9lPMcZ/sqJiLpmokg3WzSbKMjDR5A/RDpHwKODXFH35GAaqa3y QeY68de3gCMxksbam0H3UTuRvg== X-Google-Smtp-Source: AGRyM1v09Tkuuz8UuwrOvroOhMJoCBdgV2L3ZN85A5l58cG+fvTt3wxTtWL23K8XD7SPWxI3qrvVig== X-Received: by 2002:a63:6b02:0:b0:3fb:da5e:42a1 with SMTP id g2-20020a636b02000000b003fbda5e42a1mr7252626pgc.273.1655435112230; Thu, 16 Jun 2022 20:05:12 -0700 (PDT) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id p14-20020a170902780e00b0016648412514sm2332938pll.188.2022.06.16.20.05.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jun 2022 20:05:11 -0700 (PDT) Date: Thu, 16 Jun 2022 20:05:09 -0700 From: Stephen Hemminger To: Yuan Wang Cc: maxime.coquelin@redhat.com, chenbo.xia@intel.com, dev@dpdk.org, jiayu.hu@intel.com, xingguang.he@intel.com, stable@dpdk.org Subject: Re: [PATCH] net/virtio: fix socket nonblocking mode affects initialization Message-ID: <20220616200509.111a9686@hermes.local> In-Reply-To: <20220617024229.706826-1-yuanx.wang@intel.com> References: <20220617024229.706826-1-yuanx.wang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Fri, 17 Jun 2022 10:42:29 +0800 Yuan Wang wrote: > The virtio-user initialization requires unix socket to receive backend > messages in block mode. However, vhost_user_update_link_state() sets > the same socket to nonblocking via fcntl, which affects all threads. > Enabling the rxq interrupt can causes both of these behaviors to occur > concurrently, with the result that the initialization may fail > because no messages are received in nonblocking socket. > > Thread 1: > virtio_init_device() > --> virtio_user_start_device() > --> vhost_user_set_memory_table() > --> vhost_user_check_reply_ack() > > Thread 2: > virtio_interrupt_handler() > --> vhost_user_update_link_state() > > Fix that by replacing O_NONBLOCK with the recv per-call option > MSG_DONTWAIT. > > Fixes: ef53b6030039 ("net/virtio-user: support LSC") > Cc: stable@dpdk.org > > Signed-off-by: Yuan Wang Looks good and saves a few system calls. Acked-by: Stephen Hemminger