From: Paolo Abeni <pabeni@redhat.com>
To: Hariprasad Kelam <hkelam@marvell.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: kuba@kernel.org, davem@davemloft.net, edumazet@google.com,
sgoutham@marvell.com, lcherian@marvell.com, gakula@marvell.com,
jerinj@marvell.com, sbhatta@marvell.com, jhs@mojatatu.com,
xiyou.wangcong@gmail.com, jiri@resnulli.us, saeedm@nvidia.com,
richardcochran@gmail.com, tariqt@nvidia.com,
linux-rdma@vger.kernel.org, maxtram95@gmail.com,
naveenm@marvell.com, hariprasad.netdev@gmail.com
Subject: Re: [net-next PATCH V3 2/4] octeontx2-pf: qos send queues management
Date: Tue, 07 Feb 2023 13:27:58 +0100 [thread overview]
Message-ID: <f5fd80ab32931e7367c3181635f40179536608b8.camel@redhat.com> (raw)
In-Reply-To: <20230206054640.5854-3-hkelam@marvell.com>
On Mon, 2023-02-06 at 11:16 +0530, Hariprasad Kelam wrote:
> diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
> index 8a41ad8ca04f..f3ad4491ffb8 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
> +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
> @@ -758,11 +758,16 @@ int otx2_txschq_stop(struct otx2_nic *pfvf)
> void otx2_sqb_flush(struct otx2_nic *pfvf)
> {
> int qidx, sqe_tail, sqe_head;
> + struct otx2_snd_queue *sq;
> u64 incr, *ptr, val;
> int timeout = 1000;
>
> ptr = (u64 *)otx2_get_regaddr(pfvf, NIX_LF_SQ_OP_STATUS);
> - for (qidx = 0; qidx < pfvf->hw.tot_tx_queues; qidx++) {
> + for (qidx = 0; qidx < otx2_get_total_tx_queues(pfvf);
> + qidx++) {
The above can and should fit a single line.
> @@ -189,7 +190,8 @@ struct otx2_hw {
> u16 rx_queues;
> u16 tx_queues;
> u16 xdp_queues;
> - u16 tot_tx_queues;
> + u16 tc_tx_queues;
> + u16 non_qos_queues; //tx_queues and xdp_tx_queues
Please, avoid c++ style comments. Use plain /* */ instead.
> u16 max_queues;
> u16 pool_cnt;
> u16 rqpool_cnt;
[...]
> diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/qos_sq.c b/drivers/net/ethernet/marvell/octeontx2/nic/qos_sq.c
> new file mode 100644
> index 000000000000..13a8cc53eb19
[...]
> +static void otx2_qos_sq_free_sqbs(struct otx2_nic *pfvf, int qidx)
> +{
> + struct otx2_qset *qset = &pfvf->qset;
> + struct otx2_hw *hw = &pfvf->hw;
> + struct otx2_snd_queue *sq;
> + u64 iova, pa;
> + int sqb;
> +
> + sq = &qset->sq[qidx];
> + if (!sq->sqb_ptrs)
> + return;
> + for (sqb = 0; sqb < sq->sqb_count; sqb++) {
> + if (!sq->sqb_ptrs[sqb])
> + continue;
> + iova = sq->sqb_ptrs[sqb];
> + pa = otx2_iova_to_phys(pfvf->iommu_domain, iova);
> + dma_unmap_page_attrs(pfvf->dev, iova, hw->sqb_size,
> + DMA_FROM_DEVICE,
> + DMA_ATTR_SKIP_CPU_SYNC);
> + put_page(virt_to_page(phys_to_virt(pa)));
> + }
> +
> + sq->sqb_count = 0;
> +
> + sq = &qset->sq[qidx];
> + qmem_free(pfvf->dev, sq->sqe);
> + qmem_free(pfvf->dev, sq->tso_hdrs);
> + kfree(sq->sg);
> + kfree(sq->sqb_ptrs);
> + qmem_free(pfvf->dev, sq->timestamps);
> +
> + memset((void *)sq, 0, sizeof(*sq));
> +}
> +
> +/* send queue id */
> +static void otx2_qos_sqb_flush(struct otx2_nic *pfvf, int qidx)
> +{
> + int sqe_tail, sqe_head;
> + u64 incr, *ptr, val;
> +
> + ptr = (u64 *)otx2_get_regaddr(pfvf, NIX_LF_SQ_OP_STATUS);
This introduces a sparse warning:
drivers/net/ethernet/marvell/octeontx2/nic/qos_sq.c:164:16: warning: cast removes address space '__iomem' of expression
...
> + incr = (u64)qidx << 32;
> + val = otx2_atomic64_add(incr, ptr);
... which means the above is likely broken on some arches.
Thanks,
Paolo
next prev parent reply other threads:[~2023-02-07 12:28 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-06 5:46 [net-next PATCH V3 0/4] octeontx2-pf: HTB offload support Hariprasad Kelam
2023-02-06 5:46 ` [net-next PATCH V3 1/4] sch_htb: Allow HTB priority parameter in offload mode Hariprasad Kelam
2023-02-06 5:46 ` [net-next PATCH V3 2/4] octeontx2-pf: qos send queues management Hariprasad Kelam
2023-02-07 12:27 ` Paolo Abeni [this message]
2023-02-08 17:04 ` [EXT] " Hariprasad Kelam
2023-02-06 5:46 ` [net-next PATCH V3 3/4] octeontx2-pf: Refactor schedular queue alloc/free calls Hariprasad Kelam
2023-02-06 5:46 ` [net-next PATCH V3 4/4] octeontx2-pf: Add support for HTB offload Hariprasad Kelam
2023-02-07 12:48 ` Paolo Abeni
2023-02-09 16:03 ` Hariprasad Kelam
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=f5fd80ab32931e7367c3181635f40179536608b8.camel@redhat.com \
--to=pabeni@redhat.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gakula@marvell.com \
--cc=hariprasad.netdev@gmail.com \
--cc=hkelam@marvell.com \
--cc=jerinj@marvell.com \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=lcherian@marvell.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=maxtram95@gmail.com \
--cc=naveenm@marvell.com \
--cc=netdev@vger.kernel.org \
--cc=richardcochran@gmail.com \
--cc=saeedm@nvidia.com \
--cc=sbhatta@marvell.com \
--cc=sgoutham@marvell.com \
--cc=tariqt@nvidia.com \
--cc=xiyou.wangcong@gmail.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;
as well as URLs for NNTP newsgroup(s).