Issue
I'm trying to compile pktgen, but keep getting this error when I try to compile:
src="https://i.stack.imgur.com/HM01p.png" alt="pktgen" />
The DPDK version I'm running is dpdk-stable-22.11.1
and I'm following the official guide Getting Started with Pktgen and I get the error message after I have cd
into the pktgen repo and run make
. Before that I have run the following in the dpdk-stable-22.11.1
directory.
meson build
ninja -C build
I have also setup hugepages.
The error seems to suggest there is something wrong with the code inside of Pktgen which seems unlikely. When I go into the file pg_strings.c
and include ctype.h
, then run make
again, it does not give me an error for those files anymore but instead find some issue within another file etc. So it seems like something is very wrong. Any ideas on what might be the cause of this?
I'm also running this in Virtualbox with Ubuntu 22.04 if that is relevant for the issue.
UPDATE:
To clarify if I include ctype.h
I get a new error which says:
And if I fix this error I come to another file where I have to fix another error and so on. Therefore, I cannot simply include ctype
.
Solution
Most of the issues related to using pktgen 22.04.01 with the latest DPDK 22.11.1 are referenced (indirectly, of course) in the DPDK release file, which can be found at doc/guides/rel_notes/release_22_11.rst (or here)
The main issue appears to be how they've reworked their BUS / PCI libraries, and correspondingly the headers.
There are two things you'll have to do differently than the basic setup steps:
- build DPDK with the
enable_driver_sdk
option, e.g.:
meson -Dexamples=all -Denable_driver_sdk=true build
ninja -C build
sudo ninja install
-Dexamples=all
isn't necessary, but gives you the example programs. The crucial part is the -Denable_driver_sdk=true
, which will add capability and install a few header files that wouldn't exist otherwise, e.g. bus_driver.h
- Update their pktgen code so it compiles:
- lib/common/pg_strings.h: add
#include <ctype.h>
- app/pktgen-port-cfg.h: comment out the line
{RTE_ETH_RX_OFFLOAD_HEADER_SPLIT, _(HEADER_SPLIT)},
(It may be the case thatRTE_ETH_RX_OFFLOAD_HEADER_SPLIT
could simply be substituted withRTE_ETH_RX_OFFLOAD_BUFFER_SPLIT
, but that may be an incomplete fix. If you plan to offload RX header splitting to the hardware, you'll want to make sure this is properly working) - app/pktgen-port-cfg.c: comment out
.split_hdr_size = 0
- every file with
#include <rte_bus_pci.h>
(app/pktgen-latency.c, app/pktgen-port-cfg.c, app/pktgen-stats.c, app/pktgen-rate.c, app/lpktgenlib.c): add the following:
#include <rte_bus.h>
#include <bus_pci_driver.h>
#include <bus_driver.h>
Answered By - Mark H Answer Checked By - Clifford M. (WPSolving Volunteer)