Index | Thread | Search

From:
Stefan Fritsch <sf@openbsd.org>
Subject:
Re: vio: Reduce code duplication in control queue handling
To:
Claudio Jeker <cjeker@diehard.n-r-g.com>
Cc:
Alexander Bluhm <alexander.bluhm@gmx.net>, tech@openbsd.org
Date:
Fri, 6 Sep 2024 10:49:38 +0200

Download raw body.

Thread
  • Stefan Fritsch:

    vio(4) multi-queue V6

  • On Fri, 6 Sep 2024, Claudio Jeker wrote:
    
    > On Fri, Sep 06, 2024 at 10:18:52AM +0200, Stefan Fritsch wrote:
    > > Hi,
    > > 
    > > On Wed, 4 Sep 2024, Alexander Bluhm wrote:
    > > > Comments inline.
    > > 
    > > Some answers inline. New diff below.
    > > 
    > > > >  
    > > > > -	if ((r = vio_wait_ctrl(sc)) != 0)
    > > > > -		return r;
    > > > > +	while (sc->sc_ctrl_inuse != FREE) {
    > > > > +		if (sc->sc_ctrl_inuse == RESET || vio_needs_reset(sc))
    > > > > +			return ENXIO;
    > > > > +		r = tsleep_nsec(&sc->sc_ctrl_inuse, PRIBIO, "viowait", INFSLP);
    > > > 
    > > > The old code aborted if sleep() returned an error.
    > > 
    > > In the absence of PCATCH or a timeout, tsleep should not return an error. 
    > > But I added a return anyway.
    > 
    > Correct. This should not return an error. Maybe a KASSERT is enough.
    > I wonder why this uses PRIBIO here? This is not a disk IO wait.
    
    There is no PRINET/PNET. Not sure which value would be correct here. Some 
    drivers use 0, which would be PSWP, some use PWAIT, others use PRIBIO. I 
    suspect it does not matter much?
    
    
    
  • Stefan Fritsch:

    vio(4) multi-queue V6