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

Function dma_shared_data_prepare

dpdk/lib/dmadev/rte_dmadev.c:183–212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

181}
182
183static int
184dma_shared_data_prepare(void)
185{
186 const char *mz_name = "rte_dma_dev_data";
187 const struct rte_memzone *mz;
188 size_t size;
189
190 if (dma_devices_shared_data != NULL)
191 return 0;
192
193 size = sizeof(*dma_devices_shared_data) +
194 sizeof(struct rte_dma_dev_data) * dma_devices_max;
195
196 if (rte_eal_process_type() == RTE_PROC_PRIMARY)
197 mz = rte_memzone_reserve(mz_name, size, rte_socket_id(), 0);
198 else
199 mz = rte_memzone_lookup(mz_name);
200 if (mz == NULL)
201 return -ENOMEM;
202
203 dma_devices_shared_data = mz->addr;
204 if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
205 memset(dma_devices_shared_data, 0, size);
206 dma_devices_shared_data->dev_max = dma_devices_max;
207 } else {
208 dma_devices_max = dma_devices_shared_data->dev_max;
209 }
210
211 return 0;
212}
213
214static int
215dma_data_prepare(void)

Callers 1

dma_data_prepareFunction · 0.85

Calls 5

rte_eal_process_typeFunction · 0.85
rte_memzone_reserveFunction · 0.85
rte_socket_idFunction · 0.85
rte_memzone_lookupFunction · 0.85
memsetFunction · 0.85

Tested by

no test coverage detected