diff --git a/0114-app-testpmd-support-specify-TCs-when-DCB-forward.patch b/0114-app-testpmd-support-specify-TCs-when-DCB-forward.patch new file mode 100644 index 0000000000000000000000000000000000000000..e722d7f87b1d10ad60ee00d8bf0e724312885a44 --- /dev/null +++ b/0114-app-testpmd-support-specify-TCs-when-DCB-forward.patch @@ -0,0 +1,254 @@ +From 8e59ea27ffdd5ab00b2003c124a943ff42953812 Mon Sep 17 00:00:00 2001 +From: Chengwen Feng +Date: Tue, 11 Nov 2025 17:13:02 +0800 +Subject: [PATCH] app/testpmd: support specify TCs when DCB forward + +[ upstream commit 48077248013eb2b52e020cf2eb103a314d794e81] + +This commit supports specify TCs when DCB forwarding, the command: + + set dcb fwd_tc (tc_mask) + +The background of this command: only some TCs are expected to generate +traffic when the DCB function is tested based on txonly forwarding, we +could use this command to specify TCs to be used. + +Signed-off-by: Chengwen Feng +Acked-by: Huisong Li +Signed-off-by: Donghua Huang +--- + app/test-pmd/cmdline.c | 57 +++++++++++++++++++++ + app/test-pmd/config.c | 50 +++++++++++++++++- + app/test-pmd/testpmd.c | 6 +++ + app/test-pmd/testpmd.h | 3 ++ + doc/guides/testpmd_app_ug/testpmd_funcs.rst | 8 +++ + 5 files changed, 122 insertions(+), 2 deletions(-) + +diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c +index 8ef116c..26a8b44 100644 +--- a/app/test-pmd/cmdline.c ++++ b/app/test-pmd/cmdline.c +@@ -488,6 +488,9 @@ static void cmd_help_long_parsed(void *parsed_result, + "set fwd (%s)\n" + " Set packet forwarding mode.\n\n" + ++ "set dcb fwd_tc (tc_mask)\n" ++ " Set dcb forwarding on specify TCs, if bit-n in tc-mask is 1, then TC-n's forwarding is enabled\n\n" ++ + "mac_addr add (port_id) (XX:XX:XX:XX:XX:XX)\n" + " Add a MAC address on port_id.\n\n" + +@@ -5785,6 +5788,59 @@ static void cmd_set_fwd_retry_mode_init(void) + token_struct->string_data.str = token; + } + ++/* *** set dcb forward TCs *** */ ++struct cmd_set_dcb_fwd_tc_result { ++ cmdline_fixed_string_t set; ++ cmdline_fixed_string_t dcb; ++ cmdline_fixed_string_t fwd_tc; ++ uint8_t tc_mask; ++}; ++ ++static void cmd_set_dcb_fwd_tc_parsed(void *parsed_result, ++ __rte_unused struct cmdline *cl, ++ __rte_unused void *data) ++{ ++ struct cmd_set_dcb_fwd_tc_result *res = parsed_result; ++ int i; ++ if (res->tc_mask == 0) { ++ fprintf(stderr, "TC mask should not be zero!\n"); ++ return; ++ } ++ printf("Enabled DCB forwarding TC list:"); ++ dcb_fwd_tc_mask = res->tc_mask; ++ for (i = 0; i < RTE_ETH_8_TCS; i++) { ++ if (dcb_fwd_tc_mask & (1u << i)) ++ printf(" %d", i); ++ } ++ printf("\n"); ++} ++ ++static cmdline_parse_token_string_t cmd_set_dcb_fwd_tc_set = ++ TOKEN_STRING_INITIALIZER(struct cmd_set_dcb_fwd_tc_result, ++ set, "set"); ++static cmdline_parse_token_string_t cmd_set_dcb_fwd_tc_dcb = ++ TOKEN_STRING_INITIALIZER(struct cmd_set_dcb_fwd_tc_result, ++ dcb, "dcb"); ++static cmdline_parse_token_string_t cmd_set_dcb_fwd_tc_fwdtc = ++ TOKEN_STRING_INITIALIZER(struct cmd_set_dcb_fwd_tc_result, ++ fwd_tc, "fwd_tc"); ++static cmdline_parse_token_num_t cmd_set_dcb_fwd_tc_tcmask = ++ TOKEN_NUM_INITIALIZER(struct cmd_set_dcb_fwd_tc_result, ++ tc_mask, RTE_UINT8); ++ ++static cmdline_parse_inst_t cmd_set_dcb_fwd_tc = { ++ .f = cmd_set_dcb_fwd_tc_parsed, ++ .data = NULL, ++ .help_str = "config DCB forwarding on specify TCs, if bit-n in tc-mask is 1, then TC-n's forwarding is enabled, and vice versa.", ++ .tokens = { ++ (void *)&cmd_set_dcb_fwd_tc_set, ++ (void *)&cmd_set_dcb_fwd_tc_dcb, ++ (void *)&cmd_set_dcb_fwd_tc_fwdtc, ++ (void *)&cmd_set_dcb_fwd_tc_tcmask, ++ NULL, ++ }, ++}; ++ + /* *** SET BURST TX DELAY TIME RETRY NUMBER *** */ + struct cmd_set_burst_tx_retry_result { + cmdline_fixed_string_t set; +@@ -13156,6 +13212,7 @@ static cmdline_parse_ctx_t builtin_ctx[] = { + (cmdline_parse_inst_t *)&cmd_set_fwd_mask, + (cmdline_parse_inst_t *)&cmd_set_fwd_mode, + (cmdline_parse_inst_t *)&cmd_set_fwd_retry_mode, ++ (cmdline_parse_inst_t *)&cmd_set_dcb_fwd_tc, + (cmdline_parse_inst_t *)&cmd_set_burst_tx_retry, + (cmdline_parse_inst_t *)&cmd_set_promisc_mode_one, + (cmdline_parse_inst_t *)&cmd_set_promisc_mode_all, +diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c +index 2c4dedd..a7832d1 100644 +--- a/app/test-pmd/config.c ++++ b/app/test-pmd/config.c +@@ -4853,12 +4853,48 @@ get_fwd_port_total_tc_num(void) + + for (i = 0; i < nb_fwd_ports; i++) { + (void)rte_eth_dev_get_dcb_info(fwd_ports_ids[i], &dcb_info); +- total_tc_num += dcb_info.nb_tcs; ++ total_tc_num += rte_popcount32(dcb_fwd_tc_mask & ((1u << dcb_info.nb_tcs) - 1)); + } + + return total_tc_num; + } + ++static void ++dcb_fwd_tc_update_dcb_info(struct rte_eth_dcb_info *org_dcb_info) ++{ ++ struct rte_eth_dcb_info dcb_info = {0}; ++ uint32_t i, vmdq_idx; ++ uint32_t tc = 0; ++ ++ if (dcb_fwd_tc_mask == DEFAULT_DCB_FWD_TC_MASK) ++ return; ++ ++ /* ++ * Use compress scheme to update dcb-info. ++ * E.g. If org_dcb_info->nb_tcs is 4 and dcb_fwd_tc_mask is 0x8, it ++ * means only enable TC3, then the new dcb-info's nb_tcs is set to ++ * 1, and also move corresponding tc_rxq and tc_txq info to new ++ * index. ++ */ ++ for (i = 0; i < org_dcb_info->nb_tcs; i++) { ++ if (!(dcb_fwd_tc_mask & (1u << i))) ++ continue; ++ for (vmdq_idx = 0; vmdq_idx < RTE_ETH_MAX_VMDQ_POOL; vmdq_idx++) { ++ dcb_info.tc_queue.tc_rxq[vmdq_idx][tc].base = ++ org_dcb_info->tc_queue.tc_rxq[vmdq_idx][i].base; ++ dcb_info.tc_queue.tc_rxq[vmdq_idx][tc].nb_queue = ++ org_dcb_info->tc_queue.tc_rxq[vmdq_idx][i].nb_queue; ++ dcb_info.tc_queue.tc_txq[vmdq_idx][tc].base = ++ org_dcb_info->tc_queue.tc_txq[vmdq_idx][i].base; ++ dcb_info.tc_queue.tc_txq[vmdq_idx][tc].nb_queue = ++ org_dcb_info->tc_queue.tc_txq[vmdq_idx][i].nb_queue; ++ } ++ tc++; ++ } ++ dcb_info.nb_tcs = tc; ++ *org_dcb_info = dcb_info; ++} ++ + /** + * For the DCB forwarding test, each core is assigned on each traffic class. + * +@@ -4908,11 +4944,17 @@ dcb_fwd_config_setup(void) + } + } + ++ total_tc_num = get_fwd_port_total_tc_num(); ++ if (total_tc_num == 0) { ++ fprintf(stderr, "Error: total forwarding TC num is zero!\n"); ++ cur_fwd_config.nb_fwd_lcores = 0; ++ return; ++ } ++ + cur_fwd_config.nb_fwd_lcores = (lcoreid_t) nb_fwd_lcores; + cur_fwd_config.nb_fwd_ports = nb_fwd_ports; + cur_fwd_config.nb_fwd_streams = + (streamid_t) (nb_rxq * cur_fwd_config.nb_fwd_ports); +- total_tc_num = get_fwd_port_total_tc_num(); + if (cur_fwd_config.nb_fwd_lcores > total_tc_num) + cur_fwd_config.nb_fwd_lcores = total_tc_num; + +@@ -4922,7 +4964,9 @@ dcb_fwd_config_setup(void) + txp = 1; + /* get the dcb info on the first RX and TX ports */ + (void)rte_eth_dev_get_dcb_info(fwd_ports_ids[rxp], &rxp_dcb_info); ++ dcb_fwd_tc_update_dcb_info(&rxp_dcb_info); + (void)rte_eth_dev_get_dcb_info(fwd_ports_ids[txp], &txp_dcb_info); ++ dcb_fwd_tc_update_dcb_info(&txp_dcb_info); + + for (lc_id = 0; lc_id < cur_fwd_config.nb_fwd_lcores; lc_id++) { + fwd_lcores[lc_id]->stream_nb = 0; +@@ -4973,7 +5017,9 @@ dcb_fwd_config_setup(void) + else + txp = (portid_t) (rxp - 1); + rte_eth_dev_get_dcb_info(fwd_ports_ids[rxp], &rxp_dcb_info); ++ dcb_fwd_tc_update_dcb_info(&rxp_dcb_info); + rte_eth_dev_get_dcb_info(fwd_ports_ids[txp], &txp_dcb_info); ++ dcb_fwd_tc_update_dcb_info(&txp_dcb_info); + } + } + +diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c +index 9e4e99e..4519e79 100644 +--- a/app/test-pmd/testpmd.c ++++ b/app/test-pmd/testpmd.c +@@ -206,6 +206,12 @@ struct fwd_engine * fwd_engines[] = { + NULL, + }; + ++/* ++ * Bitmask for control DCB forwarding for TCs. ++ * If bit-n in tc-mask is 1, then TC-n's forwarding is enabled, and vice versa. ++ */ ++uint8_t dcb_fwd_tc_mask = DEFAULT_DCB_FWD_TC_MASK; ++ + struct rte_mempool *mempools[RTE_MAX_NUMA_NODES * MAX_SEGS_BUFFER_SPLIT]; + uint16_t mempool_flags; + +diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h +index 9b10a9e..5733df5 100644 +--- a/app/test-pmd/testpmd.h ++++ b/app/test-pmd/testpmd.h +@@ -464,6 +464,9 @@ extern cmdline_parse_inst_t cmd_show_set_raw_all; + extern cmdline_parse_inst_t cmd_set_flex_is_pattern; + extern cmdline_parse_inst_t cmd_set_flex_spec_pattern; + ++#define DEFAULT_DCB_FWD_TC_MASK 0xFF ++extern uint8_t dcb_fwd_tc_mask; ++ + extern uint16_t mempool_flags; + + /** +diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst +index 227188f..2b81a26 100644 +--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst ++++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst +@@ -1838,6 +1838,14 @@ during the flow rule creation:: + + Otherwise the default index ``0`` is used. + ++set dcb fwd_tc ++~~~~~~~~~~~~~~ ++ ++Config DCB forwarding on specify TCs, if bit-n in tc-mask is 1, then TC-n's ++forwarding is enabled, and vice versa:: ++ ++ testpmd> set dcb fwd_tc (tc_mask) ++ + Port Functions + -------------- + +-- +2.33.0 + diff --git a/0115-app-testpmd-support-multi-cores-process-one-TC.patch b/0115-app-testpmd-support-multi-cores-process-one-TC.patch new file mode 100644 index 0000000000000000000000000000000000000000..7afabfcb2efbacffb1b9c7039c6f8ee98346d260 --- /dev/null +++ b/0115-app-testpmd-support-multi-cores-process-one-TC.patch @@ -0,0 +1,292 @@ +From c77d32e88d5d5c1c5d51ca9521c9a0abca9306f0 Mon Sep 17 00:00:00 2001 +From: Chengwen Feng +Date: Tue, 11 Nov 2025 17:13:03 +0800 +Subject: [PATCH] app/testpmd: support multi-cores process one TC + +[ upstream commit fca6f2910345c25a5050a0b586e0d324ca616cbb] + +Currently, one TC can be processed by only one core, when there are a +large number of small packets, this core becomes a bottleneck. + +This commit supports multi-cores process one TC, the command: + + set dcb fwd_tc_cores (tc_cores) + +Signed-off-by: Chengwen Feng +Acked-by: Huisong Li +Signed-off-by: Donghua Huang +--- + app/test-pmd/cmdline.c | 48 ++++++++++++ + app/test-pmd/config.c | 85 ++++++++++++++++----- + app/test-pmd/testpmd.c | 9 +++ + app/test-pmd/testpmd.h | 1 + + doc/guides/testpmd_app_ug/testpmd_funcs.rst | 8 ++ + 5 files changed, 134 insertions(+), 17 deletions(-) + +diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c +index 26a8b44..62780a0 100644 +--- a/app/test-pmd/cmdline.c ++++ b/app/test-pmd/cmdline.c +@@ -5841,6 +5841,53 @@ static cmdline_parse_inst_t cmd_set_dcb_fwd_tc = { + }, + }; + ++/* *** set dcb forward cores per TC *** */ ++struct cmd_set_dcb_fwd_tc_cores_result { ++ cmdline_fixed_string_t set; ++ cmdline_fixed_string_t dcb; ++ cmdline_fixed_string_t fwd_tc_cores; ++ uint8_t tc_cores; ++}; ++ ++static void cmd_set_dcb_fwd_tc_cores_parsed(void *parsed_result, ++ __rte_unused struct cmdline *cl, ++ __rte_unused void *data) ++{ ++ struct cmd_set_dcb_fwd_tc_cores_result *res = parsed_result; ++ if (res->tc_cores == 0) { ++ fprintf(stderr, "Cores per-TC should not be zero!\n"); ++ return; ++ } ++ dcb_fwd_tc_cores = res->tc_cores; ++ printf("Set cores-per-TC: %u\n", dcb_fwd_tc_cores); ++} ++ ++static cmdline_parse_token_string_t cmd_set_dcb_fwd_tc_cores_set = ++ TOKEN_STRING_INITIALIZER(struct cmd_set_dcb_fwd_tc_cores_result, ++ set, "set"); ++static cmdline_parse_token_string_t cmd_set_dcb_fwd_tc_cores_dcb = ++ TOKEN_STRING_INITIALIZER(struct cmd_set_dcb_fwd_tc_cores_result, ++ dcb, "dcb"); ++static cmdline_parse_token_string_t cmd_set_dcb_fwd_tc_cores_fwdtccores = ++ TOKEN_STRING_INITIALIZER(struct cmd_set_dcb_fwd_tc_cores_result, ++ fwd_tc_cores, "fwd_tc_cores"); ++static cmdline_parse_token_num_t cmd_set_dcb_fwd_tc_cores_tccores = ++ TOKEN_NUM_INITIALIZER(struct cmd_set_dcb_fwd_tc_cores_result, ++ tc_cores, RTE_UINT8); ++ ++static cmdline_parse_inst_t cmd_set_dcb_fwd_tc_cores = { ++ .f = cmd_set_dcb_fwd_tc_cores_parsed, ++ .data = NULL, ++ .help_str = "config DCB forwarding cores per-TC, 1-means one core process all queues of a TC.", ++ .tokens = { ++ (void *)&cmd_set_dcb_fwd_tc_cores_set, ++ (void *)&cmd_set_dcb_fwd_tc_cores_dcb, ++ (void *)&cmd_set_dcb_fwd_tc_cores_fwdtccores, ++ (void *)&cmd_set_dcb_fwd_tc_cores_tccores, ++ NULL, ++ }, ++}; ++ + /* *** SET BURST TX DELAY TIME RETRY NUMBER *** */ + struct cmd_set_burst_tx_retry_result { + cmdline_fixed_string_t set; +@@ -13213,6 +13260,7 @@ static cmdline_parse_ctx_t builtin_ctx[] = { + (cmdline_parse_inst_t *)&cmd_set_fwd_mode, + (cmdline_parse_inst_t *)&cmd_set_fwd_retry_mode, + (cmdline_parse_inst_t *)&cmd_set_dcb_fwd_tc, ++ (cmdline_parse_inst_t *)&cmd_set_dcb_fwd_tc_cores, + (cmdline_parse_inst_t *)&cmd_set_burst_tx_retry, + (cmdline_parse_inst_t *)&cmd_set_promisc_mode_one, + (cmdline_parse_inst_t *)&cmd_set_promisc_mode_all, +diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c +index a7832d1..83475d5 100644 +--- a/app/test-pmd/config.c ++++ b/app/test-pmd/config.c +@@ -4844,6 +4844,36 @@ rss_fwd_config_setup(void) + } + } + ++static int ++dcb_fwd_check_cores_per_tc(void) ++{ ++ struct rte_eth_dcb_info dcb_info = {0}; ++ uint32_t port, tc, vmdq_idx; ++ ++ if (dcb_fwd_tc_cores == 1) ++ return 0; ++ ++ for (port = 0; port < nb_fwd_ports; port++) { ++ (void)rte_eth_dev_get_dcb_info(fwd_ports_ids[port], &dcb_info); ++ for (tc = 0; tc < dcb_info.nb_tcs; tc++) { ++ for (vmdq_idx = 0; vmdq_idx < RTE_ETH_MAX_VMDQ_POOL; vmdq_idx++) { ++ if (dcb_info.tc_queue.tc_rxq[vmdq_idx][tc].nb_queue == 0) ++ break; ++ /* make sure nb_rx_queue can be divisible. */ ++ if (dcb_info.tc_queue.tc_rxq[vmdq_idx][tc].nb_queue % ++ dcb_fwd_tc_cores) ++ return -1; ++ /* make sure nb_tx_queue can be divisible. */ ++ if (dcb_info.tc_queue.tc_txq[vmdq_idx][tc].nb_queue % ++ dcb_fwd_tc_cores) ++ return -1; ++ } ++ } ++ } ++ ++ return 0; ++} ++ + static uint16_t + get_fwd_port_total_tc_num(void) + { +@@ -4896,14 +4926,17 @@ dcb_fwd_tc_update_dcb_info(struct rte_eth_dcb_info *org_dcb_info) + } + + /** +- * For the DCB forwarding test, each core is assigned on each traffic class. ++ * For the DCB forwarding test, each core is assigned on each traffic class ++ * defaultly: ++ * Each core is assigned a multi-stream, each stream being composed of ++ * a RX queue to poll on a RX port for input messages, associated with ++ * a TX queue of a TX port where to send forwarded packets. All RX and ++ * TX queues are mapping to the same traffic class. ++ * If VMDQ and DCB co-exist, each traffic class on different POOLs share ++ * the same core. + * +- * Each core is assigned a multi-stream, each stream being composed of +- * a RX queue to poll on a RX port for input messages, associated with +- * a TX queue of a TX port where to send forwarded packets. All RX and +- * TX queues are mapping to the same traffic class. +- * If VMDQ and DCB co-exist, each traffic class on different POOLs share +- * the same core ++ * If user set cores-per-TC to other value (e.g. 2), then there will multiple ++ * cores to process one TC. + */ + static void + dcb_fwd_config_setup(void) +@@ -4911,9 +4944,10 @@ dcb_fwd_config_setup(void) + struct rte_eth_dcb_info rxp_dcb_info, txp_dcb_info; + portid_t txp, rxp = 0; + queueid_t txq, rxq = 0; +- lcoreid_t lc_id; ++ lcoreid_t lc_id, target_lcores; + uint16_t nb_rx_queue, nb_tx_queue; + uint16_t i, j, k, sm_id = 0; ++ uint16_t sub_core_idx = 0; + uint16_t total_tc_num; + struct rte_port *port; + uint8_t tc = 0; +@@ -4944,6 +4978,13 @@ dcb_fwd_config_setup(void) + } + } + ++ ret = dcb_fwd_check_cores_per_tc(); ++ if (ret != 0) { ++ fprintf(stderr, "Error: check forwarding cores-per-TC failed!\n"); ++ cur_fwd_config.nb_fwd_lcores = 0; ++ return; ++ } ++ + total_tc_num = get_fwd_port_total_tc_num(); + if (total_tc_num == 0) { + fprintf(stderr, "Error: total forwarding TC num is zero!\n"); +@@ -4951,12 +4992,17 @@ dcb_fwd_config_setup(void) + return; + } + +- cur_fwd_config.nb_fwd_lcores = (lcoreid_t) nb_fwd_lcores; ++ target_lcores = (lcoreid_t)total_tc_num * (lcoreid_t)dcb_fwd_tc_cores; ++ if (nb_fwd_lcores < target_lcores) { ++ fprintf(stderr, "Error: the number of forwarding cores is insufficient!\n"); ++ cur_fwd_config.nb_fwd_lcores = 0; ++ return; ++ } ++ ++ cur_fwd_config.nb_fwd_lcores = target_lcores; + cur_fwd_config.nb_fwd_ports = nb_fwd_ports; + cur_fwd_config.nb_fwd_streams = + (streamid_t) (nb_rxq * cur_fwd_config.nb_fwd_ports); +- if (cur_fwd_config.nb_fwd_lcores > total_tc_num) +- cur_fwd_config.nb_fwd_lcores = total_tc_num; + + /* reinitialize forwarding streams */ + init_fwd_streams(); +@@ -4979,10 +5025,12 @@ dcb_fwd_config_setup(void) + break; + k = fwd_lcores[lc_id]->stream_nb + + fwd_lcores[lc_id]->stream_idx; +- rxq = rxp_dcb_info.tc_queue.tc_rxq[i][tc].base; +- txq = txp_dcb_info.tc_queue.tc_txq[i][tc].base; +- nb_rx_queue = txp_dcb_info.tc_queue.tc_rxq[i][tc].nb_queue; +- nb_tx_queue = txp_dcb_info.tc_queue.tc_txq[i][tc].nb_queue; ++ nb_rx_queue = rxp_dcb_info.tc_queue.tc_rxq[i][tc].nb_queue / ++ dcb_fwd_tc_cores; ++ nb_tx_queue = txp_dcb_info.tc_queue.tc_txq[i][tc].nb_queue / ++ dcb_fwd_tc_cores; ++ rxq = rxp_dcb_info.tc_queue.tc_rxq[i][tc].base + nb_rx_queue * sub_core_idx; ++ txq = txp_dcb_info.tc_queue.tc_txq[i][tc].base + nb_tx_queue * sub_core_idx; + for (j = 0; j < nb_rx_queue; j++) { + struct fwd_stream *fs; + +@@ -4994,11 +5042,14 @@ dcb_fwd_config_setup(void) + fs->peer_addr = fs->tx_port; + fs->retry_enabled = retry_enabled; + } +- fwd_lcores[lc_id]->stream_nb += +- rxp_dcb_info.tc_queue.tc_rxq[i][tc].nb_queue; ++ sub_core_idx++; ++ fwd_lcores[lc_id]->stream_nb += nb_rx_queue; + } + sm_id = (streamid_t) (sm_id + fwd_lcores[lc_id]->stream_nb); ++ if (sub_core_idx < dcb_fwd_tc_cores) ++ continue; + ++ sub_core_idx = 0; + tc++; + if (tc < rxp_dcb_info.nb_tcs) + continue; +diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c +index 4519e79..8a0071e 100644 +--- a/app/test-pmd/testpmd.c ++++ b/app/test-pmd/testpmd.c +@@ -211,6 +211,15 @@ struct fwd_engine * fwd_engines[] = { + * If bit-n in tc-mask is 1, then TC-n's forwarding is enabled, and vice versa. + */ + uint8_t dcb_fwd_tc_mask = DEFAULT_DCB_FWD_TC_MASK; ++/* ++ * Poll cores per TC when DCB forwarding. ++ * E.g. 1 indicates that one core process all queues of a TC. ++ * 2 indicates that two cores process all queues of a TC. If there ++ * is a TC with 8 queues, then [0, 3] belong to first core, and ++ * [4, 7] belong to second core. ++ * ... ++ */ ++uint8_t dcb_fwd_tc_cores = 1; + + struct rte_mempool *mempools[RTE_MAX_NUMA_NODES * MAX_SEGS_BUFFER_SPLIT]; + uint16_t mempool_flags; +diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h +index 5733df5..7bc9959 100644 +--- a/app/test-pmd/testpmd.h ++++ b/app/test-pmd/testpmd.h +@@ -466,6 +466,7 @@ extern cmdline_parse_inst_t cmd_set_flex_spec_pattern; + + #define DEFAULT_DCB_FWD_TC_MASK 0xFF + extern uint8_t dcb_fwd_tc_mask; ++extern uint8_t dcb_fwd_tc_cores; + + extern uint16_t mempool_flags; + +diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst +index 2b81a26..61600a7 100644 +--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst ++++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst +@@ -1846,6 +1846,14 @@ forwarding is enabled, and vice versa:: + + testpmd> set dcb fwd_tc (tc_mask) + ++set dcb fwd_tc_cores ++~~~~~~~~~~~~~~~~~~~~ ++ ++Config DCB forwarding cores per-TC, 1-means one core process all queues of a TC, ++2-means two cores process all queues of a TC, and so on:: ++ ++ testpmd> set dcb fwd_tc_cores (tc_cores) ++ + Port Functions + -------------- + +-- +2.33.0 + diff --git a/dpdk.spec b/dpdk.spec index f1509464b543a4d6d8e863f536aff277062d19f7..23f9c277417363a0bd6f5fcdf4f018db07a76d4c 100644 --- a/dpdk.spec +++ b/dpdk.spec @@ -11,7 +11,7 @@ Name: dpdk Version: 23.11 -Release: 37 +Release: 38 URL: http://dpdk.org Source: https://fast.dpdk.org/rel/dpdk-%{version}.tar.xz @@ -146,6 +146,8 @@ Patch6110: 0110-net-hns3-fix-overwrite-mbuf-in-vector-path.patch Patch6111: 0111-net-hns3-fix-unrelease-VLAN-resource-when-init-fail.patch Patch6112: 0112-net-hns3-fix-VLAN-tag-loss-for-short-tunnel-frame.patch Patch6113: 0113-app-testpmd-fix-L4-protocol-retrieval-from-L3-header.patch +Patch6114: 0114-app-testpmd-support-specify-TCs-when-DCB-forward.patch +Patch6115: 0115-app-testpmd-support-multi-cores-process-one-TC.patch BuildRequires: meson BuildRequires: python3-pyelftools @@ -350,6 +352,11 @@ fi /usr/sbin/depmod %changelog +* Thu Nov 20 2025 huangdonghua - 23.11-38 + Enhanced DCB Functionality in testpmd: TC Configuration and Multi-core Support: + - app/testpmd: support specify TCs when DCB forward + - app/testpmd: support multi-cores process one TC + * Wed Nov 05 2025 huangdonghua - 23.11-37 Fix unrelease VLAN resource and L4 protocol retrieval from L3 header: - net/hns3: fix unrelease VLAN resource when init fail