summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author童宗振 <[email protected]>2024-07-23 09:27:30 +0000
committer童宗振 <[email protected]>2024-07-23 09:27:30 +0000
commitbdfd6cc86c7db57e3bd1968aca081f972e962d3d (patch)
treeeb2869319fd841ad7888fe80cc3eb70ae91f4ad6
parentf1a1d7fa5ff754e7b7df774852a25ef10e2a013c (diff)
Updata dpdk to 23
-rw-r--r--cmake/InstallDPDK.cmake2
-rw-r--r--infra/CMakeLists.txt16
-rw-r--r--infra/include/common.h3
-rw-r--r--service/include/sc_devmgr.h4
-rw-r--r--service/src/core.c18
-rw-r--r--service/src/devmgr.c133
-rw-r--r--service/src/pdump.c5
-rw-r--r--support/CMakeLists.txt44
-rw-r--r--support/dpdk-21.11.4/dpdk-21.11.4-bypass-flow-err-func.patch (renamed from support/dpdk/dpdk-21.11.4-bypass-flow-err-func.patch)0
-rw-r--r--support/dpdk-21.11.4/dpdk-21.11.4-dpdk-devbind-dump.patch (renamed from support/dpdk/dpdk-21.11.4-dpdk-devbind-dump.patch)0
-rw-r--r--support/dpdk-21.11.4/dpdk-21.11.4-dpdk-hugepages-path.patch (renamed from support/dpdk/dpdk-21.11.4-dpdk-hugepages-path.patch)0
-rw-r--r--support/dpdk-21.11.4/dpdk-21.11.4-dpdk-pcapng-path.patch (renamed from support/dpdk/dpdk-21.11.4-dpdk-pcapng-path.patch)0
-rw-r--r--support/dpdk-21.11.4/dpdk-21.11.4-dpdk-pdum-offset-app.patch (renamed from support/dpdk/dpdk-21.11.4-dpdk-pdum-offset-app.patch)0
-rw-r--r--support/dpdk-21.11.4/dpdk-21.11.4-dpdk-pdum-offset-c.patch (renamed from support/dpdk/dpdk-21.11.4-dpdk-pdum-offset-c.patch)0
-rw-r--r--support/dpdk-21.11.4/dpdk-21.11.4-dpdk-pdum-offset-h.patch (renamed from support/dpdk/dpdk-21.11.4-dpdk-pdum-offset-h.patch)0
-rw-r--r--support/dpdk-21.11.4/dpdk-21.11.4-extend-max-virtqueue-pairs.patch (renamed from support/dpdk/dpdk-21.11.4-extend-max-virtqueue-pairs.patch)0
-rw-r--r--support/dpdk-21.11.4/dpdk-21.11.4-fix-af-packet-run-as-slave-of-bond.patch (renamed from support/dpdk/dpdk-21.11.4-fix-af-packet-run-as-slave-of-bond.patch)0
-rw-r--r--support/dpdk-21.11.4/dpdk-21.11.4-fix-dup-msl-name-sec-process.patch (renamed from support/dpdk/dpdk-21.11.4-fix-dup-msl-name-sec-process.patch)0
-rw-r--r--support/dpdk-21.11.4/dpdk-21.11.4-fm10k-rxtx-vec.patch (renamed from support/dpdk/dpdk-21.11.4-fm10k-rxtx-vec.patch)0
-rw-r--r--support/dpdk-21.11.4/dpdk-21.11.4-mempool-ops-get-count.patch (renamed from support/dpdk/dpdk-21.11.4-mempool-ops-get-count.patch)0
-rw-r--r--support/dpdk-21.11.4/dpdk-21.11.4-memzone-namesize.patch (renamed from support/dpdk/dpdk-21.11.4-memzone-namesize.patch)0
-rw-r--r--support/dpdk-21.11.4/dpdk-21.11.4-mp-max-fds.patch (renamed from support/dpdk/dpdk-21.11.4-mp-max-fds.patch)0
-rwxr-xr-xsupport/dpdk-21.11.4/dpdk-21.11.4.tar.xz (renamed from support/dpdk/dpdk-21.11.4.tar.xz)bin15166036 -> 15166036 bytes
-rwxr-xr-xsupport/dpdk-21.11.4/dpdk-config-set.sh7
-rw-r--r--support/dpdk/dpdk-21.11.4-macro-adjust.patch19
-rw-r--r--support/dpdk/dpdk-23.11.1-bypass-flow-err-func.patch17
-rw-r--r--support/dpdk/dpdk-23.11.1-dpdk-devbind-dump.patch70
-rw-r--r--support/dpdk/dpdk-23.11.1-dpdk-hugepages-path.patch11
-rw-r--r--support/dpdk/dpdk-23.11.1-dpdk-pcapng-path.patch15
-rw-r--r--support/dpdk/dpdk-23.11.1-dpdk-pdum-offset-app.patch11
-rw-r--r--support/dpdk/dpdk-23.11.1-dpdk-pdum-offset-c.patch208
-rw-r--r--support/dpdk/dpdk-23.11.1-dpdk-pdum-offset-h.patch18
-rw-r--r--support/dpdk/dpdk-23.11.1-fix-af-packet-run-as-slave-of-bond.patch56
-rw-r--r--support/dpdk/dpdk-23.11.1-fix-dup-msl-name-sec-process.patch21
-rw-r--r--support/dpdk/dpdk-23.11.1-fix-legacy_mem_init.patch10
-rw-r--r--support/dpdk/dpdk-23.11.1-fm10k-rxtx-vec.patch12
-rw-r--r--support/dpdk/dpdk-23.11.1-mempool-ops-get-count.patch10
-rw-r--r--support/dpdk/dpdk-23.11.1-memzone-namesize.patch11
-rw-r--r--support/dpdk/dpdk-23.11.1-mlx5_glue_dlopen_info.patch24
-rw-r--r--support/dpdk/dpdk-23.11.1-mp-max-fds.patch11
-rw-r--r--support/dpdk/dpdk-23.11.1-revert-fix-devargs-in-secondary-process.patch36
-rw-r--r--support/dpdk/dpdk-23.11.1.tar.xzbin0 -> 16291592 bytes
-rwxr-xr-xsupport/dpdk/dpdk-config-set.sh6
-rw-r--r--tools/tcpdump/pdump.c52
44 files changed, 721 insertions, 129 deletions
diff --git a/cmake/InstallDPDK.cmake b/cmake/InstallDPDK.cmake
index e4018e3..c90ab28 100644
--- a/cmake/InstallDPDK.cmake
+++ b/cmake/InstallDPDK.cmake
@@ -10,6 +10,6 @@ install(PROGRAMS ${DPDK_ROOT_DIR}/bin/dpdk-devbind.py DESTINATION ${MR_INSTALL_
install(PROGRAMS ${DPDK_ROOT_DIR}/bin/dpdk-hugepages.py DESTINATION ${MR_INSTALL_BINDIR} COMPONENT Program)
-install(DIRECTORY ${DPDK_ROOT_DIR}/lib64/dpdk/pmds-22.0-glue/ DESTINATION ${MR_INSTALL_LIBDIR}
+install(DIRECTORY ${DPDK_ROOT_DIR}/lib64/dpdk/pmds-24.0-glue/ DESTINATION ${MR_INSTALL_LIBDIR}
COMPONENT Program FILES_MATCHING PATTERN "*"
PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
diff --git a/infra/CMakeLists.txt b/infra/CMakeLists.txt
index 79a3368..1674b97 100644
--- a/infra/CMakeLists.txt
+++ b/infra/CMakeLists.txt
@@ -13,36 +13,36 @@ target_link_libraries(infra rt libevent-static libevent-static-pthreads pthread
target_include_directories(infra INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/include/")
add_executable(TestPacketParser test/TestPacketParser.cc)
-target_link_libraries(TestPacketParser gtest_main infra z elf ibverbs mlx5 libevent-static libdpdk ${SYSTEMD_LIBRARIES})
+target_link_libraries(TestPacketParser gtest_main infra z elf ibverbs libevent-static libdpdk ${SYSTEMD_LIBRARIES})
target_include_directories(TestPacketParser PRIVATE include)
add_executable(TestDistributer test/TestDistributer.cc)
target_compile_definitions(TestDistributer PRIVATE -DTEST_PCAP_FILE_PREFIX=\"${CMAKE_CURRENT_SOURCE_DIR}/test/\")
-target_link_libraries(TestDistributer gtest_main infra z elf ibverbs mlx5 libevent-static ${SYSTEMD_LIBRARIES} ${PCAP_LIBRARY} libdpdk)
+target_link_libraries(TestDistributer gtest_main infra z elf ibverbs libevent-static ${SYSTEMD_LIBRARIES} ${PCAP_LIBRARY} libdpdk)
target_include_directories(TestDistributer PRIVATE include)
add_executable(TestVNode test/TestVNode.cc)
-target_link_libraries(TestVNode infra z elf ibverbs mlx5 gtest ${SYSTEMD_LIBRARIES} libdpdk)
+target_link_libraries(TestVNode infra z elf ibverbs gtest ${SYSTEMD_LIBRARIES} libdpdk)
target_include_directories(TestVNode PRIVATE include)
add_executable(TestPktClassifierEngine test/TestPktClassifierEngine.cc)
-target_link_libraries(TestPktClassifierEngine infra z elf ibverbs mlx5 gtest ${SYSTEMD_LIBRARIES} libdpdk)
+target_link_libraries(TestPktClassifierEngine infra z elf ibverbs gtest ${SYSTEMD_LIBRARIES} libdpdk)
target_include_directories(TestPktClassifierEngine PRIVATE include)
add_executable(TestSidList test/TestSidList.cc)
-target_link_libraries(TestSidList infra z elf ibverbs mlx5 gtest_main ${SYSTEMD_LIBRARIES} libdpdk)
+target_link_libraries(TestSidList infra z elf ibverbs gtest_main ${SYSTEMD_LIBRARIES} libdpdk)
target_include_directories(TestSidList PRIVATE include)
add_executable(TestLinkDb test/TestLinkDb.cc)
-target_link_libraries(TestLinkDb infra z elf ibverbs mlx5 gtest_main ${SYSTEMD_LIBRARIES} libdpdk)
+target_link_libraries(TestLinkDb infra z elf ibverbs gtest_main ${SYSTEMD_LIBRARIES} libdpdk)
target_include_directories(TestLinkDb PRIVATE include)
add_executable(TestPortAdapterMapping test/TestPortAdapterMapping.cc)
-target_link_libraries(TestPortAdapterMapping infra z elf ibverbs mlx5 gtest_main ${SYSTEMD_LIBRARIES} libdpdk)
+target_link_libraries(TestPortAdapterMapping infra z elf ibverbs gtest_main ${SYSTEMD_LIBRARIES} libdpdk)
target_include_directories(TestPortAdapterMapping PRIVATE include)
add_executable(TestDataPathTrace test/TestDataPathTrace.cc)
-target_link_libraries(TestDataPathTrace gtest_main infra z elf ibverbs mlx5 libdpdk ${SYSTEMD_LIBRARIES})
+target_link_libraries(TestDataPathTrace gtest_main infra z elf ibverbs libdpdk ${SYSTEMD_LIBRARIES})
target_include_directories(TestDataPathTrace PRIVATE include)
add_test(TestPacketParser TestPacketParser)
diff --git a/infra/include/common.h b/infra/include/common.h
index 2a0c919..881ee2d 100644
--- a/infra/include/common.h
+++ b/infra/include/common.h
@@ -6,6 +6,7 @@ extern "C"
#include <assert.h>
#include <ctype.h>
#include <fcntl.h>
+#include <pthread.h>
#include <rte_branch_prediction.h>
#include <rte_common.h>
#include <rte_log.h>
@@ -99,7 +100,7 @@ typedef uint32_t hash_t;
(type *)((char *)__mptr - offsetof(type, member)); \
})
#else
-#define container_of(ptr, type, member) ((type *)((char *)(ptr)-offsetof(type, member)))
+#define container_of(ptr, type, member) ((type *)((char *)(ptr) - offsetof(type, member)))
#endif
#endif
diff --git a/service/include/sc_devmgr.h b/service/include/sc_devmgr.h
index d6ad8ee..4eaf96a 100644
--- a/service/include/sc_devmgr.h
+++ b/service/include/sc_devmgr.h
@@ -196,8 +196,8 @@ struct dpdk_dev
struct mr_dev_desc_qid_map
{
- uint8_t qid_enabled[RTE_MAX_LCORE];
- uint8_t qid_map[RTE_MAX_LCORE];
+ uint8_t qid_enabled[RTE_MAX_LCORE];
+ uint8_t qid_map[RTE_MAX_LCORE];
};
struct mr_dev_desc
diff --git a/service/src/core.c b/service/src/core.c
index 3a209b6..01feaca 100644
--- a/service/src/core.c
+++ b/service/src/core.c
@@ -461,8 +461,8 @@ static void sc_eal_init(struct sc_main * sc, const char * cmd)
}
char str_socket_mem[MR_STRING_MAX];
- ret =
- MESA_load_profile_string_nodef(sc->local_cfgfile, "eal", "socket-mem", str_socket_mem, sizeof(str_socket_mem));
+ ret = MESA_load_profile_string_nodef(sc->local_cfgfile, "eal", "socket-mem", str_socket_mem,
+ sizeof(str_socket_mem));
if (ret > 0)
{
@@ -527,11 +527,7 @@ static void sc_eal_init(struct sc_main * sc, const char * cmd)
exit(EXIT_FAILURE);
}
-#if RTE_VERSION >= RTE_VERSION_NUM(17, 5, 0, 0)
rte_log_set_global_level(loglevel);
-#else
- rte_set_log_level(loglevel);
-#endif
g_logger_level = loglevel - 1;
@@ -556,6 +552,11 @@ static void sc_eal_init(struct sc_main * sc, const char * cmd)
ret = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &sc->cpu_set_before_eal);
MR_VERIFY_2(ret >= 0, "Cannot get init thread affinity: %s", strerror(errno));
+#if RTE_VERSION >= RTE_VERSION_NUM(23, 11, 0, 0)
+#define MR_RTE_MAX_MEMZONE 51200
+ ret = rte_memzone_max_set(MR_RTE_MAX_MEMZONE);
+ MR_VERIFY(rte_memzone_max_get() == MR_RTE_MAX_MEMZONE);
+#endif
ret = rte_eal_init((int)eal_argc, eal_argv);
if (ret < 0)
{
@@ -912,7 +913,6 @@ extern void devmgr_deinit(struct devmgr_main * devmgr_main);
extern int sw_forward_init(struct sc_main * sc);
extern int app_main_init(struct sc_main * sc);
extern int vdev_dump(struct sc_main * sc);
-extern int sw_fwd_dump(struct sc_main * sc);
extern int sw_vlan_base_forward_init(struct sc_main * sc);
extern int smartoffload_init(struct sc_main * sc);
extern int flow_main_init(struct sc_main * sc);
@@ -1207,10 +1207,6 @@ int marsio_service_main(int argc, char * argv[])
vdev_dump(sc);
port_adapter_mapping_dump();
-#if 0
- sw_fwd_dump(sc);
-#endif
-
if (rte_pdump_init() != 0)
{
MR_WARNING("Packet dump library initialization failed.");
diff --git a/service/src/devmgr.c b/service/src/devmgr.c
index 0c204ad..63ad913 100644
--- a/service/src/devmgr.c
+++ b/service/src/devmgr.c
@@ -16,6 +16,7 @@
#include <sys/queue.h>
#include <unistd.h>
+#include <rte_bus.h>
#include <rte_bus_pci.h>
#include <rte_config.h>
#include <rte_debug.h>
@@ -29,6 +30,7 @@
#include <rte_node_eth_api.h>
#include <rte_pci.h>
#include <rte_string_fns.h>
+#include <rte_version.h>
#include <MESA_prof_load.h>
#include <cJSON.h>
@@ -41,12 +43,11 @@
static struct rte_eth_conf eth_conf_default = {
.rxmode =
{
- .mq_mode = ETH_MQ_RX_NONE,
- .split_hdr_size = 0,
+ .mq_mode = RTE_ETH_MQ_RX_NONE,
},
.txmode =
{
- .mq_mode = ETH_MQ_TX_NONE,
+ .mq_mode = RTE_ETH_MQ_TX_NONE,
},
};
@@ -66,6 +67,12 @@ struct dpdk_dev_candidate
struct rte_pci_addr pci_addr;
/* STR PCI address */
char str_pci_addr[PCI_PRI_STR_SIZE];
+
+ /** for real network card, the name is str_pci_addr
+ * for virtio, the name is dpdk_vdev_name
+ * Its value is obtained through rte_eth_dev_get_name_by_port()
+ */
+ char devname[RTE_ETH_NAME_MAX_LEN];
/* vendor */
char vendor[MR_SYMBOL_MAX];
/* driver */
@@ -264,6 +271,9 @@ static int dpdk_dev_status_print(struct dpdk_dev * dev)
char str_phy_addr[MR_SYMBOL_MAX];
rte_ether_format_addr(str_phy_addr, sizeof(str_phy_addr), &dev->ether_addr);
+ char devname[RTE_ETH_NAME_MAX_LEN];
+ rte_eth_dev_get_name_by_port(dev->port_id, devname);
+
MR_INFO(" ");
MR_INFO("DPDK based device %s: PortID = %d", dev->symbol, dev->port_id);
@@ -272,6 +282,7 @@ static int dpdk_dev_status_print(struct dpdk_dev * dev)
mr_dev_desc_status_print(dev->ref_dev_desc);
/* then, the detail info of the dpdk device */
+ MR_INFO(" devname : %s", devname);
MR_INFO(" HWADDR : %s", str_phy_addr);
MR_INFO(" Maximum Transmission Unit : %u", dev->mtu);
MR_INFO(" Promiscuous mode : %s", str_enable_or_disable(dev->promisc));
@@ -280,6 +291,12 @@ static int dpdk_dev_status_print(struct dpdk_dev * dev)
MR_INFO(" Drop-En : %s", str_enable_or_disable(dev->en_drop));
MR_INFO(" RSSMode : %s", str_rssmode(dev->rssmode));
+#if 0
+#if RTE_VERSION >= RTE_VERSION_NUM(23, 11, 0, 0)
+ rte_eth_dev_priv_dump(dev->port_id, stderr);
+#endif
+#endif
+
/* Print the ip addr */
mr_dev_desc_ip_addr_print(dev->ref_dev_desc);
return 0;
@@ -710,8 +727,8 @@ int mr_dev_desc_config_load(struct devmgr_main * devmgr_main, struct mr_dev_desc
/* Get allow vlan ids */
uint32_t vlan_ids[16];
- int nr_vlan_members =
- MESA_load_profile_uint_range(cfgfile, str_section, "allow_vlan_ids", RTE_DIM(vlan_ids), vlan_ids);
+ int nr_vlan_members = MESA_load_profile_uint_range(cfgfile, str_section, "allow_vlan_ids", RTE_DIM(vlan_ids),
+ vlan_ids);
if (nr_vlan_members > 0)
{
if (nr_vlan_members > RTE_DIM(dev_desc->vlan_members))
@@ -1034,8 +1051,8 @@ int shmdev_setup_one_device(struct devmgr_main * devmgr_main, const char * devsy
}
ret = vdev_data_create(sc->vdev_main, devsym, nr_rxstream, nr_txstream, shmdev_config.sz_tun_rx,
- shmdev_config.sz_tun_tx, shmdev_config.sz_max_inflight,
- shmdev_config.batch_interval_in_us, direct_pool);
+ shmdev_config.sz_tun_tx, shmdev_config.sz_max_inflight, shmdev_config.batch_interval_in_us,
+ direct_pool);
if (unlikely(ret < 0))
{
@@ -1142,12 +1159,12 @@ static int gen_dpdk_dev_ethconf(struct dpdk_dev * dev, unsigned nr_rxq_use, stru
if ((dev_desc->drv_type == MR_DEV_DRV_TYPE_DPDK_PCI) && (nr_rxq_use > 1))
{
/* only PCI devices can run at RSS mode. */
- eth_conf.rxmode.mq_mode = ETH_MQ_RX_RSS;
+ eth_conf.rxmode.mq_mode = RTE_ETH_MQ_RX_NONE;
/* setup how NICs distributes packets */
if (dev->rssmode == MR_DEV_RSSMODE_2TUPLE_SYM)
{
- eth_conf.rx_adv_conf.rss_conf.rss_hf = ETH_RSS_IP;
+ eth_conf.rx_adv_conf.rss_conf.rss_hf = RTE_ETH_RSS_IP;
eth_conf.rx_adv_conf.rss_conf.rss_key = default_sym_rss_key;
eth_conf.rx_adv_conf.rss_conf.rss_key_len = sizeof(default_sym_rss_key);
}
@@ -1191,12 +1208,12 @@ static int gen_dpdk_dev_ethconf(struct dpdk_dev * dev, unsigned nr_rxq_use, stru
dev_desc->drv_type == MR_DEV_DRV_TYPE_DPDK_AF_PACKET)
{
/* the virtio and af_packet is not support rss */
- eth_conf.rxmode.mq_mode = ETH_MQ_RX_NONE;
+ eth_conf.rxmode.mq_mode = RTE_ETH_MQ_RX_NONE;
}
if (dev->en_vlan_strip)
{
- eth_conf.txmode.offloads |= DEV_TX_OFFLOAD_VLAN_INSERT;
+ eth_conf.txmode.offloads |= RTE_ETH_TX_OFFLOAD_VLAN_INSERT;
}
*out_eth_conf = eth_conf;
@@ -1291,8 +1308,8 @@ static int dpdk_dev_queue_setup_rss(struct dpdk_dev * dev, cpu_set_t * rx_cpu_se
struct rte_mempool * pool = mrb_direct_mempool_locate(sc->mrb_pool_main, NULL, socket_id, cpu_id);
assert(pool != NULL);
- ret =
- rte_eth_rx_queue_setup(dev->port_id, rxq + rxq_index_begin, dev->nr_rx_descs, dev_socket_id, &rxconf, pool);
+ ret = rte_eth_rx_queue_setup(dev->port_id, rxq + rxq_index_begin, dev->nr_rx_descs, dev_socket_id, &rxconf,
+ pool);
if (ret < 0)
{
MR_ERROR("dpdk device %s RXQ %d setup failed, errno = %d", dev->symbol, rxq + rxq_index_begin, ret);
@@ -1344,7 +1361,7 @@ __rte_unused static int dpdk_dev_queue_setup_hairpin(struct dpdk_dev * dev, unsi
if (unlikely(ret != 0))
{
MR_ERROR("Failed at setup rx hairpin queue at port = %d, queue = %d, peer_queue = %d, ret = %d: %s",
- dev->port_id, q_index_hairpin, q_index_hairpin_peer, ret, rte_strerror(errno));
+ dev->port_id, q_index_hairpin, q_index_hairpin_peer, ret, rte_strerror(rte_errno));
return ret;
}
}
@@ -1362,7 +1379,7 @@ __rte_unused static int dpdk_dev_queue_setup_hairpin(struct dpdk_dev * dev, unsi
if (unlikely(ret != 0))
{
MR_ERROR("Failed at setup tx hairpin queue at port = %d, queue = %d, peer_queue = %d, ret = %d: %s",
- dev->port_id, q_index_hairpin, q_index_hairpin_peer, ret, rte_strerror(errno));
+ dev->port_id, q_index_hairpin, q_index_hairpin_peer, ret, rte_strerror(rte_errno));
return ret;
}
@@ -1441,21 +1458,21 @@ __rte_unused static int dpdk_dev_setup_default_flows(struct devmgr_main * devmgr
/* setup how nics distributes packets */
if (dev->rssmode == MR_DEV_RSSMODE_2TUPLE_SYM)
{
- rss_type = ETH_RSS_IP;
+ rss_type = RTE_ETH_RSS_IP;
rss_key = default_sym_rss_key;
rss_key_len = sizeof(default_sym_rss_key);
}
else if (dev->rssmode == MR_DEV_RSSMODE_4TUPLE_SYM)
{
- rss_type =
- ETH_RSS_NONFRAG_IPV4_TCP | ETH_RSS_NONFRAG_IPV6_TCP | ETH_RSS_NONFRAG_IPV4_UDP | ETH_RSS_NONFRAG_IPV6_UDP;
+ rss_type = RTE_ETH_RSS_NONFRAG_IPV4_TCP | RTE_ETH_RSS_NONFRAG_IPV6_TCP | RTE_ETH_RSS_NONFRAG_IPV4_UDP |
+ RTE_ETH_RSS_NONFRAG_IPV6_UDP;
rss_key = default_sym_rss_key;
rss_key_len = sizeof(default_sym_rss_key);
}
else if (dev->rssmode == MR_DEV_RSSMODE_4TUPLE_ASYM)
{
- rss_type =
- ETH_RSS_NONFRAG_IPV4_TCP | ETH_RSS_NONFRAG_IPV6_TCP | ETH_RSS_NONFRAG_IPV4_UDP | ETH_RSS_NONFRAG_IPV6_UDP;
+ rss_type = RTE_ETH_RSS_NONFRAG_IPV4_TCP | RTE_ETH_RSS_NONFRAG_IPV6_TCP | RTE_ETH_RSS_NONFRAG_IPV4_UDP |
+ RTE_ETH_RSS_NONFRAG_IPV6_UDP;
rss_key = NULL;
}
@@ -1529,8 +1546,7 @@ static int dpdk_dev_setup_common(struct devmgr_main * devmgr_main, struct dpdk_d
return RT_ERR;
}
-
- if(dev->en_tx_meter)
+ if (dev->en_tx_meter)
{
ret = dpdk_dev_tx_meter_setup(dev, nr_txq_use, dev->tx_meter_cir, dev->tx_meter_cbs, dev->tx_meter_ebs);
if (ret < 0)
@@ -1587,12 +1603,12 @@ static int dpdk_dev_setup_common(struct devmgr_main * devmgr_main, struct dpdk_d
int vlan_offload_mask = 0;
if (dev->en_vlan_strip)
{
- vlan_offload_mask |= ETH_VLAN_STRIP_OFFLOAD;
+ vlan_offload_mask |= RTE_ETH_VLAN_STRIP_OFFLOAD;
}
if (dev->en_vlan_filter)
{
- vlan_offload_mask |= ETH_VLAN_FILTER_OFFLOAD;
+ vlan_offload_mask |= RTE_ETH_VLAN_FILTER_OFFLOAD;
}
if (vlan_offload_mask != 0)
@@ -1680,7 +1696,7 @@ void dpdk_dev_config_load(struct dpdk_dev * dev_dpdk, const char * cfg)
/* tx meter */
MESA_load_profile_uint_def(cfg, str_section, "en_tx_meter", &dev_dpdk->en_tx_meter, 0);
- if(dev_dpdk->en_tx_meter)
+ if (dev_dpdk->en_tx_meter)
{
unsigned int tx_meter_cir_in_Kbps = 0;
unsigned int tx_meter_cbs_in_KB = 0;
@@ -1709,6 +1725,7 @@ void dpdk_dev_config_load(struct dpdk_dev * dev_dpdk, const char * cfg)
/* TODO: allow the user to set different io cores for each devices */
}
+#if 0
static struct dpdk_dev_candidate * dpdk_dev_candidate_lookup_by_pci_addr(struct devmgr_main * devmgr_main,
struct rte_pci_addr pci_addr)
{
@@ -1734,6 +1751,20 @@ static struct dpdk_dev_candidate * dpdk_dev_candidate_lookup_by_vdev_name(struct
return NULL;
}
+#endif
+
+static struct dpdk_dev_candidate * dpdk_dev_candidate_lookup_by_devname(struct devmgr_main * devmgr_main,
+ const char * devname)
+{
+ struct dpdk_dev_candidate * dev_iter = NULL;
+ TAILQ_FOREACH(dev_iter, &devmgr_main->dpdk_dev_candidate_list, next)
+ {
+ if (strcmp(dev_iter->devname, devname) == 0)
+ return dev_iter;
+ }
+
+ return NULL;
+}
static int dpdk_dev_candidate_vdev_register(struct devmgr_main * devmgr_main, const char * kernel_name,
const char * vdev_name)
@@ -1741,8 +1772,9 @@ static int dpdk_dev_candidate_vdev_register(struct devmgr_main * devmgr_main, co
struct dpdk_dev_candidate * dev = malloc(sizeof(struct dpdk_dev_candidate));
MR_VERIFY_MALLOC(dev);
- snprintf(dev->kernel_name, sizeof(dev->kernel_name) - 1, "%s", kernel_name);
- snprintf(dev->dpdk_vdev_name, sizeof(dev->dpdk_vdev_name) - 1, "%s", vdev_name);
+ snprintf(dev->kernel_name, sizeof(dev->kernel_name), "%s", kernel_name);
+ snprintf(dev->dpdk_vdev_name, sizeof(dev->dpdk_vdev_name), "%s", vdev_name);
+ snprintf(dev->devname, sizeof(dev->devname), "%s", vdev_name);
TAILQ_INSERT_TAIL(&devmgr_main->dpdk_dev_candidate_list, dev, next);
return RT_SUCCESS;
@@ -1791,6 +1823,7 @@ static int dpdk_dev_candidate_pci_register(struct devmgr_main * devmgr_main, con
free(dev);
continue;
}
+ rte_pci_device_name(&dev->pci_addr, dev->devname, sizeof(dev->devname));
MR_DEBUG("DPDK device candidate: kernel_name=%s, pci_addr=%s, driver=%s", dev->kernel_name, dev->str_pci_addr,
dev->driver);
@@ -1978,7 +2011,7 @@ static int bond_dev_init_one_device(struct devmgr_main * devmgr_main, const char
}
int ret = rte_eth_bond_xmit_policy_set(bond_port_id, bond_dev_cfg->xmit_policy);
- if(unlikely(ret < 0))
+ if (unlikely(ret < 0))
{
MR_ERROR("Failed at setting xmit policy for bond %s: ret = %d", str_bond, ret);
goto errout;
@@ -2004,7 +2037,11 @@ static int bond_dev_init_one_device(struct devmgr_main * devmgr_main, const char
}
port_id_t slave_port_id = slave_dev_desc->port_id;
+#if RTE_VERSION >= RTE_VERSION_NUM(23, 11, 0, 0)
+ ret = rte_eth_bond_member_add(bond_port_id, slave_port_id);
+#else
ret = rte_eth_bond_slave_add(bond_port_id, slave_port_id);
+#endif
if (unlikely(ret < 0))
{
MR_ERROR("Failed at join %s to bond %s: ret = %d", str_dev_slave, str_bond, ret);
@@ -2035,7 +2072,7 @@ static int bond_dev_init_one_device(struct devmgr_main * devmgr_main, const char
}
/* get the candidate desc */
- dev_can = dpdk_dev_candidate_lookup_by_vdev_name(devmgr_main, str_bond_vdev);
+ dev_can = dpdk_dev_candidate_lookup_by_devname(devmgr_main, str_bond_vdev);
assert(dev_can != NULL);
ret = dpdk_dev_setup_from_candidate(devmgr_main, dev_can, bond_port_id);
@@ -2243,29 +2280,17 @@ int dpdk_dev_init(struct devmgr_main * devmgr_main)
/* all ethernet devices connect to pci bus */
RTE_ETH_FOREACH_DEV(port_id)
{
- struct rte_eth_dev_info dev_info_handler;
- ret = rte_eth_dev_info_get(port_id, &dev_info_handler);
- MR_VERIFY(ret == 0);
-
- struct rte_device * p_device = dev_info_handler.device;
- struct rte_bus * p_bus = rte_bus_find_by_device(p_device);
- MR_VERIFY(p_bus != NULL);
-
- struct dpdk_dev_candidate * dev_can = NULL;
- if (strncmp(p_bus->name, "pci", strlen("pci")) == 0)
- {
- dev_can = dpdk_dev_candidate_lookup_by_pci_addr(devmgr_main, RTE_DEV_TO_PCI_CONST(p_device)->addr);
- }
- else if (strncmp(p_bus->name, "vdev", strlen("vdev")) == 0)
- {
- dev_can = dpdk_dev_candidate_lookup_by_vdev_name(devmgr_main, p_device->name);
- }
- else
+ char devname[RTE_ETH_NAME_MAX_LEN];
+ ret = rte_eth_dev_get_name_by_port(port_id, devname);
+ if (unlikely(ret < 0))
{
- MR_ERROR("Unknown p_bus for the dpdk device, ignore it: port_id=%d, p_bus=%s", port_id, p_bus->name);
+ MR_ERROR("Failed to get devname, ignore it: port_id=%d", port_id);
continue;
}
+ struct dpdk_dev_candidate * dev_can = NULL;
+ dev_can = dpdk_dev_candidate_lookup_by_devname(devmgr_main, devname);
+
if (unlikely(dev_can == NULL))
{
MR_ERROR("Failed at lookup dpdk_dev_candidate, ignore it: port_id=%d", port_id);
@@ -2491,7 +2516,11 @@ static cJSON * dpdk_dev_monit_bonds(struct devmgr_main * devmgr_main, struct mr_
/* ------------------------------ SLAVES ------------------------------- */
uint16_t slaves[RTE_MAX_ETHPORTS] = {};
+#if RTE_VERSION >= RTE_VERSION_NUM(23, 11, 0, 0)
+ int num_slaves = rte_eth_bond_members_get(dpdk_dev_desc->port_id, slaves, RTE_MAX_ETHPORTS);
+#else
int num_slaves = rte_eth_bond_slaves_get(dpdk_dev_desc->port_id, slaves, RTE_MAX_ETHPORTS);
+#endif
if (unlikely(num_slaves < 0))
{
goto errout;
@@ -2514,8 +2543,12 @@ static cJSON * dpdk_dev_monit_bonds(struct devmgr_main * devmgr_main, struct mr_
/* ------------------------------ ACTIVE SLAVES ------------------------------- */
uint16_t active_slaves[RTE_MAX_ETHPORTS] = {};
+#if RTE_VERSION >= RTE_VERSION_NUM(23, 11, 0, 0)
+ int num_active_slaves = rte_eth_bond_active_members_get(dpdk_dev_desc->port_id, active_slaves, RTE_MAX_ETHPORTS);
+#else
int num_active_slaves = rte_eth_bond_active_slaves_get(dpdk_dev_desc->port_id, active_slaves, RTE_MAX_ETHPORTS);
- if (unlikely(num_slaves < 0))
+#endif
+ if (unlikely(num_active_slaves < 0))
{
goto errout;
}
@@ -2781,4 +2814,4 @@ int devmgr_init(struct devmgr_main * devmgr_main)
}
return RT_SUCCESS;
-}
+} \ No newline at end of file
diff --git a/service/src/pdump.c b/service/src/pdump.c
index b33b851..d9ecf3b 100644
--- a/service/src/pdump.c
+++ b/service/src/pdump.c
@@ -7,6 +7,7 @@
#include <rte_pcapng.h>
#include <rte_pdump.h>
#include <rte_ring.h>
+#include <rte_version.h>
#include <sc_pdump.h>
#include <sys/utsname.h>
#include <unistd.h>
@@ -141,7 +142,11 @@ void shmdev_pdump_copy(uint16_t port_id, uint16_t queue, struct rte_mempool * mp
/* The 'ts' argument represents cycles, describing only the packet interval. It doesn't save GMT; the time will
* be recorded in the 'mrpdump' tool. */
+#if RTE_VERSION >= RTE_VERSION_NUM(23, 11, 0, 0)
+ struct rte_mbuf * new_mbuf = rte_pcapng_copy(port_id, queue, mbufs[i], mp, snaplen, direction, NULL);
+#else
struct rte_mbuf * new_mbuf = rte_pcapng_copy(port_id, queue, mbufs[i], mp, snaplen, 0, direction);
+#endif
if (unlikely(new_mbuf == NULL))
__atomic_fetch_add(&stats->nombuf, 1, __ATOMIC_RELAXED);
else
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
index 4b35c80..4b35c80 100755
--- a/support/dpdk/dpdk-21.11.4.tar.xz
+++ b/support/dpdk-21.11.4/dpdk-21.11.4.tar.xz
Binary files differ
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
new file mode 100644
index 0000000..3e47cbe
--- /dev/null
+++ b/support/dpdk/dpdk-23.11.1.tar.xz
Binary files differ
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
diff --git a/tools/tcpdump/pdump.c b/tools/tcpdump/pdump.c
index bf3e83c..787a20d 100644
--- a/tools/tcpdump/pdump.c
+++ b/tools/tcpdump/pdump.c
@@ -65,6 +65,7 @@
#include <rte_pdump.h>
#include <rte_ring.h>
#include <rte_time.h>
+#include <rte_version.h>
#include <sc_pdump.h>
#include <time.h>
@@ -97,7 +98,7 @@
#define NUM_VDEVS 2
/* true if x is a power of 2 */
-#define POWEROF2(x) ((((x)-1) & (x)) == 0)
+#define POWEROF2(x) ((((x) - 1) & (x)) == 0)
#define METADATA_MAX_SIZE 256
@@ -922,14 +923,39 @@ static int pcapng_add_interface(struct pdump_tuples * pt)
static void write_interface_info(void)
{
+ /* Save PCI devices */
+ uint16_t port_id = 0;
+ RTE_ETH_FOREACH_DEV(port_id)
+ {
+ /* The list if ports in pcapng needs to be contiguous */
+ port_index[port_id] = interface_index++;
+ }
+
+#if RTE_VERSION >= RTE_VERSION_NUM(23, 11, 0, 0)
+ // In dpdk21-11, the rte_pcapng_fdopen() function automatically calls pcapng_add_interface
+ // In dpdk-23, you need to manually call rte_pcapng_add_interface()
+ port_id = 0;
+ RTE_ETH_FOREACH_DEV(port_id)
+ {
+ /* The list if ports in pcapng needs to be contiguous */
+ if (rte_pcapng_add_interface(pcapng, port_id, NULL, NULL, NULL) < 0)
+ {
+ rte_exit(EXIT_FAILURE, "port id:%u, write interface info err.\n", port_id);
+ }
+ }
+#endif
+
for (int i = 0; i < num_tuples; i++)
{
struct pdump_tuples * pt = &pdump_t[i];
- if (pt->drv_type != MR_DEV_DRV_TYPE_SHMDEV)
- continue;
- if (pcapng_add_interface(pt) < 0)
- rte_exit(EXIT_FAILURE, "Phydev:%s, write interface info err.\n", pt->dev_symbol);
- port_index[pt->port_id] = interface_index++;
+ if (pt->drv_type == MR_DEV_DRV_TYPE_SHMDEV)
+ {
+ if (pcapng_add_interface(pt) < 0)
+ {
+ rte_exit(EXIT_FAILURE, "Phydev:%s, write interface info err.\n", pt->dev_symbol);
+ }
+ port_index[pt->port_id] = interface_index++;
+ }
}
}
@@ -1120,14 +1146,6 @@ static inline void create_pcap_dumper()
rte_exit(EXIT_FAILURE, "Rte bpf convert failed\n");
}
- /* Save PCI devices */
- uint16_t port_id = 0;
- RTE_ETH_FOREACH_DEV(port_id)
- {
- /* The list if ports in pcapng needs to be contiguous */
- port_index[port_id] = interface_index++;
- }
-
return;
}
@@ -1191,12 +1209,12 @@ int main(int argc, char ** argv)
/* create dumpfile writer */
create_pcap_dumper();
- /* device enable */
- enable_pdump();
-
/* write interface info */
write_interface_info();
+ /* device enable */
+ enable_pdump();
+
/* dump packets */
dump_packets();