Skip to content

Commit 354b93e

Browse files
committed
initialize code
1 parent 32d4ec7 commit 354b93e

File tree

1,987 files changed

+719770
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,987 files changed

+719770
-0
lines changed

uinet/Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
all:
2+
make -C lib
3+
make -C example
4+
5+
clean:
6+
make -C lib clean
7+
make -C example clean

uinet/config.ini

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
[dpdk]
2+
# Hexadecimal bitmask of cores to run on.
3+
lcore_mask=1
4+
5+
# Number of memory channels.
6+
channel=4
7+
8+
# Specify base virtual address to map.
9+
#base_virtaddr=0x7f0000000000
10+
11+
# Promiscuous mode of nic, defualt: enabled.
12+
promiscuous=1
13+
numa_on=1
14+
15+
# TCP segment offload, default: disabled.
16+
tso=0
17+
18+
# HW vlan strip, default: enabled.
19+
vlan_strip=1
20+
21+
# sleep when no pkts incomming
22+
# unit: microseconds
23+
idle_sleep=100
24+
25+
# enabled port list
26+
#
27+
# EBNF grammar:
28+
#
29+
# exp ::= num_list {"," num_list}
30+
# num_list ::= <num> | <range>
31+
# range ::= <num>"-"<num>
32+
# num ::= '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'
33+
#
34+
# examples
35+
# 0-3 ports 0, 1,2,3 are enabled
36+
# 1-3,4,7 ports 1,2,3,4,7 are enabled
37+
port_list=0
38+
39+
# Port config section
40+
# Correspond to dpdk.port_list's index: port0, port1...
41+
[port0]
42+
addr=192.168.208.128
43+
netmask=255.255.255.0
44+
broadcast=192.168.208.255
45+
gateway=192.168.208.2
46+
mac=00:11:22:33:44:55
47+
48+
# lcore list used to handle this port
49+
# the format is same as port_list
50+
# lcore_list= 0
51+
52+
# Packet capture path, this will hurt performance
53+
#pcap=./a.pcap
54+
55+
# Kni config: if enabled and method=reject,
56+
# all packets that do not belong to the following tcp_port and udp_port
57+
# will transmit to kernel; if method=accept, all packets that belong to
58+
# the following tcp_port and udp_port will transmit to kernel.
59+
[kni]
60+
enable=1
61+
method=reject
62+
# The format is same as port_list
63+
tcp_port=80,443
64+
udp_port=53
65+
66+
# FreeBSD network performance tuning configurations.
67+
# Most native FreeBSD configurations are supported.
68+
[freebsd.boot]
69+
hz=100
70+
71+
# Block out a range of descriptors to avoid overlap
72+
# with the kernel's descriptor space.
73+
# You can increase this value according to your app.
74+
fd_reserve=256
75+
76+
kern.ipc.maxsockets=262144
77+
78+
net.inet.tcp.syncache.hashsize=4096
79+
net.inet.tcp.syncache.bucketlimit=100
80+
81+
net.inet.tcp.tcbhashsize=65536
82+
83+
kern.ncallout=262144
84+
85+
[freebsd.sysctl]
86+
kern.ipc.somaxconn=32768
87+
kern.ipc.maxsockbuf=16777216
88+
89+
net.link.ether.inet.maxhold=5
90+
91+
net.inet.tcp.fast_finwait2_recycle=1
92+
net.inet.tcp.sendspace=16384
93+
net.inet.tcp.recvspace=8192
94+
net.inet.tcp.nolocaltimewait=1
95+
net.inet.tcp.cc.algorithm=cubic
96+
net.inet.tcp.sendbuf_max=16777216
97+
net.inet.tcp.recvbuf_max=16777216
98+
net.inet.tcp.sendbuf_auto=1
99+
net.inet.tcp.recvbuf_auto=1
100+
net.inet.tcp.sendbuf_inc=16384
101+
net.inet.tcp.recvbuf_inc=524288
102+
net.inet.tcp.sack.enable=1
103+
net.inet.tcp.blackhole=1
104+
net.inet.tcp.msl=2000
105+
net.inet.tcp.delayed_ack=0
106+
107+
net.inet.udp.blackhole=1
108+
net.inet.ip.redirect=0

uinet/example/Makefile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
TOPDIR=..
2+
3+
ifeq ($(FF_PATH),)
4+
FF_PATH=${TOPDIR}
5+
endif
6+
7+
ifeq ($(FF_DPDK),)
8+
FF_DPDK=${TOPDIR}/dpdk/x86_64-native-linuxapp-gcc
9+
endif
10+
11+
LIBS+= -L${FF_PATH}/lib -Wl,--whole-archive,-lfstack,--no-whole-archive
12+
#LIBS+= -L${FF_DPDK}/lib -Wl,--whole-archive,-ldpdk,--no-whole-archive
13+
LIBS+= -Wl,--no-whole-archive -lrt -lm -ldl -pthread
14+
#LIBS+= -Wl,--no-whole-archive -lrt -lm -ldl -lcrypto -pthread -lnuma
15+
16+
TARGET="helloworld"
17+
all:
18+
$(CC) -m32 -g -I../lib -o ${TARGET} main.c ${LIBS}
19+
$(CC) -m32 -g -I../lib -o ${TARGET}_epoll main_epoll.c ${LIBS}
20+
21+
.PHONY: clean
22+
clean:
23+
rm -f *.o ${TARGET} ${TARGET}_epoll

0 commit comments

Comments
 (0)