diff options
Diffstat (limited to 'support')
36 files changed, 578 insertions, 39 deletions
diff --git a/support/CMakeLists.txt b/support/CMakeLists.txt index 82da9d9..7da7ce8 100644 --- a/support/CMakeLists.txt +++ b/support/CMakeLists.txt @@ -104,25 +104,28 @@ set_property(TARGET libcmocka PROPERTY IMPORTED_LOCATION ${INSTALL_DIR}/lib64/li set_property(TARGET libcmocka PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${INSTALL_DIR}/include) # Merge multiple patches into one patch file -set(DPDK_PATCH_DIR ${CMAKE_CURRENT_SOURCE_DIR}/dpdk) +set(DPDK_VERSION 23.11.1) +set(DPDK_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/dpdk) +set(DPDK_PATCH_DIR ${DPDK_SOURCE_DIR}) set(MERGED_PATCH_FILE "${CMAKE_BINARY_DIR}/merged_patches.patch") -set(DPDP_PATCH_FILES ${DPDK_PATCH_DIR}/dpdk-21.11.4-memzone-namesize.patch - ${DPDK_PATCH_DIR}/dpdk-21.11.4-fm10k-rxtx-vec.patch - ${DPDK_PATCH_DIR}/dpdk-21.11.4-mempool-ops-get-count.patch - ${DPDK_PATCH_DIR}/dpdk-21.11.4-bypass-flow-err-func.patch - ${DPDK_PATCH_DIR}/dpdk-21.11.4-fix-dup-msl-name-sec-process.patch - ${DPDK_PATCH_DIR}/dpdk-21.11.4-fix-af-packet-run-as-slave-of-bond.patch - ${DPDK_PATCH_DIR}/dpdk-21.11.4-mp-max-fds.patch - ${DPDK_PATCH_DIR}/dpdk-21.11.4-dpdk-devbind-dump.patch - ${DPDK_PATCH_DIR}/dpdk-21.11.4-dpdk-hugepages-path.patch - ${DPDK_PATCH_DIR}/dpdk-21.11.4-dpdk-pcapng-path.patch - ${DPDK_PATCH_DIR}/dpdk-21.11.4-extend-max-virtqueue-pairs.patch - ${DPDK_PATCH_DIR}/dpdk-21.11.4-dpdk-pdum-offset-c.patch - ${DPDK_PATCH_DIR}/dpdk-21.11.4-dpdk-pdum-offset-h.patch - ${DPDK_PATCH_DIR}/dpdk-21.11.4-dpdk-pdum-offset-app.patch - ${DPDK_PATCH_DIR}/dpdk-21.11.4-macro-adjust.patch +set(DPDK_PATCH_FILES ${DPDK_PATCH_DIR}/dpdk-${DPDK_VERSION}-memzone-namesize.patch + ${DPDK_PATCH_DIR}/dpdk-${DPDK_VERSION}-fm10k-rxtx-vec.patch + ${DPDK_PATCH_DIR}/dpdk-${DPDK_VERSION}-mempool-ops-get-count.patch + ${DPDK_PATCH_DIR}/dpdk-${DPDK_VERSION}-bypass-flow-err-func.patch + ${DPDK_PATCH_DIR}/dpdk-${DPDK_VERSION}-fix-dup-msl-name-sec-process.patch + ${DPDK_PATCH_DIR}/dpdk-${DPDK_VERSION}-fix-af-packet-run-as-slave-of-bond.patch + ${DPDK_PATCH_DIR}/dpdk-${DPDK_VERSION}-mp-max-fds.patch + ${DPDK_PATCH_DIR}/dpdk-${DPDK_VERSION}-dpdk-devbind-dump.patch + ${DPDK_PATCH_DIR}/dpdk-${DPDK_VERSION}-dpdk-hugepages-path.patch + ${DPDK_PATCH_DIR}/dpdk-${DPDK_VERSION}-dpdk-pcapng-path.patch + ${DPDK_PATCH_DIR}/dpdk-${DPDK_VERSION}-dpdk-pdum-offset-c.patch + ${DPDK_PATCH_DIR}/dpdk-${DPDK_VERSION}-dpdk-pdum-offset-h.patch + ${DPDK_PATCH_DIR}/dpdk-${DPDK_VERSION}-dpdk-pdum-offset-app.patch + ${DPDK_PATCH_DIR}/dpdk-${DPDK_VERSION}-mlx5_glue_dlopen_info.patch + ${DPDK_PATCH_DIR}/dpdk-${DPDK_VERSION}-revert-fix-devargs-in-secondary-process.patch + ${DPDK_PATCH_DIR}/dpdk-${DPDK_VERSION}-fix-legacy_mem_init.patch ) -execute_process(COMMAND cat ${DPDP_PATCH_FILES} OUTPUT_FILE ${MERGED_PATCH_FILE}) +execute_process(COMMAND cat ${DPDK_PATCH_FILES} OUTPUT_FILE ${MERGED_PATCH_FILE}) if(CMAKE_BUILD_TYPE STREQUAL "Debug") set(DPDK_BUILD_TYPE debug) @@ -140,10 +143,11 @@ crypto/bcmfs,crypto/ccp,crypto/nitrox,crypto/null,crypto/openssl,crypto/schedule # Although default_library=static has been set, both dynamic and static libraries are compiled. a little strange ExternalProject_Add(dpdk PREFIX dpdk - URL ${CMAKE_CURRENT_SOURCE_DIR}/dpdk/dpdk-21.11.4.tar.xz - URL_MD5 b24201da07d3fd87cacc2aa03586aed3 + URL ${DPDK_SOURCE_DIR}/dpdk-${DPDK_VERSION}.tar.xz + URL_MD5 382d5fdd8ecb1d8e0be6d70dfc5eec96 PATCH_COMMAND COMMAND patch -Ns -p1 -i ${MERGED_PATCH_FILE} + COMMAND ${CMAKE_COMMAND} -E chdir <SOURCE_DIR> bash ${DPDK_SOURCE_DIR}/dpdk-config-set.sh CONFIGURE_COMMAND COMMAND meson -Dmax_lcores=256 -Dc_args=-DRTE_ETHDEV_PROFILE_WITH_VTUNE -Ddisable_drivers=${DPDK_MESON_DISABLED_DRIVERS} -Dprefix=<INSTALL_DIR> -Dcpu_instruction_set=${MACHINE} -Dibverbs_link=dlopen -Dbuildtype=${DPDK_BUILD_TYPE} build BUILD_COMMAND ${CMAKE_COMMAND} -E chdir <SOURCE_DIR>/build ninja @@ -166,5 +170,5 @@ set_target_properties(libdpdk PROPERTIES IMPORTED_LOCATION ${M_LIB} INTERFACE_LINK_DIRECTORIES ${INSTALL_DIR}/lib64 INTERFACE_INCLUDE_DIRECTORIES ${INSTALL_DIR}/include - INTERFACE_LINK_LIBRARIES "-Wl,--whole-archive;${INSTALL_DIR}/lib64/libdpdk.a;-Wl,--no-whole-archive;rt;m;dl;pcap;numa;ibverbs;mlx5" + INTERFACE_LINK_LIBRARIES "-Wl,--whole-archive;${INSTALL_DIR}/lib64/libdpdk.a;-Wl,--no-whole-archive;rt;m;dl;pcap;numa;ibverbs;mlx5;mtcr_ul" ) diff --git a/support/dpdk/dpdk-21.11.4-bypass-flow-err-func.patch b/support/dpdk-21.11.4/dpdk-21.11.4-bypass-flow-err-func.patch index 63d8c60..63d8c60 100644 --- a/support/dpdk/dpdk-21.11.4-bypass-flow-err-func.patch +++ b/support/dpdk-21.11.4/dpdk-21.11.4-bypass-flow-err-func.patch diff --git a/support/dpdk/dpdk-21.11.4-dpdk-devbind-dump.patch b/support/dpdk-21.11.4/dpdk-21.11.4-dpdk-devbind-dump.patch index e4b4026..e4b4026 100644 --- a/support/dpdk/dpdk-21.11.4-dpdk-devbind-dump.patch +++ b/support/dpdk-21.11.4/dpdk-21.11.4-dpdk-devbind-dump.patch diff --git a/support/dpdk/dpdk-21.11.4-dpdk-hugepages-path.patch b/support/dpdk-21.11.4/dpdk-21.11.4-dpdk-hugepages-path.patch index aec7534..aec7534 100644 --- a/support/dpdk/dpdk-21.11.4-dpdk-hugepages-path.patch +++ b/support/dpdk-21.11.4/dpdk-21.11.4-dpdk-hugepages-path.patch diff --git a/support/dpdk/dpdk-21.11.4-dpdk-pcapng-path.patch b/support/dpdk-21.11.4/dpdk-21.11.4-dpdk-pcapng-path.patch index 859df2a..859df2a 100644 --- a/support/dpdk/dpdk-21.11.4-dpdk-pcapng-path.patch +++ b/support/dpdk-21.11.4/dpdk-21.11.4-dpdk-pcapng-path.patch diff --git a/support/dpdk/dpdk-21.11.4-dpdk-pdum-offset-app.patch b/support/dpdk-21.11.4/dpdk-21.11.4-dpdk-pdum-offset-app.patch index d115246..d115246 100644 --- a/support/dpdk/dpdk-21.11.4-dpdk-pdum-offset-app.patch +++ b/support/dpdk-21.11.4/dpdk-21.11.4-dpdk-pdum-offset-app.patch diff --git a/support/dpdk/dpdk-21.11.4-dpdk-pdum-offset-c.patch b/support/dpdk-21.11.4/dpdk-21.11.4-dpdk-pdum-offset-c.patch index 8d9dc9f..8d9dc9f 100644 --- a/support/dpdk/dpdk-21.11.4-dpdk-pdum-offset-c.patch +++ b/support/dpdk-21.11.4/dpdk-21.11.4-dpdk-pdum-offset-c.patch diff --git a/support/dpdk/dpdk-21.11.4-dpdk-pdum-offset-h.patch b/support/dpdk-21.11.4/dpdk-21.11.4-dpdk-pdum-offset-h.patch index ad426cd..ad426cd 100644 --- a/support/dpdk/dpdk-21.11.4-dpdk-pdum-offset-h.patch +++ b/support/dpdk-21.11.4/dpdk-21.11.4-dpdk-pdum-offset-h.patch diff --git a/support/dpdk/dpdk-21.11.4-extend-max-virtqueue-pairs.patch b/support/dpdk-21.11.4/dpdk-21.11.4-extend-max-virtqueue-pairs.patch index 2bab48d..2bab48d 100644 --- a/support/dpdk/dpdk-21.11.4-extend-max-virtqueue-pairs.patch +++ b/support/dpdk-21.11.4/dpdk-21.11.4-extend-max-virtqueue-pairs.patch diff --git a/support/dpdk/dpdk-21.11.4-fix-af-packet-run-as-slave-of-bond.patch b/support/dpdk-21.11.4/dpdk-21.11.4-fix-af-packet-run-as-slave-of-bond.patch index b0321aa..b0321aa 100644 --- a/support/dpdk/dpdk-21.11.4-fix-af-packet-run-as-slave-of-bond.patch +++ b/support/dpdk-21.11.4/dpdk-21.11.4-fix-af-packet-run-as-slave-of-bond.patch diff --git a/support/dpdk/dpdk-21.11.4-fix-dup-msl-name-sec-process.patch b/support/dpdk-21.11.4/dpdk-21.11.4-fix-dup-msl-name-sec-process.patch index 6491480..6491480 100644 --- a/support/dpdk/dpdk-21.11.4-fix-dup-msl-name-sec-process.patch +++ b/support/dpdk-21.11.4/dpdk-21.11.4-fix-dup-msl-name-sec-process.patch diff --git a/support/dpdk/dpdk-21.11.4-fm10k-rxtx-vec.patch b/support/dpdk-21.11.4/dpdk-21.11.4-fm10k-rxtx-vec.patch index fd50829..fd50829 100644 --- a/support/dpdk/dpdk-21.11.4-fm10k-rxtx-vec.patch +++ b/support/dpdk-21.11.4/dpdk-21.11.4-fm10k-rxtx-vec.patch diff --git a/support/dpdk/dpdk-21.11.4-mempool-ops-get-count.patch b/support/dpdk-21.11.4/dpdk-21.11.4-mempool-ops-get-count.patch index aadac18..aadac18 100644 --- a/support/dpdk/dpdk-21.11.4-mempool-ops-get-count.patch +++ b/support/dpdk-21.11.4/dpdk-21.11.4-mempool-ops-get-count.patch diff --git a/support/dpdk/dpdk-21.11.4-memzone-namesize.patch b/support/dpdk-21.11.4/dpdk-21.11.4-memzone-namesize.patch index 377d37d..377d37d 100644 --- a/support/dpdk/dpdk-21.11.4-memzone-namesize.patch +++ b/support/dpdk-21.11.4/dpdk-21.11.4-memzone-namesize.patch diff --git a/support/dpdk/dpdk-21.11.4-mp-max-fds.patch b/support/dpdk-21.11.4/dpdk-21.11.4-mp-max-fds.patch index 90f94b8..90f94b8 100644 --- a/support/dpdk/dpdk-21.11.4-mp-max-fds.patch +++ b/support/dpdk-21.11.4/dpdk-21.11.4-mp-max-fds.patch diff --git a/support/dpdk/dpdk-21.11.4.tar.xz b/support/dpdk-21.11.4/dpdk-21.11.4.tar.xz Binary files differindex 4b35c80..4b35c80 100755 --- a/support/dpdk/dpdk-21.11.4.tar.xz +++ b/support/dpdk-21.11.4/dpdk-21.11.4.tar.xz diff --git a/support/dpdk-21.11.4/dpdk-config-set.sh b/support/dpdk-21.11.4/dpdk-config-set.sh new file mode 100755 index 0000000..3c8199c --- /dev/null +++ b/support/dpdk-21.11.4/dpdk-config-set.sh @@ -0,0 +1,7 @@ +#!/bin/bash +echo 'start macro adjust' +current_path=$(pwd) +echo "Current work path: $current_path" +sed 's/^\(#define RTE_LIBRTE_GRAPH_STATS \).*/\10/' -i config/rte_config.h +cd ${DPDK_SOURCE_DIR} && sed 's/^\(#define RTE_MAX_MEMZONE \).*/\151200/' -i config/rte_config.h +echo 'macro adjust end'
\ No newline at end of file diff --git a/support/dpdk/dpdk-21.11.4-macro-adjust.patch b/support/dpdk/dpdk-21.11.4-macro-adjust.patch deleted file mode 100644 index 0b672e6..0000000 --- a/support/dpdk/dpdk-21.11.4-macro-adjust.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- dpdk-stable-21.11.4/config/rte_config.h 2023-05-17 19:27:18.000000000 +0800 -+++ dpdk-stable-21.11.4-mr4/config/rte_config.h 2023-12-26 17:01:15.180144454 +0800 -@@ -34,7 +34,7 @@ - #define RTE_MAX_MEM_MB_PER_LIST 32768 - #define RTE_MAX_MEMSEG_PER_TYPE 32768 - #define RTE_MAX_MEM_MB_PER_TYPE 65536 --#define RTE_MAX_MEMZONE 2560 -+#define RTE_MAX_MEMZONE 51200 - #define RTE_MAX_TAILQ 32 - #define RTE_LOG_DP_LEVEL RTE_LOG_INFO - #define RTE_MAX_VFIO_CONTAINERS 64 -@@ -99,7 +99,7 @@ - - /* rte_graph defines */ - #define RTE_GRAPH_BURST_SIZE 256 --#define RTE_LIBRTE_GRAPH_STATS 1 -+#define RTE_LIBRTE_GRAPH_STATS 0 - - /****** driver defines ********/ diff --git a/support/dpdk/dpdk-23.11.1-bypass-flow-err-func.patch b/support/dpdk/dpdk-23.11.1-bypass-flow-err-func.patch new file mode 100644 index 0000000..0783861 --- /dev/null +++ b/support/dpdk/dpdk-23.11.1-bypass-flow-err-func.patch @@ -0,0 +1,17 @@ +--- dpdk-stable-23.11.1/lib/ethdev/rte_flow.c 2024-05-17 14:46:11.000000000 +0800 ++++ dpdk-stable-23.11.1-mr/lib/ethdev/rte_flow.c 2024-07-12 15:50:28.645305362 +0800 +@@ -321,12 +321,14 @@ + static int + flow_err(uint16_t port_id, int ret, struct rte_flow_error *error) + { ++#if 0 + if (ret == 0) + return 0; + if (rte_eth_dev_is_removed(port_id)) + return rte_flow_error_set(error, EIO, + RTE_FLOW_ERROR_TYPE_UNSPECIFIED, + NULL, rte_strerror(EIO)); ++#endif + return ret; + } + diff --git a/support/dpdk/dpdk-23.11.1-dpdk-devbind-dump.patch b/support/dpdk/dpdk-23.11.1-dpdk-devbind-dump.patch new file mode 100644 index 0000000..0919c23 --- /dev/null +++ b/support/dpdk/dpdk-23.11.1-dpdk-devbind-dump.patch @@ -0,0 +1,70 @@ +--- dpdk-stable-23.11.1/usertools/dpdk-devbind.py 2024-05-17 14:46:11.000000000 +0800 ++++ dpdk-stable-23.11.1-mr/usertools/dpdk-devbind.py 2024-07-12 15:50:28.665305357 +0800 +@@ -8,6 +8,7 @@ + import subprocess + import argparse + import platform ++import json + + from glob import glob + from os.path import exists, basename +@@ -103,6 +104,7 @@ + # command-line arg flags + b_flag = None + status_flag = False ++dump_flag = False + force_flag = False + args = [] + +@@ -585,6 +587,11 @@ + display_devices("%s devices using kernel driver" % device_name, kernel_drv, + if_text + "drv=%(Driver_str)s " + "unused=%(Module_str)s %(Active)s") ++ if dump_flag and dump_path == 'stdout': ++ print(kernel_drv) ++ if dump_flag and dump_path != 'stdout': ++ f = open(dump_path, "w") ++ f.write(json.dumps(kernel_drv, sort_keys=True,indent=4)) + if no_drv: + display_devices("Other %s devices" % device_name, no_drv, + "unused=%(Module_str)s") +@@ -646,6 +653,8 @@ + global status_dev + global force_flag + global args ++ global dump_flag ++ global dump_path + + parser = argparse.ArgumentParser( + description='Utility to bind and unbind devices from Linux kernel', +@@ -660,6 +669,9 @@ + To display current network device status: + %(prog)s --status-dev net + ++To dump current kernel network device status for json: ++ %(prog)s --status-dev net --dump ('stdout' | 'path') ++ + To bind eth1 from the current driver and move to use vfio-pci + %(prog)s --bind=vfio-pci eth1 + +@@ -671,6 +683,10 @@ + """) + + parser.add_argument( ++ '-d', ++ '--dump', ++ help="Dump the status of kernel net group.") ++ parser.add_argument( + '-s', + '--status', + action='store_true', +@@ -712,6 +728,9 @@ + if opt.status_dev: + status_flag = True + status_dev = opt.status_dev ++ if opt.dump: ++ dump_flag = True ++ dump_path = opt.dump + if opt.status: + status_flag = True + status_dev = "all" diff --git a/support/dpdk/dpdk-23.11.1-dpdk-hugepages-path.patch b/support/dpdk/dpdk-23.11.1-dpdk-hugepages-path.patch new file mode 100644 index 0000000..540d97b --- /dev/null +++ b/support/dpdk/dpdk-23.11.1-dpdk-hugepages-path.patch @@ -0,0 +1,11 @@ +--- dpdk-stable-23.11.1/usertools/dpdk-hugepages.py 2024-05-17 14:46:11.000000000 +0800 ++++ dpdk-stable-23.11.1-mr/usertools/dpdk-hugepages.py 2024-07-12 15:50:28.665305357 +0800 +@@ -14,7 +14,7 @@ + BINARY_PREFIX = "KMG" + + # systemd mount point for huge pages +-HUGE_MOUNT = "/dev/hugepages" ++HUGE_MOUNT = "/var/run/mrzcpd/huge_pages" + + + def fmt_memsize(kb): diff --git a/support/dpdk/dpdk-23.11.1-dpdk-pcapng-path.patch b/support/dpdk/dpdk-23.11.1-dpdk-pcapng-path.patch new file mode 100644 index 0000000..fca9039 --- /dev/null +++ b/support/dpdk/dpdk-23.11.1-dpdk-pcapng-path.patch @@ -0,0 +1,15 @@ +--- dpdk-stable-23.11.1/lib/pcapng/rte_pcapng.c 2024-05-17 14:46:11.000000000 +0800 ++++ dpdk-stable-23.11.1-mr/lib/pcapng/rte_pcapng.c 2024-07-12 15:50:28.665305357 +0800 +@@ -236,10 +236,11 @@ + "%s-%s", dev->bus->name, dev->name); + + /* DPDK reports in units of Mbps */ ++ #if 0 + if (rte_eth_link_get(port, &link) == 0 && + link.link_status == RTE_ETH_LINK_UP) + speed = link.link_speed * PCAPNG_MBPS_SPEED; +- ++ #endif + if (rte_eth_macaddr_get(port, &macaddr) < 0) + ea = NULL; + else diff --git a/support/dpdk/dpdk-23.11.1-dpdk-pdum-offset-app.patch b/support/dpdk/dpdk-23.11.1-dpdk-pdum-offset-app.patch new file mode 100644 index 0000000..d04ab24 --- /dev/null +++ b/support/dpdk/dpdk-23.11.1-dpdk-pdum-offset-app.patch @@ -0,0 +1,11 @@ +--- dpdk-stable-23.11.1/app/dumpcap/main.c 2024-05-17 14:46:11.000000000 +0800 ++++ dpdk-stable-23.11.1-mr/app/dumpcap/main.c 2024-07-12 17:27:43.823952740 +0800 +@@ -804,7 +804,7 @@ + + TAILQ_FOREACH(intf, &interfaces, next) { + ret = rte_pdump_enable_bpf(intf->port, RTE_PDUMP_ALL_QUEUES, +- flags, intf->opts.snap_len, ++ flags, intf->opts.snap_len, 0, + r, mp, intf->bpf_prm); + if (ret < 0) { + const struct interface *intf2; diff --git a/support/dpdk/dpdk-23.11.1-dpdk-pdum-offset-c.patch b/support/dpdk/dpdk-23.11.1-dpdk-pdum-offset-c.patch new file mode 100644 index 0000000..9f324b0 --- /dev/null +++ b/support/dpdk/dpdk-23.11.1-dpdk-pdum-offset-c.patch @@ -0,0 +1,208 @@ +--- dpdk-stable-23.11.1/lib/pdump/rte_pdump.c 2024-05-17 14:46:11.000000000 +0800 ++++ dpdk-stable-23.11.1-mr/lib/pdump/rte_pdump.c 2024-07-12 17:27:43.833952738 +0800 +@@ -47,6 +47,7 @@ + + const struct rte_bpf_prm *prm; + uint32_t snaplen; ++ uint32_t offset; + }; + + struct pdump_response { +@@ -62,6 +63,7 @@ + const struct rte_bpf *filter; + enum pdump_version ver; + uint32_t snaplen; ++ uint32_t offset; + } rx_cbs[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT], + tx_cbs[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT]; + +@@ -96,7 +98,25 @@ + uint64_t rcs[nb_pkts]; + + if (cbs->filter) +- rte_bpf_exec_burst(cbs->filter, (void **)pkts, rcs, nb_pkts); ++ { ++ if (cbs->offset>0) ++ { ++ for (i = 0; i < nb_pkts; i++){ ++ rte_pktmbuf_adj(pkts[i], cbs->offset); ++ } ++ ++ rte_bpf_exec_burst(cbs->filter, (void **)pkts, rcs, nb_pkts); ++ ++ for (i = 0; i < nb_pkts; i++){ ++ rte_pktmbuf_prepend(pkts[i], cbs->offset); ++ } ++ } ++ else ++ { ++ rte_bpf_exec_burst(cbs->filter, (void **)pkts, rcs, nb_pkts); ++ } ++ } ++ + + ring = cbs->ring; + mp = cbs->mp; +@@ -171,7 +191,7 @@ + uint16_t end_q, uint16_t port, uint16_t queue, + struct rte_ring *ring, struct rte_mempool *mp, + struct rte_bpf *filter, +- uint16_t operation, uint32_t snaplen) ++ uint16_t operation, uint32_t snaplen,uint32_t offset) + { + uint16_t qid; + +@@ -191,6 +211,7 @@ + cbs->mp = mp; + cbs->snaplen = snaplen; + cbs->filter = filter; ++ cbs->offset = offset; + + cbs->cb = rte_eth_add_first_rx_callback(port, qid, + pdump_rx, cbs); +@@ -228,7 +249,7 @@ + uint16_t end_q, uint16_t port, uint16_t queue, + struct rte_ring *ring, struct rte_mempool *mp, + struct rte_bpf *filter, +- uint16_t operation, uint32_t snaplen) ++ uint16_t operation, uint32_t snaplen, uint32_t offset) + { + + uint16_t qid; +@@ -249,6 +270,7 @@ + cbs->mp = mp; + cbs->snaplen = snaplen; + cbs->filter = filter; ++ cbs->offset = offset; + + cbs->cb = rte_eth_add_tx_callback(port, qid, pdump_tx, + cbs); +@@ -367,7 +389,7 @@ + end_q = (queue == RTE_PDUMP_ALL_QUEUES) ? nb_rx_q : queue + 1; + ret = pdump_register_rx_callbacks(p->ver, end_q, port, queue, + ring, mp, filter, +- operation, p->snaplen); ++ operation, p->snaplen,p->offset); + if (ret < 0) + return ret; + } +@@ -377,7 +399,7 @@ + end_q = (queue == RTE_PDUMP_ALL_QUEUES) ? nb_tx_q : queue + 1; + ret = pdump_register_tx_callbacks(p->ver, end_q, port, queue, + ring, mp, filter, +- operation, p->snaplen); ++ operation, p->snaplen, p->offset); + if (ret < 0) + return ret; + } +@@ -523,6 +545,7 @@ + static int + pdump_prepare_client_request(const char *device, uint16_t queue, + uint32_t flags, uint32_t snaplen, ++ uint32_t offset, + uint16_t operation, + struct rte_ring *ring, + struct rte_mempool *mp, +@@ -554,6 +577,7 @@ + req->mp = mp; + req->prm = prm; + req->snaplen = snaplen; ++ req->offset = offset; + } + + rte_strscpy(mp_req.name, PDUMP_MP, RTE_MP_MAX_NAME_LEN); +@@ -583,7 +607,7 @@ + */ + static int + pdump_enable(uint16_t port, uint16_t queue, +- uint32_t flags, uint32_t snaplen, ++ uint32_t flags, uint32_t snaplen,uint32_t offset, + struct rte_ring *ring, struct rte_mempool *mp, + const struct rte_bpf_prm *prm) + { +@@ -603,7 +627,7 @@ + if (snaplen == 0) + snaplen = UINT32_MAX; + +- return pdump_prepare_client_request(name, queue, flags, snaplen, ++ return pdump_prepare_client_request(name, queue, flags, snaplen,offset, + ENABLE, ring, mp, prm); + } + +@@ -613,23 +637,24 @@ + struct rte_mempool *mp, + void *filter __rte_unused) + { +- return pdump_enable(port, queue, flags, 0, ++ return pdump_enable(port, queue, flags, 0,0, + ring, mp, NULL); + } + + int + rte_pdump_enable_bpf(uint16_t port, uint16_t queue, + uint32_t flags, uint32_t snaplen, ++ uint32_t offset, + struct rte_ring *ring, + struct rte_mempool *mp, + const struct rte_bpf_prm *prm) + { +- return pdump_enable(port, queue, flags, snaplen, ++ return pdump_enable(port, queue, flags, snaplen,offset, + ring, mp, prm); + } + + static int +-pdump_enable_by_deviceid(const char *device_id, uint16_t queue, ++pdump_enable_by_deviceid(const char *device_id, uint16_t queue, uint32_t offset, + uint32_t flags, uint32_t snaplen, + struct rte_ring *ring, + struct rte_mempool *mp, +@@ -647,7 +672,7 @@ + if (snaplen == 0) + snaplen = UINT32_MAX; + +- return pdump_prepare_client_request(device_id, queue, flags, snaplen, ++ return pdump_prepare_client_request(device_id, queue, flags, snaplen,offset, + ENABLE, ring, mp, prm); + } + +@@ -658,18 +683,19 @@ + struct rte_mempool *mp, + void *filter __rte_unused) + { +- return pdump_enable_by_deviceid(device_id, queue, flags, 0, ++ return pdump_enable_by_deviceid(device_id, queue, flags, 0, 0, + ring, mp, NULL); + } + + int + rte_pdump_enable_bpf_by_deviceid(const char *device_id, uint16_t queue, + uint32_t flags, uint32_t snaplen, ++ uint32_t offset, + struct rte_ring *ring, + struct rte_mempool *mp, + const struct rte_bpf_prm *prm) + { +- return pdump_enable_by_deviceid(device_id, queue, flags, snaplen, ++ return pdump_enable_by_deviceid(device_id, queue, flags, snaplen, offset, + ring, mp, prm); + } + +@@ -686,7 +712,7 @@ + if (ret < 0) + return ret; + +- ret = pdump_prepare_client_request(name, queue, flags, 0, ++ ret = pdump_prepare_client_request(name, queue, flags, 0, 0, + DISABLE, NULL, NULL, NULL); + + return ret; +@@ -702,7 +728,7 @@ + if (ret < 0) + return ret; + +- ret = pdump_prepare_client_request(device_id, queue, flags, 0, ++ ret = pdump_prepare_client_request(device_id, queue, flags, 0, 0, + DISABLE, NULL, NULL, NULL); + + return ret; diff --git a/support/dpdk/dpdk-23.11.1-dpdk-pdum-offset-h.patch b/support/dpdk/dpdk-23.11.1-dpdk-pdum-offset-h.patch new file mode 100644 index 0000000..b1b82f7 --- /dev/null +++ b/support/dpdk/dpdk-23.11.1-dpdk-pdum-offset-h.patch @@ -0,0 +1,18 @@ +--- dpdk-stable-23.11.1/lib/pdump/rte_pdump.h 2024-05-17 14:46:11.000000000 +0800 ++++ dpdk-stable-23.11.1-mr/lib/pdump/rte_pdump.h 2024-07-12 17:27:43.833952738 +0800 +@@ -109,6 +109,7 @@ + int + rte_pdump_enable_bpf(uint16_t port_id, uint16_t queue, + uint32_t flags, uint32_t snaplen, ++ uint32_t offset, + struct rte_ring *ring, + struct rte_mempool *mp, + const struct rte_bpf_prm *prm); +@@ -192,6 +193,7 @@ + int + rte_pdump_enable_bpf_by_deviceid(const char *device_id, uint16_t queue, + uint32_t flags, uint32_t snaplen, ++ uint32_t offset, + struct rte_ring *ring, + struct rte_mempool *mp, + const struct rte_bpf_prm *filter); diff --git a/support/dpdk/dpdk-23.11.1-fix-af-packet-run-as-slave-of-bond.patch b/support/dpdk/dpdk-23.11.1-fix-af-packet-run-as-slave-of-bond.patch new file mode 100644 index 0000000..1a42f5c --- /dev/null +++ b/support/dpdk/dpdk-23.11.1-fix-af-packet-run-as-slave-of-bond.patch @@ -0,0 +1,56 @@ +--- dpdk-stable-23.11.1/drivers/net/af_packet/rte_eth_af_packet.c 2024-05-17 14:46:11.000000000 +0800 ++++ dpdk-stable-23.11.1-mr/drivers/net/af_packet/rte_eth_af_packet.c 2024-07-12 17:27:43.833952738 +0800 +@@ -330,28 +330,6 @@ + static int + eth_dev_stop(struct rte_eth_dev *dev) + { +- unsigned i; +- int sockfd; +- struct pmd_internals *internals = dev->data->dev_private; +- +- for (i = 0; i < internals->nb_queues; i++) { +- sockfd = internals->rx_queue[i].sockfd; +- if (sockfd != -1) +- close(sockfd); +- +- /* Prevent use after free in case tx fd == rx fd */ +- if (sockfd != internals->tx_queue[i].sockfd) { +- sockfd = internals->tx_queue[i].sockfd; +- if (sockfd != -1) +- close(sockfd); +- } +- +- internals->rx_queue[i].sockfd = -1; +- internals->tx_queue[i].sockfd = -1; +- dev->data->rx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED; +- dev->data->tx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED; +- } +- + dev->data->dev_link.link_status = RTE_ETH_LINK_DOWN; + return 0; + } +@@ -455,6 +433,24 @@ + + internals = dev->data->dev_private; + req = &internals->req; ++ ++ int sockfd; ++ for (q = 0; q < internals->nb_queues; q++) { ++ sockfd = internals->rx_queue[q].sockfd; ++ if (sockfd != -1) ++ close(sockfd); ++ ++ /* Prevent use after free in case tx fd == rx fd */ ++ if (sockfd != internals->tx_queue[q].sockfd) { ++ sockfd = internals->tx_queue[q].sockfd; ++ if (sockfd != -1) ++ close(sockfd); ++ } ++ ++ internals->rx_queue[q].sockfd = -1; ++ internals->tx_queue[q].sockfd = -1; ++ } ++ + for (q = 0; q < internals->nb_queues; q++) { + munmap(internals->rx_queue[q].map, + 2 * req->tp_block_size * req->tp_block_nr); diff --git a/support/dpdk/dpdk-23.11.1-fix-dup-msl-name-sec-process.patch b/support/dpdk/dpdk-23.11.1-fix-dup-msl-name-sec-process.patch new file mode 100644 index 0000000..4191e59 --- /dev/null +++ b/support/dpdk/dpdk-23.11.1-fix-dup-msl-name-sec-process.patch @@ -0,0 +1,21 @@ +--- dpdk-stable-23.11.1/lib/eal/linux/eal_memalloc.c 2024-05-17 14:46:11.000000000 +0800 ++++ dpdk-stable-23.11.1-mr/lib/eal/linux/eal_memalloc.c 2024-07-12 17:27:43.833952738 +0800 +@@ -7,6 +7,7 @@ + #include <stdlib.h> + #include <stdio.h> + #include <stdint.h> ++#include <inttypes.h> + #include <string.h> + #include <sys/mman.h> + #include <sys/stat.h> +@@ -1447,8 +1448,8 @@ + local_msl = &local_memsegs[msl_idx]; + + /* create distinct fbarrays for each secondary */ +- snprintf(name, RTE_FBARRAY_NAME_LEN, "%s_%i", +- primary_msl->memseg_arr.name, getpid()); ++ snprintf(name, RTE_FBARRAY_NAME_LEN, "%s_%i_%"PRIx64, ++ primary_msl->memseg_arr.name, getpid(), rte_rdtsc()); + + ret = rte_fbarray_init(&local_msl->memseg_arr, name, + primary_msl->memseg_arr.len, diff --git a/support/dpdk/dpdk-23.11.1-fix-legacy_mem_init.patch b/support/dpdk/dpdk-23.11.1-fix-legacy_mem_init.patch new file mode 100644 index 0000000..e5bcc4d --- /dev/null +++ b/support/dpdk/dpdk-23.11.1-fix-legacy_mem_init.patch @@ -0,0 +1,10 @@ +--- dpdk-stable-23.11.1/lib/eal/linux/eal_memory.c 2024-05-17 14:46:11.000000000 +0800 ++++ dpdk-stable-23.11.1-mr/lib/eal/linux/eal_memory.c 2024-07-19 16:16:13.738740472 +0800 +@@ -1471,6 +1471,7 @@ + /* this is an unused list, deallocate it */ + mem_sz = msl->len; + munmap(msl->base_va, mem_sz); ++ msl->len = 0; + msl->base_va = NULL; + msl->heap = 0; + diff --git a/support/dpdk/dpdk-23.11.1-fm10k-rxtx-vec.patch b/support/dpdk/dpdk-23.11.1-fm10k-rxtx-vec.patch new file mode 100644 index 0000000..09d3886 --- /dev/null +++ b/support/dpdk/dpdk-23.11.1-fm10k-rxtx-vec.patch @@ -0,0 +1,12 @@ +--- dpdk-stable-23.11.1/drivers/net/fm10k/meson.build 2024-05-17 14:46:11.000000000 +0800 ++++ dpdk-stable-23.11.1-mr/drivers/net/fm10k/meson.build 2024-07-12 17:27:43.843952736 +0800 +@@ -14,8 +14,6 @@ + 'fm10k_ethdev.c', + 'fm10k_rxtx.c', + ) +-if arch_subdir == 'x86' +- sources += files('fm10k_rxtx_vec.c') +-endif ++ + + includes += include_directories('base') diff --git a/support/dpdk/dpdk-23.11.1-mempool-ops-get-count.patch b/support/dpdk/dpdk-23.11.1-mempool-ops-get-count.patch new file mode 100644 index 0000000..5580b51 --- /dev/null +++ b/support/dpdk/dpdk-23.11.1-mempool-ops-get-count.patch @@ -0,0 +1,10 @@ +--- dpdk-stable-23.11.1/lib/mempool/version.map 2024-05-17 14:46:11.000000000 +0800 ++++ dpdk-stable-23.11.1-mr/lib/mempool/version.map 2024-07-12 17:27:43.843952736 +0800 +@@ -31,6 +31,7 @@ + rte_mempool_register_ops; + rte_mempool_set_ops_byname; + rte_mempool_walk; ++ rte_mempool_ops_get_count; + + local: *; + }; diff --git a/support/dpdk/dpdk-23.11.1-memzone-namesize.patch b/support/dpdk/dpdk-23.11.1-memzone-namesize.patch new file mode 100644 index 0000000..928da4e --- /dev/null +++ b/support/dpdk/dpdk-23.11.1-memzone-namesize.patch @@ -0,0 +1,11 @@ +--- dpdk-stable-23.11.1/lib/eal/include/rte_memzone.h 2024-05-17 14:46:11.000000000 +0800 ++++ dpdk-stable-23.11.1-mr/lib/eal/include/rte_memzone.h 2024-07-12 17:27:43.843952736 +0800 +@@ -47,7 +47,7 @@ + */ + struct rte_memzone { + +-#define RTE_MEMZONE_NAMESIZE 32 /**< Maximum length of memory zone name.*/ ++#define RTE_MEMZONE_NAMESIZE 64 /**< Maximum length of memory zone name.*/ + char name[RTE_MEMZONE_NAMESIZE]; /**< Name of the memory zone. */ + + rte_iova_t iova; /**< Start IO address. */ diff --git a/support/dpdk/dpdk-23.11.1-mlx5_glue_dlopen_info.patch b/support/dpdk/dpdk-23.11.1-mlx5_glue_dlopen_info.patch new file mode 100644 index 0000000..84f92be --- /dev/null +++ b/support/dpdk/dpdk-23.11.1-mlx5_glue_dlopen_info.patch @@ -0,0 +1,24 @@ +--- dpdk-stable-23.11.1/drivers/common/mlx5/linux/mlx5_common_os.c 2024-05-17 14:46:11.000000000 +0800 ++++ dpdk-stable-23.11.1-mr/drivers/common/mlx5/linux/mlx5_common_os.c 2024-07-17 12:03:35.232571545 +0800 +@@ -325,6 +325,11 @@ + DRV_LOG(DEBUG, "Looking for rdma-core glue as " + "\"%s\"", name); + handle = dlopen(name, RTLD_LAZY); ++ if(!handle) { ++ dlmsg = dlerror(); ++ if (dlmsg) ++ DRV_LOG(WARNING, "Cannot load glue library: %s", dlmsg); ++ } + break; + } while (1); + path[i] = end + 1; +@@ -333,9 +338,6 @@ + } + if (!handle) { + rte_errno = EINVAL; +- dlmsg = dlerror(); +- if (dlmsg) +- DRV_LOG(WARNING, "Cannot load glue library: %s", dlmsg); + goto glue_error; + } + sym = dlsym(handle, "mlx5_glue"); diff --git a/support/dpdk/dpdk-23.11.1-mp-max-fds.patch b/support/dpdk/dpdk-23.11.1-mp-max-fds.patch new file mode 100644 index 0000000..7cb9cdc --- /dev/null +++ b/support/dpdk/dpdk-23.11.1-mp-max-fds.patch @@ -0,0 +1,11 @@ +--- dpdk-stable-23.11.1/lib/eal/include/rte_eal.h 2024-05-17 14:46:11.000000000 +0800 ++++ dpdk-stable-23.11.1-mr/lib/eal/include/rte_eal.h 2024-07-12 17:27:43.843952736 +0800 +@@ -155,7 +155,7 @@ + */ + bool rte_mp_disable(void); + +-#define RTE_MP_MAX_FD_NUM 8 /* The max amount of fds */ ++#define RTE_MP_MAX_FD_NUM 2048 /* The max amount of fds */ + #define RTE_MP_MAX_NAME_LEN 64 /* The max length of action name */ + #define RTE_MP_MAX_PARAM_LEN 256 /* The max length of param */ + struct rte_mp_msg { diff --git a/support/dpdk/dpdk-23.11.1-revert-fix-devargs-in-secondary-process.patch b/support/dpdk/dpdk-23.11.1-revert-fix-devargs-in-secondary-process.patch new file mode 100644 index 0000000..d7ae26a --- /dev/null +++ b/support/dpdk/dpdk-23.11.1-revert-fix-devargs-in-secondary-process.patch @@ -0,0 +1,36 @@ +--- dpdk-stable-23.11.1/drivers/bus/vdev/vdev.c 2024-05-17 14:46:11.000000000 +0800 ++++ dpdk-stable-23.11.1-mr/drivers/bus/vdev/vdev.c 2024-07-18 13:45:20.751042594 +0800 +@@ -263,21 +263,6 @@ + return devargs; + } + +-static struct rte_devargs * +-vdev_devargs_lookup(const char *name) +-{ +- struct rte_devargs *devargs; +- char dev_name[32]; +- +- RTE_EAL_DEVARGS_FOREACH("vdev", devargs) { +- devargs->bus->parse(devargs->name, &dev_name); +- if (strcmp(dev_name, name) == 0) { +- VDEV_LOG(INFO, "devargs matched %s", dev_name); +- return devargs; +- } +- } +- return NULL; +-} + + static int + insert_vdev(const char *name, const char *args, +@@ -291,10 +276,7 @@ + if (name == NULL) + return -EINVAL; + +- if (rte_eal_process_type() == RTE_PROC_PRIMARY) +- devargs = alloc_devargs(name, args); +- else +- devargs = vdev_devargs_lookup(name); ++ devargs = alloc_devargs(name, args); + + if (!devargs) + return -ENOMEM; diff --git a/support/dpdk/dpdk-23.11.1.tar.xz b/support/dpdk/dpdk-23.11.1.tar.xz Binary files differnew file mode 100644 index 0000000..3e47cbe --- /dev/null +++ b/support/dpdk/dpdk-23.11.1.tar.xz diff --git a/support/dpdk/dpdk-config-set.sh b/support/dpdk/dpdk-config-set.sh new file mode 100755 index 0000000..d0c760e --- /dev/null +++ b/support/dpdk/dpdk-config-set.sh @@ -0,0 +1,6 @@ +#!/bin/bash +echo 'start macro adjust' +current_path=$(pwd) +echo "Current work path: $current_path" +sed 's/^\(#define RTE_LIBRTE_GRAPH_STATS \).*/\10/' -i config/rte_config.h +echo 'macro adjust end'
\ No newline at end of file |
