fprintf(stderr, "rte_gpu_mem_cpu_map returned error\n");
goto error;
}
- printf("GPU memory mapped for CPU access at 0x%p\n", ptr_cpu);
+ printf("GPU memory CPU mapped at 0x%p\n", ptr_cpu);
((uint8_t *)ptr_cpu)[0] = 0x4;
((uint8_t *)ptr_cpu)[1] = 0x5;
((uint8_t *)ptr_cpu)[1],
((uint8_t *)ptr_cpu)[2]);
- ret = rte_gpu_mem_cpu_unmap(gpu_id, ptr_cpu);
+ ret = rte_gpu_mem_cpu_unmap(gpu_id, ptr_gpu);
if (ret < 0) {
fprintf(stderr, "rte_gpu_mem_cpu_unmap returned error %d\n", ret);
goto error;
}
- printf("GPU memory mapped for CPU access at 0x%p\n", ptr_cpu);
+ printf("GPU memory CPU unmapped, 0x%p not valid anymore\n", ptr_cpu);
ret = rte_gpu_mem_free(gpu_id, ptr_gpu);
if (ret < 0) {
error:
- rte_gpu_mem_cpu_unmap(gpu_id, ptr_cpu);
+ rte_gpu_mem_cpu_unmap(gpu_id, ptr_gpu);
rte_gpu_mem_free(gpu_id, ptr_gpu);
printf("\n=======> TEST: FAILED\n");
* consume(comm_list_item->pkt_list[idx].addr);
*/
}
- comm_list_item->status = RTE_GPU_COMM_LIST_DONE;
+ /*
+ * A real GPU workload function can't directly call rte_gpu_comm_set_status
+ * because it's a CPU-only function.
+ * A real GPU workload should implement the content
+ * of rte_gpu_comm_set_status() in GPU specific code.
+ */
+ rte_gpu_comm_set_status(comm_list_item, RTE_GPU_COMM_LIST_DONE);
return 0;
}