* Re: [PATCH v5] vdpa/ifcvf: fix the calculation of queuepair
[not found] <20220923091218.209-1-angus.chen@jaguarmicro.com>
@ 2022-09-23 10:39 ` Michael S. Tsirkin
0 siblings, 0 replies; only message in thread
From: Michael S. Tsirkin @ 2022-09-23 10:39 UTC (permalink / raw)
To: Angus Chen; +Cc: lingshan.zhu, virtualization
On Fri, Sep 23, 2022 at 05:12:18PM +0800, Angus Chen wrote:
> The q_pair_id to address a queue pair in the lm bar should be
> calculated by queue_id / 2 rather than queue_id / nr_vring.
>
> changes in v2:
> - add commitid which to be fixed
> - Acked by Zhu Lingshan <lingshan.zhu@intel.com>
> - no code changes
>
> changes in v3:
> - updated commit log with more info, addressing comments by MST
> - no code changes
>
> changes in v4:
> - updated commit log with Correct syntax, addressing comments by
> - Zhu,Lingsha and MST and Jason Wang <jasowang@redhat.com>
> - no code changes
>
> changes in v5:
> - add Acked and reviewed log of community
changelog after --- pls. if you want to keep changelog in git,
you add it in a note in git, not in commit log.
I can fix that no need to repost.
> Fixes: 2ddae773c93b ("vDPA/ifcvf: detect and use the onboard number of queues directly")
> Signed-off-by: Angus Chen <angus.chen@jaguarmicro.com>
> Reviewed-by: Jason Wang <jasowang@redhat.com>
> Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
> Acked-by: Zhu Lingshan <lingshan.zhu@intel.com>
> ---
> drivers/vdpa/ifcvf/ifcvf_base.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/vdpa/ifcvf/ifcvf_base.c b/drivers/vdpa/ifcvf/ifcvf_base.c
> index 75a703b803a2..3e4486bfa0b7 100644
> --- a/drivers/vdpa/ifcvf/ifcvf_base.c
> +++ b/drivers/vdpa/ifcvf/ifcvf_base.c
> @@ -323,7 +323,7 @@ u16 ifcvf_get_vq_state(struct ifcvf_hw *hw, u16 qid)
> u32 q_pair_id;
>
> ifcvf_lm = (struct ifcvf_lm_cfg __iomem *)hw->lm_cfg;
> - q_pair_id = qid / hw->nr_vring;
> + q_pair_id = qid / 2;
> avail_idx_addr = &ifcvf_lm->vring_lm_cfg[q_pair_id].idx_addr[qid % 2];
> last_avail_idx = vp_ioread16(avail_idx_addr);
>
> @@ -337,7 +337,7 @@ int ifcvf_set_vq_state(struct ifcvf_hw *hw, u16 qid, u16 num)
> u32 q_pair_id;
>
> ifcvf_lm = (struct ifcvf_lm_cfg __iomem *)hw->lm_cfg;
> - q_pair_id = qid / hw->nr_vring;
> + q_pair_id = qid / 2;
> avail_idx_addr = &ifcvf_lm->vring_lm_cfg[q_pair_id].idx_addr[qid % 2];
> hw->vring[qid].last_avail_idx = num;
> vp_iowrite16(num, avail_idx_addr);
> --
> 2.17.1
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-09-23 10:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20220923091218.209-1-angus.chen@jaguarmicro.com>
2022-09-23 10:39 ` [PATCH v5] vdpa/ifcvf: fix the calculation of queuepair Michael S. Tsirkin
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).