Received: by 10.192.165.148 with SMTP id m20csp2155802imm; Thu, 26 Apr 2018 06:49:52 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+jPB/a7EbhQXu92QRfFp/6B51VdLcfyNwK8m4EpSg4n8q7Iw1Xo3GxE2clriymHreTnsNN X-Received: by 10.99.190.67 with SMTP id g3mr25380969pgo.53.1524750592269; Thu, 26 Apr 2018 06:49:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524750592; cv=none; d=google.com; s=arc-20160816; b=0M5uNxLYxbwIaBb71Yfs86ekI+bRGr3lK1FyAPxllTaEtKBF/sS8lknfkuzp4p9T/i Q8cUV+2an9k3okw6S8r06aqoF+g4UrrMkY0DQxlJ8ZtWhekqJq0Z/B2WMwsnBg+R7/bb fvItaKLNnebLV8QBV617H/cmdVN59+4PMPdyGSA7nwNOdyyY63wX99AsrwBiapP3qKSG o6Uiqy61g++yc5jrNEL3LyZ5zlFjZ8T9LtZVffbfpaaoaTcHPfb3KkUmqj72pmTldPxp jM6dKnhHitX2kflffe89+SbtaPmCaVCSnlp3qrC/Do3wMpGg8e25UeKIP6CI/PdgktkV Xbug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=JM++K8boznLNv0GbG2WcK+Yvtyfcbv9YWzjObqB5S6k=; b=br0YEyTGR9L7Mpl+znidjd+puT+KMxSKSiWtrjUNHLHNNzv01WIS8eCX4DE4jJf2a5 Plzqf2JvqKuqJMNEzupxVodQN4yJFtuAedK8qJfRRPXPDRmwddltPNbIHCfd8OLjsWjG ivV/PKArbdMKGCSNsySlesSEtpVNaeJH/nGueZBwKMcEmBeVE3sHVoNLPgwSrUaeYwxk mfUcoBpdBuy+uOh0pICQIAGe4mj6c9KGNeuIe0FzZFmku5VXOJ873PcIfBgzoFsrGnXr qy6CVaT7EvDs+ekKkqDJY0MdEepaOX8jDmxlzWDGFWKpT00YLStr95kgvCYBGIXuPiL/ XZSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=U6vNHLl/; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n26si16430436pgc.677.2018.04.26.06.49.37; Thu, 26 Apr 2018 06:49:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=U6vNHLl/; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1756262AbeDZNsA (ORCPT + 99 others); Thu, 26 Apr 2018 09:48:00 -0400 Received: from mail-pg0-f41.google.com ([74.125.83.41]:42307 "EHLO mail-pg0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755172AbeDZNr4 (ORCPT ); Thu, 26 Apr 2018 09:47:56 -0400 Received: by mail-pg0-f41.google.com with SMTP id e12so15976424pgn.9; Thu, 26 Apr 2018 06:47:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=JM++K8boznLNv0GbG2WcK+Yvtyfcbv9YWzjObqB5S6k=; b=U6vNHLl/3GvjQFMrv3EAAp2tqmF1opgjKqhbvrZYhzdYrfT5eunl//rts9M+5srNIe /WxOcALw2Fnqq8VtpoatDJLZZtsWJJb3eAkIFZigliBXAvewzfXJpGryAG8Kxq4cAY1A x1LpVdj1OH1bl/ahI16jUkuHVmjmFQrpIaYxH5tCazs58Tkyc4cLCxe5ARHa6oXGJPaT 5ivDn5RA8v/rC8Gl6INqq9IuKFnH00t9zHBWjwKoH5UnX6Mlrnc2HOPKcSIHeYpeWvil /7z7qPPBZfIz13H3oYDT/wu+y56Fh1elo8tgP8St+8OCmSg9FAR9CoNHmEF7hleIWtjH rgHA== 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=JM++K8boznLNv0GbG2WcK+Yvtyfcbv9YWzjObqB5S6k=; b=b2Q4gJQajotU62apc7ByLLdJYeGXMSHqzIURsRTRVEKDLeK1SmhsdBuHkapFj81v8m AezDGsvSsOBeePWaksr7ZiDGnkU+tPiKAb+YiNVJ1E7k5GA0borUHTEOb5XOmeICu+pw Z0MSzMqI5nLojCQnKCr30esLq46Fa6Bbe3/9YbVeBG9HFgUKSxXOGLqKuhkh0vt8MqgJ EturkK+cMgdpMI5WGwseUQOfj6XYDiGyNrte0CSdjdefNf9/eKW/X/rU2un3gsOwJPBT 9VEo4/NsMYHc8Zw4Og0MC5XSjf7BOQUzxc254Njj7WIGUn1qDZ2y1Gltcd0UqovcJVMD 2wTg== X-Gm-Message-State: ALQs6tC9dnAhXsRUet8oPIfeQRsAx3OpUm3dYB1nOwpbqNUBfYhCSuG2 XjePGsiC/cpT3TicPno5uRo= X-Received: by 10.101.80.1 with SMTP id f1mr404079pgo.240.1524750475727; Thu, 26 Apr 2018 06:47:55 -0700 (PDT) Received: from [192.168.86.235] (c-67-180-167-114.hsd1.ca.comcast.net. [67.180.167.114]) by smtp.gmail.com with ESMTPSA id q126sm4047284pga.79.2018.04.26.06.47.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Apr 2018 06:47:55 -0700 (PDT) Subject: Re: [PATCH v2 net-next 1/2] tcp: add TCP_ZEROCOPY_RECEIVE support for zerocopy receive To: Ka-Cheong Poon , Eric Dumazet , "David S . Miller" Cc: netdev , Andy Lutomirski , linux-kernel , linux-mm , Soheil Hassas Yeganeh References: <20180425214307.159264-1-edumazet@google.com> <20180425214307.159264-2-edumazet@google.com> From: Eric Dumazet Message-ID: <0ab0c947-0c51-10b9-054c-7cbc5a1726bd@gmail.com> Date: Thu, 26 Apr 2018 06:47:54 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/26/2018 06:40 AM, Ka-Cheong Poon wrote: > A quick question.  Is it a normal practice to return a result > in setsockopt() given that the optval parameter is supposed to > be a const void *? Very good question. Andy suggested an ioctl() or setsockopt(), and I chose setsockopt() but it looks like a better choice would have been getsockopt() indeed. This might even allow future changes in "struct tcp_zerocopy_receive" Willem suggested to add code in tcp_recvmsg() but I prefer to not bloat this already too complex function. I will send a v3 using getsockopt() then, thanks !