From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl0-f67.google.com ([209.85.160.67]:44958 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750723AbeCFGWf (ORCPT ); Tue, 6 Mar 2018 01:22:35 -0500 Received: by mail-pl0-f67.google.com with SMTP id 9-v6so5816915ple.11 for ; Mon, 05 Mar 2018 22:22:34 -0800 (PST) Subject: Re: [bpf-next PATCH 05/16] bpf: create tcp_bpf_ulp allowing BPF to monitor socket TX/RX data To: David Miller Cc: ast@kernel.org, daniel@iogearbox.net, netdev@vger.kernel.org, davejwatson@fb.com References: <20180305195122.6612.78322.stgit@john-Precision-Tower-5810> <20180305.164008.2006986778756330199.davem@davemloft.net> <20180306.004258.1283965960386401643.davem@davemloft.net> From: John Fastabend Message-ID: <9c82ae47-59a1-f140-9d10-31e691fb3c51@gmail.com> Date: Mon, 5 Mar 2018 22:22:21 -0800 MIME-Version: 1.0 In-Reply-To: <20180306.004258.1283965960386401643.davem@davemloft.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org List-ID: On 03/05/2018 09:42 PM, David Miller wrote: > From: John Fastabend > Date: Mon, 5 Mar 2018 14:53:08 -0800 > >> I decided to make the default no-copy to mirror the existing >> sendpage() semantics and then to add the flag later. The flag >> support is not in this series simply because I wanted to get the >> base support in first. > > What existing sendpage semantics are you referring to? > All I meant by this is if an application uses sendfile() call there is no good way to know when/if the kernel side will copy or xmit the data. So a reliable user space application will need to only modify the data if it "knows" there are no outstanding sends in-flight. So if we assume applications follow this then it is OK to avoid the copy. Of course this is not good enough for security, but for monitoring/statistics (my use case 1 it works). By keep existing sendpage semantics I just meant applications should already follow the above.