Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release-v1.10 #1018

Merged
merged 28 commits into from
Feb 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
f77dfaf
kni: virtio-user replacement for kni
ywc689 Sep 30, 2024
3aecb72
vlan: flush addrs and routes when vlan device removed
ywc689 Sep 30, 2024
4da893e
build(deps): bump golang.org/x/crypto from 0.4.0 to 0.17.0 in /test/quic
dependabot[bot] Oct 10, 2024
3095daf
Merge pull request #1000 from iqiyi/dependabot/go_modules/test/quic/g…
ywc689 Oct 10, 2024
774677a
route6: support route flush and lpm differentiates same prefix routes…
ywc689 Oct 12, 2024
f5504c6
netif: fix duplicate ARP replies or KNI packets being counted as dropped
lxchx Oct 22, 2024
586c244
kni: fix tx checksum problem when tx-csum offload feature enabled on …
ywc689 Oct 16, 2024
a7ac0ca
docs: update kni-realted docs
ywc689 Oct 24, 2024
18459fc
netif: fix kni failing to work problem when netif ports hot plugging
ywc689 Oct 29, 2024
63c536f
conf: optimize init attribute
lxchx Nov 19, 2024
673aa0c
Merge pull request #1002 from lxchx/fix-duplicate-arp-reply-or-kni-as…
ywc689 Nov 25, 2024
9c87f87
Merge pull request #1005 from lxchx/conf-optimize
ywc689 Nov 28, 2024
7eb35f8
kni: fix logging and header including problems
ywc689 Dec 5, 2024
e3ef22a
Merge pull request #1004 from ywc689/kni-replacement
ywc689 Dec 6, 2024
e0dde8e
dpdk: adapted for dpdk-24.11
ywc689 Dec 5, 2024
be14683
kni: fix tx-csum offload feature of virtio-kni gets re-enabled problem
ywc689 Dec 10, 2024
eae9c15
patch: add patches for dpdk-24.11
ywc689 Dec 16, 2024
e8d2923
netif: replace device scoped fdir config with rte_flow, and use virti…
ywc689 Dec 18, 2024
794229f
doc: update docs for use of dpdk-24.11
ywc689 Dec 23, 2024
8674918
patch: remove outdated patches
ywc689 Dec 23, 2024
2711a97
kni: disable rx offloading features on virtio-user kni devices
ywc689 Dec 27, 2024
0107af3
version: release v1.10.0
ywc689 Dec 23, 2024
d015e29
netif: fix packet reception problem caused by TX_OFFLOAD_MBUF_FAST_FREE
ywc689 Jan 9, 2025
17277ab
version: update version file
ywc689 Jan 9, 2025
c91d39a
ci: update ci workflow files to support both v1.9 and v1.10
ywc689 Jan 15, 2025
c6b0c3f
Makefile: use goproxy to download dependent golang package
ywc689 Jan 15, 2025
108636a
Merge pull request #1009 from ywc689/dpdk-24.11-supports
ywc689 Jan 15, 2025
7520599
doc: fix github ci badge links
ywc689 Jan 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/build-lts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: BUILD-LTS

on:
push:
branches:
- 'DPVS-1.9-LTS'
release:
branches:
- 'DPVS-1.9-LTS'
types:
- published
pull_request:
branches:
- 'DPVS-1.9-LTS'
types:
- labeled

jobs:
build-basic:
runs-on: self-hosted
env:
PKG_CONFIG_PATH: /data/dpdk/20.11.10/dpdklib/lib64/pkgconfig
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Build
run: make -j

build-all:
runs-on: self-hosted
env:
PKG_CONFIG_PATH: /data/dpdk/20.11.10/dpdklib/lib64/pkgconfig
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Config
run: sed -i 's/=n$/=y/' config.mk
- name: Build
run: make -j
36 changes: 21 additions & 15 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,38 +1,44 @@
name: Build
name: BUILD

on:
push:
branches: [master, devel, DPVS-1.8-LTS]
branches:
- 'master'
- 'devel'
release:
branches: [master]
types: [published]
branches:
- 'master'
- 'devel'
types:
- published
schedule:
- cron: '30 2 * * 1'
pull_request:
branches: [master, devel, DPVS-1.8-LTS]
types: [labeled]
branches:
- 'master'
- 'devel'
types:
- labeled

jobs:
build-basic:
runs-on: self-hosted
env:
PKG_CONFIG_PATH: /data/dpdk/dpdklib/lib64/pkgconfig
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
PKG_CONFIG_PATH: /data/dpdk/24.11/dpdklib/lib64/pkgconfig
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: build
uses: actions/checkout@v4
- name: Build
run: make -j

build-all:
runs-on: self-hosted
env:
PKG_CONFIG_PATH: /data/dpdk/dpdklib/lib64/pkgconfig
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
PKG_CONFIG_PATH: /data/dpdk/24.11/dpdklib/lib64/pkgconfig
steps:
- name: Checkout Code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Config
run: sed -i 's/=n$/=y/' config.mk
- name: build
- name: Build
run: make -j
32 changes: 32 additions & 0 deletions .github/workflows/run-lts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: RUN-LTS

on:
push:
branches:
- 'DPVS-1.9-LTS'
release:
branches:
- 'DPVS-1.9-LTS'
types:
- published
pull_request:
types:
- labeled
branches:
- 'DPVS-1.9-LTS'

jobs:
run-dpvs:
runs-on: self-hosted
env:
PKG_CONFIG_PATH: /data/dpdk/20.11.10/dpdklib/lib64/pkgconfig
#ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Build
run: make -j
- name: Install
run: make install
- name: Run DPVS
run: sudo dpvsci $(pwd)/bin/dpvs
27 changes: 17 additions & 10 deletions .github/workflows/run.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,33 @@
name: Run
name: RUN

on:
push:
branches: [master, devel, DPVS-1.8-LTS]
branches:
- 'master'
- 'devel'
release:
branches: [master]
types: [published]
branches:
- 'master'
- 'devel'
types:
- published
schedule:
- cron: '30 3 * * 1'
- cron: '30 3 * * 1'
pull_request:
branches: [master, devel, DPVS-1.8-LTS]
types: [labeled]
types:
- labeled
branches:
- 'master'
- 'devel'

jobs:
run-dpvs:
runs-on: self-hosted
env:
PKG_CONFIG_PATH: /data/dpdk/dpdklib/lib64/pkgconfig
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
PKG_CONFIG_PATH: /data/dpdk/24.11/dpdklib/lib64/pkgconfig
steps:
- name: Checkout Code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Build
run: make -j
- name: Install
Expand Down
78 changes: 44 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
![Build](https://github.com/iqiyi/dpvs/workflows/Build/badge.svg) ![Run](https://github.com/iqiyi/dpvs/workflows/Run/badge.svg)
![Build](https://github.com/iqiyi/dpvs/workflows/BUILD/badge.svg) ![Run](https://github.com/iqiyi/dpvs/workflows/RUN/badge.svg)

![dpvs-logo.png](./pic/DPVS-logo.png)

# Introduction

`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).
`DPVS` is a high performance **Layer-4 load balancer** based on [DPDK](http://dpdk.org). It derives from Linux Virtual Server [LVS](http://www.linuxvirtualserver.org/) and its modification [alibaba/LVS](https://github.com/alibaba/LVS).

> Notes: The name `DPVS` comes from "DPDK-LVS".

Expand Down Expand Up @@ -43,25 +43,29 @@ DPVS consists of the modules illustrated in the diagram below.

This *quick start* is performed in the environments described below.

* Linux Distribution: CentOS 7.6
* Kernel: 3.10.0-957.el7.x86_64
* CPU: Intel(R) Xeon(R) CPU E5-2650 v4 @ 2.20GHz
* NIC: Intel Corporation Ethernet Controller 10-Gigabit X540-AT2 (rev 03)
* Memory: 64G with two NUMA node.
* GCC: 4.8.5 20150623 (Red Hat 4.8.5-36)
* Linux Distribution: Anolis OS release 8.8
* Kernel: 5.10.134-13.an8.x86_64
* GCC: gcc (GCC) 8.5.0 20210514 (Anolis 8.5.0-10.0.3)
* Python: 3.6 (with pyelftools: 0.31)
* meson: 0.58.2
* pkgconf: 1.4.2
* numactl-devel: 2.0.14 (required by DPDK on NUMA-aware system)
* Golang: go1.20.4 linux/amd64 (required only when CONFIG_DPVS_AGENT enabled).

Other environments should also be OK if DPDK works, please check [dpdk.org](http://www.dpdk.org) for more information.
Other environments should also be OK if DPDK works, please check [DPDK Supported Hardware](https://core.dpdk.org/supported/) and [DPDK System Requirements](https://doc.dpdk.org/guides/linux_gsg/sys_reqs.html#) for more information.

> Notes:
> 1. Please check this link for NICs supported by DPDK: http://dpdk.org/doc/nics.
> 1. Please check this link for NICs supported by DPDK: http://core.dpdk.org/supported.
> 2. `Flow Control` ([rte_flow](http://dpdk.org/doc/guides/nics/overview.html#id1)) is required for `FNAT` and `SNAT` mode when DPVS running on multi-cores unless `conn redirect` is enabled. The minimum requirements to ensure DPVS works with multi-core properly is that `rte_flow` must support "ipv4, ipv6, tcp, udp" four items, and "drop, queue" two actions.
> 3. DPVS doesn't confine itself to the this test environments. In fact, DPVS is an user-space application which relies very little on operating system, kernel versions, compilers, and other platform discrepancies. As far as is known, DPVS has been verified at least in the following environments.
> * Centos 7.2, 7.6, 7.9
> * Anolis 8.6, 8.8, 8.9
> * GCC 4.8, 8.5
> * GCC 8.5
> * Kernel: 3.10.0, 4.18.0, 5.10.134
> * NIC: Intel IXGBE, NVIDIA MLX5
> * Centos 7.x and GCC 4.8 are also supported by DPVS versions earlier than v1.10.

## Clone DPVS

Expand All @@ -74,27 +78,35 @@ Well, let's start from DPDK then.

## DPDK setup

Currently, `dpdk-stable-20.11.10` 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.6` and `dpdk-stable-18.11.2`, please use earlier DPVS releases, such as [v1.8.12](https://github.com/iqiyi/dpvs/releases/tag/v1.8.12).
Currently, `dpdk-24.11` is recommended for `DPVS`, and we will not support dpdk versions earlier than dpdk-20.11 any more. If you are still using earlier dpdk versions, please use earlier [DPVS releases](https://github.com/iqiyi/dpvs/releases). The best matched DPDK versions are listed in the table below.

> 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.
| DPVS Version | DPDK Version |
| --------------- | ---------------- |
| v1.10 | 24.11 |
| v1.9 | 20.11 |
| v1.8 | 18.11 |
| v1.7 or earlier | 17.11 or earlier |

> Notes: You can skip this section if experienced with DPDK, and refer to this [link](https://doc.dpdk.org/guides/linux_gsg/index.html) for details.

```bash
$ wget https://fast.dpdk.org/rel/dpdk-20.11.10.tar.xz # download from dpdk.org if link failed.
$ tar xf dpdk-20.11.10.tar.xz
$ wget https://fast.dpdk.org/rel/dpdk-24.11.tar.xz # download from dpdk.org if link failed.
$ tar xf dpdk-24.11.tar.xz
```

### DPDK patchs
### DPDK patches

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.
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 ixgbe flow, apply it if you are using the ixgbe network adapter.

> Notes: It's assumed we are in DPVS root directory where you have installed dpdk-stable-20.11.10 source codes. Please note it's not mandatory, just for convenience.
> Notes: It's assumed we are in DPVS root directory where you have installed dpdk-24.11 source codes. Please note it's not mandatory, just for convenience.

```
$ cd <path-of-dpvs>
$ cp patch/dpdk-stable-20.11.10/*.patch dpdk-stable-20.11.10/
$ cd dpdk-stable-20.11.10/
$ patch -p1 < 0001-kni-use-netlink-event-for-multicast-driver-part.patch
$ patch -p1 < 0002-pdump-change-dpdk-pdump-tool-for-dpvs.patch
$ cp patch/dpdk-24.11/*.patch dpdk-24.11/
$ cd dpdk-24.11/
$ patch -p1 < 0001-pdump-add-cmdline-packet-filters-for-dpdk-pdump-tool.patch
$ patch -p1 < 0002-debug-enable-dpdk-eal-memory
$ patch -p1 < 0003-ixgbe_flow-patch-ixgbe-fdir-rte_flow-for-dpvs.patch
$ ...
```

Expand All @@ -105,7 +117,7 @@ $ ...
Use meson-ninja to build DPDK, and export environment variable `PKG_CONFIG_PATH` for DPDK application (DPVS). The sub-Makefile `src/dpdk.mk` in DPVS will check the presence of libdpdk.

```bash
$ cd dpdk-stable-20.11.10
$ cd dpdk-24.11
$ mkdir dpdklib # user desired install folder
$ mkdir dpdkbuild # user desired build folder
$ meson -Denable_kmods=true -Dprefix=dpdklib dpdkbuild
Expand All @@ -116,7 +128,7 @@ $ export PKG_CONFIG_PATH=$(pwd)/../dpdklib/lib64/pkgconfig/

> 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.

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).
Next is to set up DPDK hugepage. Our test environment is NUMA system. For single-node system please refer to the [link](http://doc.dpdk.org/guides/linux_gsg/sys_reqs.html#use-of-hugepages-in-the-linux-environment).

```bash
$ # for NUMA machine
Expand All @@ -137,34 +149,32 @@ $ mount -t hugetlbfs nodev /mnt/huge
```

> Notes:
> 1. Hugepages of other size, such as 1GB-size hugepages, can also be used if your system supports.
> 1. Hugepages of other sizes, such as 1GB-size hugepages, can also be used if your system supports.
> 2. It's recommended to reserve hugepage memory and isolate CPUs used by DPVS with linux kernel cmdline options in production environments, for example `isolcpus=1-9 default_hugepagesz=1G hugepagesz=1G hugepages=32`.

Next, install kernel modules required by DPDK and DPVS.

* DPDK driver kernel module:
Depending on your NIC and system, NIC may require binding a DPDK-compitable driver, such as `vfio-pci`, `igb_uio`, or `uio_pci_generic`. Refer to [DPDK doc](https://doc.dpdk.org/guides/linux_gsg/linux_drivers.html) for more details. In this test, we use the linux standard UIO kernel module `uio_pci_generic`.
Depending on your NIC and system, NIC may require binding a DPDK-compitable driver, such as `vfio-pci`, `igb_uio`, or `uio_pci_generic`. Note that some NICs supporting bifircated driver should skip the step. Refer to [DPDK Linux Drivers](https://doc.dpdk.org/guides/linux_gsg/linux_drivers.html) for details. In this test, we use the linux standard UIO kernel module `uio_pci_generic` for the ixgbe NIC.

* KNI kernel module:
KNI kernel module `rte_kni.ko` is required by DPVS as the exception data path which processes packets not dealt with in DPVS to kernel stack.
The KNI kernel module, library and PMD has been removed since DPDK 23.11 release. DPVS has replaced it with virtio-user devices(namely virtio-user kni) since v1.10. Nevertheless, the kernel module `rte_kni.ko` is required if you are still using DPDK KNI in earlier DPDK/DPVS versions as a solution to the exception data path.

```bash
$ modprobe uio_pci_generic

$ cd dpdk-stable-20.11.10
$ insmod dpdkbuild/kernel/linux/kni/rte_kni.ko carrier=on

$ # bind eth0 to uio_pci_generic (Be aware: Network on eth0 will get broken!)
$ ## bind eth0 to uio_pci_generic (Be aware: Network on eth0 will get broken!)
$ ./usertools/dpdk-devbind.py --status
$ ifconfig eth0 down # assuming eth0's pci-bus location is 0000:06:00.0
$ ./usertools/dpdk-devbind.py -b uio_pci_generic 0000:06:00.0
```
> Notes:
> 1. The test in our Quick Start uses only one NIC. Bind as many NICs as required in your DPVS application to DPDK driver kernel module. For example, you should bind at least 2 NICs if you are testing DPVS with two-arm.
> 2. `dpdk-devbind.py -u` can be used to unbind driver and switch it back to Linux driver like `ixgbe`. Use `lspci` or `ethtool -i eth0` to check the NIC's PCI bus-id. Please refer to [DPDK Doc:Binding and Unbinding Network Ports to/from the Kernel Modules](https://doc.dpdk.org/guides/linux_gsg/linux_drivers.html#binding-and-unbinding-network-ports-to-from-the-kernel-modules) for more details.
> 3. NVIDIA/Mellanox NIC uses bifurcated driver which doesn't rely on UIO/VFIO driver, so not bind any DPDK driver kernel module, but [NVIDIA MLNX_OFED/EN](https://network.nvidia.com/products/infiniband-drivers/linux/mlnx_ofed/) is required. Refer to [Mellanox DPDK](https://enterprise-support.nvidia.com/s/article/mellanox-dpdk) for its PMD and [Compilation Prerequisites](https://doc.dpdk.org/guides/platform/mlx5.html#linux-prerequisites) for OFED installation.
> 4. A kernel module parameter `carrier` has been 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 extra parameter `carrier=on` to make KNI devices work properly.
> 5. Multiple DPVS instances can run on a single server if there are enough NICs or VFs within one NIC. Refer to [tutorial:Multiple Instances](https://github.com/iqiyi/dpvs/blob/devel/doc/tutorial.md#multi-instance) for details.
> 2. `dpdk-devbind.py -u` can be used to unbind driver and switch it back to Linux driver. Use `lspci` or `ethtool -i eth0` to check the NIC's PCI bus-id. Please refer to [DPDK Doc:Binding and Unbinding Network Ports to/from the Kernel Modules](https://doc.dpdk.org/guides/linux_gsg/linux_drivers.html#binding-and-unbinding-network-ports-to-from-the-kernel-modules) for more details.
> 3. NVIDIA/Mellanox NIC uses bifurcated driver which doesn't rely on UIO/VFIO driver, so NOT bind any DPDK driver kernel module, but [NVIDIA MLNX_OFED/EN](https://network.nvidia.com/products/infiniband-drivers/linux/mlnx_ofed/) is required. Refer to [Mellanox DPDK](https://enterprise-support.nvidia.com/s/article/mellanox-dpdk) for its PMD and [Compilation Prerequisites](https://doc.dpdk.org/guides/platform/mlx5.html#linux-prerequisites) for OFED installation.
> 4. A kernel module parameter `carrier` was added to `rte_kni.ko` for DPDK 18.11~23.11, and the default value for it is "off". We need to load `rte_kni.ko` with extra parameter `carrier=on` to make KNI devices work properly.
> 5. Following the DPDK technical board decision and refinement, the KNI kernel module, library and PMD was removed from the DPDK 23.11 release (refer to [ABI and API Deprecation(DPDK 22.11)](https://doc.dpdk.org/guides-22.11/rel_notes/deprecation.html)). As a replacement solution, DPVS has supported [virtio-user as exception path](https://doc.dpdk.org/guides/howto/virtio_user_as_exception_path.html) since v1.9.10, which is default off in v1.9 and can be enabled with `CONFIG_KNI_VIRTIO_USER` in config.mk.
> 6. Multiple DPVS instances can run on a single server if there are enough NICs or VFs within one NIC. Refer to [tutorial:Multiple Instances](https://github.com/iqiyi/dpvs/blob/devel/doc/tutorial.md#multi-instance) for details.

## Build DPVS

Expand Down Expand Up @@ -211,7 +221,7 @@ $ ./dpvs &
$ # alternatively and strongly advised, start DPVS with NIC and CPU explicitly specified:
$ ./dpvs -- -a 0000:06:00.0 -l 1-9
```
> Notes:
> Tips:
> 1. Run `./dpvs --help` for DPVS supported command line options, and `./dpvs -- --help` for common DPDK EAL command line options.
> 2. The default `dpvs.conf` require 9 CPUs(1 master worker, 8 slave workers), modify it if not so many available CPUs in your system.

Expand Down
Loading