From patchwork Mon Aug 20 20:21:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 28983 Received: (qmail 72332 invoked by alias); 20 Aug 2018 20:21:43 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 72322 invoked by uid 89); 20 Aug 2018 20:21:42 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_PASS, URIBL_RED autolearn=ham version=3.3.2 spammy= X-HELO: relay1.mentorg.com Date: Mon, 20 Aug 2018 20:21:34 +0000 From: Joseph Myers To: Florian Weimer CC: Subject: Re: Update netinet/tcp.h from Linux 4.18 In-Reply-To: <5197cfcd-9fcc-127a-4168-3b2b26a144f3@redhat.com> Message-ID: References: <5197cfcd-9fcc-127a-4168-3b2b26a144f3@redhat.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 On Mon, 20 Aug 2018, Florian Weimer wrote: > > +struct tcp_zerocopy_receive > > +{ > > + uint64_t address; /* Address of mapping. */ > > + uint32_t length; /* Number of bytes to map/mapped. */ > > + uint32_t recv_skip_hint; /* Amount of bytes to skip. */ > > +}; > > I'm not sure if the field comments are helpful because the in/out information > is missing. How about this patch version which includes that information? Update netinet/tcp.h from Linux 4.18. This patch adds constants from netinet/tcp.h in Linux 4.18, and an associated struct tcp_zerocopy_receive, to sysdeps/gnu/netinet/tcp.h. The new TCP_REPAIR_* constants seemed sufficiently related to those already present to include them. Note that this patch does not include additions to struct tcp_info; there are many other elements in this structure in the Linux kernel that are not included in the glibc version (which was last extended in 2007, it seems). Such additions to the end of the structure may be OK with the expected way it is used (size passed explicitly to the kernel with getsockopt), but in principle any change to the size of a type provided by glibc is an ABI change for external applications / libraries using that type in their ABIs, and has the associated risks of such a change. Tested for x86_64. 2018-08-20 Joseph Myers * sysdeps/gnu/netinet/tcp.h (TCP_ZEROCOPY_RECEIVE): New macro. (TCP_INQ): Likewise. (TCP_CM_INQ): Likewise. (TCP_REPAIR_ON): Likewise. (TCP_REPAIR_OFF): Likewise. (TCP_REPAIR_OFF_NO_WP): Likewise. (struct tcp_zerocopy_receive): New type. diff --git a/sysdeps/gnu/netinet/tcp.h b/sysdeps/gnu/netinet/tcp.h index 44a72e929e..1a164a9649 100644 --- a/sysdeps/gnu/netinet/tcp.h +++ b/sysdeps/gnu/netinet/tcp.h @@ -75,6 +75,14 @@ #define TCP_MD5SIG_EXT 32 /* TCP MD5 Signature with extensions. */ #define TCP_FASTOPEN_KEY 33 /* Set the key for Fast Open (cookie). */ #define TCP_FASTOPEN_NO_COOKIE 34 /* Enable TFO without a TFO cookie. */ +#define TCP_ZEROCOPY_RECEIVE 35 +#define TCP_INQ 36 /* Notify bytes available to read + as a cmsg on read. */ +#define TCP_CM_INQ TCP_INQ + +#define TCP_REPAIR_ON 1 +#define TCP_REPAIR_OFF 0 +#define TCP_REPAIR_OFF_NO_WP -1 #ifdef __USE_MISC # include @@ -327,6 +335,14 @@ struct tcp_repair_window uint32_t rcv_wup; }; +/* For use with TCP_ZEROCOPY_RECEIVE. */ +struct tcp_zerocopy_receive +{ + uint64_t address; /* In: address of mapping. */ + uint32_t length; /* In/out: number of bytes to map/mapped. */ + uint32_t recv_skip_hint; /* Out: amount of bytes to skip. */ +}; + #endif /* Misc. */ #endif /* netinet/tcp.h */