Skip to content

Commit

Permalink
Merge pull request #326 from iqiyi/devel
Browse files Browse the repository at this point in the history
IPv6 supports
  • Loading branch information
ywc689 committed Nov 10, 2018
2 parents 282d735 + 146f579 commit 32bd598
Show file tree
Hide file tree
Showing 106 changed files with 12,457 additions and 2,743 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -33,3 +33,4 @@ Module.symvers
modules.order
*.ko
*.mod.c
.ycm_extra_conf.py
20 changes: 20 additions & 0 deletions CONTRIBUTING.md
@@ -0,0 +1,20 @@
# Contributing

We are really glad you're reading this, because we need volunteer developers to enhance this open source project. Pls feel free to submit issues, bugfix or new features. We really appreciate any contributing work you made to the project.

How to contribute the project? In general, we follow the "fork-and-pull" [Git workflow](https://nvie.com/posts/a-successful-git-branching-model/). Two main branches with infinite lifetime exist: **master** and **devel**. It is recommended that you should follow the workflow if you want to submit a patch to the project.

* S1. **Fork** the repo on Github.
* S2. **Clone** the project to your own machine.
* S3. **Checkout** to `devel` branch of the project on your own machine.
* S4. **Commit** changes on your own branch.
* S5. **Push** your work back up to your fork.
* S6. Submit a **Pull Request** so that we can review your changes.

NOTE: Be sure to merge the latest from "upstream" before making a pull request!

# Coding conventions

Basically, codeing style should be consistent in the whole project. We recommend to use the [Linux kernel coding style](https://www.kernel.org/doc/html/v4.10/process/coding-style.html#).

NOTE: As for indentations, we use 4-char indents, not 8-char indents. This is different from Linux kernel coding style.
8 changes: 4 additions & 4 deletions conf/dpvs.bond.conf.sample
Expand Up @@ -25,7 +25,7 @@ netif_defs {
rx {
queue_number 8
descriptor_number 1024
rss tcp
rss all
}
tx {
queue_number 8
Expand All @@ -39,7 +39,7 @@ netif_defs {
rx {
queue_number 8
descriptor_number 1024
rss tcp
rss all
}
tx {
queue_number 8
Expand All @@ -54,7 +54,7 @@ netif_defs {
rx {
queue_number 8
descriptor_number 1024
rss tcp
rss all
}
tx {
queue_number 8
Expand All @@ -68,7 +68,7 @@ netif_defs {
rx {
queue_number 8
descriptor_number 1024
rss tcp
rss all
}
tx {
queue_number 8
Expand Down
27 changes: 25 additions & 2 deletions conf/dpvs.conf.items
Expand Up @@ -26,12 +26,17 @@ netif_defs {
#max_burst_size 32
queue_number 6 <16, 0-16>
descriptor_number 256 <256, 16-8192>
rss ip <tcp, tcp|ip>
rss all <all, all|ip|tcp|udp|sctp|ether|port|tunnel>
}
tx {
queue_number 6 <16, 0-16>
descriptor_number 512 <512, 16-8192>
}
fdir {
mode perfect <perfect, none|signature|perfect|perfect_mac_vlan|perfect_tunnel>
pballoc 64k <64k, 64k|128k|256k>
status matched <matched, close|matched|always>
}
! promisc_mode <disable>
! kni_name dpdk0.kni <char[32]>
}
Expand All @@ -41,7 +46,7 @@ netif_defs {
#max_burst_size 32
queue_number 4
descriptor_number 128
rss tcp
rss all
}
tx {
queue_number 4
Expand Down Expand Up @@ -137,6 +142,7 @@ neigh_defs {

! dpvs ipv4 config
ipv4_defs {
forwarding off <off, on/off>
<init> default_ttl 64 <64, 0-255>
fragment {
<init> bucket_number 4096 <4096, 32-65536>
Expand All @@ -146,6 +152,22 @@ ipv4_defs {
}
}

! dpvs ipv6 config
ipv6_defs {
disable off <off, on/off>
forwarding off <off, on/off>
route6 {
<init> method "hlist" <"hlist"/"lpm">
recycle_time 10 <10, 1-36000>
lpm {
<init> lpm6_max_rules 1024 <1024, 16-2147483647>
<init> lpm6_num_tbl8s 65536 <65536, 16-2147483647>
<init> rt6_array_size 65536 <65536, 16-2147483647>
<init> rt6_hash_bucket 256 <256, 2-2147483647>
}
}
}

! control plane config
ctrl_defs {
lcore_msg {
Expand Down Expand Up @@ -221,3 +243,4 @@ ipvs_defs {
sa_pool {
<init> pool_hash_size 16 <16, 1-128>
}

72 changes: 46 additions & 26 deletions conf/dpvs.conf.sample
Expand Up @@ -13,50 +13,60 @@
! global config
global_defs {
log_level WARNING
! log_file /var/log/dpvs.log
! log_file /var/log/dpvs.log
}

! netif config
netif_defs {
<init> pktpool_size 2097151
<init> pktpool_size 1048575
<init> pktpool_cache 256

<init> device dpdk0 {
rx {
queue_number 8
descriptor_number 1024
rss tcp
rss all
}
tx {
queue_number 8
descriptor_number 1024
}
! promisc_mode
fdir {
mode perfect
pballoc 64k
status matched
}
! promisc_mode
kni_name dpdk0.kni
}

<init> device dpdk1 {
rx {
queue_number 8
descriptor_number 1024
rss tcp
rss all
}
tx {
queue_number 8
descriptor_number 1024
}
! promisc_mode
fdir {
mode perfect
pballoc 64k
status matched
}
! promisc_mode
kni_name dpdk1.kni
}

! <init> bonding bond0 {
! mode 0
! slave dpdk0
! slave dpdk1
! primary dpdk0
! kni_name bond0.kni
! }
}
! <init> bonding bond0 {
! mode 0
! slave dpdk0
! slave dpdk1
! primary dpdk0
! kni_name bond0.kni
!}


! worker config (lcores)
worker_defs {
Expand Down Expand Up @@ -217,7 +227,7 @@ neigh_defs {

! dpvs ipv4 config
ipv4_defs {
<init> ipv4_forward off ! set this to on, dpvs will forward packets that NOT hit rules directly
forwarding off ! set this to on, dpvs will forward packets that NOT hit rules directly
<init> default_ttl 64
fragment {
<init> bucket_number 4096
Expand All @@ -227,12 +237,22 @@ ipv4_defs {
}
}

! dpvs ipv6 config
ipv6_defs {
disable off
forwarding off
route6 {
method "hlist"
recycle_time 10
}
}

! control plane config
ctrl_defs {
lcore_msg {
<init> ring_size 4096
<init> multicast_queue_length 256
sync_msg_timeout_us 2000
sync_msg_timeout_us 20000
}
ipc_msg {
<init> unix_domain /var/run/dpvs_ctrl
Expand All @@ -245,20 +265,20 @@ ipvs_defs {
<init> conn_pool_size 2097152
<init> conn_pool_cache 256
conn_init_timeout 3
! expire_quiescent_template
! fast_xmit_close
! expire_quiescent_template
! fast_xmit_close
}

udp {
defence_udp_drop
! defence_udp_drop
timeout {
normal 300
last 3
}
}

tcp {
defence_tcp_drop
! defence_tcp_drop
timeout {
none 2
established 90
Expand All @@ -278,19 +298,19 @@ ipvs_defs {
mss 1452
ttl 63
sack
! wscale
! timestamp
! wscale
! timestamp
}
! defer_rs_syn
! defer_rs_syn
rs_syn_max_retry 3
ack_storm_thresh 10
max_ack_saved 3
conn_reuse_state {
close
time_wait
! fin_wait
! close_wait
! last_ack
! fin_wait
! close_wait
! last_ack
}
}
}
Expand Down

0 comments on commit 32bd598

Please sign in to comment.