Michael S. Tsirkin
2022-Sep-22 11:43 UTC
[PATCH] vDPA/ifcvf: fix the Calculation of queuepair
Thanks! Let's see if we get an ack. Minor things for the future (in case a new version will be needed): Subject should include the patch version. Also pls avoid capital letters in the middle of the sentence. E.g. [PATCH v3] vDPA/ifcvf: fix the calculation of queuepair On Thu, Sep 22, 2022 at 07:00:17PM +0800, Angus Chen wrote:> The queuepair should be divided by 2 > It should not be hw->nr_vring when multi-queue feature was enabled > fix commit 2ddae773c93b ("detect and use the onboard number ")An extra " " here at the end. It's also a good idea to add: Fixes: 2ddae773c93b ("detect and use the onboard number")> > Signed-off-by: Angus Chen <angus.chen at jaguarmicro.com>> ---A good thing to add here is a changelog. In this case the patch is unchanged, so you would write: changes in v2: - updated commit log with more info, addressing comments by MST - no code changes add more versions to this as you are revising the patch.> 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