摘要:CAS学习无锁队列前先看一个基本概念,CAS原子指令操作。 CAS(Compare and Swap,比较并替换)原子指令,用来保障数据的一致性。 指令有三个参数,当前内存值V、旧的预期值A、更新的值B,当且仅当预期值A和内存值V相同时,将内存值修改为B并返回true,否则什么都不做,并返回fals
阅读全文
摘要:初始化分析 一个设备驱动要实现的功能根据实际需要可能千差万别,但是究其本质来说无非两件事情:一个是内存的操作,另外一个就是中断的处理。Igb_uio驱动和igb驱动都是网卡这个PCI设备的驱动,相同点就是要使能PCI设备,分配内存等,不同的就在于对内存和中断的处理方式的差异。 下面看下igb_uio
阅读全文
摘要:[root@localhost memzone]# gdb build/app/TestMalloc GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-119.el7 Copyright (C) 2013 Free Software Foundation, I
阅读全文
摘要:/* set up interrupt support (but not enable interrupts) */ static int pci_vfio_setup_interrupts(struct rte_pci_device *dev, int vfio_dev_fd) { int i,
阅读全文
摘要:[root@localhost ixgbe]# cpupower frequency-info analyzing CPU 0: driver: cppc_cpufreq CPUs which run at the same hardware frequency: 0 1 2 3 4 5 6 7 8
阅读全文
摘要:修改收发包队列数 [[email protected] tong]# ethtool -g eth0 Ring parameters for eth0: Pre-set maximums: RX: 4096 RX Mini: 0 RX Jumbo: 0 TX: 4096 Current hardwa
阅读全文
摘要:tr -s 删除所有重复出现字符序列,只保留第一个;即将重复出现字符串压缩为一个字符串。 cat /proc/interrupts | tr -s " " | more [root@localhost ixgbe]# cat /proc/interrupts |less -S CPU0 CPU1 C
阅读全文
摘要:1、request_irq会去写mxi msg 普通网卡驱动申请中断 int ixgbe_init_interrupt_scheme(struct ixgbe_adapter *adapter) { err = ixgbe_alloc_q_vectors(adapter); } static int
阅读全文
摘要:#define IXGBE_MIN_RING_DESC 32 #define IXGBE_MAX_RING_DESC 4096 #define RTE_PMD_IXGBE_TX_MAX_BURST 32 #define RTE_PMD_IXGBE_RX_MAX_BURST 32 #define RT
阅读全文
摘要:一般驱动 https://www.cnblogs.com/codestack/p/12906441.html static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent) netdev = alloc_et
阅读全文
摘要:ixgbe_dev_rx_queue_start 设置好dma地址 IXGBE_WRITE_REG(hw, IXGBE_RDH(rxq->reg_idx), 0); IXGBE_WRITE_REG(hw, IXGBE_RDT(rxq->reg_idx), rxq->nb_rx_desc - 1);
阅读全文
摘要:参考: https://blog.csdn.net/jeawayfox/article/details/105444104 net/hns3/hns3_ethdev.c:4918: return rte_eth_dev_pci_generic_probe(pci_dev, rte_eal_init
阅读全文
摘要:int rte_lcore_is_enabled(unsigned int lcore_id) { struct rte_config *cfg = rte_eal_get_configuration(); if (lcore_id >= RTE_MAX_LCORE) return 0; retur
阅读全文
摘要:build/app/TestMalloc -n 4 --proc-type=primary mz addr: 100012838, mz->addr :13febc780 , mz->addr_64 : 13febc780 arr addr: ffffe7739ad8 arr addr: 13feb
阅读全文
摘要:rte_fbarray_init eal_get_fbarray_path(path, sizeof(path), name); /* * Each fbarray is unique to process namespace, i.e. the * filename depends on proc
阅读全文
摘要:转载 https://blog.csdn.net/jsh13417/article/details/107285384 两种数据结构体介绍 Malloc 库内部使用了两种数据结构类型(可以参考dpdk官方文档3.4.4章节介绍): struct malloc_heap:用于在每个 CPU Socke
阅读全文
摘要:[root@localhost dpdk-19.11]# cat /sys/devices/system/node/node*/hugepages/hugepages-2048kB/nr_hugepages 0 0 0 0 [root@localhost dpdk-19.11]# cat /sys/
阅读全文
摘要:#include <stdio.h> #include <string.h> #include <stdint.h> #include <errno.h> #include <sys/queue.h> #include <rte_memory.h> #include <rte_launch.h> #
阅读全文
摘要:更详细的内容见man page。这里举例说明: nm -u hello.o 显示hello.o 中的未定义符号,需要和其他对象文件进行链接. nm -A /usr/lib/* 2>/dev/null | grep "T memset" 在 /usr/lib/ 目录下找出哪个库文件定义了memset函
阅读全文