Commit 6f84622d authored by Zhu Lingshan's avatar Zhu Lingshan Committed by Michael S. Tsirkin

vDPA/ifcvf: cacheline alignment for ifcvf_hw

This commit introduces a new cacheline aligned layout for
ifcvf_hw.
Signed-off-by: default avatarZhu Lingshan <lingshan.zhu@intel.com>
Link: https://lore.kernel.org/r/20220222115428.998334-6-lingshan.zhu@intel.comSigned-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent 9b3e8148
...@@ -340,10 +340,8 @@ int ifcvf_set_vq_state(struct ifcvf_hw *hw, u16 qid, u16 num) ...@@ -340,10 +340,8 @@ int ifcvf_set_vq_state(struct ifcvf_hw *hw, u16 qid, u16 num)
static int ifcvf_hw_enable(struct ifcvf_hw *hw) static int ifcvf_hw_enable(struct ifcvf_hw *hw)
{ {
struct virtio_pci_common_cfg __iomem *cfg; struct virtio_pci_common_cfg __iomem *cfg;
struct ifcvf_adapter *ifcvf;
u32 i; u32 i;
ifcvf = vf_to_adapter(hw);
cfg = hw->common_cfg; cfg = hw->common_cfg;
for (i = 0; i < hw->nr_vring; i++) { for (i = 0; i < hw->nr_vring; i++) {
if (!hw->vring[i].ready) if (!hw->vring[i].ready)
...@@ -366,10 +364,8 @@ static int ifcvf_hw_enable(struct ifcvf_hw *hw) ...@@ -366,10 +364,8 @@ static int ifcvf_hw_enable(struct ifcvf_hw *hw)
static void ifcvf_hw_disable(struct ifcvf_hw *hw) static void ifcvf_hw_disable(struct ifcvf_hw *hw)
{ {
struct virtio_pci_common_cfg __iomem *cfg;
u32 i; u32 i;
cfg = hw->common_cfg;
ifcvf_set_config_vector(hw, VIRTIO_MSI_NO_VECTOR); ifcvf_set_config_vector(hw, VIRTIO_MSI_NO_VECTOR);
for (i = 0; i < hw->nr_vring; i++) { for (i = 0; i < hw->nr_vring; i++) {
ifcvf_set_vq_vector(hw, i, VIRTIO_MSI_NO_VECTOR); ifcvf_set_vq_vector(hw, i, VIRTIO_MSI_NO_VECTOR);
......
...@@ -66,16 +66,18 @@ struct ifcvf_hw { ...@@ -66,16 +66,18 @@ struct ifcvf_hw {
u8 __iomem *isr; u8 __iomem *isr;
/* Live migration */ /* Live migration */
u8 __iomem *lm_cfg; u8 __iomem *lm_cfg;
u16 nr_vring;
/* Notification bar number */ /* Notification bar number */
u8 notify_bar; u8 notify_bar;
u8 msix_vector_status;
/* virtio-net or virtio-blk device config size */
u32 config_size;
/* Notificaiton bar address */ /* Notificaiton bar address */
void __iomem *notify_base; void __iomem *notify_base;
phys_addr_t notify_base_pa; phys_addr_t notify_base_pa;
u32 notify_off_multiplier; u32 notify_off_multiplier;
u32 dev_type;
u64 req_features; u64 req_features;
u64 hw_features; u64 hw_features;
u32 dev_type;
struct virtio_pci_common_cfg __iomem *common_cfg; struct virtio_pci_common_cfg __iomem *common_cfg;
void __iomem *dev_cfg; void __iomem *dev_cfg;
struct vring_info vring[IFCVF_MAX_QUEUES]; struct vring_info vring[IFCVF_MAX_QUEUES];
...@@ -84,9 +86,7 @@ struct ifcvf_hw { ...@@ -84,9 +86,7 @@ struct ifcvf_hw {
struct vdpa_callback config_cb; struct vdpa_callback config_cb;
int config_irq; int config_irq;
int vqs_reused_irq; int vqs_reused_irq;
/* virtio-net or virtio-blk device config size */ u16 nr_vring;
u32 config_size;
u8 msix_vector_status;
}; };
struct ifcvf_adapter { struct ifcvf_adapter {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment