From: Ratheesh Kannoth <rkannoth@marvell.com>
To: Yuho Choi <oss.patchbox@gmail.com>
Cc: Sunil Goutham <sgoutham@marvell.com>,
Geetha sowjanya <gakula@marvell.com>,
Subbaraya Sundeep <sbhatta@marvell.com>,
Bharat Bhushan <bbhushan2@marvell.com>,
Hariprasad Kelam <hkelam@marvell.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>,
Jacob Keller <jacob.e.keller@intel.com>, <netdev@vger.kernel.org>
Subject: Re: [PATCH net] octeontx2-pf: QOS: Don't free SQ memory if disabling the SQ fails
Date: Thu, 26 Nov 2026 07:41:57 +0530 [thread overview]
Message-ID: <aweVbaB3p6C1IlXv@rkannoth-OptiPlex-7090> (raw)
In-Reply-To: <20261124190046.415260-2-oss.patchbox@gmail.com>
On 2026-11-25 at 00:30:24, Yuho Choi (oss.patchbox@gmail.com) wrote:
> otx2_qos_disable_sq() asks the AF to disable the QoS send queue, its
> aura and its pool, but ignores the result of otx2_qos_ctx_disable().
> If the mailbox request fails, for example on a timeout or an AQ error,
> the driver cannot confirm that all three contexts have been disabled.
> It frees the SQBs, the pool stack, and the aura flow-control buffer
> anyway, which the hardware may continue to reference.
>
> If the disable fails, log an error and keep the memory: leaking it is
> safer than freeing memory the hardware may still access. If the queue
> is not set up again, otx2_free_hw_resources() frees it later with the
> other queues when the interface goes down, after the SQ and NPA
> contexts of the whole LF have been disabled.
>
> Fixes: ab6dddd2a669 ("octeontx2-pf: qos send queues management")
> Signed-off-by: Yuho Choi <oss.patchbox@gmail.com>
> ---
> Compile-tested only (x86_64 with COMPILE_TEST, OCTEONTX2_PF=m, W=1). I
> don't have OcteonTX2/CN10K hardware, and the disable only fails when
> the mailbox request to the AF fails, so I could not trigger this path.
>
> drivers/net/ethernet/marvell/octeontx2/nic/qos_sq.c | 12 ++++++++++--
> 1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/qos_sq.c b/drivers/net/ethernet/marvell/octeontx2/nic/qos_sq.c
> index 683efce519af..e9ca884cfb4d 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/nic/qos_sq.c
> +++ b/drivers/net/ethernet/marvell/octeontx2/nic/qos_sq.c
> @@ -283,7 +283,7 @@ void otx2_qos_disable_sq(struct otx2_nic *pfvf, int qidx)
> struct otx2_hw *hw = &pfvf->hw;
> struct otx2_snd_queue *sq;
> struct otx2_cq_queue *cq;
> - int pool_id, sq_idx;
> + int pool_id, sq_idx, err;
>
> sq_idx = hw->non_qos_queues + qidx;
>
> @@ -311,8 +311,16 @@ void otx2_qos_disable_sq(struct otx2_nic *pfvf, int qidx)
> otx2_cleanup_tx_cqes(pfvf, cq);
>
> mutex_lock(&pfvf->mbox.lock);
> - otx2_qos_ctx_disable(pfvf, sq_idx, pool_id);
> + err = otx2_qos_ctx_disable(pfvf, sq_idx, pool_id);
> mutex_unlock(&pfvf->mbox.lock);
function calls like otx2_smq_flush(),otx2_qos_nix_npa_ndc_sync() [ these 2,3 lines
above otx2_qos_ctx_disable() ] can also fail. Marvell need to handle those errors in
a seperate patch.
Reviewed-by: Ratheesh Kannoth <rkannoth@marvell.com>
next prev parent reply other threads:[~2026-11-26 2:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-24 19:00 [PATCH net] octeontx2-pf: QOS: Don't free SQ memory if disabling the SQ fails Yuho Choi
2026-11-24 19:02 ` netdev-bot+sinfo
2026-11-26 2:11 ` Ratheesh Kannoth [this message]
2026-11-26 7:00 ` netdev-bot+sashiko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aweVbaB3p6C1IlXv@rkannoth-OptiPlex-7090 \
--to=rkannoth@marvell.com \
--cc=andrew+netdev@lunn.ch \
--cc=bbhushan2@marvell.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=gakula@marvell.com \
--cc=hkelam@marvell.com \
--cc=horms@kernel.org \
--cc=jacob.e.keller@intel.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=oss.patchbox@gmail.com \
--cc=pabeni@redhat.com \
--cc=sbhatta@marvell.com \
--cc=sgoutham@marvell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox