Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B8539C64EC4 for ; Tue, 28 Feb 2023 22:40:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229533AbjB1Wkl (ORCPT ); Tue, 28 Feb 2023 17:40:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229595AbjB1Wki (ORCPT ); Tue, 28 Feb 2023 17:40:38 -0500 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 119762E0CB; Tue, 28 Feb 2023 14:40:09 -0800 (PST) Received: by mail-pj1-x102e.google.com with SMTP id me6-20020a17090b17c600b0023816b0c7ceso7300962pjb.2; Tue, 28 Feb 2023 14:40:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1677624007; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=k1M39pp6BOTJLqCwHMILP4cFGR727Jpzqg5ju78BWx8=; b=Oz6li5x7qu54218EoqDEzjLgff3Vj2grOCtgtsoWTNgT6AYnNiUcIuRQiqcJOEA5gZ lokkfjPyQ+w2r3I5ruEt9DFdVy3H+AEbsZWNRLJfP9IrivZCulnotDP2dkKjCHW2jezd oH/1GsAf3wBT5OLBNz4wyDvwXNa1SJ1QxHOLzEYf1Kl89mujGFgm28uhD1qlomCjEflr bCeRRfAqUwJtDDixVCbany7a9KpomAINGpJM705L2yJVBZK4mK9qrIQDIxc6JJIFd9yF tjQFz536hqsfFmqM8whmhUnWETcCHagKQ8gjozlmnJvIEERWUuH+zGpWm83+hejyxPyb WJ+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677624007; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=k1M39pp6BOTJLqCwHMILP4cFGR727Jpzqg5ju78BWx8=; b=I7cIpliuWGRGqFKm2A1s8ZUg4Jc5n6dHM/3e9ZtF6BcBzO1IITWjl4OuMl5P5dv4FJ 7ONEXzuv/jR/twhujq4lDNtYJMrNyRC38iq+ae6y5CesvFcXYhTOHWhsMuB6fW97p41p 3vWDN7kkxBxphtO6XzW5nwN5QNlzjDw2ul7OhCCttl4GANVBVJexGy8Q1C39SenUSHBW fA+Ko4aBMJuNxd2oS2aLO62x1kQwcP+Mbo1RnY3vDHJL5EseOT/CAN47vdQgVCaTtawl 0TVPbsXt9EL96vzv7xQCz0svBzfiiDxGUaval8Ln64eRjC1kapMVDhi1gNKoYh2QnvwJ XJdg== X-Gm-Message-State: AO0yUKWekz0uoPRulgFUu0JZ2WZm1qXZQFZfo8xsBt/gtJXbBSSn4gyG yUrkiv/N58OmHGJs4gAMzPw= X-Google-Smtp-Source: AK7set/cI3/YGAgHbDcqpXTyWxlPEBObsGXe9DTePwqU5sY2tx6bSstbGZUhiztB9D0VuAUQRYFuKA== X-Received: by 2002:a17:903:187:b0:199:1996:71ec with SMTP id z7-20020a170903018700b00199199671ecmr4957460plg.16.1677624007358; Tue, 28 Feb 2023 14:40:07 -0800 (PST) Received: from localhost (c-73-164-155-12.hsd1.wa.comcast.net. [73.164.155.12]) by smtp.gmail.com with ESMTPSA id l6-20020a170902d34600b0019cb8ffd209sm7029866plk.229.2023.02.28.14.40.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Feb 2023 14:40:06 -0800 (PST) Date: Sat, 18 Feb 2023 07:25:41 +0000 From: Bobby Eshleman To: "Michael S. Tsirkin" Cc: Bobby Eshleman , Cong Wang , kvm@vger.kernel.org, Alexei Starovoitov , virtualization@lists.linux-foundation.org, Song Liu , Eric Dumazet , Stanislav Fomichev , linux-kselftest@vger.kernel.org, Shuah Khan , Mykola Lysenko , Daniel Borkmann , John Fastabend , Andrii Nakryiko , Yonghong Song , Paolo Abeni , KP Singh , Stefan Hajnoczi , Jakub Kicinski , Hao Luo , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jiri Olsa , bpf@vger.kernel.org, Martin KaFai Lau , "David S. Miller" Subject: Re: [PATCH net-next v3 1/3] vsock: support sockmap Message-ID: References: <20230227-vsock-sockmap-upstream-v3-0-7e7f4ce623ee@bytedance.com> <20230227-vsock-sockmap-upstream-v3-1-7e7f4ce623ee@bytedance.com> <20230228163518-mutt-send-email-mst@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230228163518-mutt-send-email-mst@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 28, 2023 at 04:36:22PM -0500, Michael S. Tsirkin wrote: > On Tue, Feb 28, 2023 at 07:04:34PM +0000, Bobby Eshleman wrote: > > @@ -1241,19 +1252,34 @@ static int vsock_dgram_connect(struct socket *sock, > > > > memcpy(&vsk->remote_addr, remote_addr, sizeof(vsk->remote_addr)); > > sock->state = SS_CONNECTED; > > + sk->sk_state = TCP_ESTABLISHED; > > > > out: > > release_sock(sk); > > return err; > > } > > > How is this related? Maybe add a comment to explain? Does > TCP_ESTABLISHED make sense for all types of sockets? > Hey Michael, definitely, I can leave a comment. The real reason is due to this piece of logic in sockmap: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/net/core/sock_map.c?h=v6.2#n531 And because of it, you see the same thing in (for example) unix_dgram_connect(): https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/net/unix/af_unix.c?h=v6.2#n1394 I believe it makes sense for these other socket types.