Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp4416591rwb; Sat, 21 Jan 2023 11:26:03 -0800 (PST) X-Google-Smtp-Source: AMrXdXvLxK3xkB6POmE+bI1vTpfJvMBz3/b1xeLxPnNEMT2vVj9zBE/qwe19TRMTQ20Rb2+Bc834 X-Received: by 2002:a05:6a21:99a7:b0:b5:d781:ca7 with SMTP id ve39-20020a056a2199a700b000b5d7810ca7mr26853151pzb.3.1674329162872; Sat, 21 Jan 2023 11:26:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674329162; cv=none; d=google.com; s=arc-20160816; b=kg7GNQIJ72M4xImfeAWUPCmI+88dWroNaZBv+1cvX7/qawZNvsuRrJuw/jzyeRDAja 4C25JzT1zi3T05YtbHhQOdQb1gdsfsxw/Rtvsa/WASmqlgH2JqhDUi+6PDmneu90jHpk e5DJ3dKZCxi0cHCBTc+tiFfReGW/JyCJUEIL0wcJ4fDWsA5MUY7lGNnNmrnmkus1UmnA Hz0uqI8pzkMEm1XLWI0CB0DMVoi21lo0dRXId4jMKuYuhd38/qtVeo+zeGKx8nTG5y0a 5XFaEhXw3bO5l4TM9As24YK7Le/VZ0h/X3bO3JXCGBXw0qC1XW9BF2mbArXgMZN0x8Dw QQBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=o445b1MnVY2xcczIeGhfEHs/6/N/MTgkwXpPKatAAvc=; b=yGCArJNEI3XarVQe3Ltp9KeqKIRWKY1mkddTi9bAC/xkNrZPdJcm/xJ592ukn+7K4G sz5Esj358S7aD3rnlPrBq8pfBHjnU/ZR2sbyBATsH4Rub+2r1ssqA2/1mVeu0qrGx7qJ SeKntaZWMTX98Tho2La3eD6VTpvDHzwYBdT1XBjRF1+O2P5eL8nJHuTHnfNgk5UZ8y6Z 9yj8G2myCaUdb54PCqYmp+S6DhHp+QKdofnzG55Pc3BUB6hhEMjPrBIIIYM2g+bow26w IupDdqMmVKQSAbTPmec15RjMEKFo5wbPfmj/sz5Lf/70IfdzBfiUfxt0Q1ZWu22zy0lX vtBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=blGf0rss; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a8-20020a170902710800b00194b7455ecasi11530240pll.415.2023.01.21.11.25.56; Sat, 21 Jan 2023 11:26:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=blGf0rss; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229787AbjAUTWg (ORCPT + 52 others); Sat, 21 Jan 2023 14:22:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229523AbjAUTWf (ORCPT ); Sat, 21 Jan 2023 14:22:35 -0500 Received: from mail-oo1-xc33.google.com (mail-oo1-xc33.google.com [IPv6:2607:f8b0:4864:20::c33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81BA6279BD; Sat, 21 Jan 2023 11:22:34 -0800 (PST) Received: by mail-oo1-xc33.google.com with SMTP id u13-20020a4aa34d000000b004f5219f9424so1544556ool.5; Sat, 21 Jan 2023 11:22:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=o445b1MnVY2xcczIeGhfEHs/6/N/MTgkwXpPKatAAvc=; b=blGf0rssVVm4/xsfLxsV1fJdJ18QG6trE/kND3h68y2KoRQZ7YJqp3Ug2tjGJtc/7C UIa94wgq+dllVnMbIEl45CyyUgycOLzfLCm/Gy8CwS+X82vAypOsKizt70EpHKmH35Cn eXEc9zjW5E4B3Qzv5HwgiO9plLXKZ1AgZ50JWCmAMizmIZ0LPLCDEZdfGNhrH3W4Nu5u pifwhrY8QR5QEvuKGRTWnGkd4zN7cGcM4cBrbXuNdE9Nz2zG1ea9YlqME+265CqNW4ky ds2QxNvIFt0WFifhuegALERmlghRRPVH8ypCEe/w9wYyMoPO8g4IJkiV0DEiirQoRZFN UluA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=o445b1MnVY2xcczIeGhfEHs/6/N/MTgkwXpPKatAAvc=; b=w3qNgSPRbERFhYcL0okOdh4WllhjwSA6+KuAmP0/Up0stomBMPmbjAFPMnb8ToAh8P eu+aqBB+9Px0gM03XwG26x6PuSD0YGvDHlE1xDBYMh49wzXcZilw5wQPAwFlvxitEq/i rx36z72B31LlwyqGlS8G/aN39VOzqBBZglGxWP2au3wPVCvvXL8WmNuoh2oZYZjJPKcI fmEGSgeWkqoG3B9BaGnBc5G2YwSqZIk71FBDOlpvHjwZweiBXgnirb91jYpyZ+fOWa4M fpwqfQtHLw9sdmipE0mhY7lQC2MrRxK2lgb93EozrPBSUiLi7yGTUODFEt+fE+kxYZHZ xXTQ== X-Gm-Message-State: AFqh2kpQohtdRrbUiJROZPcM2XTztY1A6Y6d5Ol+hpgsjVxeWHk06lvw UTedBO12dsx5O5Fr8ALcrCU= X-Received: by 2002:a4a:e68e:0:b0:4f5:200e:a1bf with SMTP id u14-20020a4ae68e000000b004f5200ea1bfmr8669367oot.1.1674328953754; Sat, 21 Jan 2023 11:22:33 -0800 (PST) Received: from localhost ([2600:1700:65a0:ab60:b306:d5d0:37ec:2fa]) by smtp.gmail.com with ESMTPSA id i23-20020a4a8d97000000b004a0ad937ccdsm10693131ook.1.2023.01.21.11.22.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Jan 2023 11:22:32 -0800 (PST) Date: Sat, 21 Jan 2023 11:22:31 -0800 From: Cong Wang To: Bobby Eshleman Cc: Stefan Hajnoczi , Stefano Garzarella , "Michael S. Tsirkin" , Jason Wang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Andrii Nakryiko , Mykola Lysenko , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Shuah Khan , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, Cong Wang Subject: Re: [PATCH RFC 1/3] vsock: support sockmap Message-ID: References: <20230118-support-vsock-sockmap-connectible-v1-0-d47e6294827b@bytedance.com> <20230118-support-vsock-sockmap-connectible-v1-1-d47e6294827b@bytedance.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230118-support-vsock-sockmap-connectible-v1-1-d47e6294827b@bytedance.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 18, 2023 at 12:27:39PM -0800, Bobby Eshleman wrote: > +static int vsock_read_skb(struct sock *sk, skb_read_actor_t read_actor) > +{ > + struct vsock_sock *vsk = vsock_sk(sk); > + > + if (!vsk->transport) > + return -ENODEV; > + > + if (!vsk->transport->read_skb) > + return -EOPNOTSUPP; Can we move these two checks to sockmap update path? It would make vsock_read_skb() faster. > + > + return vsk->transport->read_skb(vsk, read_actor); > +} Essentially can be just this one line. Thanks.