duanjp8617 / rpkt

User-space packet processing in Rust
Apache License 2.0
31 stars 10 forks source link

Fix small problems that prevent this package to build #1

Closed Civil closed 7 months ago

Civil commented 7 months ago
Civil commented 7 months ago

I probably forgot to mention that there were some dependencies missing that I've added and probably few other small things that I forgot.

On my test bench it seems that tests are working fine with DPDK 23.11:

warning: rpkt-dpdk-sys@0.1.0: Compiler version doesn't include clang or GCC: "cc" "--version"
    Finished test [unoptimized + debuginfo] target(s) in 0.03s
     Running unittests src/lib.rs (target/debug/deps/rpkt-391f469e21628f0e)

running 20 tests
test arp::packet::tests::packet_build ... ok
test arp::packet::tests::packet_parse ... ok
test cursors::tests::test_cursor ... ok
test cursors::tests::test_cursor_mut ... ok
test ether::packet::tests::packet_build ... ok
test ether::packet::tests::packet_parse ... ok
test icmpv4::packet::tests::packet_build ... ok
test icmpv4::packet::tests::packet_parse ... ok
test ipv4::option::tests::test_ipv4_option ... ok
test ipv4::packet::tests::packet_build ... ok
test ipv4::packet::tests::packet_parse ... ok
test tcp::option::tests::option_build ... ok
test tcp::option::tests::option_parse ... ok
test tcp::packet::tests::packet_build ... ok
test tcp::packet::tests::packet_parse ... ok
test udp::packet::tests::cursor_parse1 ... ok
test udp::packet::tests::cursor_parse2 ... ok
test udp::packet::tests::fake_nat ... ok
test udp::packet::tests::packet_build ... ok
test udp::packet::tests::packet_parse ... ok

test result: ok. 20 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

     Running unittests src/lib.rs (target/debug/deps/rpkt_dpdk-2209dc90bf80a778)

running 7 tests
test lcore::tests::bind_2_cores_to_the_same_lcore ... EAL: Detected CPU lcores: 32
EAL: Detected NUMA nodes: 1
EAL: Detected static linkage of DPDK
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: Selected IOVA mode 'VA'
EAL: VFIO support initialized
EAL: Probe PCI driver: mlx5_pci (15b3:101d) device: 0000:16:00.0 (socket 0)
EAL: Probe PCI driver: mlx5_pci (15b3:101d) device: 0000:16:00.1 (socket 0)
EAL: Probe PCI driver: mlx5_pci (15b3:1013) device: 0000:34:00.0 (socket 0)
EAL: Probe PCI driver: mlx5_pci (15b3:1013) device: 0000:34:00.1 (socket 0)
EAL: Probe PCI driver: mlx5_pci (15b3:a2d6) device: 0000:52:00.0 (socket 0)
EAL: Probe PCI driver: mlx5_pci (15b3:a2d6) device: 0000:52:00.1 (socket 0)
EAL: Probe PCI driver: mlx5_pci (15b3:1013) device: 0000:70:00.0 (socket 0)
EAL: Probe PCI driver: mlx5_pci (15b3:1013) device: 0000:70:00.1 (socket 0)
EAL: Probe PCI driver: mlx5_pci (15b3:1013) device: 0000:8e:00.0 (socket 0)
EAL: Probe PCI driver: mlx5_pci (15b3:1013) device: 0000:8e:00.1 (socket 0)
EAL: Probe PCI driver: mlx5_pci (15b3:1019) device: 0000:ac:00.0 (socket 0)
EAL: Probe PCI driver: mlx5_pci (15b3:1019) device: 0000:ac:00.1 (socket 0)
EAL: Probe PCI driver: mlx5_pci (15b3:1019) device: 0000:ca:00.0 (socket 0)
EAL: Probe PCI driver: mlx5_pci (15b3:1019) device: 0000:ca:00.1 (socket 0)
ok
test lcore::tests::bind_lcore_to_thread_0 ... ok
test mbuf::tests::mbuf_data_append_remove ... ok
test mempool::tests::alloc_mbuf_from_multiple_threads ... ok
test mempool::tests::create_mempool_with_same_name ... ok
test mempool::tests::mbuf_alloc_and_size_check ... ok
test mempool::tests::mbuf_data_unchanged_after_realloc ... ok

test result: ok. 7 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 3.24s

     Running unittests src/lib.rs (target/debug/deps/rpkt_dpdk_sys-de39f984e373d377)

running 54 tests
test bindgen_test_layout_cpu_set_t ... ok
test bindgen_test_layout_rte_eth_conf ... ok
test bindgen_test_layout_rte_eth_conf__bindgen_ty_1 ... ok
test bindgen_test_layout_rte_eth_conf__bindgen_ty_2 ... ok
test bindgen_test_layout_rte_eth_dcb_rx_conf ... ok
test bindgen_test_layout_rte_eth_dcb_tx_conf ... ok
test bindgen_test_layout_rte_eth_desc_lim ... ok
test bindgen_test_layout_rte_eth_dev_info ... ok
test bindgen_test_layout_rte_eth_dev_portconf ... ok
test bindgen_test_layout_rte_eth_intr_conf ... ok
test bindgen_test_layout_rte_eth_rss_conf ... ok
test bindgen_test_layout_rte_eth_rxconf ... ok
test bindgen_test_layout_rte_eth_rxmode ... ok
test bindgen_test_layout_rte_eth_rxseg ... ok
test bindgen_test_layout_rte_eth_rxseg_capa ... ok
test bindgen_test_layout_rte_eth_rxseg_split ... ok
test bindgen_test_layout_rte_eth_stats ... ok
test bindgen_test_layout_rte_eth_switch_info ... ok
test bindgen_test_layout_rte_eth_thresh ... ok
test bindgen_test_layout_rte_eth_txconf ... ok
test bindgen_test_layout_rte_eth_txmode ... ok
test bindgen_test_layout_rte_eth_vmdq_dcb_conf ... ok
test bindgen_test_layout_rte_eth_vmdq_dcb_conf__bindgen_ty_1 ... ok
test bindgen_test_layout_rte_eth_vmdq_dcb_tx_conf ... ok
test bindgen_test_layout_rte_eth_vmdq_rx_conf ... ok
test bindgen_test_layout_rte_eth_vmdq_rx_conf__bindgen_ty_1 ... ok
test bindgen_test_layout_rte_eth_vmdq_tx_conf ... ok
test bindgen_test_layout_rte_ether_addr ... ok
test bindgen_test_layout_rte_mbuf ... ok
test bindgen_test_layout_rte_mbuf__bindgen_ty_1 ... ok
test bindgen_test_layout_rte_mbuf__bindgen_ty_1__bindgen_ty_1 ... ok
test bindgen_test_layout_rte_mbuf__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 ... ok
test bindgen_test_layout_rte_mbuf__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 ... ok
test bindgen_test_layout_rte_mbuf__bindgen_ty_2 ... ok
test bindgen_test_layout_rte_mbuf__bindgen_ty_2__bindgen_ty_1 ... ok
test bindgen_test_layout_rte_mbuf__bindgen_ty_2__bindgen_ty_1__bindgen_ty_1 ... ok
test bindgen_test_layout_rte_mbuf__bindgen_ty_2__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 ... ok
test bindgen_test_layout_rte_mbuf__bindgen_ty_2__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 ... ok
test bindgen_test_layout_rte_mbuf__bindgen_ty_2__bindgen_ty_1__bindgen_ty_2 ... ok
test bindgen_test_layout_rte_mbuf__bindgen_ty_3 ... ok
test bindgen_test_layout_rte_mbuf__bindgen_ty_3__bindgen_ty_1 ... ok
test bindgen_test_layout_rte_mbuf_ext_shared_info ... ok
test bindgen_test_layout_rte_mbuf_sched ... ok
test bindgen_test_layout_rte_mempool ... ok
test bindgen_test_layout_rte_mempool__bindgen_ty_1 ... ok
test bindgen_test_layout_rte_mempool_cache ... ok
test bindgen_test_layout_rte_mempool_memhdr ... ok
test bindgen_test_layout_rte_mempool_memhdr__bindgen_ty_1 ... ok
test bindgen_test_layout_rte_mempool_memhdr_list ... ok
test bindgen_test_layout_rte_mempool_objhdr ... ok
test bindgen_test_layout_rte_mempool_objhdr__bindgen_ty_1 ... ok
test bindgen_test_layout_rte_mempool_objhdr_list ... ok
test bindgen_test_layout_rte_memzone ... ok
test bindgen_test_layout_rte_memzone__bindgen_ty_1 ... ok

test result: ok. 54 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

     Running unittests src/lib.rs (target/debug/deps/rpkt_time-0b4369f3e2b46778)

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

   Doc-tests rpkt

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

   Doc-tests rpkt-dpdk

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

   Doc-tests rpkt-dpdk-sys

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

   Doc-tests rpkt-time

running 9 tests
test rpkt-time/src/instant.rs - instant::Instant::as_unix_nanos (line 179) ... ok
test rpkt-time/src/instant.rs - instant::Instant::checked_duration_since (line 83) ... ok
test rpkt-time/src/instant.rs - instant::Instant::duration_since (line 61) ... ok
test rpkt-time/src/instant.rs - instant::Instant::elapsed (line 134) ... ok
test rpkt-time/src/instant.rs - instant::Instant::now (line 40) ... ok
test rpkt-time/src/instant.rs - instant::Instant::raw (line 23) ... ok
test rpkt-time/src/instant.rs - instant::Instant::saturating_duration_since (line 107) ... ok
test rpkt-time/src/lib.rs - cycles_per_sec (line 53) ... ok
test rpkt-time/src/lib.rs - tsc_stable (line 37) ... ok

test result: ok. 9 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 8.86s
Civil commented 7 months ago

Add second commit fixes benches.

If you are interested, here are the results I got: https://gist.github.com/Civil/852836624bb1e61b206370d6ae31f73c

Civil commented 7 months ago

This is the final form of the PR right now.

I've decided not to try to de-dup code where possible because I still need to become more familiar with it.

There is a chance I'll send more PRs after doing more tests around the library if that is ok with you.

duanjp8617 commented 7 months ago

I haven't really got time to check this repo for about a month or so. Thank you for your pr!