From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Dumazet Subject: Re: [PATCH v2 net-next 02/14] net: Add a new socket option for a future transmit time. Date: Sat, 7 Jul 2018 17:44:30 -0700 Message-ID: <069d42b8-b5d1-cc4f-449c-f5ccbec7fa60@gmail.com> References: <20180703224300.25300-1-jesus.sanchez-palencia@intel.com> <20180703224300.25300-3-jesus.sanchez-palencia@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: tglx@linutronix.de, jan.altenberg@linutronix.de, vinicius.gomes@intel.com, kurt.kanzenbach@linutronix.de, henrik@austad.us, richardcochran@gmail.com, ilias.apalodimas@linaro.org, ivan.khoronzhuk@linaro.org, mlichvar@redhat.com, willemb@google.com, jhs@mojatatu.com, xiyou.wangcong@gmail.com, jiri@resnulli.us, eric.dumazet@gmail.com, jeffrey.t.kirsher@intel.com To: Jesus Sanchez-Palencia , netdev@vger.kernel.org Return-path: Received: from mail-pf0-f195.google.com ([209.85.192.195]:33870 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754249AbeGHAod (ORCPT ); Sat, 7 Jul 2018 20:44:33 -0400 Received: by mail-pf0-f195.google.com with SMTP id e10-v6so11161733pfn.1 for ; Sat, 07 Jul 2018 17:44:33 -0700 (PDT) In-Reply-To: <20180703224300.25300-3-jesus.sanchez-palencia@intel.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 07/03/2018 03:42 PM, Jesus Sanchez-Palencia wrote: > From: Richard Cochran > > This patch introduces SO_TXTIME. User space enables this option in > order to pass a desired future transmit time in a CMSG when calling > sendmsg(2). The argument to this socket option is a 8-bytes long struct > provided by the uapi header net_tstamp.h defined as: > > struct sock_txtime { > clockid_t clockid; > u32 flags; > }; > > Note that new fields were added to struct sock by filling a 2-bytes > hole found in the struct. For that reason, neither the struct size or > number of cachelines were altered. > diff --git a/include/uapi/linux/net_tstamp.h b/include/uapi/linux/net_tstamp.h > index 4fe104b2411f..c9a77c353b98 100644 > --- a/include/uapi/linux/net_tstamp.h > +++ b/include/uapi/linux/net_tstamp.h > @@ -141,4 +141,19 @@ struct scm_ts_pktinfo { > __u32 reserved[2]; > }; > > +/* > + * SO_TXTIME gets a struct sock_txtime with flags being an integer bit > + * field comprised of these values. > + */ > +enum txtime_flags { > + SOF_TXTIME_DEADLINE_MODE = (1 << 0), > + > + SOF_TXTIME_FLAGS_MASK = (SOF_TXTIME_DEADLINE_MODE) > +}; > + > +struct sock_txtime { > + clockid_t clockid; /* reference clockid */ > + u32 flags; /* flags defined by enum txtime_flags */ > +}; > + I was under the impression that we could not use 'u32' type in include/uapi/linux/* file This must be replaced by __u32, right ?