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

Function read_wq_int

dpdk/drivers/dma/idxd/idxd_bus.c:163–188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

161}
162
163static int
164read_wq_int(struct rte_dsa_device *dev, const char *filename,
165 int *value)
166{
167 char sysfs_node[PATH_MAX];
168 FILE *f;
169 int ret = 0;
170
171 snprintf(sysfs_node, sizeof(sysfs_node), "%s/%s/%s",
172 dsa_get_sysfs_path(), dev->wq_name, filename);
173 f = fopen(sysfs_node, "r");
174 if (f == NULL) {
175 IDXD_PMD_ERR("%s(): opening file '%s' failed: %s",
176 __func__, sysfs_node, strerror(errno));
177 return -1;
178 }
179
180 if (fscanf(f, "%d", value) != 1) {
181 IDXD_PMD_ERR("%s(): error reading file '%s': %s",
182 __func__, sysfs_node, strerror(errno));
183 ret = -1;
184 }
185
186 fclose(f);
187 return ret;
188}
189
190static int
191read_device_int(struct rte_dsa_device *dev, const char *filename,

Callers 1

idxd_probe_dsaFunction · 0.85

Calls 2

snprintfFunction · 0.85
dsa_get_sysfs_pathFunction · 0.85

Tested by

no test coverage detected