From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756268AbeDZNsA (ORCPT ); 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 X-Google-Smtp-Source: AB8JxZqPlsi1Y2CZ8BBrECN6FBkDzvX1jdy7zOa2f6kcH0mmk9G811ekuOol+5a1REFnW0SfJWBsRg== 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 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 !