Index | Thread | Search

From:
Alexander Bluhm <bluhm@openbsd.org>
Subject:
Re: clear ice(4) OACTIVE flag on reset
To:
tech@openbsd.org
Date:
Thu, 3 Apr 2025 17:45:53 +0200

Download raw body.

Thread
On Thu, Apr 03, 2025 at 04:07:06PM +0200, Stefan Sperling wrote:
> bluhm@ noticed that ice(4) never clears the OACTIVE flag once it is set,
> not even after ifconfig down/up. The patch below should fix this.

OK bluhm@

> I noticed that ixl(4), which is what I based this code on, does not
> seem to be calling ifq_clr_oactive() either.
> Am I missing something or does ixl(4) suffer from the same bug?

I never ran into hanging oactive on ixl(4).  But looking into the
code I would say this also not correct.

bluhm

> M  sys/dev/pci/if_ice.c  |  10+  0-
> 
> 1 file changed, 10 insertions(+), 0 deletions(-)
> 
> commit - e674ff4efec7cbf97d8e840abe7d4932a91406a2
> commit + 0336eca967bec836ac7dbcfb34458c7d7f036338
> blob - bd0dce1b0ea933c29b54da3b432b5fb3e4eac94e
> blob + 3c1b9b72bc178e04c330e03ceff2eb3268a028b2
> --- sys/dev/pci/if_ice.c
> +++ sys/dev/pci/if_ice.c
> @@ -13077,6 +13077,13 @@ ice_up(struct ice_softc *sc)
>  
>  	ifp->if_flags |= IFF_RUNNING;
>  
> +	for (i = 0; i < vsi->num_tx_queues; i++) {
> +		struct ice_tx_queue *txq = &vsi->tx_queues[i];
> +		struct ifqueue *ifq = txq->txq_ifq;
> +
> +		ifq_clr_oactive(ifq);
> +	}
> +
>  	ice_set_state(&sc->state, ICE_STATE_DRIVER_INITIALIZED);
>  	rw_exit_write(&sc->sc_cfg_lock);
>  	return 0;
> @@ -13379,6 +13386,7 @@ ice_flush_txq_interrupts(struct ice_vsi *vsi)
>  void
>  ice_txq_clean(struct ice_softc *sc, struct ice_tx_queue *txq)
>  {
> +	struct ifqueue *ifq = txq->txq_ifq;
>  	struct ice_tx_map *txm;
>  	bus_dmamap_t map;
>  	unsigned int i;
> @@ -13400,6 +13408,8 @@ ice_txq_clean(struct ice_softc *sc, struct ice_tx_queu
>  	}
>  
>  	txq->txq_cons = txq->txq_prod = 0;
> +
> +	ifq_clr_oactive(ifq);
>  }
>  
>  void