From owner-freebsd-net@FreeBSD.ORG Wed Jun 9 19:16:58 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 678201065678; Wed, 9 Jun 2010 19:16:58 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id D7B0B8FC13; Wed, 9 Jun 2010 19:16:57 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o59JH4SO034069 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 9 Jun 2010 22:17:04 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o59JGpjG037144; Wed, 9 Jun 2010 22:16:51 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o59JGpxW037143; Wed, 9 Jun 2010 22:16:51 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 9 Jun 2010 22:16:51 +0300 From: Kostik Belousov To: Jung-uk Kim Message-ID: <20100609191651.GR83316@deviant.kiev.zoral.com.ua> References: <201006091444.50560.jkim@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="2TczCHLg+zehSNVj" Content-Disposition: inline In-Reply-To: <201006091444.50560.jkim@FreeBSD.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-2.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_50, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: freebsd-net@freebsd.org Subject: Re: [RFC] BPF timestamping X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2010 19:16:58 -0000 --2TczCHLg+zehSNVj Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jun 09, 2010 at 02:44:47PM -0400, Jung-uk Kim wrote: > bpf(4) can only timestamp packets with microtime(9). I want to expand=20 > it to be able to use different format and resolution. The patch is=20 > here: >=20 > http://people.freebsd.org/~jkim/bpf_tstamp.diff >=20 > With this patch, we can select different format and resolution of the=20 > timestamps. It is done via ioctl(2) with BIOCSTSTAMP command. =20 > Similarly, you can get the current format and resolution with=20 > BIOCGTSTAMP command. Currently, the following functions are=20 > available: >=20 > BPF_T_MICROTIME microtime(9) > BPF_T_NANOTIME nanotime(9) > BPF_T_BINTIME bintime(9) > BPF_T_MICROTIME_FAST getmicrotime(9) > BPF_T_NANOTIME_FAST getnanotime(9) > BPF_T_BINTIME_FAST getbintime(9) > BPF_T_NONE ignore time stamps >=20 > (Note: Additionally, there is an experimental machanism to tag packets=20 > with timestamps in struct bintime format via mbuf_tags(9) from lower=20 > layer, e.g., device driver. However, I didn't test it because I=20 > wasn't sure whether this is the right thing to do.) >=20 > While I was here, I moved the bogus SIZEOF_BPF_HDR macro into bpf.c=20 > and tried to make it little bit more correct. For example, the=20 > 32-bit shim should be able to handle alignment more properly for=20 > non-Ethernet DLTs. I tried my best not to break ABI/API (especially=20 > for 32-bit platforms) and relevant places are all marked with=20 > BURN_BRIDGES. Putting COMPAT_FREEBSD32 under BURN_BRIDGES feels somewhat strange. --2TczCHLg+zehSNVj Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkwP6KMACgkQC3+MBN1Mb4gMUgCggfGPETcl7pZMIGgEO2aQwiU1 vjEAoLBJwH1ZOgNDulSWZ1q1/umWXi71 =iYaM -----END PGP SIGNATURE----- --2TczCHLg+zehSNVj--