From: stsp Date: Thu, 8 Feb 2024 11:20:29 +0000 (+0000) Subject: mark full qwx(4) Tx queues, such that the OACTIVE mechanism will be used X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=ac51647de41f7479a3cba091c47c7ffd665418b5;p=openbsd mark full qwx(4) Tx queues, such that the OACTIVE mechanism will be used Not quite tested yet. It is very hard to fill the queues at present because Tx operation will freeze when we try. To be investigated next. --- diff --git a/sys/dev/ic/qwx.c b/sys/dev/ic/qwx.c index 4034a7ca719..8575f59587e 100644 --- a/sys/dev/ic/qwx.c +++ b/sys/dev/ic/qwx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: qwx.c,v 1.22 2024/02/08 11:16:49 stsp Exp $ */ +/* $OpenBSD: qwx.c,v 1.23 2024/02/08 11:20:29 stsp Exp $ */ /* * Copyright 2023 Stefan Sperling @@ -12729,6 +12729,9 @@ qwx_wmi_process_mgmt_tx_comp(struct qwx_softc *sc, if (arvif->txmgmt.queued > 0) arvif->txmgmt.queued--; + if (arvif->txmgmt.queued < nitems(arvif->txmgmt.data) - 1) + sc->qfullmsk &= ~(1U << QWX_MGMT_QUEUE_ID); + if (tx_compl_param->status != 0) ifp->if_oerrors++; } @@ -14801,6 +14804,9 @@ qwx_dp_tx_completion_handler(struct qwx_softc *sc, int ring_id) qwx_dp_tx_complete_msdu(sc, tx_ring, msdu_id, &ts); } + if (tx_ring->queued < sc->hw_params.tx_ring_size - 1) + sc->qfullmsk &= ~(1 << ring_id); + return 0; } @@ -22234,6 +22240,10 @@ qwx_dp_tx(struct qwx_softc *sc, struct qwx_vif *arvif, uint8_t pdev_id, #endif tx_ring->queued++; tx_ring->cur = (tx_ring->cur + 1) % sc->hw_params.tx_ring_size; + + if (tx_ring->queued >= sc->hw_params.tx_ring_size - 1) + sc->qfullmsk |= (1 << ti.ring_id); + return 0; } @@ -22335,6 +22345,10 @@ qwx_mac_mgmt_tx_wmi(struct qwx_softc *sc, struct qwx_vif *arvif, txmgmt->cur = (txmgmt->cur + 1) % nitems(txmgmt->data); txmgmt->queued++; + + if (txmgmt->queued >= nitems(txmgmt->data) - 1) + sc->qfullmsk |= (1U << QWX_MGMT_QUEUE_ID); + return 0; err_unmap_buf: diff --git a/sys/dev/ic/qwxvar.h b/sys/dev/ic/qwxvar.h index 68fd58d12a5..bbf99a368a8 100644 --- a/sys/dev/ic/qwxvar.h +++ b/sys/dev/ic/qwxvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: qwxvar.h,v 1.12 2024/02/06 14:18:15 stsp Exp $ */ +/* $OpenBSD: qwxvar.h,v 1.13 2024/02/08 11:20:29 stsp Exp $ */ /* * Copyright (c) 2018-2019 The Linux Foundation. @@ -1675,6 +1675,7 @@ struct qwx_softc { int sc_tx_timer; uint32_t qfullmsk; +#define QWX_MGMT_QUEUE_ID 31 bus_addr_t mem; struct ath11k_hw_params hw_params;