Re: FT232H variant in uftdi(4)

2020-12-09 Thread Jan Klemkow
On Wed, Dec 09, 2020 at 09:11:35AM +0100, Jan Klemkow wrote: > On Tue, Dec 08, 2020 at 09:03:53PM -0300, Daniel Bolgheroni wrote: > > I have a FT232H variant (marked FT232HQ, 0403:6014) which works with > > uftdi(4). > > > > Still related to uftdi(4), sys/dev/usb/

diff: replace useless use of MCLGETL with MCLGET

2020-12-12 Thread Jan Klemkow
Hi, The use of MCLGETL with the default length MCLBYTES is useless. Thus, this diff removes '(void)' from the MCLGET macro as it is in the MCLGETL and replaces all uses of MCLGETL with MCLBYTES by MCLGET. OK? bye, Jan Index: arch/octeon/dev/if_ogx.c

diff: cleanup type handling

2020-12-12 Thread Jan Klemkow
Hi, The type of the local variable hash in pf_map_addr() has right length but the wrong type. This diff uses the correct type and removes the useless casts. Both functions uses hash as pf_addr, so no cast is needed. OK? bye, Jan Index: net/pf_lb.c =

diff: mbuf-chains for tcp/ip/ether_ouput

2020-12-15 Thread Jan Klemkow
Hi, I took on old idea and diff [1] from bluhm and finished it for the IPv4 case. This change uses mbuf chains in tcp/ip/ether_output instead of single mbufs. This approach takes lesser processing power per packets, which we want to send out. In several code path it optimises the processing bec

rc.d(8) for tcpbench

2020-12-15 Thread Jan Klemkow
Hi, for frequent performance test it would be nice to just start tcpbench as a regular service. tcpbench gets an extra user and group with this diff and is already pledged to "stdio". Thus, there should be no security risk to do this even in hostile environments. OK? bye, Jan Index: etc/Makef

Re: rc.d(8) for tcpbench

2020-12-15 Thread Jan Klemkow
On Tue, Dec 15, 2020 at 03:43:38PM -0700, Theo de Raadt wrote: > Jan Klemkow wrote: > > > for frequent performance test it would be nice to just start tcpbench > > as a regular service. tcpbench gets an extra user and group with this > > diff and is already pledged

Re: rc.d(8) for tcpbench

2020-12-15 Thread Jan Klemkow
On Tue, Dec 15, 2020 at 10:59:50PM +, Stuart Henderson wrote: > On 2020/12/15 23:07, Jan Klemkow wrote: > > for frequent performance test it would be nice to just start tcpbench > > as a regular service. tcpbench gets an extra user and group with this > > diff and is alre

Re: diff: tcp ack improvement

2020-12-17 Thread Jan Klemkow
ping On Fri, Nov 06, 2020 at 01:10:52AM +0100, Jan Klemkow wrote: > Hi, > > bluhm and I make some network performance measurements and kernel > profiling. > > Setup:Linux (iperf) -10gbit-> OpenBSD (relayd) -10gbit-> Linux (iperf) > > We figured out, that

remove double call of ttyopen()

2020-12-28 Thread Jan Klemkow
Hi, The following diff removes useless double calls of ttyopen. l_open is a pointer to ttyopen(). All other serial drivers also just use l_open, as it is the general API for this. OK? Bye, Jan Index: arch/luna88k/dev/siotty.c ===

Re: remove double call of ttyopen()

2020-12-28 Thread Jan Klemkow
On Mon, Dec 28, 2020 at 07:59:23PM +0100, Klemens Nanni wrote: > On Mon, Dec 28, 2020 at 03:49:35PM +0100, Jan Klemkow wrote: > > The following diff removes useless double calls of ttyopen. l_open is > > a pointer to ttyopen(). All other serial drivers also just use l_open, &

Re: diff: tcp ack improvement

2021-01-05 Thread Jan Klemkow
On Wed, Dec 23, 2020 at 11:59:13AM +, Stuart Henderson wrote: > On 2020/12/17 20:50, Jan Klemkow wrote: > > ping > > > > On Fri, Nov 06, 2020 at 01:10:52AM +0100, Jan Klemkow wrote: > > > bluhm and I make some network performance measurements and kernel > >

Re: diff: tcp ack improvement

2021-02-03 Thread Jan Klemkow
On Tue, Jan 05, 2021 at 10:30:33AM +0100, Claudio Jeker wrote: > On Tue, Jan 05, 2021 at 10:16:04AM +0100, Jan Klemkow wrote: > > On Wed, Dec 23, 2020 at 11:59:13AM +, Stuart Henderson wrote: > > > On 2020/12/17 20:50, Jan Klemkow wrote: > > > > ping > > >

Re: diff: tcp ack improvement

2021-02-08 Thread Jan Klemkow
On Mon, Feb 08, 2021 at 03:42:54PM +0100, Alexander Bluhm wrote: > On Wed, Feb 03, 2021 at 11:20:04AM +0100, Claudio Jeker wrote: > > Just commit it. OK claudio@ > > If people see problems we can back it out again. > > This has huge impact on TCP performance. > > http://bluhm.genua.de/perform/res

LibreSSL regressions

2021-02-13 Thread Jan Klemkow
Hi, A coworker of mine has made tests with LibreSSL [1] and found some regressions. I took his test descriptions and created the following automated regression test. In the repository he described his findings in detail. I kept the numbers of the files and subtests in the target names for now.

Re: LibreSSL regressions

2021-02-15 Thread Jan Klemkow
On Sat, Feb 13, 2021 at 03:53:48PM +0100, Theo Buehler wrote: > On Sat, Feb 13, 2021 at 11:58:04AM +0100, Jan Klemkow wrote: > > A coworker of mine has made tests with LibreSSL [1] and found some > > regressions. I took his test descriptions and created the following > > auto

Re: LibreSSL regressions

2021-02-15 Thread Jan Klemkow
On Tue, Feb 16, 2021 at 04:36:59AM +1100, Joel Sing wrote: > On 21-02-15 14:49:46, Jan Klemkow wrote: > > +create-libressl-test-certs: create-libressl-test-certs.pl > > + ${PERL} ${.CURDIR}/$@.pl > > We can see how this goes, however we may end up wanting to generate &

Re: LibreSSL regressions

2021-02-16 Thread Jan Klemkow
On Tue, Feb 16, 2021 at 04:36:59AM +1100, Joel Sing wrote: > On 21-02-15 14:49:46, Jan Klemkow wrote: > > On Sat, Feb 13, 2021 at 03:53:48PM +0100, Theo Buehler wrote: > > > On Sat, Feb 13, 2021 at 11:58:04AM +0100, Jan Klemkow wrote: > > > > A coworker of mine has ma

LibreSSL legacy verifier regression

2021-02-24 Thread Jan Klemkow
lib/libcrypto/expcert/expcrt.c diff -N lib/libcrypto/expcert/expcrt.c --- /dev/null 1 Jan 1970 00:00:00 - +++ lib/libcrypto/expcert/expcrt.c 24 Feb 2021 05:27:46 - @@ -0,0 +1,218 @@ +/* $OpenBSD$ */ +/* + * Copyright (c) 2021 Jan Klemkow + * Copyright (c) 2021 Anton Borowka + * + *

fix nvme(4): NULL deref. and empty device attachments

2021-02-24 Thread Jan Klemkow
Hi, While attaching the following disks, the nvme driver runs into a NULL dereference in nvme_scsi_capacity16() and nvme_scsi_capacity(). nvme0 at pci1 dev 0 function 0 vendor "Intel", unknown product 0x0a54 rev 0x00: msix, NVMe 1.2 nvme0: INTEL SSDPE2KX040T8, firmware VDV10170, serial PHLJ04130

Re: LibreSSL legacy verifier regression

2021-02-25 Thread Jan Klemkow
On Wed, Feb 24, 2021 at 09:21:56PM +0100, Theo Buehler wrote: > On Wed, Feb 24, 2021 at 09:00:05PM +0100, Theo Buehler wrote: > > On Wed, Feb 24, 2021 at 06:47:00AM +0100, Jan Klemkow wrote: > > > another co-worker of mine has found an other regress in the LibreSSL > > &g

ixl(4): add missing pci dev id for X710 10GBase-T

2021-02-26 Thread Jan Klemkow
Hi, The diff below adds a missing PCI device ID for an X710 10GBase NIC into the ixl(4) driver. The interfaces attach and run properly with this diff. ixl0 at pci11 dev 0 function 0 "Intel X710 10GBaseT" rev 0x02: port 0, FW 8.1.63299 API 1.12, msix, 8 queues, address 3c:ec:ef:1f:c3:ba ixl1 at

pcidump(8): add missing PCI classes

2021-03-05 Thread Jan Klemkow
Hi, this diff adds the missing PCI classes Accelerator and Instrumentation. Thus, we can replace a few unknown in its output: - 0x0008: Class: 13 (unknown), Subclass: 00 (unknown), + 0x0008: Class: 13 Instrumentation, Subclass: 00 (null), Both Classes have vendor specific APIs. So,

Re: pcidump(8): add missing PCI classes

2021-03-05 Thread Jan Klemkow
On Fri, Mar 05, 2021 at 04:13:53PM +0100, Mark Kettenis wrote: > > Date: Fri, 5 Mar 2021 12:05:38 +0100 > > From: Jan Klemkow > > Content-Type: text/plain; charset=us-ascii > > Content-Disposition: inline > > > > Hi, > > > > this diff adds the mis

Re: pcidump(8): add missing PCI classes

2021-03-05 Thread Jan Klemkow
On Fri, Mar 05, 2021 at 09:22:28AM -0700, Theo de Raadt wrote: > Fix dump() to convert subclass == NULL into something else, or maybe the > fix should be in pci_subclass() itself. My initial mistake was to use zero in an empty list. This leads to one element in the list, which causes wrong list h

LibreSSL: extend the max. no. of SANs for avoid OOM error

2021-03-09 Thread Jan Klemkow
Hi, The verification of the https://ugos.ugm.ac.id certificate contains 2032 subject alt names which leads to the following error in LibreSSL. # openssl s_client -connect ugos.ugm.ac.id:443 ... verify error:num=17:out of memory ... The following diff sets the maximum number of SANs to the next h

add missing PCI ID for Intel NVMe

2021-03-12 Thread Jan Klemkow
Hi, This diff add a missing PCI ID of an Intel NVMe disk. The disk works after my last fix [1]. OK? bye, Jan [1]: https://marc.info/?l=openbsd-tech&m=161418460303831 Index: pcidevs === RCS file: /cvs/src/sys/dev/pci/pcidevs,v ret

Re: add missing PCI ID for Intel NVMe

2021-03-13 Thread Jan Klemkow
On Fri, Mar 12, 2021 at 11:56:00AM +0100, Mark Kettenis wrote: > I believe this is what ark.intel.com calls a "Intel SSD DC P4510 > Series" part. Is that correct? Yes, that is correct. On Fri, Mar 12, 2021 at 10:00:54PM +1100, Jonathan Gray wrote: > On Fri, Mar 12, 2021 at 11

ixl(4): add ID for X710 10G SFP+

2021-03-14 Thread Jan Klemkow
Hi, This diff attaches the Intel x710 10G SFP+ NIC in ixl(4). ixl2 at pci11 dev 0 function 2 "Intel X710 10G SFP+" rev 0x02: port 1, FW 8.1.63299 API 1.12, msix, 8 queues, address 3c:ec:ef:1f:c3:bc ixl3 at pci11 dev 0 function 3 "Intel X710 10G SFP+" rev 0x02: port 3, FW 8.1.63299 API 1.12, msi

Re: ixl(4): add ID for X710 10G SFP+

2021-03-15 Thread Jan Klemkow
On Sun, Mar 14, 2021 at 12:39:42PM -0600, Theo de Raadt wrote: > > +product INTEL X710_10G_SFP_2 0x104e X710 10G SFP+ > > You only need: > > X710 SFP+ > > Adding 10G is incorrect. OK? Thanks, Jan Index: if_ixl.c === RCS file:

Re: ixl(4): add ID for X710 10G SFP+

2021-03-15 Thread Jan Klemkow
On Mon, Mar 15, 2021 at 01:35:28AM -0600, Theo de Raadt wrote: > My comments are about the "text name", which goes into every kernel > anyone compiles. > > It should be as short as possible. Sorry, I missed that point. > But the reason why 10G is incorrect is because surely the port can > accept

Re: LibreSSL: extend the max. no. of SANs for avoid OOM error

2021-03-17 Thread Jan Klemkow
ping On Tue, Mar 09, 2021 at 03:49:32PM +0100, Jan Klemkow wrote: > Hi, > > The verification of the https://ugos.ugm.ac.id certificate contains 2032 > subject alt names which leads to the following error in LibreSSL. > > # openssl s_client -connect ugos.ugm.ac.id:443 > ...

Re: vmm crash on 6.9-beta

2021-03-19 Thread Jan Klemkow
Hi, I had the same issue a few days ago a server hardware of mine. I just ran 'cvs up'. So, it looks like a generic bug in FFS and not related to vmm. OpenBSD 6.9-beta (GENERIC.MP) #396: Thu Mar 11 19:15:56 MST 2021 dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP ciao,

fyi: get HP EliteBook 830 G7/G8 booting

2021-03-26 Thread Jan Klemkow
Hi, If you want to boot OpenBSD on an HP EliteBook 830 G7/G8, the bootloader will hang while loading the kernel. Because, the UEFI loads the bootloader on the same place in memory, where the bootloader will copy the kernel. We are unable to load the kernel on arbitrary memory. Thus, the followin

if_parse_packet(): refactor packet parsing on driver level

2022-10-24 Thread Jan Klemkow
Hi, We have a lot of redundant code on the network device driver layer, that parses the content of mbufs for ethernet, ip and tcp header. This diff introduces a new function if_parse_packet() to centralize this feature. It just refactors ix(4) and ixl(4) code because, I could test this cards and

Fix kernel build without IPSEC option

2022-11-02 Thread Jan Klemkow
Hi, if you build the kernel without IPSEC it will run into several compiler and linker errors. This diff add some missing #ifdefs to fix this. ok? bye, jan Index: net/if_pfsync.c === RCS file: /mount/openbsd/cvs/src/sys/net/if_pfs

Re: ix(4): LRO forwarding

2023-05-25 Thread Jan Klemkow
On Wed, May 24, 2023 at 05:28:58PM +0200, Alexander Bluhm wrote: > On Tue, May 23, 2023 at 02:14:57PM +0200, Jan Klemkow wrote: > > Hi, > > > > This diff sets needed offloading flags and the calculated mss to LRO > > mbufs in ix(4). Thus, we can forward this p

Re: Virtio fix for testing

2023-05-26 Thread Jan Klemkow
On Wed, May 24, 2023 at 08:50:26PM +0200, Stefan Fritsch wrote: > I forgot to mention that no stress test is necessary. If it boots and the > virtio devices work at all, that should be enough. Works for me on Linux/KVM with the following devices: vga1 at pci0 dev 2 function 0 "Qumranet Virtio 1.x

Re: ifconfig rename tcplro

2023-06-06 Thread Jan Klemkow
On Tue, Jun 06, 2023 at 02:31:52PM +0200, Alexander Bluhm wrote: > I would suggest to rename ifconfig tcprecvoffload to tcplro. Maybe > it's just because I had to type that long name too often. > > With that we have consistent naming: > # ifconfig ix0 tcplro > # sysctl net.inet.tcp.tso=1 > > Als

Re: ifconfig rename tcplro

2023-06-06 Thread Jan Klemkow
On Tue, Jun 06, 2023 at 05:54:31PM +0300, Vitaliy Makkoveev wrote: > On Tue, Jun 06, 2023 at 02:31:52PM +0200, Alexander Bluhm wrote: > > I would suggest to rename ifconfig tcprecvoffload to tcplro. Maybe > > it's just because I had to type that long name too often. > > > > With that we have cons

Re: ifconfig rename tcplro

2023-06-06 Thread Jan Klemkow
On Tue, Jun 06, 2023 at 09:37:22AM -0700, Chris Cappuccio wrote: > Jan Klemkow [j.klem...@wemelug.de] wrote: > > On Tue, Jun 06, 2023 at 05:54:31PM +0300, Vitaliy Makkoveev wrote: > > > On Tue, Jun 06, 2023 at 02:31:52PM +0200, Alexander Bluhm wrote: > > > > I wo

Re: ifconfig rename tcplro

2023-06-07 Thread Jan Klemkow
On Wed, Jun 07, 2023 at 02:49:07PM +0300, Vitaliy Makkoveev wrote: > On Wed, Jun 07, 2023 at 01:29:09PM +0200, Alexander Bluhm wrote: > > On Wed, Jun 07, 2023 at 12:59:11PM +0300, Vitaliy Makkoveev wrote: > > > On Wed, Jun 07, 2023 at 10:19:32AM +1000, David Gwynne wrote: > > > > > > > > > > > >

ix(4): allocate less memory for tx buffers

2023-06-09 Thread Jan Klemkow
Hi, TSO packets are limited to MAXMCLBYTES (64k). Thus, we don't need to allocate IXGBE_TSO_SIZE (256k) per packet for the transmit buffers. This saves 3/4 of the memory and allows me to pack over 8 ix(8) ports into one machine. Otherwise I run out of devbuf in malloc(9). ok? bye, Jan Index:

Re: ix(4): allocate less memory for tx buffers

2023-06-09 Thread Jan Klemkow
On Fri, Jun 09, 2023 at 06:11:38PM +0200, Jan Klemkow wrote: > TSO packets are limited to MAXMCLBYTES (64k). Thus, we don't need to > allocate IXGBE_TSO_SIZE (256k) per packet for the transmit buffers. > > This saves 3/4 of the memory and allows me to pack over 8 ix(8) ports &

Re: ix(4): allocate less memory for tx buffers

2023-06-09 Thread Jan Klemkow
On Fri, Jun 09, 2023 at 06:59:57PM +0200, Jan Klemkow wrote: > On Fri, Jun 09, 2023 at 06:11:38PM +0200, Jan Klemkow wrote: > > TSO packets are limited to MAXMCLBYTES (64k). Thus, we don't need to > > allocate IXGBE_TSO_SIZE (256k) per packet for the transmit buffers. > &

Re: tso ip6 forward

2023-06-16 Thread Jan Klemkow
On Fri, Jun 16, 2023 at 12:06:08PM +0200, Alexander Bluhm wrote: > On Mon, Jun 12, 2023 at 03:46:28PM +0200, Alexander Bluhm wrote: > > I found a little inconsistency in IPv6 forwarding with TSO. > > > > Sending with TSO should only done if the large packet does not fit > > in the interface MTU.

Re: lo(4) loopback LRO and TSO

2023-07-02 Thread Jan Klemkow
On July 2, 2023 2:33:41 PM GMT+02:00, Claudio Jeker wrote: >On Sun, Jul 02, 2023 at 02:28:17PM +0200, Alexander Bluhm wrote: >> anyone? > >Was not able to test yet but I like the diff. >Right now this is a noop since LRO is not on by default for lo(4). >Because of that OK claudio@ The diff wo

Add ethernet type check in ifsetlro()

2023-07-03 Thread Jan Klemkow
Hi, bluhm pointed out that the ether_brport_isset() check it just allowed on ethernet devices. Thus, I put an additional ethernet check in the condition. This also fixes EBUSY errors of "ifconfig lo0 tcplro" calls in my setup. ok? bye, Jan Index: net/if.c =

Re: tcp lro tso path mtu

2023-07-06 Thread Jan Klemkow
On Mon, Jul 03, 2023 at 08:04:11PM +0300, Alexander Bluhm wrote: > As final step before making LRO (Large Receive Offload) the default, > we have to fix path MTU discovery when forwarding. > > The drivers, currently ix(4) and lo(4) only, record an upper bound > of the size of the original packets

Re: tcp lro tso path mtu

2023-07-06 Thread Jan Klemkow
On Thu, Jul 06, 2023 at 10:19:21PM +0300, Alexander Bluhm wrote: > On Thu, Jul 06, 2023 at 08:49:03PM +0200, Jan Klemkow wrote: > > > @@ -109,6 +109,9 @@ > > > #include > > > #include > > > #include > > > > I think is a merge b

Re: tcp lro by default, call for testing

2023-07-10 Thread Jan Klemkow
On Sat, Jul 08, 2023 at 05:15:26PM +0300, Alexander Bluhm wrote: > I am not aware of any more limitations when enabling LRO for TCP > in the network drivers. The feature allows to receive agregated > packets larger than the MTU. Receiving TCP streams becomes much > faster. > > As the network har

ixl(4): protect admin queue with mutex

2023-07-19 Thread Jan Klemkow
Hi, there is an issue with the admin queue of ixl(4) which leads into the following panic when the link state changes: uvm_fault(0x818005f8, 0x18, 0, 2) -> e kernel: page fault trap, code=0 Stopped at ixl_intr0+0xca: movq%rdx,0x18(%rax) TIDPIDUID PRFLAGS PFLAG

fix vlan handling with tcplro on ix(4)

2023-07-26 Thread Jan Klemkow
Hi, I missed the vlan-tag size in the mss calculation of lro packets in ix(4). This diff add vlan-header detection in ether_extract_headers() and uses this information to calculate the right mss. This fixes forwarding of vlan tagged lro packets. ok? bye, Jan Index: dev/pci/if_ix.c ===

TSO for ixl(4)

2023-10-18 Thread Jan Klemkow
Hi, This diff implements TCP Segmentation Offloading for ixl(4). I tested it successfully on amd64 and sparc64 with Intel X710. It should increase the TCP bulk performance to 10 Gbit/s. On sparc64 I got an increase from 600 MBit/s to 2.000 Gbit/s. Further testing is welcome. bye, Jan Index:

Re: IPv4 on ix(4) slow/nothing - 7.4

2023-10-19 Thread Jan Klemkow
On Wed, Oct 18, 2023 at 08:53:44PM +0200, Alexander Bluhm wrote: > On Wed, Oct 18, 2023 at 08:19:29PM +0200, Mischa wrote: > > It's indeed something like that: ix -> vlan (tagged) -> veb > > When vlan is added to veb, kernel should disable LRO on ix. > All testing before release did not find this

snmpd(8): fix use of uninitialized pointer

2020-03-09 Thread Jan Klemkow
Hi, The following diff fixes the use of the uninitialized pointer iter in trapcmd_exec(). iter is just initialized in traphandler_parse() if vers is SNMP_V2. In all other cases iter stays uninitialized and may dereferenced in trapcmd_exec(). OK? bye, Jan Index: traphandler.c =

Re: snmpd(8): fix use of uninitialized pointer

2020-03-10 Thread Jan Klemkow
er to NULL anyway? bye, Jan > On 3/9/20 11:38 PM, Jan Klemkow wrote: > > Hi, > > > > The following diff fixes the use of the uninitialized pointer iter > > in trapcmd_exec(). > > > > iter is just initialized in traphandler_parse() if vers is SNMP_V2.

Re: snmpd(8): fix use of uninitialized pointer

2020-03-10 Thread Jan Klemkow
On Tue, Mar 10, 2020 at 01:13:46PM +0100, Martijn van Duren wrote: > On 3/10/20 10:21 AM, Jan Klemkow wrote: > > On Tue, Mar 10, 2020 at 12:27:20AM +0100, Martijn van Duren wrote: > >> Looking at RFC1157 section 4.1.6, an snmpv1 trap should also contain a > >> varbindlis

Re: snmpd(8): fix use of uninitialized pointer

2020-03-10 Thread Jan Klemkow
the additional varbinds to > the trap handle "command". > > Now actually asking for OKs. :-) OK jan@ > On 3/10/20 1:43 PM, Jan Klemkow wrote: > > On Tue, Mar 10, 2020 at 01:13:46PM +0100, Martijn van Duren wrote: > >> On 3/10/20 10:21 AM, Jan Klemkow wrote: >

diff: em(4) deadlock fix

2020-04-21 Thread Jan Klemkow
Hi, The following diff fixes a deadlock in em(4) when system runs out of mbuf(9)s. Tested with current on amd64 with: em0 at pci0 dev 25 function 0 "Intel I217-LM" rev 0x05: msi, mac 0x1e phy 0xb, address d0:50:99:c1:67:94 When the system runs out of mbufs, the receive ring of the em-NIC also r

Re: patch: Enable dock audio on Thinkpad dock (Thinkpad L460)

2020-04-27 Thread Jan Klemkow
On Thu, Apr 16, 2020 at 05:59:44PM -0500, Abel Abraham Camarillo Ojeda wrote: > On Tuesday, February 11, 2020, Abel Abraham Camarillo Ojeda > wrote: > > On Wednesday, January 8, 2020, Abel Abraham Camarillo Ojeda > > wrote: > >> On Mon, Dec 30, 2019 at 1:24 PM Abel Abraham Camarillo Ojeda > >>

Re: diff: em(4) deadlock fix

2020-05-08 Thread Jan Klemkow
On Mon, Apr 27, 2020 at 10:42:52AM +0200, Martin Pieuchot wrote: > On 21/04/20(Tue) 15:54, Jan Klemkow wrote: > > The following diff fixes a deadlock in em(4) when system runs out of > > mbuf(9)s. > > > > Tested with current on amd64 with: > > em0 at pci0 dev

Re: diff: em(4) deadlock fix

2020-05-09 Thread Jan Klemkow
On Fri, May 08, 2020 at 04:36:28PM +0200, Mark Kettenis wrote: > > Date: Fri, 8 May 2020 15:39:26 +0200 > > From: Jan Klemkow > > On Mon, Apr 27, 2020 at 10:42:52AM +0200, Martin Pieuchot wrote: > > > So the current logic assumes that as long as the ring contains de

diff: uvm: fix unitialized var and simplify code in km_alloc()

2020-05-20 Thread Jan Klemkow
Hi, The function km_alloc() returns the uninitialized local variable sva if pgl is empty. It seems to be not possible in the current condition of the code, but I'm not sure if this is guaranteed. Thus, I would prefer to initialize sva with zero. It also seems to be unnecessary to loop over the

ftpd(8): remove useless islower(3) in upper()

2021-05-01 Thread Jan Klemkow
Hi, This cleanup diff, removes a useless if islower(3) from the loop. It is guarantee by toupper(3) that no character will be changed if its not a lower one. man toupper(3): The toupper() and toupper_l() functions convert a lower-case letter to the corresponding upper-case letter. The

ftpd(8): constify internal functions

2021-05-04 Thread Jan Klemkow
Hi, The following diff adds some missing consts for char * to the internal program functions. OK? bye, Jan Index: extern.h === RCS file: /cvs/src/libexec/ftpd/extern.h,v retrieving revision 1.21 diff -u -p -r1.21 extern.h --- exter

services(5): add default ftps ports

2021-05-04 Thread Jan Klemkow
Hi, Add missing ftps defaults ports to servies(5). OK? bye, Jan Index: services === RCS file: /cvs/src/etc/services,v retrieving revision 1.99 diff -u -p -r1.99 services --- services18 Feb 2021 02:30:29 - 1.99 +++ serv

Re: services(5): add default ftps ports

2021-05-05 Thread Jan Klemkow
On Wed, May 05, 2021 at 11:09:12AM +0100, Stuart Henderson wrote: > On 2021/05/04 12:07, Jan Klemkow wrote: > > Add missing ftps defaults ports to servies(5). > > > > Index: services > > === > >

ftpd(8): remove double fflush(3) calls

2021-05-05 Thread Jan Klemkow
Hi, The function lreply() already calls fflush(3) on stdout. So, this calls are useless. OK? bye, Jan Index: ftpd.c === RCS file: /cvs/src/libexec/ftpd/ftpd.c,v retrieving revision 1.229 diff -u -p -r1.229 ftpd.c --- ftpd.c 1

Re: services(5): add default ftps ports

2021-05-06 Thread Jan Klemkow
uot; call, which uses this port. Thus, I made this change. > Jan Klemkow wrote: > > On Wed, May 05, 2021 at 11:09:12AM +0100, Stuart Henderson wrote: > > > On 2021/05/04 12:07, Jan Klemkow wrote: >

Re: services(5): add default ftps ports

2021-05-06 Thread Jan Klemkow
On Thu, May 06, 2021 at 06:36:52PM +0200, Mark Kettenis wrote: > > From: "Theo de Raadt" > > Date: Thu, 06 May 2021 10:26:31 -0600 > > > > Jan Klemkow wrote: > > > > > On Wed, May 05, 2021 at 12:18:43PM -0600, Theo de Raadt wrote: > > >

Re: services(5): add default ftps ports

2021-05-07 Thread Jan Klemkow
On Thu, May 06, 2021 at 11:09:03AM -0600, Theo de Raadt wrote: > Jan Klemkow wrote: > > > > > > I'm working on a diff to bring ftps with libtls into our ftpd(8). > > > > > There > > > > > is a "getaddrinfo(NULL, "ftps", &

ftpd(8): add pledge(2)

2021-05-13 Thread Jan Klemkow
Hi, This is the first attempt to bring pledge into ftpd. The Main ftpd process can't use pledge for now because of possible chroot(2) calls. But, the two forks after user login are pledged with this diff. I tested it manually and with the ftpd's regression tests. OK? bye, Jan Index: monitor.c

Re: ftpd(8): remove double fflush(3) calls

2021-05-13 Thread Jan Klemkow
ping? On Wed, May 05, 2021 at 04:42:49PM +0200, Jan Klemkow wrote: > Hi, > > The function lreply() already calls fflush(3) on stdout. So, this calls > are useless. > > OK? > > bye, > Jan > > Index: ftpd.c >

Re: ftpd(8): constify internal functions

2021-05-13 Thread Jan Klemkow
ping? On Tue, May 04, 2021 at 10:50:50AM +0200, Jan Klemkow wrote: > Hi, > > The following diff adds some missing consts for char * to the internal > program functions. > > OK? > > bye, > Jan > > Index: extern.h > ==

Re: ftpd(8): remove useless islower(3) in upper()

2021-05-13 Thread Jan Klemkow
ping? On Sat, May 01, 2021 at 11:19:56AM +0200, Jan Klemkow wrote: > Hi, > > This cleanup diff, removes a useless if islower(3) from the loop. It is > guarantee by toupper(3) that no character will be changed if its not a > lower one. > > man toupper(3): > The

Re: ftpd(8): add pledge(2)

2021-05-13 Thread Jan Klemkow
On Thu, May 13, 2021 at 10:40:40AM -0600, Theo de Raadt wrote: > + if (pledge("stdio rpath inet recvfd sendfd " > + "wpath cpath proc tty getpw", NULL) == -1) > > Please change the order: > > stdio rpath wpath cpath inet recvfd sendf

ftpd(8): remove useless parameter of get_line()

2021-05-16 Thread Jan Klemkow
Hi, This diff removes the useless FILE* parameter of get_line(). In every call this parameter is always "stdin". Thus, we can replace ever use of the variable iop with stdin. Like every other diff, I tested this diff with the ftpd regression tests. OK? bye, Jan Index: extern.h ==

Re: snmpd rename context to pdutype

2021-05-18 Thread Jan Klemkow
On Fri, May 07, 2021 at 04:18:50PM +0200, Martijn van Duren wrote: > When moving the traphandler to the snmpe process I overlooked the fact > that "type" is being saved inside the switch statement under the > sm_context name. RFC3411 talks about pduType, and the name context means > something compl

Re: ftpd(8): constify internal functions

2021-05-21 Thread Jan Klemkow
ping? On Thu, May 13, 2021 at 04:44:56PM +0200, Jan Klemkow wrote: > ping? > > On Tue, May 04, 2021 at 10:50:50AM +0200, Jan Klemkow wrote: > > Hi, > > > > The following diff adds some missing consts for char * to the internal > > program functions. &

Re: ftpd(8): remove double fflush(3) calls

2021-05-21 Thread Jan Klemkow
ping? On Thu, May 13, 2021 at 04:44:23PM +0200, Jan Klemkow wrote: > ping? > > On Wed, May 05, 2021 at 04:42:49PM +0200, Jan Klemkow wrote: > > Hi, > > > > The function lreply() already calls fflush(3) on stdout. So, this calls > > are useless. > > >

Re: ftpd(8): remove useless islower(3) in upper()

2021-05-21 Thread Jan Klemkow
ping? On Thu, May 13, 2021 at 04:45:14PM +0200, Jan Klemkow wrote: > ping? > > On Sat, May 01, 2021 at 11:19:56AM +0200, Jan Klemkow wrote: > > Hi, > > > > This cleanup diff, removes a useless if islower(3) from the loop. It is > > guarantee by toupper(3) tha

ftpd(8): Convert K&R function definitions to modern C

2021-05-30 Thread Jan Klemkow
Hi, Convert K&R function definitions to modern C. OK? bye, Jan Index: ftpcmd.y === RCS file: /cvs/src/libexec/ftpd/ftpcmd.y,v retrieving revision 1.72 diff -u -p -r1.72 ftpcmd.y --- ftpcmd.y23 May 2021 17:01:21 - 1.72

Fix: tcp_output window calculation error

2021-07-22 Thread Jan Klemkow
Hi, This calculation of the receive window has a logic error: If win is 0 it will be overwritten by (rcv_adv - rcv_nxt). Thus, win will be (rcv_adv - rcv_nxt) even if its below (sb_hiwat / 4). We could just remove the dead (sb_hiwat / 4) code, or reorder the conditions to keep the original feat

vmx(4): remove useless code

2021-08-05 Thread Jan Klemkow
Hi, The following diff removes useless code from the driver. As discussed here [1] and committed there [2], the hypervisor doesn't do anything with the data structures. We even just set NULL to the pointer since the initial commit of vmx(4). So, I guess it better to remove all of these. The va

Re: vmx(4): remove useless code

2021-08-06 Thread Jan Klemkow
On Fri, Aug 06, 2021 at 12:06:04PM +0200, Patrick Wildt wrote: > On Fri, Aug 06, 2021 at 11:05:53AM +0200, Patrick Wildt wrote: > > Am Thu, Aug 05, 2021 at 02:33:01PM +0200 schrieb Jan Klemkow: > > > Hi, > > > > > > The following diff removes useless code from

enable cu(4) in amd64/GENERIC by default

2021-09-02 Thread Jan Klemkow
Hi, The card and cables don't have the signaling lines, that getty to use it as com(4). But with "local" in ttys(5) it works. I have this driver in productive use for about 5 years now. OK? bye, Jan Index: arch/amd64/conf/GENERIC ===

diff: add USB ANT-m Stick via uscom(4)

2018-08-09 Thread Jan Klemkow
Hi, the following diff adds support for an USB ANT+ receiver which is used to communicate with wireless fitness tracking devices. The USB device appears as a serial interface. I just add the device ID to the existing uscom(4) driver and enabled it in GENERIC. I don't know why it was deactivated

fix: unveil(2) error handling

2018-08-30 Thread Jan Klemkow
Hi, I found a little bug in the unveil(2) error handling. After blocking unveil(2) by unveil(NULL, NULL), an additional unveil(2) call sets errno to EINVAL instead of EPERM as the manpage saids: EPERM An attempt to increase permissions was made, or the path was not accessible, or unvei

diff: ndp(8): hostname lookup via /etc/ethers

2018-10-22 Thread Jan Klemkow
Hi, The following diff adds the option -e to ndp(8), which resolved printed hostnames via /etc/ethers. You are able to recognise hosts with IPv6 auto privacy extension addresses on local IPv6 routers. Also hosts inside of a yp(8) domain are able to lookup their neighbors via the shared /etc/ethe

Re: Add acpipci(4) on amd64

2018-10-23 Thread Jan Klemkow
Hi Mark, On Mon, Oct 22, 2018 at 09:45:06PM +0200, Mark Kettenis wrote: > Diff below adds an acpipci(4) driver on amd64. For now the main > purpose of this driver is to make the PCI-specific _OSC calls to > advertise the functionality we support. Most notably this advertises > support for PCIE n

Re: Add acpipci(4) on amd64

2018-10-23 Thread Jan Klemkow
Hi Mark, On Tue, Oct 23, 2018 at 07:32:16PM +0200, Mark Kettenis wrote: > > Date: Tue, 23 Oct 2018 18:40:42 +0200 > > From: Jan Klemkow > > On Mon, Oct 22, 2018 at 09:45:06PM +0200, Mark Kettenis wrote: > > > Diff below adds an acpipci(4) driver on amd64. For now the

Re: inteldrm(4): uvm write-combining support

2018-10-28 Thread Jan Klemkow
On Sat, Oct 27, 2018 at 12:31:48PM +0200, Mark Kettenis wrote: > > Date: Sat, 27 Oct 2018 17:16:57 +1100 > > From: Jonathan Gray > > > > On Fri, Oct 26, 2018 at 09:47:51PM +0200, Mark Kettenis wrote: > > > Diff below adds support to uvm to create wtite-combining mappings and > > > uses this to im

diff: Fix send(2) EACCES mistake

2018-10-28 Thread Jan Klemkow
Hi, Unlike the manpage saids or one might think , sendto(2) sets errno to EHOSTUNREACH instead of EACCES in cases of blocking by pf(4) or not enabled broadcasts. Finally I ran into both cases and think, its time to fix this issue. The diff suggests a new explanation that should cover all error c

Re: diff: Fix send(2) EACCES mistake

2018-10-29 Thread Jan Klemkow
On Sun, Oct 28, 2018 at 10:58:34PM +, Jason McIntyre wrote: > On Sun, Oct 28, 2018 at 09:40:33PM +0100, Jan Klemkow wrote: > > Unlike the manpage saids or one might think , sendto(2) sets errno to > > EHOSTUNREACH instead of EACCES in cases of blocking by pf(4) or not > &g

Re: diff: Fix send(2) EACCES mistake

2018-11-09 Thread Jan Klemkow
On Tue, Oct 30, 2018 at 07:13:24AM +, Jason McIntyre wrote: > On Mon, Oct 29, 2018 at 11:55:52PM +0100, Jan Klemkow wrote: > > On Sun, Oct 28, 2018 at 10:58:34PM +, Jason McIntyre wrote: > > > On Sun, Oct 28, 2018 at 09:40:33PM +0100, Jan Klemkow wrote: > > > &g

Re: diff: Fix send(2) EACCES mistake

2018-11-09 Thread Jan Klemkow
On Fri, Nov 09, 2018 at 06:57:16PM +0100, Claudio Jeker wrote: > On Fri, Nov 09, 2018 at 06:09:34PM +0100, Jan Klemkow wrote: > > I printed the code path below to make it easier to review the diff. > > While I was following the code path again, I found an inconsistency > > bet

Re: diff: Fix send(2) EACCES mistake

2018-11-09 Thread Jan Klemkow
On Fri, Nov 09, 2018 at 12:36:20PM -0700, Alexander Bluhm wrote: > On Fri, Nov 09, 2018 at 08:24:47PM +0100, Jan Klemkow wrote: > > Perfect, I also think its more intuitive to get a "permission denied" > > in case of a pf(4) block then a "Host is unreachable".

Re: diff: Fix send(2) EACCES mistake

2018-11-10 Thread Jan Klemkow
On Sat, Nov 10, 2018 at 11:22:48AM +0100, Claudio Jeker wrote: > On Fri, Nov 09, 2018 at 03:49:32PM -0700, Alexander Bluhm wrote: > > On Fri, Nov 09, 2018 at 09:03:20PM +0100, Jan Klemkow wrote: > > > On Fri, Nov 09, 2018 at 12:36:20PM -0700, Alexander Bluhm wrote: > > >

diff: ftpd(8): fix for sign-compare compiler warnings

2018-11-24 Thread Jan Klemkow
Hi, This diff fixes some -Wsign-compare compiler warnings in ftpd(8) by using the right types for 'i' and 'len'. One warning is left, but I don't see that it's fixable without suppressing the warning by a cast of len to size_t. And casting might be controversial in this case?! /usr/src/libexec/

Re: diff: ftpd(8): fix for sign-compare compiler warnings

2018-12-06 Thread Jan Klemkow
On Tue, Nov 27, 2018 at 09:03:15AM +0100, Theo Buehler wrote: > On Sun, Nov 25, 2018 at 12:32:23AM +0100, Jan Klemkow wrote: > > This diff fixes some -Wsign-compare compiler warnings in ftpd(8) by > > using the right types for 'i' and 'len'. One warning is

  1   2   3   >