[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250627165942.1f70a6da@kernel.org>
Date: Fri, 27 Jun 2025 16:59:42 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Subbaraya Sundeep <sbhatta@...vell.com>
Cc: <andrew+netdev@...n.ch>, <davem@...emloft.net>, <edumazet@...gle.com>,
<pabeni@...hat.com>, <sgoutham@...vell.com>, <gakula@...vell.com>,
<hkelam@...vell.com>, <bbhushan2@...vell.com>, <netdev@...r.kernel.org>,
Suman Ghosh <sumang@...vell.com>
Subject: Re: [net-next PATCH] octeontx2-pf: Check for DMAC extraction before
setting VF DMAC
On Wed, 25 Jun 2025 17:00:02 +0530 Subbaraya Sundeep wrote:
> + /* Check if NPC_DMAC feature is set in NPC. If not set then
> + * return from the function.
> + */
> + mutex_lock(&pf->mbox.lock);
> + req = otx2_mbox_alloc_msg_npc_get_field_status(&pf->mbox);
> + if (!req) {
> + mutex_unlock(&pf->mbox.lock);
> + return -ENOMEM;
> + }
> +
> + req->field = NPC_DMAC;
> + ret = otx2_sync_mbox_msg(&pf->mbox);
> + if (ret) {
> + mutex_unlock(&pf->mbox.lock);
> + return ret;
> + }
> +
> + rsp = (struct npc_get_field_status_rsp *)otx2_mbox_get_rsp
> + (&pf->mbox.mbox, 0, &req->hdr);
This is too ugly. Cast it to a void pointer to avoid the super long
line.
> + if (IS_ERR(rsp)) {
> + mutex_unlock(&pf->mbox.lock);
> + return PTR_ERR(rsp);
> + }
> +
> + mutex_unlock(&pf->mbox.lock);
> +
> + if (!rsp->enable)
> + return 0;
Please send as a fix, and factor this out to a helper.
--
pw-bot: cr
Powered by blists - more mailing lists