re(4): watchdog timeout and temporally disable MSI interrupt

2022-09-30 Thread Joseph Boese
Thank you so much Mr. Takayoshi for this simple patch as it allowed me to move 
forward on using OpenBSD as my sys-net qube in QubesOS.  I simply had to build 
and shove if_re_pci.o in the proper directory and do a reorder_kernel.  I 
imagine anyone with an RT8168 chipset trying to run OpenBSD in a Xen guest is 
seeing this issue.  Considering that is the chipset that comes with my Dell 
Inspiron and ton of other computers it's probably a very common chipset.  The 
venn diagram of people interested in OpenBSD security and QubesOS is probably 
significant as well.  Be great if some fix for this winds up in the next 
version of OpenBSD as having to roll your own is a bit of pain but again 
grateful for this patch sir.

>List:   openbsd-tech
>Subject:re(4): watchdog timeout and temporally disable MSI interrupt
>From:   SASANO Takayoshi 
>Date:   2022-08-07 11:27:19
>Message-ID: 87zgggway0.wl-uaa () mx5 ! nisiq ! net
>Hi,

>Sometimes I see "re0: watchdog timeout" message on my amd64 PC.


>I suspect this caused by MSI interrupt so I tweaked if_re_pci.c like this:

>--- if_re_pci.c~ Sat Mar 12 03:00:48 2022
>+++ if_re_pci.c  Sat Jun 11 19:35:17 2022
@@ -159,7 +159,7 @@
  }

> /* Allocate interrupt */
>-if (pci_intr_map_msi(pa, &ih) == 0)
>+if (/*pci_intr_map_msi(pa, &ih) ==*/ 0)
>   sc->rl_flags |= RL_FLAG_MSI;
> else if (pci_intr_map(pa, &ih) != 0) {
>   printf(": couldn't map interrupt\n");

>After this modify, I do not see "watchdog timeout".

>I want to know how many people see this timeout of re(4) and
>that is solved by this MSI tweak.

>Or, please tell me if there is any other workarounds.

>Regards,
>--
>SASANO Takayoshi (JG1UAA) 


Re: wc(1): add -L flag to write length of longest line

2022-09-30 Thread Theo de Raadt
Todd C. Miller  wrote:

> On Thu, 29 Sep 2022 23:30:54 -0400, Daniel Dickman wrote:
> 
> > > On Sep 29, 2022, at 8:24 PM, Joerg Sonnenberger  wrote:
> > > 
> > > On Thu, Sep 29, 2022 at 08:39:16PM +1000, Jonathan Gray wrote:
> > >> wc counts items in files.  Finding the longest item indeed sounds
> > >> like a task better suited to awk.
> >
> > Doesn’t gnu wc show that tabs have length 8 rather than length 1?
> 
> Yes.
> 
> > Do the other wc implementations differ?
> 
> FreeBSD and NetBSD "wc -L" counts it as a single character.

How about if I want a feature that finds the shortest line?
Will that be -S?

And what about a feature to count dangling whitespace at the end of
lines?  -W looks available for use. Actually there are many flag
characters available, because wc hasn't jumped the shark yet, as ls did.

Imagine the eventual synopsis, it kind of rolls off the tongue

NAME
wc - word, line, and byte or character, or longest or shortest
 line, or dangling whitespace count

I'm looking forward to wc being able to edit files, and for further
extensibility because awk is slow, it can include a lisp interpreter.
Or maybe it should compile and run rust programs?  Safer that way.

I'm sure there are other people have other desireable features which I
haven't listed. For instance, could wc.c be the scaffold to use for the
long-desired web browser to be included in OpenBSD?



Re: wc(1): add -L flag to write length of longest line

2022-09-30 Thread Todd C . Miller
On Thu, 29 Sep 2022 23:30:54 -0400, Daniel Dickman wrote:

> > On Sep 29, 2022, at 8:24 PM, Joerg Sonnenberger  wrote:
> > 
> > On Thu, Sep 29, 2022 at 08:39:16PM +1000, Jonathan Gray wrote:
> >> wc counts items in files.  Finding the longest item indeed sounds
> >> like a task better suited to awk.
>
> Doesn’t gnu wc show that tabs have length 8 rather than length 1?

Yes.

> Do the other wc implementations differ?

FreeBSD and NetBSD "wc -L" counts it as a single character.

 - todd