Index | Thread | Search

From:
"Theo de Raadt" <deraadt@openbsd.org>
Subject:
Re: uncm(4): process all notifications in one interrupt transfer
To:
Chris Cappuccio <chris@nmedia.net>
Cc:
Mikolaj Kucharski <mikolaj@kucharski.name>, tech@openbsd.org, Jan Schreiber <jes@posteo.de>
Date:
Mon, 12 Oct 2026 09:16:32 -0600

Download raw body.

Thread
  • Chris Cappuccio:

    uncm(4): process all notifications in one interrupt transfer

    • Theo de Raadt:

      uncm(4): process all notifications in one interrupt transfer

  • David Gwynne:

    uncm(4): process all notifications in one interrupt transfer

  • Chris Cappuccio <chris@nmedia.net> wrote:
    
    > Stefan Sperling [stsp@stsp.name] wrote:
    > > 
    > > Could we copy these messages out of sc_intr_msg into another variable
    > > of struct usb_cdc_notification type with memcpy() after checking sizes?
    > > 
    > > We must avoid unaligned access on some platforms OpenBSD supports. Just
    > > casting a uint8_t * type to a struct * type could make us end up in ddb
    > > on such platforms if the device doesn't align its messages as expected
    > > by the platform.
    > > 
    > > I realize this makes the driver slower and we're already copying data from
    > > and to USB transfers. But complicated message framing like this has a cost.
    > > 
    > 
    > there's always __STRICT_ALIGNMENT so network drivers can choose an
    > optimal path
    > 
    > #ifdef __STRICT_ALIGNMENT
    >  copies
    > #else
    >  maybe less copies
    > #endif
    > 
    
    Please don't do that.  The code in the #ifdef will rot.
    
    
  • Chris Cappuccio:

    uncm(4): process all notifications in one interrupt transfer

  • David Gwynne:

    uncm(4): process all notifications in one interrupt transfer