export RTE_SDK=/usr/share/dpdk
make
sudo ./build/l2fwd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 0 is too far from ` ;) | |
set -g base-index 1 | |
# Automatically set window title | |
set-window-option -g automatic-rename on | |
set-option -g set-titles on | |
#set -g default-terminal screen-256color | |
set -g status-keys vi | |
set -g history-limit 10000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
*======================================================================= | |
* Filename:redis_thread.c | |
* | |
* Version: 1.0 | |
* Created on: April 03, 2018 | |
* | |
* Author: corvo | |
*======================================================================= | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ch14-timers.c ---- demonstrate interval timers */ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <assert.h> | |
#include <signal.h> | |
#include <sys/time.h> | |
/* handler --- handle SIGALRM */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <netinet/in.h> | |
#include <netinet/ip.h> | |
#include <string.h> | |
#include <arpa/inet.h> // 如果不添加这个头文件, inet_ntoa获取的字符串也无法读取 | |
int main(int argc, char *argv[]) | |
{ | |
struct in_addr ip_src; // 32bits 源IP地址 |
L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns
Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
SSD random read ........................ 150,000 ns = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 测试环境: | |
* Archlinux 4.15.3-2 | |
* GCC 7.3.0 | |
* | |
* g++ -std=c++11 -g -pthread con_test.cpp | |
* | |
* 原文链接: https://corvo.myseu.cn/2018/02/17/2018-02-17-Spurious-Wakeup/ | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 编译: | |
* gcc client.c -o client | |
* | |
* 运行: | |
* ./client 127.0.0.1 12345 <string> | |
*/ | |
#include "stdio.h" | |
#include "sys/socket.h" | |
#include "arpa/inet.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Just for windows gvim, now maybe you could use it on linux. | |
colorscheme desert | |
set nu | |
" Windows上与Linux上配置是不同的 | |
if has('win32') | |
set guifont=consolas:h12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# When i use fish shell, I need export proxy and unset proxy like in bash | |
# No Proxy | |
function noproxy | |
#/usr/local/sbin/noproxy #turn off proxy server | |
#unset http_proxy https_proxy HTTP_PROXY HTTPS_PROXY | |
set -g -e http_proxy | |
set -g -e https_proxy | |
set -g -e HTTP_PROXY |