Skip to content
Ivan Koveshnikov edited this page Oct 27, 2022 · 7 revisions

Requirements

Supported Linux kernel version: 5.17
Supported Linux distribution: Ubuntu 20.04 LTS

To process regular expressions at the highest speeds possible, the REGEX runtime must have access to vector instructions such as AVX2 or AVX512. As we propose to use REXEX runtime as an XDP helper function, and execute it inside the softIRQ context, where vector instructions are not available, a few patches are required for the Linux kernel.

As Ubuntu 20.04 LTS provides neither Linux 5.17 nor the required patches, a custom build of the kernel is required. We also provide the patched kernel in binary packages.

Build a patched kernel version

The first and the most crucial patch is related to safe interaction with vector instruction set from the softIRQ context. Multiple subsystems in the Linux kernel take advantage of the vector instruction set, but the latter wasn't used in the softIRQ context before. To ensure the safe usage between the softIRQ and the process context, we have to disable preemption and interrupts while FPU is in use.

The next series of patches ( second, third) are required to make registering the XDP helper possible. Although the work on providing eBPF helpers inside loadable modules was started in Linux 5.16, it wasn't completed until Linux 5.18. We intend to update the module to use the latest stable kernel, and these patch series are going to be obsoleted and not required.

Pre-built packages

All the packages are available on the latest release page We provide bundles:

  • rex-dkms.deb with the regex module
  • linux_package.zip with the patched Linux kernel

Install from sources

To build a DEB package, run the command below:

fakeroot debian/rules binary

After installation, the DKMS subsystem will build the module.

apt-get install -y ./rex-dkms_*_all.deb 

Userspace tools

For the configuration part, a usual build of the Hyper scan may be used. But build from sources is also possible:

cmake -B build -DFAT_RUNTIME=OFF
cmake --build build -j$(nproc)