Container
Namespace
A namespace wraps a global system resource in an abstraction that
makes it appear to the processes within the namespace that they
have their own isolated instance of the global resource. Changes
to the global resource are visible to other processes that are
members of the namespace, but are invisible to oth...
PCI,PCIe扫盲
PCI和PCIe
PCI即Peripheral Component Interconnect,中文意思是“外围器件互联”,是由PCISIG (PCI Special Interest Group)推出的一种局部并行总线标准。
它曾经是个人电脑中使用最为广泛的接口,几乎所有的主板产品上都带有这种插槽。目前该总线已经逐渐被PCI Express总线所取代。
PCI-Express是继ISA和PCI总线之后的第三代I/O总线,即3GIO。 由Intel在2001年的IDF上提出,由PCI-SIG(PCI特殊兴趣组织)认证发布后才改名为“PCI-Express”。它的主要优势就是数据传输速率高,另外还有抗干扰能力强,传输距离远,功耗低等优点。
PCI做的工作
0、Driver通过pci_r...
devlink
devlink-dev:
1. devlink dev show - display devlink device attributes
# devlink dev show
pci/0000:01:00.0
2. devlink dev eswitch set - sets devlink device eswitch attributes
# devlink dev eswitch set pci/0000:5e:00.0 mode switchdev
3. devlink dev param show - display devlink device supported configuration parameters attributes
# dev...
expect脚本语言 匹配机制
expect
# cat expect_test
#!/usr/bin/expect
spawn ./test
expect {
"xxx" { }
"123" { puts "got123"; exp_continue; }
"555" { puts "got555"; exp_continue; }
}
# cat test
#!/bin/bash
sleep 3
echo "444"
sleep 3
echo "555"
sleep 3
echo "123"
sleep 3
echo "666"
sleep 3
echo "123"
test脚本用于输出一组数据:
444
555
123
666
123
expect_te...
网卡收发包流程
softnet_data数据结构
每个cpu都有收发包的入口队列和出口队列,他们都包含在一个sofnet_data结构体中。
每个cpu有一个softnet_data结构体。
struct softnet_data
{
int throttle;
int cng_level;
int avg_blog;
struct sk_buff_head input_pkt_queue;
struct list_head poll_list;
struct net_device *output_queue;
struct sk_buff *completion_queue;
struct net_device backlog_dev;
}
th...
Linux iperf3
iperf3 homepage
download iperf3
iperf3是一款Linux下的网络吞吐量测量工具,它支持测量TCP、UDP、SCTP吞吐量。
iperf3有两种运行模式:client、server。
使用iperf3进行测试时,需要在一台服务器以server模式运行iperf3,在另一台机器以client模式运行iperf3.
默认情况下,数据由client端发送给server端,client端测量发送速率,server端测量接收速率。使用-R参数可以反转测试。
测试过程中,iperf3 client会首先与server端创建控制连接(TCP连接,服务器端默认端口是5201,可以使用-p参数修改默认端口),控制连接用来同步测试参数、控制测试的开始和结束、以及发送...
Linux lsof命令
本文来源
lsof是系统管理/安全的尤伯工具。将这个工具称之为lsof真实名副其实,因为它是指“列出打开文件(lists openfiles)”。而有一点要切记,在Unix中一切(包括网络套接口)都是文件。
有趣的是,lsof也是有着最多开关的Linux/Unix命令之一。它有那么多的开关,它有许多选项支持使用-和+前缀。
1. usage: [-?abhlnNoOPRstUvV] [+|-c c] [+|-d s] [+D D] [+|-f[cgG]]
2. [-F [f]] [-g [s]] [-i [i]] [+|-L [l]] [+|-M] [-o [o]]
3. [-p s] [+|-r [t]] [-S [t]] [-T [t]] [-...
共计 109 篇文章,14 页。