MCPcopy Create free account
hub / github.com/F-Stack/f-stack / intel_ntb4_check_ppd

Function intel_ntb4_check_ppd

dpdk/drivers/raw/ntb/ntb_hw_intel.c:140–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138}
139
140static int
141intel_ntb4_check_ppd(struct ntb_hw *hw)
142{
143 uint8_t revision_id;
144 uint32_t reg_val;
145 int ret;
146
147 ret = rte_pci_read_config(hw->pci_dev, &revision_id,
148 NTB_PCI_DEV_REVISION_ID_LEN,
149 NTB_PCI_DEV_REVISION_ID_REG);
150 if (ret != NTB_PCI_DEV_REVISION_ID_LEN) {
151 NTB_LOG(ERR, "Cannot get NTB PCI Device Revision ID.");
152 return -EIO;
153 }
154
155 reg_val = rte_read32(hw->hw_addr + XEON_GEN4_PPD1_OFFSET);
156
157 /* Distinguish HW platform (ICX/SPR) via PCI Revision ID */
158 if (revision_id > NTB_PCI_DEV_REVISION_ICX_MAX)
159 ret = intel_ntb4_check_ppd_for_SPR(hw, reg_val);
160 else if (revision_id >= NTB_PCI_DEV_REVISION_ICX_MIN)
161 ret = intel_ntb4_check_ppd_for_ICX(hw, reg_val);
162 else {
163 NTB_LOG(ERR, "Invalid NTB PCI Device Revision ID.");
164 return -EIO;
165 }
166
167 return ret;
168}
169
170static int
171intel_ntb_dev_init(const struct rte_rawdev *dev)

Callers 1

intel_ntb_dev_initFunction · 0.85

Calls 4

rte_pci_read_configFunction · 0.50
rte_read32Function · 0.50

Tested by

no test coverage detected