精华内容
下载资源
问答
  • vpp
    2019-10-10 09:04:56

    VPP

    always_inline uword
    ip4_input_inline (vlib_main_t * vm,
    vlib_node_runtime_t * node,
    vlib_frame_t * frame, int verify_checksum)
    {
    vnet_main_t *vnm = vnet_get_main ();
    u32 n_left_from, *from;
    u32 thread_index = vm->thread_index;
    vlib_node_runtime_t *error_node =
    vlib_node_get_runtime (vm, ip4_input_node.index);
    vlib_simple_counter_main_t *cm;
    vlib_buffer_t *bufs[VLIB_FRAME_SIZE], **b;
    ip4_header_t *ip[4];
    u16 nexts[VLIB_FRAME_SIZE], *next;
    u32 sw_if_index[4];
    u32 last_sw_if_index = ~0;
    u32 cnt = 0;
    int arc_enabled = 0;

    from = vlib_frame_vector_args (frame);
    n_left_from = frame->n_vectors;

    if (node->flags & VLIB_NODE_FLAG_TRACE)
    vlib_trace_frame_buffers_only (vm, node, from, frame->n_vectors,
    /* stride */ 1,
    sizeof (ip4_input_trace_t));

    cm = vec_elt_at_index (vnm->interface_main.sw_if_counters,
    VNET_INTERFACE_COUNTER_IP4);

    vlib_get_buffers (vm, from, bufs, n_left_from);
    b = bufs;
    next = nexts;
    while (n_left_from >= 4)
    {
    u32 x = 0;

      /* Prefetch next iteration. */
      if (n_left_from >= 12)
    {
      vlib_prefetch_buffer_header (b[8], LOAD);
      vlib_prefetch_buffer_header (b[9], LOAD);
      vlib_prefetch_buffer_header (b[10], LOAD);
      vlib_prefetch_buffer_header (b[11], LOAD);
    
      vlib_prefetch_buffer_data (b[4], LOAD);
      vlib_prefetch_buffer_data (b[5], LOAD);
      vlib_prefetch_buffer_data (b[6], LOAD);
      vlib_prefetch_buffer_data (b[7], LOAD);
    }
    
      vnet_buffer (b[0])->ip.adj_index[VLIB_RX] = ~0;
      vnet_buffer (b[1])->ip.adj_index[VLIB_RX] = ~0;
      vnet_buffer (b[2])->ip.adj_index[VLIB_RX] = ~0;
      vnet_buffer (b[3])->ip.adj_index[VLIB_RX] = ~0;
    
      sw_if_index[0] = vnet_buffer (b[0])->sw_if_index[VLIB_RX];
      sw_if_index[1] = vnet_buffer (b[1])->sw_if_index[VLIB_RX];
      sw_if_index[2] = vnet_buffer (b[2])->sw_if_index[VLIB_RX];
      sw_if_index[3] = vnet_buffer (b[3])->sw_if_index[VLIB_RX];
    
      x |= sw_if_index[0] ^ last_sw_if_index;
      x |= sw_if_index[1] ^ last_sw_if_index;
      x |= sw_if_index[2] ^ last_sw_if_index;
      x |= sw_if_index[3] ^ last_sw_if_index;
    
      if (PREDICT_TRUE (x == 0))
    {
      /* we deal with 4 more packets sharing the same sw_if_index
         with the previous one, so we can optimize */
      cnt += 4;
      if (arc_enabled)
        {
          next[0] = ip4_input_set_next (sw_if_index[0], b[0], 1);
          next[1] = ip4_input_set_next (sw_if_index[1], b[1], 1);
          next[2] = ip4_input_set_next (sw_if_index[2], b[2], 1);
          next[3] = ip4_input_set_next (sw_if_index[3], b[3], 1);
        }
      else
        {
          next[0] = ip4_input_set_next (sw_if_index[0], b[0], 0);
          next[1] = ip4_input_set_next (sw_if_index[1], b[1], 0);
          next[2] = ip4_input_set_next (sw_if_index[2], b[2], 0);
          next[3] = ip4_input_set_next (sw_if_index[3], b[3], 0);
        }
    }
      else
    {
      ip4_input_check_sw_if_index (vm, cm, sw_if_index[0],
    			       &last_sw_if_index, &cnt, &arc_enabled);
      ip4_input_check_sw_if_index (vm, cm, sw_if_index[1],
    			       &last_sw_if_index, &cnt, &arc_enabled);
      ip4_input_check_sw_if_index (vm, cm, sw_if_index[2],
    			       &last_sw_if_index, &cnt, &arc_enabled);
      ip4_input_check_sw_if_index (vm, cm, sw_if_index[3],
    			       &last_sw_if_index, &cnt, &arc_enabled);
    
      next[0] = ip4_input_set_next (sw_if_index[0], b[0], 1);
      next[1] = ip4_input_set_next (sw_if_index[1], b[1], 1);
      next[2] = ip4_input_set_next (sw_if_index[2], b[2], 1);
      next[3] = ip4_input_set_next (sw_if_index[3], b[3], 1);
    }
    
      ip[0] = vlib_buffer_get_current (b[0]);
      ip[1] = vlib_buffer_get_current (b[1]);
      ip[2] = vlib_buffer_get_current (b[2]);
      ip[3] = vlib_buffer_get_current (b[3]);
    
      ip4_input_check_x4 (vm, error_node, b, ip, next, verify_checksum);
    
      /* next */
      b += 4;
      next += 4;
      n_left_from -= 4;
    }
    

    while (n_left_from)
    {
    u32 next0;
    vnet_buffer (b[0])->ip.adj_index[VLIB_RX] = ~0;
    sw_if_index[0] = vnet_buffer (b[0])->sw_if_index[VLIB_RX];
    ip4_input_check_sw_if_index (vm, cm, sw_if_index[0], &last_sw_if_index,
    &cnt, &arc_enabled);
    next0 = ip4_input_set_next (sw_if_index[0], b[0], arc_enabled);
    ip[0] = vlib_buffer_get_current (b[0]);
    ip4_input_check_x1 (vm, error_node, b[0], ip[0], &next0,
    verify_checksum);
    next[0] = next0;

      /* next */
      b += 1;
      next += 1;
      n_left_from -= 1;
    }
    

    vlib_increment_simple_counter (cm, thread_index, last_sw_if_index, cnt);
    vlib_buffer_enqueue_to_next (vm, node, from, nexts, frame->n_vectors);
    return frame->n_vectors;
    }

    更多相关内容
  • Contiv-VPP 是的CNI插件,它采用基于的可编程 ,提供功能丰富的高性能云原生网络和服务。 有关更多详细信息,请参见 产品特点 VPP上的kube-proxy实现-在用户空间( 和完全实现) 支持,包括memif接口 支持 ,k8s...
  • centos编码生成的vpp

    2021-11-26 16:33:35
    centos编码生成的vpp包 centos7和8都能用
  • 1引言该存储库将提供基于 VPP 主机堆栈的优化 NGINX。 我们提供了两种 VPP 主机栈集成方式,即 LDP 和 VCL。 LDP 基本上是未修改的NGINX 通过LD_PRELOAD 带VPP,而VCL NGINX 是直接将VPP 主机堆栈与NGINX 代码更改...
  • VPP开发的基础知识
  • Vpp session层代码解析,包括vpp与其他进程的交互、session的建立和管理
  • VPP研究及使用 --- Qos策略
  • ubuntu20.04编译生成的vpp包以及依赖包,可以实现离线安装
  • ubuntu18.04编译生成的vpp包以及依赖包,可以实现离线安装vpp
  • 这些是“下一个” VPP版本的正在进行的发行说明。 下一个发行版号由放置在master分支上的vXX.YY-rc0标签确定。 它可能是也可能不是实际的发行版号,因此除非已在VPP社区会议上确认,否则不要将其视为承诺!这个怎么...
  • vpp的官方文档,他家的文档太多了,不见得好找了。这个比较旧了(2017年的),但新接触的开发者还是可以看看的。免费下载私信我,积分不是我设得
  • vpp相关介绍,可以更加全面了解VPP
  • C#调用相机vpp文件,显示判断,并不合格显示文字,vpp文件太大,需要联系
  • ACL-VPP.doc

    2019-07-29 16:14:05
    VPP Input ACL Software Functional and Design Specification, VPP ACL功能介绍和实现原理
  • vpp-webapp #VPP停车Web应用程序[GIS]开发说明/注释 要求 #### Node JS #### Bower #### Gulp ##构建说明(本地环境) sudo npm安装 凉亭安装 确保至少选择Angular 1.4以防止错误 cd到服务器文件夹并运行npm ...
  • vpp 源代码

    2018-04-25 16:20:15
    vpp 官网源代码,从https://github.com/FDio/vpp 官网上下载的正版源代码,后续会持续更新,由于github上下载源代码特别的慢,所以传到csdn上方便大家
  • Linux基金会FDIO的开源项目Cisco VPP的官方快速入门手册,纯净英文版本,非常适合VPP初学者快速上手VPP
  • 官方离线安装包,测试可用。使用rpm -ivh [rpm完整包名] 进行安装
  • VPP规范于1993年由泰克公司、惠普公司、美国国家仪器公司等35家最大的仪器仪表公司成立的VPP(VXI P1ug&P1ay)系统联盟发布,该规范定义了系统的框架、软件接口、软件环境和仪器驱动程序模型。它把与仪器的底层通信...
  • Vpp tcp层代码解析.pdf

    2021-09-19 15:10:02
    vpp tcp 三次握手建连和挥手断连的代码流程解析,含状态机图
  • Vpp epoll实现的代码解析和vpp与上层应用进行报文交互流程解析
  • 输出1VPP正弦波信号介绍rar,输出1VPP正弦波信号介绍
  • sdk-vpp

    2021-02-20 20:29:53
    sdk-vpp
  • VPP平台是一个可扩展的框架,可提供开箱即用的生产质量交换机/路由器功能。 它是思科矢量数据包处理(VPP)技术的开源版本:一种高性能的数据包处理堆栈,可以在商用CPU上运行。 实施VPP的好处是其高性能,经过验证...
  • dBm&vpp;&rms;换算表

    2018-06-26 09:44:26
    dBm与幅度与有效值 等之间的换算表格,可以快速查询相关数值对应的的不同单位的数值大小。
  • vpp初始化代码解析.pdf

    2021-09-19 14:43:18
    进行vpp初始化流程的代码解析和vpp框架的梳理,对了解vpp的node、thread、worker有较大帮助
  • dBm_vpp_W转换工具.exe

    2021-08-04 16:12:24
    峰峰值vp-p与dBm与W换算的小工具,自我感觉还不错。
  • TB_SaveData.vpp

    2021-08-26 11:58:52
    TB_SaveData.vpp
  • vpp-18.04-1.x86_64.rpm

    2021-12-23 15:12:13
    官方离线安装包,测试可用。使用rpm -ivh [rpm完整包名] 进行安装
  • VPP性能测试

    2022-07-03 22:02:07
    安装VPP VPP版本 VPP线程 网卡Intel 82599。 UIO驱动 启动参数配置,需要配置到grub中,重启生效。 结果 RFC2544测试,64字节报文,双向大约能达到线速的75%。开始VPP没有加载上X710网卡。 将UIO驱动替换为igb_uio。...

    环境:

    # cat /etc/issue
    Ubuntu 18.04.5 LTS \n \l
    #
    # uname -a
    Linux localhost 4.15.0-112-generic #113-Ubuntu SMP Thu Jul 9 23:41:39 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
    

    处理器

    vpp# show cpu
    Model name:               Intel(R) Xeon(R) CPU E3-1225 v3 @ 3.20GHz
    Microarch model (family): [0x6] Haswell ([0x3c] Haswell) stepping 0x3
    Flags:                    sse3 pclmulqdq ssse3 sse41 sse42 avx rdrand avx2 aes invariant_tsc
    Base frequency:           3.19 GHz
    

    安装VPP

    # curl -s https://packagecloud.io/install/repositories/fdio/release/script.deb.sh | sudo bash
    # apt-get install vpp vpp-plugin-core vpp-plugin-dpdk
    

    VPP版本

    vpp# show version
    vpp v21.10.1-release built by root on 4f6ead0c141f at 2021-11-17T14:25:30
    

    VPP线程

    vpp# show threads
    ID     Name                Type        LWP     Sched Policy (Priority)  lcore  Core   Socket State
    0      vpp_main                        1178    other (0)                0      0      0
    1      vpp_wk_0            workers     1664    other (0)                1      1      0
    2      vpp_wk_1            workers     1665    other (0)                2      2      0
    3      vpp_wk_2            workers     1666    other (0)                3      3      0
    

    网卡

    Intel 82599。

    vpp# set interface state TenGigabitEthernet3/0/0 up
    vpp# set interface state TenGigabitEthernet3/0/1 up
    vpp#
    vpp# set interface ip address TenGigabitEthernet3/0/0 11.1.1.1/16
    vpp# set interface ip address TenGigabitEthernet3/0/1 12.1.1.1/16
    

    UIO驱动

    uio_pci_generic
    

    启动参数配置,需要配置到grub中,重启生效。

    # cat /proc/cmdline
    BOOT_IMAGE=/vmlinuz-4.15.0-112-generic root=/dev/mapper/ubuntu--vg-ubuntu--lv ro console=tty0 console=ttyS0,115200n8 isolcpus=1-3 rcu_nocbs=1-3 nohz_full=1-3 hugepagesz=1GB hugepages=4 default_hugepagesz=1GB maybe-ubiquity
    

    结果
    RFC2544测试,64字节报文,双向大约能达到线速的75%。

    网卡X710

    开始VPP没有加载上X710网卡。

    # vppctl
    vpp#
    vpp# show logging
    2022/06/30 07:17:59:833 notice     dpdk           EAL: Detected 4 lcore(s)
    2022/06/30 07:17:59:833 notice     dpdk           EAL: Detected 1 NUMA nodes
    2022/06/30 07:17:59:833 notice     dpdk           EAL: Detected static linkage of DPDK
    2022/06/30 07:17:59:833 notice     dpdk           EAL: Selected IOVA mode 'PA'
    2022/06/30 07:17:59:833 notice     dpdk           EAL: WARNING! Base virtual address hint (0xa80001000 != 0x7f32c0000000) not respected!
    2022/06/30 07:17:59:833 notice     dpdk           EAL:    This may cause issues with mapping memory into secondary processes
    2022/06/30 07:17:59:833 notice     dpdk           EAL: Probe PCI driver: net_e1000_igb (8086:1533) device: 0000:02:00.0 (socket 0)
    2022/06/30 07:17:59:833 notice     dpdk           EAL: Probe PCI driver: net_e1000_igb (8086:1533) device: 0000:03:00.0 (socket 0)
    2022/06/30 07:17:59:833 notice     dpdk           EAL: Probe PCI driver: net_e1000_igb (8086:1533) device: 0000:04:00.0 (socket 0)
    2022/06/30 07:17:59:833 notice     dpdk           EAL: Probe PCI driver: net_e1000_igb (8086:1533) device: 0000:05:00.0 (socket 0)
    2022/06/30 07:17:59:833 notice     dpdk           EAL: Probe PCI driver: net_e1000_igb (8086:1533) device: 0000:06:00.0 (socket 0)
    2022/06/30 07:17:59:833 notice     dpdk           EAL: Probe PCI driver: net_e1000_igb (8086:1533) device: 0000:07:00.0 (socket 0)
    2022/06/30 07:17:59:833 notice     dpdk           EAL: Probe PCI driver: net_e1000_igb (8086:1533) device: 0000:08:00.0 (socket 0)
    2022/06/30 07:17:59:833 notice     dpdk           EAL: Probe PCI driver: net_e1000_igb (8086:1533) device: 0000:09:00.0 (socket 0)
    2022/06/30 07:17:59:833 notice     dpdk           EAL: VFIO support not initialized
    2022/06/30 07:17:59:833 notice     dpdk           EAL: Couldn't map new region for DMA
    

    将UIO驱动替换为igb_uio。

    # cat vpp.service
    [Unit]
    Description=vector packet processing engine
    After=network.target
    
    [Service]
    Type=simple
    ExecStartPre=-/sbin/modprobe igb_uio
    ExecStart=/usr/bin/vpp -c /etc/vpp/startup.conf
    ExecStopPost=/bin/rm -f /dev/shm/db /dev/shm/global_vm /dev/shm/vpe-api
    Restart=always
    # Uncomment the following line to enable VPP coredumps on crash
    # You still need to configure the rest of the system to collect them, see
    # https://fdio-vpp.readthedocs.io/en/latest/troubleshooting/reportingissues/reportingissues.html#core-files
    # for details
    #LimitCORE=infinity
    
    [Install]
    WantedBy=multi-user.target
    

    安装igb_uio内核驱动模块。

    # apt-get install -y dpdk-igb-uio-dkms
    ...
    Setting up librte-pmd-octeontx-ssovf17.11:amd64 (17.11.10-0ubuntu0.1) ...
    Setting up libdpdk-dev:amd64 (17.11.10-0ubuntu0.1) ...
    Setting up dpdk-dev (17.11.10-0ubuntu0.1) ...
    Setting up dpdk-igb-uio-dkms (17.11.10-0ubuntu0.1) ...
    Loading new dpdk-igb-uio-17.11.10 DKMS files...
    Building for 4.15.0-112-generic
    Building initial module for 4.15.0-112-generic
    Done.
    
    igb_uio:
    Running module version sanity check.
     - Original module
       - No original module exists within this kernel
     - Installation
       - Installing to /lib/modules/4.15.0-112-generic/updates/dkms/
    
    depmod........
    
    DKMS: install completed.
    Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
    Processing triggers for libc-bin (2.27-3ubuntu1.2) ...
    

    如下安装位置。

    # find /lib/modules/ -name "igb_uio*"
    /lib/modules/4.15.0-112-generic/updates/dkms/igb_uio.ko
    

    将X710网卡Firmware更新。

    # tar -xf 700Series_NVMUpdatePackage_v8_70_Linux.tar.gz
    #
    # cd 700Series/Linux_x64/
    #
    # ./nvmupdate64e
    
    Intel(R) Ethernet NVM Update Tool
    NVMUpdate version 1.38.13.1
    Copyright(C) 2013 - 2022 Intel Corporation.
    
    
    WARNING: To avoid damage to your device, do not stop the update or reboot or power off the system during this update.
    Inventory in progress. Please wait 
    ****
    
    
    Num Description                          Ver.(hex)  DevId S:B    Status
    === ================================== ============ ===== ====== ==============
    01) Intel(R) Ethernet Converged         8.64(8.40)   1572 00:001 Update
        Network Adapter X710                                         available
    
    
    Options: Adapter Index List (comma-separated), [A]ll, e[X]it
    Enter selection: 1
    Would you like to back up the NVM images? [Y]es/[N]o: n
    Update in progress. This operation may take several minutes.
    [....|*****]
    
    
    Num Description                          Ver.(hex)  DevId S:B    Status
    === ================================== ============ ===== ====== ==============
    01) Intel(R) Ethernet Converged        8.112(8.70)   1572 00:001 Update
        Network Adapter X710                                         successful
    
    Reboot is required to complete the update process.
    
    Tool execution completed with the following status: All operations completed successfully.
    Press any key to exit.
    

    测试结果
    RFC2544测试,64字节报文,双向大约能达到线速的65%。

    展开全文

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 6,164
精华内容 2,465
关键字:

vpp