You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+40-36Lines changed: 40 additions & 36 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@
6
6
7
7
`DPVS` is a high performance **Layer-4 load balancer** based on [DPDK](http://dpdk.org). It's derived from Linux Virtual Server [LVS](http://www.linuxvirtualserver.org/) and its modification [alibaba/LVS](https://github.com/alibaba/LVS).
8
8
9
-
> The name `DPVS` comes from "DPDK-LVS".
9
+
> Notes: The name `DPVS` comes from "DPDK-LVS".
10
10
11
11

12
12
@@ -52,7 +52,9 @@ This *quick start* is tested with the environment below.
52
52
Other environments should also be OK if DPDK works, please check [dpdk.org](http://www.dpdk.org) for more info.
53
53
54
54
* Please check this link for NICs supported by DPDK: http://dpdk.org/doc/nics.
55
-
* Note `flow-director` ([fdir](http://dpdk.org/doc/guides/nics/overview.html#id1)) is needed for `FNAT` and `SNAT` mode with multi-cores.
55
+
* Note `flow control` ([rte_flow](http://dpdk.org/doc/guides/nics/overview.html#id1)) is needed for `FNAT` and `SNAT` mode with multi-cores.
56
+
57
+
> Notes: To let dpvs work properly with multi-cores, rte_flow items must support "ipv4, ipv6, tcp, udp" four items, and rte_flow actions must support "drop, queue" at least.
56
58
57
59
## Clone DPVS
58
60
@@ -65,48 +67,49 @@ Well, let's start from DPDK then.
65
67
66
68
## DPDK setup.
67
69
68
-
Currently, `dpdk-stable-18.11.2` is recommended for `DPVS`. `dpdk-stable-17.11.2` and `dpdk-stable-17.11.6`are supported until the lifecycle end of DPVS v1.8.
70
+
Currently, `dpdk-stable-20.11.1` is recommended for `DPVS`, and we will not support dpdk version earlier than dpdk-20.11 any more. If you are still using earlier dpdk versions, such as `dpdk-stable-17.11.2`, `dpdk-stable-17.11.6`and `dpdk-stable-18.11.2`, please use earlier dpvs releases, such as [v1.8.10](https://github.com/iqiyi/dpvs/releases/tag/v1.8.10).
69
71
70
-
> You can skip this section if experienced with DPDK, and refer the [link](http://dpdk.org/doc/guides/linux_gsg/index.html) for details.
72
+
> Notes: You can skip this section if experienced with DPDK, and refer the [link](http://dpdk.org/doc/guides/linux_gsg/index.html) for details.
71
73
72
74
```bash
73
-
$ wget https://fast.dpdk.org/rel/dpdk-18.11.2.tar.xz # download from dpdk.org if link failed.
74
-
$ tar xf dpdk-18.11.2.tar.xz
75
+
$ wget https://fast.dpdk.org/rel/dpdk-20.11.1.tar.xz # download from dpdk.org if link failed.
76
+
$ tar xf dpdk-20.11.1.tar.xz
75
77
```
76
78
77
79
### DPDK patchs
78
80
79
81
There are some patches for DPDK to support extra features needed by DPVS. Apply them if needed. For example, there's a patch for DPDK `kni` driver for hardware multicast, apply it if you are to launch `ospfd` on `kni` device.
80
82
81
-
> Assuming we are in DPVS root directory and dpdk-stable-18.11.2 is under it, please note it's not mandatory, just for convenience.
83
+
> Notes: Assuming we are in DPVS root directory and dpdk-stable-20.11.1 is under it, please note it's not mandatory, just for convenience.
> It's advised to patch all if your are not sure about what they are meant for.
94
+
> Tips: It's advised to patch all if your are not sure about what they are meant for.
93
95
94
96
### DPDK build and install
95
97
96
-
Now build DPDK and export `RTE_SDK` env variable for DPDK app (DPVS).
98
+
Use meson-ninja to build DPDK libraries, and export environment variable `PKG_CONFIG_PATH`for DPDK app (DPVS). The `dpdk.mk` in DPVS checks the presence of libdpdk.
97
99
98
100
```bash
99
-
$ cd dpdk-stable-18.11.2/
100
-
$ make config T=x86_64-native-linuxapp-gcc
101
-
Configuration done
102
-
$ make # or make -j40 to save time, where 40 is the cpu core number.
In our tutorial, `RTE_TARGET` is set to the default "build", thus DPDK libs and header files can be found in `dpdk-stable-18.11.2/build`.
110
+
> Tips: You can use script [dpdk-build.sh](./scripts/dpdk-build.sh)to facilitate dpdk build. Run `dpdk-build.sh -h` for the usage of the script.
108
111
109
-
Now to set up DPDK hugepage, our test environment is NUMA system. For single-node system please refer to the [link](http://dpdk.org/doc/guides/linux_gsg/sys_reqs.html).
112
+
Next is to set up DPDK hugepage. Our test environment is NUMA system. For single-node system please refer to the [link](http://dpdk.org/doc/guides/linux_gsg/sys_reqs.html).
110
113
111
114
```bash
112
115
$ # for NUMA machine
@@ -117,40 +120,41 @@ $ mkdir /mnt/huge
117
120
$ mount -t hugetlbfs nodev /mnt/huge
118
121
```
119
122
120
-
Install kernel modules and bind NIC with `igb_uio` driver. Quick start uses only one NIC, normally we use 2 for FNAT cluster, even 4 for bonding mode. For example, suppose the NIC we would use to run DPVS is eth0, in the meantime, we still keep another standalone NIC eth1 for debugging.
123
+
Install kernel modules and bind NIC with `uio_pci_generic` driver. Quick start uses only one NIC, normally we use two for FNAT cluster, even four for bonding mode. For example, suppose the NIC we would use to run DPVS is eth0, in the meantime, we still keep another standalone NIC eth1 for debugging.
> Note that a kernel parameter `carrier` is added to `rte_kni.ko` since [DPDK v18.11](https://elixir.bootlin.com/dpdk/v18.11/source/kernel/linux/kni/kni_misc.c), and the default value for it is "off". We need to load `rte_kni.ko` with the extra parameter `carrier=on` to make KNI devices work properly.
136
+
> Notes:
137
+
> 1. An alternative to the `uio_pci_generic` is `igb_uio`, which is moved to a separated repository [dpdk-kmods](http://git.dpdk.org/dpdk-kmods).
138
+
> 2. A kernel module parameter `carrier` is added to `rte_kni.ko` since [DPDK v18.11](https://elixir.bootlin.com/dpdk/v18.11/source/kernel/linux/kni/kni_misc.c), and the default value for it is "off". We need to load `rte_kni.ko` with the extra parameter `carrier=on` to make KNI devices work properly.
135
139
136
140
`dpdk-devbind.py -u` can be used to unbind driver and switch it back to Linux driver like `ixgbe`. You can also use `lspci` or `ethtool -i eth0` to check the NIC PCI bus-id. Please refer to [DPDK site](http://www.dpdk.org) for more details.
137
141
138
-
> Note: PMD of Mellanox NIC is built on top of libibverbs using the Raw Ethernet Accelerated Verbs AP. It doesn't rely on UIO/VFIO driver. Thus, Mellanox NICs should not bind the `igb_uio` driver. Refer to [Mellanox DPDK](https://community.mellanox.com/s/article/mellanox-dpdk) for details.
142
+
> Notes: PMD of Mellanox NIC is built on top of libibverbs using the Raw Ethernet Accelerated Verbs AP. It doesn't rely on UIO/VFIO driver. Thus, Mellanox NICs should not bind the `igb_uio` driver. Refer to [Mellanox DPDK](https://community.mellanox.com/s/article/mellanox-dpdk) for details.
139
143
140
144
## Build DPVS
141
145
142
-
It's simple, just set `RTE_SDK` and build it.
146
+
It's simple, just set `PKG_CONFIG_PATH` and build it.
143
147
144
148
```bash
145
-
$ cd dpdk-stable-18.11.2/
146
-
$ export RTE_SDK=$PWD
149
+
$ export PKG_CONFIG_PATH=<path-of-libdpdk.pc># normally located at dpdklib/lib64/pkgconfig/libdpdk.pc
147
150
$ cd<path-of-dpvs>
148
151
149
-
$ make # or "make -j40" to speed up.
152
+
$ make # or "make -j" to speed up
150
153
$ make install
151
154
```
152
-
153
-
> Build dependencies may be needed, such as `automake`, `libnl3`, `libnl-genl-3.0`, `openssl`, `popt` and `numactl`. You can install the missing dependencies by using the package manager of the system, e.g., `yum install popt-devel` (CentOS).
155
+
> Notes:
156
+
> 1. Build dependencies may be needed, such as `pkg-config`(version 0.29.2+),`automake`, `libnl3`, `libnl-genl-3.0`, `openssl`, `popt` and `numactl`. You can install the missing dependencies by using the package manager of the system, e.g., `yum install popt-devel` (CentOS).
157
+
> 2. Early `pkg-config` versions (v0.29.2 before) may cause dpvs build failure. If so, please upgrade this tool.
>It means the NIC count of DPVS does not match `/etc/dpvs.conf`. Please use `dpdk-devbind` to adjust the NIC number or modify `dpvs.conf`. We'll improve this part to make DPVS more "clever" to avoid modify config file when NIC count does not match.
198
202
199
-
What config items does `dpvs.conf` support and how to configure them? Well, `DPVS` maintains a config item file `conf/dpvs.conf.items` which lists all supported config entries and corresponding feasible values.
203
+
What config items does `dpvs.conf` support? How to configure them? Well, `DPVS` maintains a config item file `conf/dpvs.conf.items` which lists all supported config entries and corresponding feasible values. Besides, some config sample files maintained as `./conf/dpvs.*.sample` show the configurations of dpvs in some specified cases.
0 commit comments