vdpa/ifcvf: fix the calculation of queuepair
authorAngus Chen <angus.chen@jaguarmicro.com>
Fri, 23 Sep 2022 09:10:13 +0000 (17:10 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Oct 2022 08:39:43 +0000 (10:39 +0200)
commita0e3719e030a631e9148fb760a644d5aeffbb06d
tree6faaac9354454fca0c4a94d01169e2cdfbdeacc6
parent4755d9d2c9b08f975b9b0a794deebb17412f2be0
vdpa/ifcvf: fix the calculation of queuepair

[ Upstream commit db5db1a00d0816207be3a0166fcb4f523eaf3b52 ]

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.

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>
Message-Id: <20220923091013.191-1-angus.chen@jaguarmicro.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/vdpa/ifcvf/ifcvf_base.c