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

pktgen-port-cfg.c involves a formatting issue in a printf-like output statement. #261

Open
Jack-song-gif opened this issue May 30, 2024 · 4 comments

Comments

@Jack-song-gif
Copy link

Jack-song-gif commented May 30, 2024

The problem pktgen-port-cfg.c regarding a formatting problem in a printf-like output statement has not been resolved yet .
Environment:
Pktgen-DPDK$ cat VERSION
24.05.4

../app/pktgen-port-cfg.c:168:34: error: format ‘%ld’ expects argument of type ‘long int’, but argument 3 has type ‘int’ [-Werror=format=] 168 | pktgen_log_panic("Unable to allocate %ld pkt_seq_t headers", NUM_TOTAL_PKTS); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~ | | | int ../app/pktgen-port-cfg.c:168:17: note: in expansion of macro ‘pktgen_log_panic’ 168 | pktgen_log_panic("Unable to allocate %ld pkt_seq_t headers", NUM_TOTAL_PKTS); | ^~~~~~~~~~~~~~~~ ../app/pktgen-port-cfg.c:168:56: note: format string is defined here 168 | pktgen_log_panic("Unable to allocate %ld pkt_seq_t headers", NUM_TOTAL_PKTS); | ~~^ | | | long int | %d cc1: all warnings being treated as errors [4/5] Compiling C object app/pktgen.p/pktgen.c.o

@KeithWiles
Copy link
Collaborator

On my Ubuntu 24.04 LTS and Pktgen I do not see this error. I am compiling for x86_64 machine what is the OS used and the type of machine building pktgen?

@joygetsit
Copy link

joygetsit commented May 30, 2024

This error is present in Ubuntu 22.04 LTS. I made it work by modifying the formatting, exactly according to the error.

@Jack-song-gif
Copy link
Author

On my Ubuntu 24.04 LTS and Pktgen I do not see this error. I am compiling for x86_64 machine what is the OS used and the type of machine building pktgen?

My OS is: Ubuntu 22.04.3 LTS and the machine type is x86_64

Now,I have another question,I need to cross-compile for aarch64 machine ,How can I do it?
I tried to use meson to specify the configuration file, but encountered an issue that caused an error when using ninja.

The following are the operation steps:
1.First
$ meson arm64-build --cross-file ./arm64_cn10k_linux_gcc1
The Meson build system
Version: 0.61.2
Source dir: /home/zheng/zhengshihong/Pktgen-DPDK
Build dir: /home/zheng/zhengshihong/Pktgen-DPDK/arm64-build
Build type: cross build
Program cat found: YES (/usr/bin/cat)
Project name: pktgen
Project version: 24.05.4
C compiler for the host machine: ccache aarch64-marvell-linux-gnu-gcc (gcc 12.2.0 "aarch64-marvell-linux-gnu-gcc (Marvell Inc. Version: Marvell GCC12 build 12006.0) 12.2.0")
C linker for the host machine: aarch64-marvell-linux-gnu-gcc ld.bfd 2.38.50
C compiler for the build machine: ccache cc (gcc 11.4.0 "cc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0")
C linker for the build machine: cc ld.bfd 2.38
Build machine cpu family: x86_64
Build machine cpu: x86_64
Host machine cpu family: aarch64
Host machine cpu: armv8.6-a
Target machine cpu family: aarch64
Target machine cpu: armv8.6-a
Compiler for C supports arguments -mavx: NO
Compiler for C supports arguments -mavx2: NO
Compiler for C supports arguments -Wno-pedantic: YES
Compiler for C supports arguments -Wno-format-truncation: YES
Found pkg-config: /usr/bin/aarch64-linux-gnu-pkg-config (0.29.2)
Found CMake: /usr/bin/cmake (3.22.1)
Run-time dependency libfgen found: NO (tried pkgconfig and cmake)
Run-time dependency libdpdk found: YES 22.11.0
Message: prefix: /home/zheng/zhengshihong/sysroot/usr libdir: lib
Message: DPDK lib path: /home/zheng/zhengshihong/sysroot/usr/lib
Library rte_net_bond found: YES
Program python3 found: YES (/usr/bin/python3)
WARNING: Python files installed by Meson might not be found by python interpreter.
This warning can be avoided by setting "python.platlibdir" option.
WARNING: Python files installed by Meson might not be found by python interpreter.
This warning can be avoided by setting "python.purelibdir" option.
Library rte_net_i40e found: NO
Library rte_net_ixgbe found: NO
Library rte_net_ice found: NO
Library rte_bus_vdev found: YES
Run-time dependency threads found: YES
Run-time dependency numa found: YES 2.0.14
Run-time dependency pcap found: YES 1.10.1
Library dl found: YES
Library m found: YES
Program doxygen found: YES (/usr/bin/doxygen)
Program generate_doxygen.sh found: YES (/home/zheng/zhengshihong/Pktgen-DPDK/doc/api/generate_doxygen.sh)
Program generate_examples.sh found: YES (/home/zheng/zhengshihong/Pktgen-DPDK/doc/api/generate_examples.sh)
Program doxy-html-custom.sh found: YES (/home/zheng/zhengshihong/Pktgen-DPDK/doc/api/doxy-html-custom.sh)
Configuring doxy-api.conf using configuration
Program sphinx-build found: YES (/usr/bin/sphinx-build)
Build targets in project: 12
NOTICE: Future-deprecated features used:

  • 0.56.0: {'meson.build_root', 'meson.source_root', 'Dependency.get_pkgconfig_variable'}

pktgen 24.05.4

User defined options
Cross files: ./arm64_cn10k_linux_gcc1

Found ninja-1.10.1 at /usr/bin/ninja
2.Second
$ ninja
[64/64] Linking target app/pktgen
FAILED: app/pktgen
te_net_bond.so -Wl,--end-group -Wl,--as-needed -Wl,--as-needed -Wl,--as-needed -Wl,--as-needed -Wl,--as-needed -Wl,--as-needed
/home/zheng/zhengshihong/marvell-tools-12006.0/bin/../lib/gcc/aarch64-marvell-linux-gnu/12.2.0/../../../../aarch64-marvell-linux-gnu/bin/ld: lib/hmap/libhmap.a.p/hmap.c.o: in function hmap_create': hmap.c:(.text+0x4f4): undefined reference to strlcpy'
/home/zheng/zhengshihong/marvell-tools-12006.0/bin/../lib/gcc/aarch64-marvell-linux-gnu/12.2.0/../../../../aarch64-marvell-linux-gnu/bin/ld: app/pktgen.p/pktgen-cmds.c.o: in function enable_bonding': pktgen-cmds.c:(.text+0x5728): undefined reference to rte_eth_bond_members_get'
/home/zheng/zhengshihong/marvell-tools-12006.0/bin/../lib/gcc/aarch64-marvell-linux-gnu/12.2.0/../../../../aarch64-marvell-linux-gnu/bin/ld: pktgen-cmds.c:(.text+0x5740): undefined reference to rte_eth_bond_active_members_get' /home/zheng/zhengshihong/marvell-tools-12006.0/bin/../lib/gcc/aarch64-marvell-linux-gnu/12.2.0/../../../../aarch64-marvell-linux-gnu/bin/ld: app/pktgen.p/pktgen-cmds.c.o: in function show_bonding_mode':
pktgen-cmds.c:(.text+0x590c): undefined reference to rte_eth_bond_members_get' /home/zheng/zhengshihong/marvell-tools-12006.0/bin/../lib/gcc/aarch64-marvell-linux-gnu/12.2.0/../../../../aarch64-marvell-linux-gnu/bin/ld: pktgen-cmds.c:(.text+0x593c): undefined reference to rte_eth_bond_active_members_get'
/home/zheng/zhengshihong/marvell-tools-12006.0/bin/../lib/gcc/aarch64-marvell-linux-gnu/12.2.0/../../../../aarch64-marvell-linux-gnu/bin/ld: pktgen-cmds.c:(.text+0x5a20): undefined reference to rte_eth_bond_8023ad_member_info' /home/zheng/zhengshihong/marvell-tools-12006.0/bin/../lib/gcc/aarch64-marvell-linux-gnu/12.2.0/../../../../aarch64-marvell-linux-gnu/bin/ld: pktgen-cmds.c:(.text+0x5d2c): undefined reference to rte_eth_bond_members_get'
collect2: 错误: ld 返回 1
ninja: build stopped: subcommand failed.

@KeithWiles
Copy link
Collaborator

Not going to be much help here as I only compile for x86_64.

It appears strlcpy does not exist in the build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants