From owner-freebsd-arch@freebsd.org Tue Oct 9 22:18:27 2018 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 505F310BF883 for ; Tue, 9 Oct 2018 22:18:27 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (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 F25B9814E8 for ; Tue, 9 Oct 2018 22:18:26 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 087463C475F; Tue, 9 Oct 2018 22:18:26 +0000 (UTC) Date: Tue, 9 Oct 2018 22:18:26 +0000 From: Brooks Davis To: freebsd-arch@freebsd.org Subject: style change for syscalls.master Message-ID: <20181009221826.GA75401@spindle.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="IS0zKkzwUGydFO0o" Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Oct 2018 22:18:27 -0000 --IS0zKkzwUGydFO0o Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable I have a patch (https://reviews.freebsd.org/D17488) that removes the need for backslash line continuations in syscalls.master files with the aim of making the files more readable. Based on the functionality in that patch, I'd like to propose changing the style of the file to something better suited the long lines introduced by long type/variable names and SAL annotations. I'd also like it to be easier to diff between the main syscalls.master and the freebsd32 version. Longer term, I hope to be able to generate freebsd32 files from the default syscalls.master which will be aided by reducing diffs and making room for more annotations. To those ends, I propose a reformat along the lines of the examples below: Old format: 1 AUE_EXIT STD { void sys_exit(int rval); } exit \ sys_exit_args void =2E.. 5 AUE_OPEN_RWTC STD { int open( \ _In_z_ char *path, \ int flags, \ int mode); } New format: 1 AUE_EXIT STD { void sys_exit( int rval ); } exit sys_exit_args void =2E.. 5 AUE_OPEN_RWTC STD {=20 int open(=20 _In_z_ char *path, =20 int flags, =20 int mode =20 ); =20 } For an example of where this makes diffs easier, consider preadv: Old format: 289 AUE_PREADV STD { ssize_t preadv(int fd, \ _In_reads_(iovcnt) \ struct iovec *iovp, \ u_int iovcnt, off_t offset); } New format: 289 AUE_PREADV STD { ssize_t preadv( int fd, _In_reads_(iovcnt) struct iovec *iovp, u_int iovcnt, off_t offset ); } New format (freebsd32): 289 AUE_PREADV STD { ssize_t freebsd32_preadv( int fd, _In_reads_(iovcnt) struct iovec32 *iovp, u_int iovcnt, uint32_t offset1, uint32_t offset2 ); } Some comments on this: - One-variable-per-line allows for annotations and is struct-like which is appropriate since this is more about declaring uap structs then about function declarations. - I chose the top level indent keep things readable without adding a blank between each syscall block. I'd be happy to drop things back one tab if we'd rather have blanks between each declaration. - If one really cared about vertical space, one could combine the ");", "}", and alternative names, but I didn't find that very aesthetic. I'd like to know if this would break any out-of-tree parsers. If so, we can easily keep backslashes, but I'd rather clear those out if we're going to complicate svn blame for every line in the file. Parsers written in more sensible languages than the in-tree sh+sed+awk monster seem likely to be easy to fix and I hope that a more stylized format will be easier to handle with dumb parsers, but I'd like to hear if this change would cause issues. -- Brooks P.S. I'd plan to make this change after the 12.0 branch, but would like to reach concensus sooner as I'm working on yet-another-syscall vector in my work tree and I'd like to use this there. --IS0zKkzwUGydFO0o Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJbvSkwAAoJEKzQXbSebgfA5dwIAIaOn+RGmwrlyNgiPHvF6AW9 0YjF0fgtIxKHzkH37F2iPJl62dxudK2dshsmCFmg5rP9bA5H+/9ovgrqWrzhvbAb iRgMDVztuzNu0Yq3UUorD7qeRUAg1eTsNxHCVfei/DncYDgK+Ln3zn+AN+g+jkY1 i90kpmtTeGnHSTmwbD58DjHwOQTJz5jgmSqEHw2ShMxuae0VHEGuVwsX0sg6/XfE yQO0eFg+UohJdC7QIe9JoYB0MBjcfCx9nC++CmUUcNUmBs3zXxQNjku8QGI7OJ3i 1BGDxP7WM4KqRE0xINfvt7dP1oNLq2Ry1USB5KIt0MFlYSEWM15AMOcRZZkNAMc= =2kf+ -----END PGP SIGNATURE----- --IS0zKkzwUGydFO0o-- From owner-freebsd-arch@freebsd.org Sat Oct 13 18:07:30 2018 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8495710D156A; Sat, 13 Oct 2018 18:07:30 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gate2.funkthat.com", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 081E78456A; Sat, 13 Oct 2018 18:07:29 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (localhost [127.0.0.1]) by gold.funkthat.com (8.15.2/8.15.2) with ESMTPS id w9DI7KuJ048378 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 13 Oct 2018 11:07:20 -0700 (PDT) (envelope-from jmg@gold.funkthat.com) Received: (from jmg@localhost) by gold.funkthat.com (8.15.2/8.15.2/Submit) id w9DI7KBn048377; Sat, 13 Oct 2018 11:07:20 -0700 (PDT) (envelope-from jmg) Date: Sat, 13 Oct 2018 11:07:20 -0700 From: John-Mark Gurney To: Warner Losh Cc: Brooks Davis , FreeBSD-STABLE Mailing List , FreeBSD Net , "freebsd-arch@freebsd.org" , freebsd-fcp@freebsd.org Subject: Re: FCP-0101: Deprecating most 10/100 Ethernet drivers Message-ID: <20181013180720.GW75530@funkthat.com> Mail-Followup-To: Warner Losh , Brooks Davis , FreeBSD-STABLE Mailing List , FreeBSD Net , "freebsd-arch@freebsd.org" , freebsd-fcp@freebsd.org References: <20181004154744.79EA3154E@spqr.komquats.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 11.0-RELEASE-p7 amd64 X-PGP-Fingerprint: D87A 235F FB71 1F3F 55B7 ED9B D5FF 5A51 C0AC 3D65 X-Files: The truth is out there X-URL: https://www.funkthat.com/ X-Resume: https://www.funkthat.com/~jmg/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? User-Agent: Mutt/1.6.1 (2016-04-27) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (gold.funkthat.com [127.0.0.1]); Sat, 13 Oct 2018 11:07:21 -0700 (PDT) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Oct 2018 18:07:30 -0000 Warner Losh wrote this message on Thu, Oct 04, 2018 at 09:53 -0600: > On Thu, Oct 4, 2018 at 9:46 AM Cy Schubert > wrote: > > > I'm willing to help out with rl(4) as I have one here. Others, not > > scheduled for removal, that I can help one way or another are are NICs, > > including wireless, currently installed here. > > > > There's an iflib man page that's a decent place to start. The API has > evolved over time, so corrections to the man page would be welcome (and > committed as quickly as the freeze allows). I'm reading through the current > iflib drivers to see which one would be best to recommend. Can you recommend one? It'd be nice to just document which driver you should use as a reference in the iflib man page... I looked briefly at converting awg over to iflib, but the iflib man pages were very sparce in any text to describe what each function needs to do... It says it in very high level, which is useful if you already know what needs to be done.. for example: ifdi_tx_queues_alloc() Mandatory function that is called during iflib_attach to allocate transmit queues. vaddrs and paddrs are arrays of virtual and physical addresses respectively of the hardware transmit queues. ntxqs is the number of queues per qset. ntxqsets is the number of qsets. It says it allocates memory for the queue, but upon allocation where does it put the values? It sounds like vaddrs and paddrs arrays are already allocated and you just use these addresses... But there is no way I can write code from this description... Also, lots of terminology is missing, like what is a qset? -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."