pktgen / Pktgen-DPDK

DPDK based packet generator
Other
392 stars 120 forks source link

error: expected specifier-qualifier-list before ‘RTE_STD_C11’ #253

Closed vincentmli closed 7 months ago

vincentmli commented 7 months ago

Hi,

I followed the pktgen installation instructions to git clone pktgen, but ran into below error

../../usr/src/pktgen-dpdk/lib/common/mbuf.h:20:5: error: expected specifier-qualifier-list before ‘RTE_STD_C11’
   20 |     RTE_STD_C11
      |     ^~~~~~~~~~~
../../usr/src/pktgen-dpdk/lib/common/mbuf.h: In function ‘pktmbuf_restore’:
../../usr/src/pktgen-dpdk/lib/common/mbuf.h:55:20: error: ‘union pktgen_data’ has no member named ‘data_len’
   55 |     m->data_len = d.data_len;
      |                    ^
../../usr/src/pktgen-dpdk/lib/common/mbuf.h:56:20: error: ‘union pktgen_data’ has no member named ‘pkt_len’
   56 |     m->pkt_len  = d.pkt_len;
      |                    ^
../../usr/src/pktgen-dpdk/lib/common/mbuf.h:57:20: error: ‘union pktgen_data’ has no member named ‘buf_len’
   57 |     m->buf_len  = d.buf_len;
      |                    ^
../../usr/src/pktgen-dpdk/lib/common/mbuf.h:49:23: error: variable ‘d’ set but not used [-Werror=unused-but-set-variable]
   49 |     union pktgen_data d;
      |                       ^

the tagged tar ball release does not have this issue, for example pktgen-24.03.1.tar.gz, this almost got me quit using pktgen since I have not used it for couple of years, but I do like pktgen when I could use it. should the INSTALL.md suggest users to try tar ball release in case main branch having issues? maybe this does not happen often to main branch and it is just me not lucky :).

vincentmli commented 7 months ago

as side note, for reference, I also used https://github.com/pktgen/Pktgen-DPDK/issues/28#issuecomment-807858919 steps to get pktgen working

KeithWiles commented 7 months ago

In DPDK they removed the use of RTE_STD_C11 define, which causes Pktgen build to fail, which I fixed in 24.03.1.

When I view the lib/common/mbuf.h at https://github.com/pktgen/Pktgen-DPDK/blob/main/lib/common/mbuf.h I do not see the RTE_STD_C11 define, which is correct for 24.03.1 release. I pulled down the tarball and looked in that file and again did not see the define.

Verify the mbuf.h file does not contain RTE_STD_C11 define at line 20. If it does exist then we have some other problem.

The tagged tarball is package up by GitHub and then downloaded, I do not handle these tarballs directly. The main branch is currently ahead of the 24.03.1 tag because of PR's that have been submitted, but again it looks correct.

vincentmli commented 7 months ago

ah, must be my bad, somehow I mistakenly treated my old git clone of main branch as new git clone, sorry for the noise. now I can happily enjoy using pktgen :)

vincentmli commented 7 months ago

@KeithWiles actually it is not my mistake, in the INSTALL.md, it has: git clone http://dpdk.org/git/apps/pktgen-dpdk which still has the RTE_STD_C11 in mbuf.h, so github pktgen is not synced with dpdk.org pktgen-dkpk.

KeithWiles commented 7 months ago

Thanks I will fix the INSTALL.md file