DPDK /example/helloworld代码详读
来源:互联网 发布:mac ps没有足够内存 编辑:程序博客网 时间:2024/06/13 06:44
static intlcore_hello(__attribute__((unused)) void *arg) //__attribute__((unused))表示该函数或变量可能不使用,告诉编译器不要给出告警;{unsigned lcore_id;lcore_id = rte_lcore_id(); //返回正在运行的执行单元的ID。printf("hello from core %u\n", lcore_id);return 0;}
intmain(int argc, char **argv){int ret;unsigned lcore_id;ret = rte_eal_init(argc, argv);//初始化EAL工作,返回0表示初始化成功,DPDK很多函数用返回值为0表示功能实现;if (ret < 0)rte_panic("Cannot init EAL\n");/* call lcore_hello() on every slave lcore */RTE_LCORE_FOREACH_SLAVE(lcore_id) { //RTE_LCORE_FOREACH_SLAVE其实是一个循环,遍历除当前主核之外的所有逻辑核;rte_eal_remote_launch(lcore_hello, NULL, lcore_id);//在逻辑核ID=lcore_id的核上运行lcore_hello;}/* call it on master lcore too */lcore_hello(NULL); //在主逻辑核调用lcore_hello(),因为获取的id为当前核;rte_eal_mp_wait_lcore();return 0;}
有问题相互交流学习
阅读全文
1 0
- DPDK /example/helloworld代码详读
- dpdk helloworld代码分析
- dpdk helloworld代码分析
- DPDK Skeleton代码详读
- DPDK helloworld
- DPDK helloworld
- DPDK Samples 01HelloWorld
- DPDK-实战之helloworld
- DPDK-helloworld实例分析
- dpdk中文-从helloworld看dpdk
- DPDK代码内存分析
- dpdk 代码分析一
- intel dpdk api helloworld 源码学习
- dpdk 代码分析 : 内存初始化
- DPDK简单example的阅读——l2fwd
- intel dpdk在ubuntu12.04中测试testpmd、helloworld程序
- DPDK
- DPDK
- org.springframework.context.ApplicationContextException: Unable to start embedded container; nested
- python MySQLdb 库的使用练习
- 使用 Tortoise SVN 创建 Externals 外部引用目录
- 交叉熵和损失函数
- Servlet(6)生成验证码
- DPDK /example/helloworld代码详读
- How to respond with HTTP 400 error in a Spring MVC @ResponseBody method returning String?
- 建造者模式
- Android事件总线EventBus 3.0的基本使用
- hdfs dfsadmin -reconfig reload datanode dfs.datanode.data.dir without restart datanode
- 1000以内的所以完数
- HTML5 单个或者多个Video标签视频加载第一帧方法(poster属性)
- FastDFS分布式文件系统安装与使用(单节点)
- LeetCode:67. Add Binary