From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexei Starovoitov Subject: Re: [PATCH net-next] bpf: Add access to snd_cwnd and others in sock_ops Date: Sun, 3 Dec 2017 10:26:48 -0800 Message-ID: <20171203182646.26z3pu6keynirx4v@ast-mbp> References: <20171201181504.1040223-1-brakmo@fb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: netdev , Daniel Borkmann , Kernel Team , Vlad Dumitrescu To: Lawrence Brakmo Return-path: Received: from mail-pf0-f195.google.com ([209.85.192.195]:34216 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751369AbdLCS0w (ORCPT ); Sun, 3 Dec 2017 13:26:52 -0500 Received: by mail-pf0-f195.google.com with SMTP id a90so6864656pfk.1 for ; Sun, 03 Dec 2017 10:26:51 -0800 (PST) Content-Disposition: inline In-Reply-To: <20171201181504.1040223-1-brakmo@fb.com> Sender: netdev-owner@vger.kernel.org List-ID: On Fri, Dec 01, 2017 at 10:15:04AM -0800, Lawrence Brakmo wrote: > Adds read access to snd_cwnd and srtt_us fields of tcp_sock. Since these > fields are only valid if the socket associated with the sock_ops program > call is a full socket, the field is_fullsock is also added to the > bpf_sock_ops struct. If the socket is not a full socket, reading these > fields returns 0. > > Note that in most cases it will not be necessary to check is_fullsock to > know if there is a full socket. The context of the call, as specified by > the 'op' field, can sometimes determine whether there is a full socket. > > The struct bpf_sock_ops has the following fields added: > > __u32 is_fullsock; /* Some TCP fields are only valid if > * there is a full socket. If not, the > * fields read as zero. > */ > __u32 snd_cwnd; > __u32 srtt_us; /* Averaged RTT << 3 in usecs */ > > There is a new macro, SOCK_OPS_GET_TCP32(NAME), to make it easier to add > read access to more 32 bit tcp_sock fields. > > Signed-off-by: Lawrence Brakmo lgtm Acked-by: Alexei Starovoitov will wait for Daniel to either ack it or apply it.