Skip to content

Instantly share code, notes, and snippets.

@grigorescu
Created January 5, 2022 21:39
Show Gist options
  • Save grigorescu/726bdbfbd9a17c28c5c61e68bd981a5d to your computer and use it in GitHub Desktop.
Save grigorescu/726bdbfbd9a17c28c5c61e68bd981a5d to your computer and use it in GitHub Desktop.
Running DPDK Zeek as a non-privileged user

We're tripling down on acronyms, by using the VFIO driver, with IOMMU and SR-IOV.

Boot parameters

intel_iommu=on iommu=pt default_hugepagesz=1G hugepagesz=1G hugepages=16

Enable hugepages

echo 4096 | sudo tee /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages
mkdir -p /tmp/mnt/huge
mount -t hugetlbfs nodev /tmp/mnt/huge
chown zeek: /tmp/mnt/huge

Enable SR-IOV

echo 1 | sudo tee /sys/module/vfio_pci/parameters/enable_sriov

Bind the NIC to the correct driver

sudo dpdk-devbind.py -b vfio-pci 02:00.0
chown zeek: /dev/vfio/vfio /dev/vfio/52

Set limits

/etc/security/limit.d/24-memlock.conf:

# memlock unit: KiB
zeek hard memlock 16777216
zeek soft memlock 1048576

Then, as the Zeek user: ulimit -l 16777216

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment