* Re: [PATCH v3] vdpa/ifcvf: fix the calculation of queuepair
[not found] <20220923010356.2084-1-angus.chen@jaguarmicro.com>
@ 2022-09-23 5:30 ` Michael S. Tsirkin
[not found] ` <21c4c74a-e340-0aaf-80b4-413d968144c5@intel.com>
1 sibling, 0 replies; 3+ messages in thread
From: Michael S. Tsirkin @ 2022-09-23 5:30 UTC (permalink / raw)
To: Angus Chen; +Cc: lingshan.zhu, virtualization
On Fri, Sep 23, 2022 at 09:03:56AM +0800, Angus Chen wrote:
> The queuepair should be divided by 2 and
> it should not be hw->nr_vring when multi-queue feature was enabled
>
> Fixes: 2ddae773c93b ("vDPA/ifcvf: detect and use the onboard number of queues directly")
>
> changes in v2:
> - add commitid which to be fixed
> - no code changes
>
> changes in v3:
> - updated commit log with more info, addressing comments by MST
> - no code changes
Note the changelog should go after -- not before that.
And all tags such as Fixes: and Signed-off-by: be together
without empty lines separating them.
> Signed-off-by: Angus Chen <angus.chen@jaguarmicro.com>
and if code is unchanged then it's acceptable (and preferred) to carry forward
acks from previous versions, such as the one from Zhu Lingshan.
same if code is changed but trivially.
> ---
> 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] 3+ messages in thread
* Re: [PATCH v3] vdpa/ifcvf: fix the calculation of queuepair
[not found] ` <21c4c74a-e340-0aaf-80b4-413d968144c5@intel.com>
@ 2022-09-23 5:32 ` Michael S. Tsirkin
[not found] ` <5494f583-1672-2246-9030-5b8b870ad430@intel.com>
0 siblings, 1 reply; 3+ messages in thread
From: Michael S. Tsirkin @ 2022-09-23 5:32 UTC (permalink / raw)
To: Zhu, Lingshan; +Cc: virtualization, Angus Chen
On Fri, Sep 23, 2022 at 11:21:41AM +0800, Zhu, Lingshan wrote:
>
>
> On 9/23/2022 9:03 AM, Angus Chen wrote:
> > The queuepair should be divided by 2 and
> > it should not be hw->nr_vring when multi-queue feature was enabled
> This is not about MQ, even no MQ, there are still space in the cap storing
> (though invalid)queue states that can be addressed.
> So I think just describe q_pair_id = qid / 2 here.
hmm without MQ qid is always 0 or 1 so the old calculation
and the new one give the same result right?
I guess this is what Angus Chen meant.
Would you mind writing a good commit log for us then?
> for the code change:
> Acked-by: Zhu Lingshan<lingshan.zhu@intel.com>
>
> Thanks
> > Fixes: 2ddae773c93b ("vDPA/ifcvf: detect and use the onboard number of queues directly")
> >
> > changes in v2:
> > - add commitid which to be fixed
> > - no code changes
> >
> > changes in v3:
> > - updated commit log with more info, addressing comments by MST
> > - no code changes
> >
> > Signed-off-by: Angus Chen <angus.chen@jaguarmicro.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);
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v3] vdpa/ifcvf: fix the calculation of queuepair
[not found] ` <5494f583-1672-2246-9030-5b8b870ad430@intel.com>
@ 2022-09-23 6:02 ` Michael S. Tsirkin
0 siblings, 0 replies; 3+ messages in thread
From: Michael S. Tsirkin @ 2022-09-23 6:02 UTC (permalink / raw)
To: Zhu, Lingshan; +Cc: virtualization, Angus Chen
On Fri, Sep 23, 2022 at 01:43:36PM +0800, Zhu, Lingshan wrote:
>
>
> On 9/23/2022 1:32 PM, Michael S. Tsirkin wrote:
> > On Fri, Sep 23, 2022 at 11:21:41AM +0800, Zhu, Lingshan wrote:
> > >
> > > On 9/23/2022 9:03 AM, Angus Chen wrote:
> > > > The queuepair should be divided by 2 and
> > > > it should not be hw->nr_vring when multi-queue feature was enabled
> > > This is not about MQ, even no MQ, there are still space in the cap storing
> > > (though invalid)queue states that can be addressed.
> > > So I think just describe q_pair_id = qid / 2 here.
> > hmm without MQ qid is always 0 or 1 so the old calculation
> > and the new one give the same result right?
> Yes, if no MQ, the queue pair id is always 0. The original code
> is buggy anyway, we need the queue pair id = qid /2 even without MQ.
>
> If there are 8 queues, even no MQ feature bit negotiated, the HW
> still stores the queue states though invalid but can be addressed.
>
> And we are working on a new layout of this LM cap/bar.
> > I guess this is what Angus Chen meant.
> > Would you mind writing a good commit log for us then?
> I think it can be as easy as:
> The q_pair_id to address a queue pair in the lm bar should be
> calculated by queue_id / 2 than queue_id / nr_vring
English requires "rather than" and not "than" here. Otherwise, ok.
Angus Chen could you post v4 with this corrected and Lingshan Zhu's
ack included please?
> Thanks,
> Zhu Lingshan
> >
> > > for the code change:
> > > Acked-by: Zhu Lingshan<lingshan.zhu@intel.com>
> > >
> > > Thanks
> > > > Fixes: 2ddae773c93b ("vDPA/ifcvf: detect and use the onboard number of queues directly")
> > > >
> > > > changes in v2:
> > > > - add commitid which to be fixed
> > > > - no code changes
> > > >
> > > > changes in v3:
> > > > - updated commit log with more info, addressing comments by MST
> > > > - no code changes
> > > >
> > > > Signed-off-by: Angus Chen <angus.chen@jaguarmicro.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);
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-09-23 6:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20220923010356.2084-1-angus.chen@jaguarmicro.com>
2022-09-23 5:30 ` [PATCH v3] vdpa/ifcvf: fix the calculation of queuepair Michael S. Tsirkin
[not found] ` <21c4c74a-e340-0aaf-80b4-413d968144c5@intel.com>
2022-09-23 5:32 ` Michael S. Tsirkin
[not found] ` <5494f583-1672-2246-9030-5b8b870ad430@intel.com>
2022-09-23 6:02 ` 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).