From owner-svn-src-head@freebsd.org Tue Jan 17 16:57:57 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEAA7CB4298 for ; Tue, 17 Jan 2017 16:57:57 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4AA751965 for ; Tue, 17 Jan 2017 16:57:56 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 15440b64-dcd6-11e6-9357-bffcd86bd944 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id 15440b64-dcd6-11e6-9357-bffcd86bd944; Tue, 17 Jan 2017 16:57:53 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v0HGvgnA017712; Tue, 17 Jan 2017 09:57:42 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1484672262.86335.163.camel@freebsd.org> Subject: Re: svn commit: r312296 - in head: lib/libc/sys sys/kern sys/netinet sys/netinet6 sys/sys tools/regression/sockets/udp_pingpong tools/regression/sockets/unix_cmsg From: Ian Lepore To: Maxim Sobolev , Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 17 Jan 2017 09:57:42 -0700 In-Reply-To: References: <201701161746.v0GHkcPX071529@repo.freebsd.org> <20170117065231.GW2611@FreeBSD.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2017 16:57:57 -0000 In my experience, enums are a superior way to define integer constants (compared to #define), but they are pure poison as variable types in APIs and structures because their size is a compiler implementation choice. -- Ian On Tue, 2017-01-17 at 08:40 -0800, Maxim Sobolev wrote: > That being said, is there any other socket option value in there > implemented as enum? I don't see anything obvious, so that I am > curious if > it would stick out as an odd one in there. What do you think? > > -Max > > On Tue, Jan 17, 2017 at 6:22 AM, Maxim Sobolev > wrote: > > > > > Of course it's possible. Do you guys want me to amend that patch? > > > > -Max > > > > On Mon, Jan 16, 2017 at 10:52 PM, Gleb Smirnoff > g> > > wrote: > > > > > > > >   Hi! > > > > > > On Mon, Jan 16, 2017 at 05:46:38PM +0000, Maxim Sobolev wrote: > > > M> Author: sobomax > > > M> Date: Mon Jan 16 17:46:38 2017 > > > M> New Revision: 312296 > > > M> URL: https://svnweb.freebsd.org/changeset/base/312296 > > > M> > > > M> Log: > > > M>   Add a new socket option SO_TS_CLOCK to pick from several > > > different > > > clock > > > M>   sources to return timestamps when SO_TIMESTAMP is enabled. > > > Two > > > additional > > > M>   clock sources are: > > > M> > > > M>   o nanosecond resolution realtime clock (equivalent of > > > CLOCK_REALTIME); > > > M>   o nanosecond resolution monotonic clock (equivalent of > > > CLOCK_MONOTONIC). > > > M> > > > M>   In addition to this, this option provides unified interface > > > to get > > > bintime > > > M>   (equivalent of using SO_BINTIME), except it also supported > > > with IPv6 > > > where > > > M>   SO_BINTIME has never been supported. The long term plan is > > > to > > > depreciate > > > M>   SO_BINTIME and move everything to using SO_TS_CLOCK. > > > M> > > > M>   Idea for this enhancement has been briefly discussed on the > > > Net > > > session > > > M>   during dev summit in Ottawa last June and the general input > > > was > > > positive. > > > M> > > > M>   This change is believed to benefit network > > > benchmarks/profiling as > > > well > > > M>   as other scenarios where precise time of arrival measurement > > > is > > > necessary. > > > M> > > > M>   There are two regression test cases as part of this commit: > > > one > > > extends unix > > > M>   domain test code (unix_cmsg) to test new SCM_XXX types and > > > another > > > one > > > M>   implementis totally new test case which exchanges UDP > > > packets > > > between two > > > M>   processes using both conventional methods (i.e. calling > > > clock_gettime(2) > > > M>   before recv(2) and after send(2)), as well as using > > > setsockopt()+recv() in > > > M>   receive path. The resulting delays are checked for sanity > > > for all > > > supported > > > M>   clock types. > > > M> > > > M>   Reviewed by:    adrian, gnn > > > M>   Differential Revision:  https://reviews.freebsd.org/D9171 > > > > > > Is it possible to declare possible values as a enum and make > > > so_ts_clock > > > fields of that enum type? > > > > > > -- > > > Totus tuus, Glebius. > > > > > >