数据库修仙金丹篇三——vpp源码流程

VPP-main() 源码学习 VLIB_INIT_FUNCTION用来定义构造函数,注册函数到vlib_main_t->init_function_registrations,这个链表在main()函数之前创建。vlib_main()-> vlib_call_all_init_functions()注册的函数在这里被调用初始化,最后执行函数vlib_main_loop()。 阅读详情

vpp源码流程

代码流程

启动
读取配置文件,解析参数
main线程绑核
初始化堆
查找插件路径
vlib_unix_main
thread0
  • main
初始化vpp的堆,映射内存
使用mmap将内存匿名映射到vpp进程内
main
clib_mem_init_thread_safe
clib_mem_init
create_mspace
CALL_MMAP
clib_mem_set_heap
vpe_main_init
vlib_unix_main
  • vlib_unix_main
筛选enable的插件
执行每个插件的early_init
执行每个插件的config函数
vlib_unix_main
vlib_plugin_config
vlib_plugin_early_init
vlib_load_new_plugins
load_one_plugin
early_init
vlib_call_all_config_functions
config_function_registrations
clib_elf_main_init
vlib_thread_stack_init
clib_calljmp
thread0
  • thread0
thread0
vlib_main
clib_time_init
vlib_physmem_init
vlib_buffer_main_init
vlib_thread_init
vlib_map_stat_segment_init
vlib_register_all_static_nodes
vlib_node_main_init
vpe_api_init
vlibmemory_init
map_api_segment_init
vlib_call_all_init_functions
vlib_buffer_create_free_list
vlib_call_all_config_functions
vlib_call_all_main_loop_enter_functions
vlib_main_loop
  • vlib_main_loop
vlib_main_loop
vlib_main_or_worker_loop
dispatch_process
dispatch_node
  • dpdk plugin
load_one_plugin
dpdk_early_init
dpdk_config
dpdk_process_node
dpdk_process
dpdk_lib_init
dpdk_input_node
dpdk_device_input
rte_eth_rx_burst
vpp初始化 --- 线程初始化及线程模型 1、main线程申请堆 clib_mem_init_thread_safe -》调create_mspace 根据指定的堆大小进行mmap内存; init_user_mstate使用(mspace)heap记录mmap的内存的起始地点和结束的地址,并初始化堆头部 -》clib_mem_set_heap 将(mspace)heap记录到全局变量clib_per_cpu_... 阅读详情

相关推荐

vpp初始化代码解析.pdf

进行vpp初始化流程的代码解析和vpp框架的梳理,对了解vpp的node、thread、worker有较大帮助

VPP源码分析

VPP三个角度源码分析VPP架构

chbljy321的专栏 1912

vpp中的协程实现

最近在看 vpp 的源码,发现里面用了大量的 setjmp 和 longjmp,在逐渐深入阅读代码的过程中才意识到这就是所谓的协程呀。花了一些时间将其中的关键代码抽出来进行调试,收获不少,想要学习协程的同学可以做个参考。 下面这个关于协程的 demo 是基于 x86 架构的,一共涉及四个文件,分别是 longjmp.h // 声明 jmp 相关函数的原型 longjmp.S // 使用 x86 汇编代码实现 jmp 相关函数 main.c // 使用 jmp 相...

choumin的专栏 1460

开关电源拓扑结构选型指南:从Buck到Full-Bridge的实战解析

本文为硬件工程师提供了开关电源拓扑结构的实战选型指南。文章系统解析了从基础的Buck、Boost、Buck-Boost,到隔离型的Flyback、Forward,再到中高功率的半桥、全桥以及高效率的LLC谐振拓扑的适用场景与核心特点。通过对比分析各拓扑的优缺点,并结合输入输出电压、功率等级、成本与效率等关键参数,给出了清晰的选型决策路径,帮助工程师根据具体项目需求选择最合适的电源“骨架”。

weixin_29306261的博客 111

稀疏数据分析:马蹄估计量及其理论性质

稀疏数据分析:马蹄估计量及其理论性质基本框架half-Cauchy分布为什么它叫马蹄估计量后验均值、shrinkage与κ\kappaκθ\thetaθ的边缘先验分布的阶马蹄估计的一致性收敛速率Clarke-Barron(1990)引理马蹄估计的最优收敛速率 这是对The horseshoe estimator for sparse signal这篇论文的回顾,这篇论文在Modern Bayesian statistics与Bayesian Machine Learning领域比较重要,它提出了一种新的先验

一个不愿透露姓名的博客 3803

90分钟带你快速解读VPP源码 流程剖析

网络流处理开源框架vpp,一起来评测你的代码阅读能力。90分钟带你快速解读VPP源码 流程剖析。2. 常用plugin组件 链表头插法。1. vpp启动流程的加载so库。3. 运行时回调的设计模式。

lingshengxiyou的博客 866

浅析MOS管导通过程及RC吸收电路设计要点

RC吸收电路 米勒电容 MOS导通过程

liangbo1999的博客 2万+

数据库修仙金丹篇十二——ptp1588v2实现方案

ptp1588v2实现方案

growdu的网络博客 1977

【ES】--Elasticsearch的分词器深度研究

分词器是ik_max_word,会将“龙马家书”拆分为“龙马”、“马家”、“家书”。然后filter配置的是edge_ngram_filter,在上面拆分的token词组基础上,按照edge_ngram_filter规则进一步拆分。从结果看:分词器是keyword,filter支持edge_ngram_filter,字符过滤器支持tsconvert【简繁体】。分词器是keyword,表明是不进行分词,但filtet中edge_ngram_filter是按照布长方式拆分token,所以得到如此结果。

寻梦友的博客 2459

ComfyUI整合包V8中文版最新版介绍

和普通AI绘图网页不同,它把图像生成的每一个步骤拆分成一个个"节点",用连线把它们串起来,形成工作流。里面包含ComfyUI内核、Python运行环境、常用插件、部分预置模型,还有一个叫"绘世启动器"的图形界面管理工具。网上的对比数据显示,WebUI最低需要4G显存,ComfyUI最低3G显存就能运行。可以在里面管理插件、切换模型路径、设置显存模式、查看日志报错,还有"疑难解答"功能,遇到报错可以先扫描一下看是不是已知问题。原版ComfyUI的界面是英文的,右键菜单、节点名称全是英文。

欢迎来到鸾姝淡月博客,专为程序员和编程爱好者打造的技术博客。我们分享编程语言趋势、开发工具、编程哲学、职业发展等,助你掌握新技术,优化技能,激发编程热情。 5231

VPP VCL API

我用的这个版本VCL API 还是有很多不兼容的问题,执行ping会导致VPP崩溃,执行curl 会卡住,无法解析域名。wget,ssh,iperf 都可以正常运行。本实验将虚拟机的网卡桥接到家庭网络中,VPP接管网卡,并打开dhcp client,获取路由器分配的IP。通过VPP 的 VCL API,可以在不修改应用的情况下,使应用通过VPP 访问网络。打开新终端,并配置环境变量。

wjmasd的博客 1399

NSGA-II 多目标优化 —— 理论、案例与交互式 GUI 实现

本文详细介绍了 NSGA-II 多目标优化算法的基本原理、数学模型和实现流程。从非支配排序、拥挤距离计算到遗传操作,NSGA-II 通过对种群进行分层和排序,能够有效求解多目标优化问题,获得 Pareto 前沿解集。通过机械结构优化、资源分配和控制参数调优等典型案例,我们展示了 NSGA-II 在实际工程中的广泛应用。为帮助工程师和研究者更直观地理解算法求解过程,本文提供了基于 Python 与 PyQt6 的交互式 GUI 演示系统代码示例。

闲人编程的博客 2121

VPP代码阅读中文注解(二)

clib_mem_init_thread_safe有2个版本。 其中一个在mem_mheap.c中 void * clib_mem_init_thread_safe (void *memory, uword memory_size) { mheap_t *h; u8 *heap; clib_mem_init (memory, memory_size); heap = cl...

weixin_40870382的博客 1392

win10 跳过U8环境检测的IE WebControls.rar

win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

vpp的运行流程、协程的实现以及node的运行

linuxi++;i++;f2 (env);inti = 0;f1 (&env);return 0;for (i = 0;i++)j = 0;for (i = 0;uword v;intint res;return res;#endif。

qjh_serena的博客 2454

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

VPP创建主HEAP内存

初始化clib_mem_vm_map_hdr_t结构的hdr,将其作为新的内存映射尾部赋值给last_map,初始化hdr的起始地址,页面大小和数量等信息。base起始地址开头为clib_mem_heap_t结构,进行初始化,随后跳过此结构以及名称长度的空间,将随后空间生成mspace结构,以供mspace_malloc分配内存使用,例如pool_get的内存分配。在函数clib_mem_vm_map_internal中,首先设置mmap标志MAP_SHARED,mmap的空间变动在其它进程中可见。

redwingz的博客 1466

VPP源码-plugin流程

vpp添加插件plugin 源代码中添加自定义插件文件夹 实现一个打印包头信息的插件,源代码如下:进入到vpp的源码根目录下,输入以下指令:vpp的源码编译成功后,进入到vpp源码根目录运行:

qjh_serena的博客 609

思科VPP源码分析(dpdk node分析)

VPP使用者几乎都会使用dpdk node作为收包驱动,本文将分析其源码。- 基本概念vlib_buffer_t dpdk收到的数据包用rte_mbuf结构描述。vpp为了兼容其它收包node(netmap,pcap等)改为使用vlib_buffer_t来描述数据包。 vlib_buffer_t紧跟在rte_mbuf后面,headroom空间中。vlib_get_next_framevlib

呆呆辉的专栏 1万+

思科VPP源码分析(多线程支持分析)

基本概念 核心函数

呆呆辉的专栏 6878

DPDK VPP简单入门及源码plugin实例分析

DPDK VPP简单入门及源码plugin实例分析

zhp优快云921011的博客 8365

vpp源码阅读---node节点调度总结

调度类型总结 调度方式总结 个人理解:从代码上来看只有Input类型的node节点注册的时候state设置成中断方式,才会出现中断和轮训的切换,默认全是轮询方式。PRE_INPUT类型node只能按照轮询当时来调度。设置成state为中断也是一样的。 中断方式和轮询方式之间切换。 模式切换依据累计报文数量,在vlib_main_or_worker_loop启动中设置。 PRE_INPUT和INPUT类型调度 Pre_input类型只能在main线程上被调度,一般为Process类型提供输入。 in

轻飘飞扬 7157

思科VPP源码分析(路由框架分析二)

基本理论

呆呆辉的专栏 9219

Cisco VPP入门(一)——VPP源码编译与安装

VPP是Cisco开源的路由工程,支持如下网络功能:   我的系统是Ubuntu 14.04,使用VPP1606分支代码进行编译安装 1、下载源码 git clone -b stable/1606 https://github.com/FDio/vpp.git 2、编译  进入目录并且安装依赖文件  #cd vpp  # make install-dep  生成Makefi...

Illina的专栏 5742

vpp插件DHCP client源码分析

通常用于特定的数据包处理流程中,用于识别DHCP客户端的数据包。一旦识别出DHCP客户端的数据包,通常会触发特定的处理流程,可能涉及为客户端分配IP地址或处理网络配置等。添加client需要先在DHCP client pool索引if,查找是否存在相同的,不存在的话,再从DHCP client pool中分配一个client并添加设备信息。在这个函数中,将会解析接收到的配置信息,并将其应用到DHCP客户端。可能作为 VPP 中的数据包处理函数的一部分,用于筛选和处理适用于本地接口的 DHCP 数据包。

wjj970802的博客 1434

vpp feature node使用分析总结(snat)

vpp node框架的分析请查看http://blog.youkuaiyun.com/jqh9804 在分析vpp代码snat插件时,看到了以feature模式添加node的方式,于是简单分析了一下feature node的api 以ip4-unicast类为例: ARC (Argonaut RISC Core)  文件:ip4_forward.c /* Built-in ip4 uni

shaoyunzhe的专栏 8700
上一篇: 数据库修仙金丹篇四——vpp vector指北
下一篇: 数据库修仙秘境篇五——linux cache指北
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

我在数据库世界里修仙

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值