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

Function intel_ntb3_check_ppd

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

Source from the content-addressed store, hash-verified

45}
46
47static int
48intel_ntb3_check_ppd(struct ntb_hw *hw)
49{
50 uint8_t reg_val;
51 int ret;
52
53 ret = rte_pci_read_config(hw->pci_dev, &reg_val,
54 sizeof(reg_val), XEON_PPD_OFFSET);
55 if (ret < 0) {
56 NTB_LOG(ERR, "Cannot get NTB PPD (PCIe port definition).");
57 return -EIO;
58 }
59
60 /* Check connection topo type. Only support B2B. */
61 switch (reg_val & XEON_PPD_CONN_MASK) {
62 case XEON_PPD_CONN_B2B:
63 NTB_LOG(INFO, "Topo B2B (back to back) is using.");
64 break;
65 case XEON_PPD_CONN_TRANSPARENT:
66 case XEON_PPD_CONN_RP:
67 default:
68 NTB_LOG(ERR, "Not supported conn topo. Please use B2B.");
69 return -EINVAL;
70 }
71
72 /* Check device type. */
73 if (reg_val & XEON_PPD_DEV_DSD) {
74 NTB_LOG(INFO, "DSD, Downstream Device.");
75 hw->topo = NTB_TOPO_B2B_DSD;
76 } else {
77 NTB_LOG(INFO, "USD, Upstream device.");
78 hw->topo = NTB_TOPO_B2B_USD;
79 }
80
81 /* Check if bar4 is split. Do not support split bar. */
82 if (reg_val & XEON_PPD_SPLIT_BAR_MASK) {
83 NTB_LOG(ERR, "Do not support split bar.");
84 return -EINVAL;
85 }
86
87 return 0;
88}
89
90static int
91intel_ntb4_check_ppd_for_ICX(struct ntb_hw *hw, uint32_t reg_val)

Callers 1

intel_ntb_dev_initFunction · 0.85

Calls 1

rte_pci_read_configFunction · 0.50

Tested by

no test coverage detected