[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y+Zdi48x+g/Ypre+@corigine.com>
Date: Fri, 10 Feb 2023 16:06:51 +0100
From: Simon Horman <simon.horman@...igine.com>
To: Hariprasad Kelam <hkelam@...vell.com>
Cc: netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
kuba@...nel.org, davem@...emloft.net, pabeni@...hat.com,
edumazet@...gle.com, sgoutham@...vell.com, lcherian@...vell.com,
gakula@...vell.com, jerinj@...vell.com, sbhatta@...vell.com,
jhs@...atatu.com, xiyou.wangcong@...il.com, jiri@...nulli.us,
saeedm@...dia.com, richardcochran@...il.com, tariqt@...dia.com,
linux-rdma@...r.kernel.org, maxtram95@...il.com,
naveenm@...vell.com, bpf@...r.kernel.org,
hariprasad.netdev@...il.com
Subject: Re: [net-next Patch V4 3/4] octeontx2-pf: Refactor schedular queue
alloc/free calls
On Fri, Feb 10, 2023 at 04:40:50PM +0530, Hariprasad Kelam wrote:
> Multiple transmit scheduler queues can be configured at different
> levels to support traffic shaping and scheduling. But on txschq free
> requests, the transmit schedular config in hardware is not getting
> reset. This patch adds support to reset the stale config.
>
> The txschq alloc response handler updates the default txschq
> array which is used to configure the transmit packet path from
> SMQ to TL2 levels. However, for new features such as QoS offload
> that requires it's own txschq queues, this handler is still
> invoked and results in undefined behavior. The code now handles
> txschq response in the mbox caller function.
>
> Signed-off-by: Hariprasad Kelam <hkelam@...vell.com>
> Signed-off-by: Naveen Mamindlapalli <naveenm@...vell.com>
> Signed-off-by: Sunil Kovvuri Goutham <sgoutham@...vell.com>
> ---
> .../ethernet/marvell/octeontx2/af/rvu_nix.c | 45 +++++++++++++++++++
> .../marvell/octeontx2/nic/otx2_common.c | 36 ++++++++-------
> .../ethernet/marvell/octeontx2/nic/otx2_pf.c | 4 --
> .../ethernet/marvell/octeontx2/nic/otx2_vf.c | 4 --
> 4 files changed, 64 insertions(+), 25 deletions(-)
...
> diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
> index 73c8d36b6e12..4cb3fab8baae 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
> +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
> @@ -716,7 +716,8 @@ EXPORT_SYMBOL(otx2_smq_flush);
> int otx2_txsch_alloc(struct otx2_nic *pfvf)
> {
> struct nix_txsch_alloc_req *req;
> - int lvl;
> + struct nix_txsch_alloc_rsp *rsp;
> + int lvl, schq, rc;
>
> /* Get memory to put this msg */
> req = otx2_mbox_alloc_msg_nix_txsch_alloc(&pfvf->mbox);
> @@ -726,8 +727,24 @@ int otx2_txsch_alloc(struct otx2_nic *pfvf)
> /* Request one schq per level */
> for (lvl = 0; lvl < NIX_TXSCH_LVL_CNT; lvl++)
> req->schq[lvl] = 1;
> + rc = otx2_sync_mbox_msg(&pfvf->mbox);
> + if (rc)
> + return rc;
>
> - return otx2_sync_mbox_msg(&pfvf->mbox);
> + rsp = (struct nix_txsch_alloc_rsp *)
> + otx2_mbox_get_rsp(&pfvf->mbox.mbox, 0, &req->hdr);
> + if (IS_ERR(rsp))
> + return PTR_ERR(rsp);
> +
> + /* Setup transmit scheduler list */
> + for (lvl = 0; lvl < NIX_TXSCH_LVL_CNT; lvl++)
> + for (schq = 0; schq < rsp->schq[lvl]; schq++)
> + pfvf->hw.txschq_list[lvl][schq] =
> + rsp->schq_list[lvl][schq];
> +
> + pfvf->hw.txschq_link_cfg_lvl = rsp->link_cfg_lvl;
nit: extra whitespace before '='
> +
> + return 0;
> }
Powered by blists - more mailing lists