Re: pfctl: use mnemonic macros, terminate string with null char

2019-01-19 Thread Klemens Nanni
On Sat, Jan 19, 2019 at 05:14:56PM +1300, Richard Procter wrote: > > +#define PF_OPTIMIZE_NONE 0x > > these PF_OPTIMIZE_* are bit-field definitions, > see e.g. pfctl_optimize.c:299. While I'm aware of this, > But PF_OPTIMIZE_NONE is not, as pf->optimize & PF_OPTIMIZE_NONE > is never

Re: [PATCH] systat reports inaccurate statistics for disk i/o speed

2019-01-19 Thread Bryan Linton
On 2019-01-19 16:09:05, Ted Unangst wrote: > Bryan Linton wrote: > > Hello tech@, > > > > I'd appreciate it if someone could review both this patch and my > > analysis. > > There is no reason for etime to be a global. We can make it a local with the > correct value in the two functions that use

snake bug

2019-01-19 Thread Ted Unangst
mlarkin discovered that if the treasure lands on the snake, you won't see it. it's still there, but invisible. this fixes the display to draw the correct character. Index: snake.c === RCS file: /cvs/src/games/snake/snake.c,v

Re: [PATCH] systat reports inaccurate statistics for disk i/o speed

2019-01-19 Thread Bryan Linton
On 2019-01-19 15:00:20, Otto Moerbeek wrote: > On Sat, Jan 19, 2019 at 09:30:12PM +0900, Bryan Linton wrote: > > > Hello tech@, > > > > I'd appreciate it if someone could review both this patch and my > > analysis. > > > > [...] > > > > ADDENDUM > > > > > > I'm curious why iostat.c

Re: pfctl: use mnemonic macros, terminate string with null char

2019-01-19 Thread Richard Procter
Hi, Comments below, > On 19/01/2019, at 2:32 PM, Klemens Nanni wrote: > > A few assorted nits for consistency and proper format, no object change. > > OK? > > Index: pfctl.c > === > RCS file: /cvs/src/sbin/pfctl/pfctl.c,v >

[PATCH] systat reports inaccurate statistics for disk i/o speed

2019-01-19 Thread Bryan Linton
Hello tech@, I'd appreciate it if someone could review both this patch and my analysis. PROBLEM --- When running systat, the vmstat page shows inaccurate numbers for disk i/o speed (likely only on multiprocessor systems) when compared to both the iostat page, as well as the statistics

Re: [PATCH] systat reports inaccurate statistics for disk i/o speed

2019-01-19 Thread Otto Moerbeek
On Sat, Jan 19, 2019 at 09:30:12PM +0900, Bryan Linton wrote: > Hello tech@, > > I'd appreciate it if someone could review both this patch and my > analysis. > > > PROBLEM > --- > When running systat, the vmstat page shows inaccurate numbers for > disk i/o speed (likely only on

Re: Virtio 1.0 for the kernel

2019-01-19 Thread Stefan Fritsch
On Saturday, 12 January 2019 01:49:09 CET Jonathan Gray wrote: > On Fri, Jan 11, 2019 at 03:21:11PM -0800, William Ahern wrote: > > On Fri, Jan 11, 2019 at 10:43:25AM +0100, Stefan Fritsch wrote: > > > > > > > /* only used for sizeof, not actually allocated */ > > > extern struct

Re: return value check in snprintf(3) example code

2019-01-19 Thread Ingo Schwarze
Hi Theo and Theo, Theo de Raadt wrote on Fri, Jan 18, 2019 at 08:06:32PM -0700: > Ted Unangst wrote: >> Theo Buehler wrote: >>> According to our documentation and all the standards I checked, >>> snprintf() returns a negative value on error, not necessarily -1. >>> This confused me quite a bit

Re: bwfm(4): show media mode, TX rate, and RSSI

2019-01-19 Thread Patrick Wildt
On Tue, Jan 15, 2019 at 10:01:42PM +0100, Stefan Sperling wrote: > This diff makes 'ifconfig bwfm0' display whether 11n is active or not, > what the current Tx rate is, and show up-to-date RSSI measurements. > I'm leaving display of 11ac Tx rates for future work because that will > require a

Re: kcov: trace cmp

2019-01-19 Thread Alexander Bluhm
On Fri, Jan 18, 2019 at 07:34:35PM +0100, Anton Lindqvist wrote: > You're right, updated diff. OK bluhm@ > Index: share/man/man4/kcov.4 > === > RCS file: /cvs/src/share/man/man4/kcov.4,v > retrieving revision 1.6 > diff -u -p -r1.6

Re: [PATCH 1/7] virtio: adjust virtio_setup_queue prototype for 1.0

2019-01-19 Thread Mike Larkin
On Sat, Jan 19, 2019 at 05:37:29PM +0100, Stefan Fritsch wrote: > Make it take an address instead of a PFN. > Pass the virtqueue pointer. In virtio 1.0, more information has to be > configured in the device. Also call virtio_setup_queue() after the > information has been filled in. > --- >

Re: [PATCH] systat reports inaccurate statistics for disk i/o speed

2019-01-19 Thread Ted Unangst
Bryan Linton wrote: > Hello tech@, > > I'd appreciate it if someone could review both this patch and my > analysis. There is no reason for etime to be a global. We can make it a local with the correct value in the two functions that use it, avoiding future problems as well. Index: vmstat.c

[PATCH 7/7] Support virtio 1.0 for virtio_pci

2019-01-19 Thread Stefan Fritsch
virtio 1.0 for virtio_mmio it not yet implemented, but 0.9 devices continue to work. --- share/man/man4/virtio.4 | 11 +- sys/dev/pci/virtio_pci.c| 518 +++- sys/dev/pci/virtio_pcireg.h | 57 sys/dev/pv/if_vio.c | 9 +-

[PATCH 4/7] virtio_pci: Split bus space handles

2019-01-19 Thread Stefan Fritsch
In virtio_pci 1.0, different parts of the register set may be located in different BARs. Use subregions to make the access independent of the virtio version. --- sys/dev/pci/virtio_pci.c | 114 +++ 1 file changed, 80 insertions(+), 34 deletions(-) diff --git

cd9660: unused field in iso_node

2019-01-19 Thread Anton Lindqvist
Hi, The i_lockf field in `struct iso_node' looks unused since the initial import. Also, vop_advlock is mapped to eopnotsupp() in cd9660_vops. Comments? OK? Index: isofs/cd9660/cd9660_node.h === RCS file:

[PATCH 5/7] virtio_pci: Move msix vector config into functions

2019-01-19 Thread Stefan Fritsch
--- sys/dev/pci/virtio_pci.c | 38 -- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/sys/dev/pci/virtio_pci.c b/sys/dev/pci/virtio_pci.c index d69db1968d0..7be93684a68 100644 --- a/sys/dev/pci/virtio_pci.c +++ b/sys/dev/pci/virtio_pci.c @@

[PATCH 1/7] virtio: adjust virtio_setup_queue prototype for 1.0

2019-01-19 Thread Stefan Fritsch
Make it take an address instead of a PFN. Pass the virtqueue pointer. In virtio 1.0, more information has to be configured in the device. Also call virtio_setup_queue() after the information has been filled in. --- sys/dev/fdt/virtio_mmio.c | 11 +++ sys/dev/pci/virtio_pci.c | 11

[PATCH 3/7] virtio: Add a few feature bit defines and names

2019-01-19 Thread Stefan Fritsch
--- sys/dev/pv/if_vio.c| 84 +++--- sys/dev/pv/vioblk.c| 3 ++ sys/dev/pv/vioblkreg.h | 21 ++- sys/dev/pv/virtio.c| 1 + 4 files changed, 62 insertions(+), 47 deletions(-) diff --git a/sys/dev/pv/if_vio.c b/sys/dev/pv/if_vio.c index

[PATCH 0/7] Virtio 1.0 in the kernel

2019-01-19 Thread Stefan Fritsch
Hi, here comes the split up diff for virtio 1.0 support. Compared to the previous diff, I have omitted some changes in how the feature bits and negotiation works. This also means that the feature bit defines in the headers stay the same and vmd is not affected. I have tested that virtio_mmio on

[PATCH 6/7] Rework virtio_negotiate_features()

2019-01-19 Thread Stefan Fritsch
Add a sc_driver_features field that is automatically used by virtio_negotiate_features() and during reinit. Make virtio_negotiate_features() return an error code. Virtio 1.0 has a special status bit for feature negotiation that means that negotiation can fail. Make virtio_negotiate_features()

[PATCH 2/7] virtio: Prepare for 64 feature bits

2019-01-19 Thread Stefan Fritsch
virtio 1.0 supports an arbitrary number of feature bits. However, so far no more than 64 are used (compared to 32 in virtio 0.9). Adjust data types to support 64 feature bits. Later, we may want to use bitmaps and setbit(), ... to support even more feature bits. --- sys/dev/fdt/virtio_mmio.c |

Re: [PATCH 3/7] virtio: Add a few feature bit defines and names

2019-01-19 Thread Mike Larkin
On Sat, Jan 19, 2019 at 05:37:31PM +0100, Stefan Fritsch wrote: > --- > sys/dev/pv/if_vio.c| 84 +++--- > sys/dev/pv/vioblk.c| 3 ++ > sys/dev/pv/vioblkreg.h | 21 ++- > sys/dev/pv/virtio.c| 1 + > 4 files changed, 62 insertions(+), 47

Re: [PATCH 4/7] virtio_pci: Split bus space handles

2019-01-19 Thread Mike Larkin
On Sat, Jan 19, 2019 at 05:37:32PM +0100, Stefan Fritsch wrote: > In virtio_pci 1.0, different parts of the register set may be located in > different BARs. Use subregions to make the access independent of the > virtio version. > --- This one will need someone more well versed in PCI BARs/etc to

Re: [PATCH 5/7] virtio_pci: Move msix vector config into functions

2019-01-19 Thread Mike Larkin
On Sat, Jan 19, 2019 at 05:37:33PM +0100, Stefan Fritsch wrote: > --- > sys/dev/pci/virtio_pci.c | 38 -- > 1 file changed, 24 insertions(+), 14 deletions(-) > ok mlarkin > diff --git a/sys/dev/pci/virtio_pci.c b/sys/dev/pci/virtio_pci.c > index

Re: [PATCH 7/7] Support virtio 1.0 for virtio_pci

2019-01-19 Thread Mike Larkin
On Sat, Jan 19, 2019 at 05:37:35PM +0100, Stefan Fritsch wrote: > virtio 1.0 for virtio_mmio it not yet implemented, but 0.9 devices > continue to work. > --- This one also should have someone who is well versed in PCI take a look. -ml > share/man/man4/virtio.4 | 11 +- >

Re: [PATCH 6/7] Rework virtio_negotiate_features()

2019-01-19 Thread Mike Larkin
On Sat, Jan 19, 2019 at 05:37:34PM +0100, Stefan Fritsch wrote: > Add a sc_driver_features field that is automatically used by > virtio_negotiate_features() and during reinit. > > Make virtio_negotiate_features() return an error code. Virtio 1.0 has a > special status bit for feature negotiation