projects
/
linux-2.6-microblaze.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'address-masking'
[linux-2.6-microblaze.git]
/
drivers
/
vdpa
/
ifcvf
/
ifcvf_base.c
diff --git
a/drivers/vdpa/ifcvf/ifcvf_base.c
b/drivers/vdpa/ifcvf/ifcvf_base.c
index
060f837
..
472daa5
100644
(file)
--- a/
drivers/vdpa/ifcvf/ifcvf_base.c
+++ b/
drivers/vdpa/ifcvf/ifcvf_base.c
@@
-69,20
+69,19
@@
static int ifcvf_read_config_range(struct pci_dev *dev,
return 0;
}
return 0;
}
-
static
u16 ifcvf_get_vq_size(struct ifcvf_hw *hw, u16 qid)
+u16 ifcvf_get_vq_size(struct ifcvf_hw *hw, u16 qid)
{
u16 queue_size;
{
u16 queue_size;
+ if (qid >= hw->nr_vring)
+ return 0;
+
vp_iowrite16(qid, &hw->common_cfg->queue_select);
queue_size = vp_ioread16(&hw->common_cfg->queue_size);
return queue_size;
}
vp_iowrite16(qid, &hw->common_cfg->queue_select);
queue_size = vp_ioread16(&hw->common_cfg->queue_size);
return queue_size;
}
-/* This function returns the max allowed safe size for
- * all virtqueues. It is the minimal size that can be
- * suppprted by all virtqueues.
- */
u16 ifcvf_get_max_vq_size(struct ifcvf_hw *hw)
{
u16 queue_size, max_size, qid;
u16 ifcvf_get_max_vq_size(struct ifcvf_hw *hw)
{
u16 queue_size, max_size, qid;
@@
-94,7
+93,7
@@
u16 ifcvf_get_max_vq_size(struct ifcvf_hw *hw)
if (!queue_size)
continue;
if (!queue_size)
continue;
- max_size = m
in
(queue_size, max_size);
+ max_size = m
ax
(queue_size, max_size);
}
return max_size;
}
return max_size;