Re: OpenBSD (memory management) performance issues

2021-01-26 Thread Otto Moerbeek
On Tue, Jan 26, 2021 at 04:08:40PM +, Marek Klein wrote:

> Hi,
> 
> We are working on an appliance like product that is based on OpenBSD.
> Recently we found out that our performance critical C++ program is
> ~2.5 times slower on OpenBSD compared to Ubuntu 20.04.
> 
> The program basically just reads data from stdin, does some
> transformation of the data, and returns the result on stdout, thus
> the program does not perform any further I/O operations nor interacts
> with other programs. We extensively use the C++ standard library string
> class for manipulation of data.
> 
> We started searching for the reason, and eliminated I/O as a factor.
> During some experiments we found out that one, perhaps not the only
> one, factor is OpenBSD's memory management. To test this assumption we
> wrote a simple program that allocates and frees memory in a loop.
> Something like:
> 
> for (...) {
>   void *buffer = malloc(...);
>   ...
>   free(buffer);
> }
> 
> We compiled it on OpenBSD with clang
> $ /usr/bin/c++ --version
> OpenBSD clang version 10.0.1
> Target: amd64-unknown-openbsd6.8
> Thread model: posix
> InstalledDir: /usr/bin
> 
> using options '-O3 -DNDEBUG -std=gnu++11' and ran it without memory
> junking.
> 
> $ time MALLOC_OPTIONS=jj ./memory_allocs --cycles 123456789 --size 1024
> 
> real  0m27.218s
> user  0m27.220s
> sys   0m0.020s
> 
> We compiled the same program on Ubuntu 20.04 with g++
> $ /usr/bin/c++ --version
> c++ (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
> 
> using the same options '-O3 -DNDEBUG -std=gnu++11'
> 
> $ time ./memory_allocs --cycles 123456789 --size 1024
> 
> real  0m1,920s
> user  0m1,915s
> sys   0m0,004s
> 
> Both systems were tested in the same virtualized environment (VSphere),
> thus we can assume the "hardware" is the same.
> 
> Given the virtual environment, the tests might not be scientifically
> the best choice, but they serve the observation well enough. We
> actually ruled out virtualization as a cause in other tests.

Short story: the slowness is because you get more security.

Somewhat longer story: depending on the size if the allocation actual
unmaps take place on free. This will catch use-after-free always. For
smaller allocations, caching takes place, sadly you did not tell us
how big the total of your allocations are. So I cannot predict if
enlargering the cache will help you.

Now the differnence is quite big so I like to know what you are doing
exactly in your test program.  Please provide the full test porogram
so I can take a look.

> 
> What other options are there we could try in order to speed the memory
> management up?

Some hintss: allocate/free less, use better algorithms that do not
allocate as much.  With C++ make sure your code uses moves of objects
instead of copies whenever possible. Use reserve() wisely. If all else
fails you might go for custom allocaters, but you will loose security
features.

-Otto

> 
> Also are there any other known areas, for CPU bound processing, where
> OpenBSD performs worse than other "common" platforms? 
> 
> Cheers,
> Marek
> 



iked(8) CREATE_CHILD_SA successful at initial connection time, fail at rekey interval

2021-01-26 Thread Darren S.
Greetings,

Responder: OpenBSD 6.8 GENERIC.MP#4 amd64 iked
Initiator: pfSense  2.4.5-RELEASE-p1 (arm) [FreeBSD 11.3-STABLE]
(built on Tue Jun 02 17:45:24 EDT 2020) strongSwan 5.8.4

Using IKEv2 for tunnel from a residential gateway to passive iked
responder. Using RSA auth with PKI from ikectl(8). Phase 1 setup with
IKE SAs and initial child SAs and connection time flow insertion works
great, but subsequent rekey attempts after configured timeout fail out
with NO_PROPOSAL_CHOSEN:

### Initial setup (responder)
Jan 26 17:50:21 strannik iked[41041]: spi=0x6184b254a8e8d175: recv
IKE_SA_INIT req 0 peer x.y.113.164:500 local x.y.97.55:500, 464 bytes,
policy 'home'
Jan 26 17:50:21 strannik iked[41041]: spi=0x6184b254a8e8d175: send
IKE_SA_INIT res 0 peer x.y.113.164:500 local x.y.97.55:500, 471 bytes
Jan 26 17:50:21 strannik iked[41041]: spi=0x6184b254a8e8d175: recv
IKE_AUTH req 1 peer x.y.113.164:4500 local x.y.97.55:4500, 1472 bytes,
policy 'home'
Jan 26 17:50:21 strannik iked[41041]: spi=0x6184b254a8e8d175: send
IKE_AUTH res 1 peer x.y.113.164:4500 local x.y.97.55:4500, 1328 bytes,
NAT-T
Jan 26 17:50:21 strannik iked[41041]: spi=0x6184b254a8e8d175:
ikev2_childsa_enable: loaded SPIs: 0x57a023eb, 0xc696f983
Jan 26 17:50:21 strannik iked[41041]: spi=0x6184b254a8e8d175:
ikev2_childsa_enable: loaded flows: ESP-10.0.10.0/24=10.0.1.0/24(0),
ESP-10.0.10.0/24=10.0.4.0/24(0), ESP-10.0.10.0/24=10.0.7.0/24(0)
Jan 26 17:50:21 strannik iked[41041]: spi=0x6184b254a8e8d175:
established peer x.y.113.164:4500[ASN1_DN//CN=initiator] local
x.y.97.55:4500[ASN1_DN//CN=responder] policy 'home' as responder

### Rekey failure (responder)
Jan 26 18:48:30 strannik iked[41041]: ikev2_resp_create_child_sa: no
proposal chosen
Jan 26 18:48:30 strannik iked[41041]: spi=0x6184b254a8e8d175:
ikev2_log_proposal: ESP #1 ENCR=AES_CBC-256
Jan 26 18:48:30 strannik iked[41041]: spi=0x6184b254a8e8d175:
ikev2_log_proposal: ESP #1 INTEGR=HMAC_SHA2_256_128
Jan 26 18:48:30 strannik iked[41041]: spi=0x6184b254a8e8d175:
ikev2_log_proposal: ESP #1 DH=MODP_2048
Jan 26 18:48:30 strannik iked[41041]: spi=0x6184b254a8e8d175:
ikev2_log_proposal: ESP #1 ESN=NONE
Jan 26 18:48:30 strannik iked[41041]: spi=0x6184b254a8e8d175:
ikev2_add_error: NO_PROPOSAL_CHOSEN


During the failure state the tunnel stays established and both sides
report connected status, but no traffic flows over the tunnel.
Attempts to renegotiate phase 2 appears to happen every 10s after that
point.

# ikectl show sa
iked_sas: 0x9481f54d7d0 rspi 0xfd60f500455aa58f ispi
0xf2134f3e308e03da
x.y.97.55:4500->x.y.113.164:4500[] ESTABLISHED
r natt nexti 0x0 pol 0x94868ba9000
  sa_flows: 0x94858fa4c00 ESP out 10.0.10.0/24 -> 10.0.1.0/24 [0]@-1
(L) @0x9481f54d7d0
  sa_flows: 0x94858fa1400 ESP in 10.0.1.0/24 -> 10.0.10.0/24 [0]@-1
(L) @0x9481f54d7d0
  sa_flows: 0x94858fa4000 ESP out 10.0.10.0/24 -> 10.0.4.0/24 [0]@-1
(L) @0x9481f54d7d0
  sa_flows: 0x947e1ca9400 ESP in 10.0.4.0/24 -> 10.0.10.0/24 [0]@-1
(L) @0x9481f54d7d0
  sa_flows: 0x94858fa4400 ESP out 10.0.10.0/24 -> 10.0.7.0/24 [0]@-1
(L) @0x9481f54d7d0
  sa_flows: 0x94858fa1800 ESP in 10.0.7.0/24 -> 10.0.10.0/24 [0]@-1
(L) @0x9481f54d7d0
iked_flows: 0x94858fa1400 ESP in 10.0.1.0/24 -> 10.0.10.0/24 [0]@-1
(L) @0x9481f54d7d0
iked_flows: 0x947e1ca9400 ESP in 10.0.4.0/24 -> 10.0.10.0/24 [0]@-1
(L) @0x9481f54d7d0
iked_flows: 0x94858fa1800 ESP in 10.0.7.0/24 -> 10.0.10.0/24 [0]@-1
(L) @0x9481f54d7d0
iked_flows: 0x94858fa4c00 ESP out 10.0.10.0/24 -> 10.0.1.0/24 [0]@-1
(L) @0x9481f54d7d0
iked_flows: 0x94858fa4000 ESP out 10.0.10.0/24 -> 10.0.4.0/24 [0]@-1
(L) @0x9481f54d7d0
iked_flows: 0x94858fa4400 ESP out 10.0.10.0/24 -> 10.0.7.0/24 [0]@-1
(L) @0x9481f54d7d0
iked_dstid_sas: 0x9481f54d7d0 rspi 0xfd60f500455aa58f ispi
0xf2134f3e308e03da
x.y.97.55:4500->x.y.113.164:4500[] ESTABLISHED
r natt nexti 0x0 pol 0x94868ba9000

### Configuration, responder
ikev2 "home" passive esp inet \
from 10.0.10.0/24 to 10.0.1.0/24 \
from 10.0.10.0/24 to 10.0.4.0/24 \
from 10.0.10.0/24 to 10.0.7.0/24 \
local responder peer initiator \
srcid "/CN=responder" dstid "/CN=initiator"


### dmesg, responder

OpenBSD 6.8 (GENERIC.MP) #4: Mon Jan 11 10:35:56 MST 2021

r...@syspatch-68-amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 4278042624 (4079MB)
avail mem = 4133351424 (3941MB)
random: good seed from bootblocks
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.8 @ 0xf5920 (10 entries)
bios0: vendor SeaBIOS version
"rel-1.12.1-0-ga5cab58e9a3f-prebuilt.qemu.org" date 04/01/2014
bios0: QEMU Standard PC (i440FX + PIIX, 1996)
acpi0 at bios0: ACPI 1.0
acpi0: sleep states S3 S4 S5
acpi0: tables DSDT FACP APIC HPET
acpi0: wakeup devices
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel Xeon Processor (Skylake, IBRS), 2594.80 MHz, 06-55-04
cpu0: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SE

Re: OpenSMTPD is not sending e-mail.

2021-01-26 Thread latincom

Hello misc@

I can not believe that the solution has been to open port 25, Vultr rent 
servers whit port 25 closed!


Thanks so much to Stuart Henderson for the solution.

On 2021-01-20 5:04 p.m., latincom wrote:
I read the archives of OpenSMTPD, and found 2 messages related to ssl, 
nothing more. Can someone give me an advise where to look, please?


did something stupid, maybe:
I forgot, that the installer, ask for a name; then i wrote a name, which 
later change to a fqdn; according to man page; declared it in hosts and 
myname!


 From Log:
mta delivery evpid=7465b44496df9b1a from= 
to= rcpt=<-> source="-" relay="openbsd.org" 
delay=11h8m1s result="TempFail" stat="Network error on destination MXs"


smtp.conf:
#    $OpenBSD: smtpd.conf,v 1.14 2019/11/26 20:14:38 gilles Exp $

# This is the smtpd server system-wide configuration file.
# See smtpd.conf(5) for more information.

table aliases file:/etc/mail/aliases

listen on socket

# To accept external mail, replace with: listen on all
#
listen on all

action "local_mail" mbox alias 
action "outbound" relay

# Uncomment the following to accept external mail for domain "example.org"
#
match from any for domain "agroena.org" action "local_mail"
match from local for local action "local_mail"
match from local for any action "outbound"

ssl:
m# ls -l /etc/ssl/
total 764
-r--r--r--  1 root  bin    350172 Oct  4 23:47 cert.pem
-r--r--r--  1 root  wheel    3791 Jan 10 23:57 fullchain.pem
-rw-r--r--  1 root  wheel    2703 Oct  4 23:47 ikeca.cnf
-r--r--r--  1 root  bin   745 Oct  4 23:47 openssl.cnf
drwx--  2 root  wheel 512 Jan 10 23:57 private
-r--r--r--  1 root  bin  1006 Oct  4 23:47 x509v3.cnfatch from local







Re: Updating user groups - deregistering Iran BSD User Group (IRBUG)

2021-01-26 Thread Ingo Schwarze
Hi Faraz,

Faraz Vahedi wrote on Thu, Jan 14, 2021 at 08:05:32AM +:

> With a heavy heart, I am writing to hereby announce the end of the
> IRBUG's activities, the user group that I have been running for about
> two years.  Because of the current situation in Iran, the pandemic era,
> and several other reasons, I sadly decided to stop our further
> activities as a user group

I deleted your entry for now, please speak up if you hear about any other
group in Iran that would make sense to be listed, or if the situation
improves such that activities can be resumed.

> and will I hereafter as an individual, keep on advocating, helping,
> and educating anyone interested if I could do so anytime.

All the best for you!

> Therefore, please remove the IRBUG from the list as it no longer
> is active.
> 
> I am very much grateful to anyone who supported me during this journey,
> thank you very much, people. I hope I can make more contributions to
> the project in both technical and educational development.

Just watch out for bugs that show up in your personal usage of OpenBSD,
and try to write and send patches to fix them whenever possible.  :-)

Yours,
  Ingo



Re: cwm manpage default keybinding is incorrect

2021-01-26 Thread tetrahedra

On Tue, Jan 26, 2021 at 12:06:43PM -0500, Okan Demirmen wrote:
Please see my 2nd post where I explained I was hitting "Backspace", 
and the

official documentation does not mention any binding for CM-Backspace.


I did not see a 2nd post; in any case, this is not cwm(1), rather the
default mapping to terminate X and documented in default xkb mappings.



Okay, then that would explain it. Thanks!



Re: cwm manpage default keybinding is incorrect

2021-01-26 Thread tetrahedra

On Tue, Jan 26, 2021 at 09:39:31AM -0500, Okan Demirmen wrote:

On Sat 2021.01.23 at 01:04 +, tetrahe...@danwin1210.me wrote:

The cwm default keybindings listed in the manpage do not appear to be
entirely correct:
https://man.openbsd.org/cwm

For example the man page lists:
CM-DeleteLock the screen.

However, CM-Delete actually restarts the window manager (!) on my install
(6.8).


Hi - Are you sure you're hitting 'Delete' and not 'Backspace'? Or have
re-mapped keys?


Please see my 2nd post where I explained I was hitting "Backspace", and 
the official documentation does not mention any binding for 
CM-Backspace.




Re: Bootloader on USB stick fails with "root device not found"

2021-01-26 Thread tetrahedra

On Mon, Jan 25, 2021 at 08:08:20PM +0100, Jan Stary wrote:

I am trying to set up the bootloader on an external
USB stick to boot my FDE-encrypted disk:


Why? You say you can boot from the disk itself.


See the original linked email discussion from my post for the reasons 
why. Short answer: if you have your bootloader with you at all times in 
your pocket, an evil maid can't tamper with it to recover your FDE 
encryption key.


I managed to get the thing not to panic by using 
the -a flag, i.e

boot> boot sr0a:/bsd -a

Unfortunately, when I use the kernel-suggested default devices (root 
device on sd1a, swap device sd1b) then I boot the OS on my USB stick, 
rather than the OS on the FDE encrypted drive.


If I tell it to boot sd0a (root) / sd0a (swap) then it panicks with 
"cannot mount root". (probably because sd0 is an encrypted drive)


If I type ? then it gives me the options:
exit em0 sd0[a-p] sd1[a-p]

If I try telling it to boot sr0a as the root device, then it again just 
prompts me with the available options given above -- evidently it can't 
find sr0a.


It looks to me like -- even though it is prompting me for the FDE 
encryption password after I enter the 'boot sr0a:/bsd -a' command -- the 
kernel is ether not decrypting or not mounting the softraid disk.


Booting with the '-c' option and typing 'list' shows that there is a 
softraid entry:

6 softraid0 at root flags 0x0

Attempting to enable it with 'enable 6' returns the message
6 softraid0 already enabled

The kernel does not accept 'softraid0a' as a root device name.

'machine diskinfo' at the boot> prompt reveals that the hard disk is hd1 
and the USB stick is hd0. However, the post-probe list of available 
disks is

hd0 hd1 sr0*
so I assume there is no point to trying to boot sr1a.

Any ideas why the kernel isn't seeing sr0a as a root device?



6.8 and Procmail/Formail: anyone still using them?

2021-01-26 Thread Austin Hook


Wonder if anyone is still using Procmail/Formail under 6.8 for presorting 
incoming mail before it hits one's main inbox.

Also wondering if folks send the remainimg mail, after filtering, to 
/var/mail/*user*, or to ~/mbox or to ~mail/mbox.  Any advantage to be had, 
or any mere consensus, regardless of advantages?

I also use whitelisting extensively, and any such "From: emailaddresses" 
get priority.  Does anyone else?

Myself: Having problems with Procmail/formail, after upgrading from 5.3 to 
a new server running 6.8.  Would like to hear of anyone else's experience.

Thanks,

Austin Hook
Milk River, Alberta



Re: cwm manpage default keybinding is incorrect

2021-01-26 Thread Okan Demirmen
On Tue 2021.01.26 at 16:12 +, tetrahe...@danwin1210.me wrote:
> On Tue, Jan 26, 2021 at 09:39:31AM -0500, Okan Demirmen wrote:
> > On Sat 2021.01.23 at 01:04 +, tetrahe...@danwin1210.me wrote:
> > > The cwm default keybindings listed in the manpage do not appear to be
> > > entirely correct:
> > > https://man.openbsd.org/cwm
> > > 
> > > For example the man page lists:
> > > CM-Delete  Lock the screen.
> > > 
> > > However, CM-Delete actually restarts the window manager (!) on my install
> > > (6.8).
> > 
> > Hi - Are you sure you're hitting 'Delete' and not 'Backspace'? Or have
> > re-mapped keys?
> 
> Please see my 2nd post where I explained I was hitting "Backspace", and the
> official documentation does not mention any binding for CM-Backspace.

I did not see a 2nd post; in any case, this is not cwm(1), rather the
default mapping to terminate X and documented in default xkb mappings. 



Re: Bootable USB stick using dd on OpenBSD

2021-01-26 Thread Ivan
I am very sorry for not reading the fucking manual!
-- 
Regards,
Ivan



Re: cwm manpage default keybinding is incorrect

2021-01-26 Thread Okan Demirmen
On Sat 2021.01.23 at 01:04 +, tetrahe...@danwin1210.me wrote:
> The cwm default keybindings listed in the manpage do not appear to be
> entirely correct:
> https://man.openbsd.org/cwm
> 
> For example the man page lists:
> CM-Delete  Lock the screen.
> 
> However, CM-Delete actually restarts the window manager (!) on my install
> (6.8).

Hi - Are you sure you're hitting 'Delete' and not 'Backspace'? Or have
re-mapped keys?



Re: NIC Port L2 Switching capability

2021-01-26 Thread Kaya Saman

Thanks Stuart!


On 1/26/21 11:36 AM, Stuart Henderson wrote:

On 2021-01-25, Kaya Saman  wrote:

Thanks a lot Tom for your response.


Perhaps I wasn't quite clear in what I am trying to achieve?


When I say trunk, I meant from a switch perspective as in a 802.1Q trunk
port on a switch.


I think I got mixed up with the OpenBSD terminology since it is slightly
different:

yes.


So now I just need to find out how the switch interface works in OpenBSD
and see if I can get it working with 802.1q tagging and the rest of the
L2 networking protocols.

You do not want the "switch" interface type. "bridge" is the one you
need for what you're asking to do, but...



I figured this one out in my VM setup which was basically that I needed 
to activate 'promiscuous mode' on the NIC's. Afterwards, bridging the 
Trunks worked fine. I haven't tested anything other then basic 
connectivity yet though so I do not know how the setup will behave.





 Of course an alternate would be to link the 1GbE switch to the 10GbE
 switch and do things that way, but the above would be more practical
 from a cabling sense.

...that alternative is the real answer. Using bridge for this will
be a mess (you haven't mentioned PF yet but configuring that will be
a pain) and won't perform particularly well.

With bridge, I *think* you will want to bridge the vlan interfaces
together, not the trunk interfaces.




Hmm. this is the exact area that I'm trying to explore currently.


Currently what I have in place is this:


Router (4 port lacp trunk - multiple vlans , no bridging , PF rules for 
vlans and NAT ) ->


<- Switch1 (lacp trunk to router) ->

Switch1 (lacp trunk to Switch2)

Switch1 (lacp trunk to Switch3)

Switch1 (lacp trunk to Switch4)


Switch2 (lacp trunk to Switch5)



So basically Switch1 is being used as an aggregation switch to link to 
multiple other switches.




If I changed things around by adding a new higher performance (10GbE) 
switch above Switch1 then I would need to re-cable and change my main 
trunk interface over from using the 1GbE NICs to 10GbE NICs. Outside of 
this nothing much else would need to change as PF would stay the same.



However, if I created a new 2 port lacp trunk using the 10GbE interfaces 
then bridged the new trunk with the existing trunk will that mean that 
all the sub-interfaces will be bridged additionally?


For example if data is sent on vlan1 then will all the vlans see this? I 
will verify this in my VM setup additionally but I'm curious as to how 
PF would be affected by this?



It would be really nice if there was a mechanism to just do something 
like which is perfectly fine on a switch then have PF working as normal 
on top:



switchport g0/1

trunk

lagg-group 1


switchport g0/2

trunk

lagg-group 2



But of course in OpenBSD vlans are bound to an interface which makes the 
configuration a little different.




Regards,


Kaya





Re: 4G mini PCI-e modem support?

2021-01-26 Thread Matt Dainty
* Patrick Wildt  [2021-01-08 11:17:18]:
> Am Fri, Jan 08, 2021 at 02:29:02PM + schrieb Peter Kay:
> > There appear to be no 4G modem support at the moment, specifically a
> > mini PCI-e one so I can stick it in a PC engines apu4d4 and have a
> > backup connection.
> > 
> > Presuming a driver would need to be written, but just checking if I've
> > missed anything?
> 
> There's umb(4).  It supports USB's MBIM standard.  There are some MBIM
> compatible chips around, one for instance is this one:
> 
> https://www.varia-store.com/de/produkt/87272-simcom-sim7600e-h-mpcie-eu-lte-cat-4-modul.html
> 
> You'll probably need to switch it into MBIM mode once via a specific
> AT-command over the serial, but otherwise it should do.
> 
> I'm sure there are plenty of other MBIM-compatible devices, this is just
> the one from the top of my head.

Does this SIMCom card work under OpenBSD with umb(4)? I can see its device
IDs were added to umsm(4) in 2018.

I'm also looking for a mini PCIe 4G/LTE card to put in an APU4. I'm not
sure an M.2 card will fit into the standard case with the added height of
the M.2 <-> mini PCIe adapter so I'd prefer to just get a mini PCIe device
and avoid the extra adapter. Are there any other umb(4)-compatible devices
in a mini PCIe form factor I can look for that will work in Europe?

Matt



Re: Bootable USB stick using dd on OpenBSD

2021-01-26 Thread Janne Johansson
Den tis 26 jan. 2021 kl 14:11 skrev Ivan :
> I wonder why I have to make of=... being equal to some partition instead of 
> the whole memstick?
> Why does man page example tells to use of=/dev/rsd1c but not of=/dev/rsd1? 
> And why does it use exactly 'c' partition but not 'a', does that matter?

http://www.openbsd.org/faq/faq14.html#intro

-- 
May the most significant bit of your life be positive.



Bootable USB stick using dd on OpenBSD

2021-01-26 Thread Ivan
I wonder why I have to make of=... being equal to some partition instead of the 
whole memstick?

Why does man page example tells to use of=/dev/rsd1c but not of=/dev/rsd1? And 
why does it use exactly 'c' partition but not 'a', does that matter?
-- 
Regards,
Ivan



Re: auto-boot

2021-01-26 Thread Stuart Longland
On 25/1/21 11:40 pm, Bastien Durel wrote:
> Hello,
> 
> Short-circuit pins 3-5 using my DB9 cable as Mihai Popescu said[1]
> worked.
> Alas, this setup prevent to plug-in the cable on the other side ^^
> 
> But this confirm there is an hardware problem.
> 
> So if I understand well, I have to buy 2 of these[2], add a short-
> circuit between pins in one side, and connet them with an ethernet
> cable ?

That's a possibility… another no-solder option as I say is you grab a
suitable serial extension lead, chop it in half, and use screw terminal
blocks to bridge the right connections make the appropriate cross-overs.

Done that many times at work for an ad-hoc serial cable for wiring up
various RS-485 serial interfaces (Moxa U-Port 1150s, Advantec industrial
serial interfaces and el cheapo Jaycar no-name USB dongles) to Modbus
and proprietary serial meter networks.

A bonus with this approach is that you can easily change it if needed.
A downside is it's less robust as the wires usually aren't designed for
those kinds of stresses, so you may find some zip tied stress relief is
needed.  No good for a "professional" permanent install, but fine for
private use or for a quick lash-up for testing purposes.

There'll be some buzzing out of wires with a multimeter to figure out
which wire is which, but for DE9 cables it usually isn't a big issue.
It's not like you're trying to terminate a Ultra-160 SCSI cable.

If you go the DE9→RJ-45 route, make sure you use a straight-through CAT5
cable, or you'll have much head scratching when stuff doesn't work.
-- 
Stuart Longland (aka Redhatter, VK4MSL)

I haven't lost my mind...
  ...it's backed up on a tape somewhere.



Re: NIC Port L2 Switching capability

2021-01-26 Thread Stuart Henderson
On 2021-01-25, Kaya Saman  wrote:
> Thanks a lot Tom for your response.
>
>
> Perhaps I wasn't quite clear in what I am trying to achieve?
>
>
> When I say trunk, I meant from a switch perspective as in a 802.1Q trunk 
> port on a switch.
>
>
> I think I got mixed up with the OpenBSD terminology since it is slightly 
> different:

yes.

> So now I just need to find out how the switch interface works in OpenBSD 
> and see if I can get it working with 802.1q tagging and the rest of the 
> L2 networking protocols.

You do not want the "switch" interface type. "bridge" is the one you
need for what you're asking to do, but...

>> Of course an alternate would be to link the 1GbE switch to the 10GbE
>> switch and do things that way, but the above would be more practical
>> from a cabling sense.

...that alternative is the real answer. Using bridge for this will
be a mess (you haven't mentioned PF yet but configuring that will be
a pain) and won't perform particularly well.

With bridge, I *think* you will want to bridge the vlan interfaces
together, not the trunk interfaces.




Re: OpenSMTPD is not sending e-mail.

2021-01-26 Thread Stuart Henderson
On 2021-01-25, latincom  wrote:
> It had worked for many years; but this time OpenBSD 6.8; server and 
> Laptop, are not working as the man page says.
>
> I did an empiric test, because i am not qualified for a real test.
>
> Both are not able to send messages (e-mails), to other machines.
> The message at maillog is the same:
>
> result="TempFail" stat="Network error on destination MXs"

Perhaps your ISP blocks port 25. What do you get if you type
"telnet gmail-smtp-in.l.google.com 25"? It should go something
like this:

$ telnet gmail-smtp-in.l.google.com 25
Trying 66.102.1.27...
Connected to gmail-smtp-in.l.google.com.
Escape character is '^]'.
220 mx.google.com ESMTP k2si3832128wrm.242 - gsmtpquit  
221 2.0.0 closing 
connection k2si3832128wrm.242 - gsmtp
Connection closed by foreign host.




Re: M2 SSD in a PCI-E adapter

2021-01-26 Thread Jan Stary
On Jan 08 08:46:20, mill...@openbsd.org wrote:
> On Fri, 08 Jan 2021 16:19:02 +0100, Jan Stary wrote:
> 
> > I know the disk itself works: this is the disk plugged into
> > an M.2 slot in a Dell Latitude E5570 (full dmesg below):
> > sd0 at scsibus1 targ 0 lun 0:  
> > naa.5001b448b85325
> > 30
> > sd0: 238475MB, 512 bytes/sector, 488397168 sectors, thin
> 
> That is not an NVME SSD, it is an M.2 SATA SSD.  You need a different
> adaptor.

Just to confirm: yes, it's an NVME adaptor.
and a NVME disk works just right in the adaptor.

Thank you.