summaryrefslogtreecommitdiff
path: root/include/linux/net
diff options
context:
space:
mode:
authorJoshua Hay <joshua.a.hay@intel.com>2025-07-09 00:05:54 +0300
committerTony Nguyen <anthony.l.nguyen@intel.com>2025-07-14 20:57:51 +0300
commit6aa53e861c1a0c042690c9b7c5c153088ae61079 (patch)
tree50be086f7164f04e3b70d68619e8fe6153f6fc43 /include/linux/net
parented6e1c8796a4fad45e61e3a0c4d9f90b62809052 (diff)
downloadlinux-6aa53e861c1a0c042690c9b7c5c153088ae61079.tar.xz
idpf: implement get LAN MMIO memory regions
The RDMA driver needs to map its own MMIO regions for the sake of performance, meaning the IDPF needs to avoid mapping portions of the BAR space. However, to be HW agnostic, the IDPF cannot assume where these are and must avoid mapping hard coded regions as much as possible. The IDPF maps the bare minimum to load and communicate with the control plane, i.e., the mailbox registers and the reset state registers. Because of how and when mailbox register offsets are initialized, it is easier to adjust the existing defines to be relative to the mailbox region starting address. Use a specific mailbox register write function that uses these relative offsets. The reset state register addresses are calculated the same way as for other registers, described below. The IDPF then calls a new virtchnl op to fetch a list of MMIO regions that it should map. The addresses for the registers in these regions are calculated by determining what region the register resides in, adjusting the offset to be relative to that region, and then adding the register's offset to that region's mapped address. If the new virtchnl op is not supported, the IDPF will fallback to mapping the whole bar. However, it will still map them as separate regions outside the mailbox and reset state registers. This way we can use the same logic in both cases to access the MMIO space. Reviewed-by: Madhu Chittim <madhu.chittim@intel.com> Signed-off-by: Joshua Hay <joshua.a.hay@intel.com> Signed-off-by: Tatyana Nikolova <tatyana.e.nikolova@intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Diffstat (limited to 'include/linux/net')
-rw-r--r--include/linux/net/intel/iidc_rdma_idpf.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/net/intel/iidc_rdma_idpf.h b/include/linux/net/intel/iidc_rdma_idpf.h
index 16c970dd4c6e..bab697e18fd6 100644
--- a/include/linux/net/intel/iidc_rdma_idpf.h
+++ b/include/linux/net/intel/iidc_rdma_idpf.h
@@ -31,10 +31,18 @@ enum iidc_function_type {
IIDC_FUNCTION_TYPE_VF,
};
+struct iidc_rdma_lan_mapped_mem_region {
+ u8 __iomem *region_addr;
+ __le64 size;
+ __le64 start_offset;
+};
+
struct iidc_rdma_priv_dev_info {
struct msix_entry *msix_entries;
u16 msix_count; /* How many vectors are reserved for this device */
enum iidc_function_type ftype;
+ __le16 num_memory_regions;
+ struct iidc_rdma_lan_mapped_mem_region *mapped_mem_regions;
};
int idpf_idc_vport_dev_ctrl(struct iidc_rdma_core_dev_info *cdev_info, bool up);