diff --git a/0398-app-testpmd-remove-useless-check-in-TSO-command.patch b/0398-app-testpmd-remove-useless-check-in-TSO-command.patch new file mode 100644 index 0000000000000000000000000000000000000000..4c6f4fc8e026ff008377c7a300761627e40fdbe5 --- /dev/null +++ b/0398-app-testpmd-remove-useless-check-in-TSO-command.patch @@ -0,0 +1,49 @@ +From f799040a5fe871e9e11101e66ccbdecea8d84b56 Mon Sep 17 00:00:00 2001 +From: Huisong Li +Date: Tue, 7 Nov 2023 12:11:16 +0800 +Subject: [PATCH 398/410] app/testpmd: remove useless check in TSO command + +[ upstream commit 773397f6f4b5e325e786835343bacbc454d1e5f0 ] + +Testpmd has added the check of TSO offload capability of port, please see +the commit 3926dd2b6668 ("app/testpmd: enforce offload capabilities check") + +So the code following the check code memtioned above to display warning +when port doesn't support TSO offload doesn't access to forever. + +Fixes: 3926dd2b6668 ("app/testpmd: enforce offload capabilities check") +Cc: stable@dpdk.org + +Signed-off-by: Huisong Li +Acked-by: Ferruh Yigit +--- + app/test-pmd/cmdline.c | 13 ------------- + 1 file changed, 13 deletions(-) + +diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c +index cdf943162b..88fd296bbc 100644 +--- a/app/test-pmd/cmdline.c ++++ b/app/test-pmd/cmdline.c +@@ -4961,19 +4961,6 @@ cmd_tso_set_parsed(void *parsed_result, + ports[res->port_id].tso_segsz); + } + cmd_config_queue_tx_offloads(&ports[res->port_id]); +- +- /* display warnings if configuration is not supported by the NIC */ +- ret = eth_dev_info_get_print_err(res->port_id, &dev_info); +- if (ret != 0) +- return; +- +- if ((ports[res->port_id].tso_segsz != 0) && +- (dev_info.tx_offload_capa & RTE_ETH_TX_OFFLOAD_TCP_TSO) == 0) { +- fprintf(stderr, +- "Warning: TSO enabled but not supported by port %d\n", +- res->port_id); +- } +- + cmd_reconfig_device_queue(res->port_id, 1, 1); + } + +-- +2.33.0 + diff --git a/0399-app-testpmd-fix-tunnel-TSO-capability-check.patch b/0399-app-testpmd-fix-tunnel-TSO-capability-check.patch new file mode 100644 index 0000000000000000000000000000000000000000..9bc2a46f9c92863cb2de9aa613e55db80a2b938a --- /dev/null +++ b/0399-app-testpmd-fix-tunnel-TSO-capability-check.patch @@ -0,0 +1,95 @@ +From 0ff1a5865fb7e5f11f174cb0cf10eff3a0a90f25 Mon Sep 17 00:00:00 2001 +From: Huisong Li +Date: Sat, 11 Nov 2023 12:59:41 +0800 +Subject: [PATCH 399/410] app/testpmd: fix tunnel TSO capability check + +[ upstream commit 6d4def820aa7d118f1ebdebf7af8ba6299ac20ee ] + +Currently, testpmd set tunnel TSO offload even if fail to get dev_info. +In this case, the 'tx_offload_capa' in dev_info is a random value, + +Fixes: 6f51deb903b2 ("app/testpmd: check status of getting ethdev info") +Cc: stable@dpdk.org + +Signed-off-by: Huisong Li +Reviewed-by: Ferruh Yigit +--- + app/test-pmd/cmdline.c | 29 ++++++++++++++--------------- + 1 file changed, 14 insertions(+), 15 deletions(-) + +diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c +index 88fd296bbc..9164f02932 100644 +--- a/app/test-pmd/cmdline.c ++++ b/app/test-pmd/cmdline.c +@@ -5018,39 +5018,33 @@ struct cmd_tunnel_tso_set_result { + portid_t port_id; + }; + +-static struct rte_eth_dev_info +-check_tunnel_tso_nic_support(portid_t port_id) ++static void ++check_tunnel_tso_nic_support(portid_t port_id, uint64_t tx_offload_capa) + { +- struct rte_eth_dev_info dev_info; +- +- if (eth_dev_info_get_print_err(port_id, &dev_info) != 0) +- return dev_info; +- +- if (!(dev_info.tx_offload_capa & RTE_ETH_TX_OFFLOAD_VXLAN_TNL_TSO)) ++ if (!(tx_offload_capa & RTE_ETH_TX_OFFLOAD_VXLAN_TNL_TSO)) + fprintf(stderr, + "Warning: VXLAN TUNNEL TSO not supported therefore not enabled for port %d\n", + port_id); +- if (!(dev_info.tx_offload_capa & RTE_ETH_TX_OFFLOAD_GRE_TNL_TSO)) ++ if (!(tx_offload_capa & RTE_ETH_TX_OFFLOAD_GRE_TNL_TSO)) + fprintf(stderr, + "Warning: GRE TUNNEL TSO not supported therefore not enabled for port %d\n", + port_id); +- if (!(dev_info.tx_offload_capa & RTE_ETH_TX_OFFLOAD_IPIP_TNL_TSO)) ++ if (!(tx_offload_capa & RTE_ETH_TX_OFFLOAD_IPIP_TNL_TSO)) + fprintf(stderr, + "Warning: IPIP TUNNEL TSO not supported therefore not enabled for port %d\n", + port_id); +- if (!(dev_info.tx_offload_capa & RTE_ETH_TX_OFFLOAD_GENEVE_TNL_TSO)) ++ if (!(tx_offload_capa & RTE_ETH_TX_OFFLOAD_GENEVE_TNL_TSO)) + fprintf(stderr, + "Warning: GENEVE TUNNEL TSO not supported therefore not enabled for port %d\n", + port_id); +- if (!(dev_info.tx_offload_capa & RTE_ETH_TX_OFFLOAD_IP_TNL_TSO)) ++ if (!(tx_offload_capa & RTE_ETH_TX_OFFLOAD_IP_TNL_TSO)) + fprintf(stderr, + "Warning: IP TUNNEL TSO not supported therefore not enabled for port %d\n", + port_id); +- if (!(dev_info.tx_offload_capa & RTE_ETH_TX_OFFLOAD_UDP_TNL_TSO)) ++ if (!(tx_offload_capa & RTE_ETH_TX_OFFLOAD_UDP_TNL_TSO)) + fprintf(stderr, + "Warning: UDP TUNNEL TSO not supported therefore not enabled for port %d\n", + port_id); +- return dev_info; + } + + static void +@@ -5060,6 +5054,7 @@ cmd_tunnel_tso_set_parsed(void *parsed_result, + { + struct cmd_tunnel_tso_set_result *res = parsed_result; + struct rte_eth_dev_info dev_info; ++ int ret; + + if (port_id_is_invalid(res->port_id, ENABLED_WARN)) + return; +@@ -5071,7 +5066,11 @@ cmd_tunnel_tso_set_parsed(void *parsed_result, + if (!strcmp(res->mode, "set")) + ports[res->port_id].tunnel_tso_segsz = res->tso_segsz; + +- dev_info = check_tunnel_tso_nic_support(res->port_id); ++ ret = eth_dev_info_get_print_err(res->port_id, &dev_info); ++ if (ret != 0) ++ return; ++ ++ check_tunnel_tso_nic_support(res->port_id, dev_info.tx_offload_capa); + if (ports[res->port_id].tunnel_tso_segsz == 0) { + ports[res->port_id].dev_conf.txmode.offloads &= + ~(RTE_ETH_TX_OFFLOAD_VXLAN_TNL_TSO | +-- +2.33.0 + diff --git a/0400-app-testpmd-add-explicit-check-for-tunnel-TSO.patch b/0400-app-testpmd-add-explicit-check-for-tunnel-TSO.patch new file mode 100644 index 0000000000000000000000000000000000000000..95b2d68d12cb5bd1f251472e4152ce9b5ba60a3d --- /dev/null +++ b/0400-app-testpmd-add-explicit-check-for-tunnel-TSO.patch @@ -0,0 +1,120 @@ +From 1e6660cb97216a23e8f8f463ae66e83f2c6414ff Mon Sep 17 00:00:00 2001 +From: Huisong Li +Date: Sat, 11 Nov 2023 12:59:42 +0800 +Subject: [PATCH 400/410] app/testpmd: add explicit check for tunnel TSO + +[ upstream commit 33156a6bc61560e74a126ade38a7af9c1fa02671 ] + +If port don't support TSO of tunnel packets, tell user in advance and no +need to change other configuration of this port in case of fault spread. + +In addition, if some tunnel offloads don't support, which is not an +error case, the log about this shouldn't be to stderr. + +Fixes: 3926dd2b6668 ("app/testpmd: enforce offload capabilities check") +Cc: stable@dpdk.org + +Signed-off-by: Huisong Li +Reviewed-by: Ferruh Yigit +--- + app/test-pmd/cmdline.c | 55 ++++++++++++++++++------------------------ + 1 file changed, 24 insertions(+), 31 deletions(-) + +diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c +index 9164f02932..444c7a79ff 100644 +--- a/app/test-pmd/cmdline.c ++++ b/app/test-pmd/cmdline.c +@@ -5022,28 +5022,22 @@ static void + check_tunnel_tso_nic_support(portid_t port_id, uint64_t tx_offload_capa) + { + if (!(tx_offload_capa & RTE_ETH_TX_OFFLOAD_VXLAN_TNL_TSO)) +- fprintf(stderr, +- "Warning: VXLAN TUNNEL TSO not supported therefore not enabled for port %d\n", ++ printf("Warning: VXLAN TUNNEL TSO not supported therefore not enabled for port %d\n", + port_id); + if (!(tx_offload_capa & RTE_ETH_TX_OFFLOAD_GRE_TNL_TSO)) +- fprintf(stderr, +- "Warning: GRE TUNNEL TSO not supported therefore not enabled for port %d\n", ++ printf("Warning: GRE TUNNEL TSO not supported therefore not enabled for port %d\n", + port_id); + if (!(tx_offload_capa & RTE_ETH_TX_OFFLOAD_IPIP_TNL_TSO)) +- fprintf(stderr, +- "Warning: IPIP TUNNEL TSO not supported therefore not enabled for port %d\n", ++ printf("Warning: IPIP TUNNEL TSO not supported therefore not enabled for port %d\n", + port_id); + if (!(tx_offload_capa & RTE_ETH_TX_OFFLOAD_GENEVE_TNL_TSO)) +- fprintf(stderr, +- "Warning: GENEVE TUNNEL TSO not supported therefore not enabled for port %d\n", ++ printf("Warning: GENEVE TUNNEL TSO not supported therefore not enabled for port %d\n", + port_id); + if (!(tx_offload_capa & RTE_ETH_TX_OFFLOAD_IP_TNL_TSO)) +- fprintf(stderr, +- "Warning: IP TUNNEL TSO not supported therefore not enabled for port %d\n", ++ printf("Warning: IP TUNNEL TSO not supported therefore not enabled for port %d\n", + port_id); + if (!(tx_offload_capa & RTE_ETH_TX_OFFLOAD_UDP_TNL_TSO)) +- fprintf(stderr, +- "Warning: UDP TUNNEL TSO not supported therefore not enabled for port %d\n", ++ printf("Warning: UDP TUNNEL TSO not supported therefore not enabled for port %d\n", + port_id); + } + +@@ -5054,6 +5048,12 @@ cmd_tunnel_tso_set_parsed(void *parsed_result, + { + struct cmd_tunnel_tso_set_result *res = parsed_result; + struct rte_eth_dev_info dev_info; ++ uint64_t all_tunnel_tso = RTE_ETH_TX_OFFLOAD_VXLAN_TNL_TSO | ++ RTE_ETH_TX_OFFLOAD_GRE_TNL_TSO | ++ RTE_ETH_TX_OFFLOAD_IPIP_TNL_TSO | ++ RTE_ETH_TX_OFFLOAD_GENEVE_TNL_TSO | ++ RTE_ETH_TX_OFFLOAD_IP_TNL_TSO | ++ RTE_ETH_TX_OFFLOAD_UDP_TNL_TSO; + int ret; + + if (port_id_is_invalid(res->port_id, ENABLED_WARN)) +@@ -5066,30 +5066,23 @@ cmd_tunnel_tso_set_parsed(void *parsed_result, + if (!strcmp(res->mode, "set")) + ports[res->port_id].tunnel_tso_segsz = res->tso_segsz; + +- ret = eth_dev_info_get_print_err(res->port_id, &dev_info); +- if (ret != 0) +- return; +- +- check_tunnel_tso_nic_support(res->port_id, dev_info.tx_offload_capa); + if (ports[res->port_id].tunnel_tso_segsz == 0) { +- ports[res->port_id].dev_conf.txmode.offloads &= +- ~(RTE_ETH_TX_OFFLOAD_VXLAN_TNL_TSO | +- RTE_ETH_TX_OFFLOAD_GRE_TNL_TSO | +- RTE_ETH_TX_OFFLOAD_IPIP_TNL_TSO | +- RTE_ETH_TX_OFFLOAD_GENEVE_TNL_TSO | +- RTE_ETH_TX_OFFLOAD_IP_TNL_TSO | +- RTE_ETH_TX_OFFLOAD_UDP_TNL_TSO); ++ ports[res->port_id].dev_conf.txmode.offloads &= ~all_tunnel_tso; + printf("TSO for tunneled packets is disabled\n"); + } else { +- uint64_t tso_offloads = (RTE_ETH_TX_OFFLOAD_VXLAN_TNL_TSO | +- RTE_ETH_TX_OFFLOAD_GRE_TNL_TSO | +- RTE_ETH_TX_OFFLOAD_IPIP_TNL_TSO | +- RTE_ETH_TX_OFFLOAD_GENEVE_TNL_TSO | +- RTE_ETH_TX_OFFLOAD_IP_TNL_TSO | +- RTE_ETH_TX_OFFLOAD_UDP_TNL_TSO); ++ ret = eth_dev_info_get_print_err(res->port_id, &dev_info); ++ if (ret != 0) ++ return; ++ ++ if ((all_tunnel_tso & dev_info.tx_offload_capa) == 0) { ++ fprintf(stderr, "Error: port=%u don't support tunnel TSO offloads.\n", ++ res->port_id); ++ return; ++ } ++ check_tunnel_tso_nic_support(res->port_id, dev_info.tx_offload_capa); + + ports[res->port_id].dev_conf.txmode.offloads |= +- (tso_offloads & dev_info.tx_offload_capa); ++ (all_tunnel_tso & dev_info.tx_offload_capa); + printf("TSO segment size for tunneled packets is %d\n", + ports[res->port_id].tunnel_tso_segsz); + +-- +2.33.0 + diff --git a/0401-app-testpmd-fix-tunnel-TSO-configuration.patch b/0401-app-testpmd-fix-tunnel-TSO-configuration.patch new file mode 100644 index 0000000000000000000000000000000000000000..3f7ff7690319d35bc9401b193a1ad54b464339c3 --- /dev/null +++ b/0401-app-testpmd-fix-tunnel-TSO-configuration.patch @@ -0,0 +1,71 @@ +From 27c78af1f290c342b6fb64c2f57a430628f5062f Mon Sep 17 00:00:00 2001 +From: Huisong Li +Date: Sat, 11 Nov 2023 12:59:43 +0800 +Subject: [PATCH 401/410] app/testpmd: fix tunnel TSO configuration + +[ upstream commit e43dc93803c4623840472c6109ef05e26286ec2f ] + +Currently, there are two conditions to set tunnel TSO, like "parse +tunnel" and "outer IP checksum". +If these conditions are not satisfied, testpmd should not change their +configuration, like tx_offloads on port and per queue, and no need to +request "reconfig device". + +Fixes: 597f9fafe13b ("app/testpmd: convert to new Tx offloads API") +Cc: stable@dpdk.org + +Signed-off-by: Huisong Li +Reviewed-by: Ferruh Yigit +--- + app/test-pmd/cmdline.c | 25 ++++++++++++++----------- + 1 file changed, 14 insertions(+), 11 deletions(-) + +diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c +index 444c7a79ff..fd897dc80c 100644 +--- a/app/test-pmd/cmdline.c ++++ b/app/test-pmd/cmdline.c +@@ -5079,12 +5079,6 @@ cmd_tunnel_tso_set_parsed(void *parsed_result, + res->port_id); + return; + } +- check_tunnel_tso_nic_support(res->port_id, dev_info.tx_offload_capa); +- +- ports[res->port_id].dev_conf.txmode.offloads |= +- (all_tunnel_tso & dev_info.tx_offload_capa); +- printf("TSO segment size for tunneled packets is %d\n", +- ports[res->port_id].tunnel_tso_segsz); + + /* Below conditions are needed to make it work: + * (1) tunnel TSO is supported by the NIC; +@@ -5097,14 +5091,23 @@ cmd_tunnel_tso_set_parsed(void *parsed_result, + * is not necessary for IPv6 tunneled pkts because there's no + * checksum in IP header anymore. + */ +- +- if (!ports[res->port_id].parse_tunnel) ++ if (!ports[res->port_id].parse_tunnel) { + fprintf(stderr, +- "Warning: csum parse_tunnel must be set so that tunneled packets are recognized\n"); ++ "Error: csum parse_tunnel must be set so that tunneled packets are recognized\n"); ++ return; ++ } + if (!(ports[res->port_id].dev_conf.txmode.offloads & +- RTE_ETH_TX_OFFLOAD_OUTER_IPV4_CKSUM)) ++ RTE_ETH_TX_OFFLOAD_OUTER_IPV4_CKSUM)) { + fprintf(stderr, +- "Warning: csum set outer-ip must be set to hw if outer L3 is IPv4; not necessary for IPv6\n"); ++ "Error: csum set outer-ip must be set to hw if outer L3 is IPv4; not necessary for IPv6\n"); ++ return; ++ } ++ ++ check_tunnel_tso_nic_support(res->port_id, dev_info.tx_offload_capa); ++ ports[res->port_id].dev_conf.txmode.offloads |= ++ (all_tunnel_tso & dev_info.tx_offload_capa); ++ printf("TSO segment size for tunneled packets is %d\n", ++ ports[res->port_id].tunnel_tso_segsz); + } + + cmd_config_queue_tx_offloads(&ports[res->port_id]); +-- +2.33.0 + diff --git a/0402-app-testpmd-allow-offload-config-for-all-ports.patch b/0402-app-testpmd-allow-offload-config-for-all-ports.patch new file mode 100644 index 0000000000000000000000000000000000000000..398caca204edc3298dcdcea19b59fc24ec386bd4 --- /dev/null +++ b/0402-app-testpmd-allow-offload-config-for-all-ports.patch @@ -0,0 +1,359 @@ +From 7830c0aee5eff3f97a39b2a49ead39ffa315182f Mon Sep 17 00:00:00 2001 +From: Dengdui Huang +Date: Fri, 10 Nov 2023 17:10:13 +0800 +Subject: [PATCH 402/410] app/testpmd: allow offload config for all ports + +[ upstream commit 6280fe565b44aad684cab320939acdd52ec1a9ec ] + +Support config Rx/Tx offload for all ports in following commands: +1. port config all rx_offload (offloading) (on|off) +2. port config all tx_offload (offloading) (on|off) + +Signed-off-by: Dengdui Huang +Acked-by: Chengwen Feng +Reviewed-by: Ferruh Yigit +Acked-by: Huisong Li +--- + app/test-pmd/cmdline.c | 205 ++++++++++++++++++-- + doc/guides/testpmd_app_ug/testpmd_funcs.rst | 8 +- + 2 files changed, 189 insertions(+), 24 deletions(-) + +diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c +index fd897dc80c..f380d35eec 100644 +--- a/app/test-pmd/cmdline.c ++++ b/app/test-pmd/cmdline.c +@@ -867,7 +867,7 @@ static void cmd_help_long_parsed(void *parsed_result, + "port config (port_id) udp_tunnel_port add|rm vxlan|geneve|ecpri (udp_port)\n\n" + " Add/remove UDP tunnel port for tunneling offload\n\n" + +- "port config rx_offload all|vlan_strip|" ++ "port config (port_id|all) rx_offload all|vlan_strip|" + "ipv4_cksum|udp_cksum|tcp_cksum|tcp_lro|qinq_strip|" + "outer_ipv4_cksum|macsec_strip|header_split|" + "vlan_filter|vlan_extend|scatter|" +@@ -883,7 +883,7 @@ static void cmd_help_long_parsed(void *parsed_result, + " Enable or disable a per queue Rx offloading" + " only on a specific Rx queue\n\n" + +- "port config (port_id) tx_offload all|vlan_insert|" ++ "port config (port_id|all) tx_offload all|vlan_insert|" + "ipv4_cksum|udp_cksum|tcp_cksum|sctp_cksum|tcp_tso|" + "udp_tso|outer_ipv4_cksum|qinq_insert|vxlan_tnl_tso|" + "gre_tnl_tso|ipip_tnl_tso|geneve_tnl_tso|" +@@ -16210,12 +16210,8 @@ search_rx_offload(const char *name) + } + + static void +-cmd_config_per_port_rx_offload_parsed(void *parsed_result, +- __rte_unused struct cmdline *cl, +- __rte_unused void *data) ++config_port_rx_offload(portid_t port_id, char *name, bool on) + { +- struct cmd_config_per_port_rx_offload_result *res = parsed_result; +- portid_t port_id = res->port_id; + struct rte_eth_dev_info dev_info; + struct rte_port *port = &ports[port_id]; + uint16_t nb_rx_queues; +@@ -16234,18 +16230,18 @@ cmd_config_per_port_rx_offload_parsed(void *parsed_result, + if (ret != 0) + return; + +- if (!strcmp(res->offload, "all")) { ++ if (!strcmp(name, "all")) { + offload = dev_info.rx_offload_capa; + } else { +- offload = search_rx_offload(res->offload); ++ offload = search_rx_offload(name); + if (offload == 0) { +- fprintf(stderr, "Unknown offload name: %s\n", res->offload); ++ fprintf(stderr, "Unknown offload name: %s\n", name); + return; + } + } + + nb_rx_queues = dev_info.nb_rx_queues; +- if (!strcmp(res->on_off, "on")) { ++ if (on) { + port->dev_conf.rxmode.offloads |= offload; + for (q = 0; q < nb_rx_queues; q++) + port->rx_conf[q].offloads |= offload; +@@ -16258,6 +16254,18 @@ cmd_config_per_port_rx_offload_parsed(void *parsed_result, + cmd_reconfig_device_queue(port_id, 1, 1); + } + ++static void ++cmd_config_per_port_rx_offload_parsed(void *parsed_result, ++ __rte_unused struct cmdline *cl, ++ __rte_unused void *data) ++{ ++ struct cmd_config_per_port_rx_offload_result *res = parsed_result; ++ bool on; ++ ++ on = strcmp(res->on_off, "on") == 0; ++ config_port_rx_offload(res->port_id, res->offload, on); ++} ++ + cmdline_parse_inst_t cmd_config_per_port_rx_offload = { + .f = cmd_config_per_port_rx_offload_parsed, + .data = NULL, +@@ -16277,6 +16285,79 @@ cmdline_parse_inst_t cmd_config_per_port_rx_offload = { + } + }; + ++/* Enable/Disable all port Rx offloading */ ++struct cmd_config_all_port_rx_offload_result { ++ cmdline_fixed_string_t port; ++ cmdline_fixed_string_t config; ++ cmdline_fixed_string_t port_all; ++ cmdline_fixed_string_t rx_offload; ++ cmdline_fixed_string_t offload; ++ cmdline_fixed_string_t on_off; ++}; ++ ++static cmdline_parse_token_string_t cmd_config_all_port_rx_offload_result_port = ++ TOKEN_STRING_INITIALIZER ++ (struct cmd_config_all_port_rx_offload_result, ++ port, "port"); ++static cmdline_parse_token_string_t cmd_config_all_port_rx_offload_result_config = ++ TOKEN_STRING_INITIALIZER ++ (struct cmd_config_all_port_rx_offload_result, ++ config, "config"); ++ ++static cmdline_parse_token_string_t cmd_config_all_port_rx_offload_result_port_all = ++ TOKEN_STRING_INITIALIZER(struct cmd_config_all_port_rx_offload_result, ++ port_all, "all"); ++static cmdline_parse_token_string_t cmd_config_all_port_rx_offload_result_rx_offload = ++ TOKEN_STRING_INITIALIZER ++ (struct cmd_config_all_port_rx_offload_result, ++ rx_offload, "rx_offload"); ++static cmdline_parse_token_string_t cmd_config_all_port_rx_offload_result_offload = ++ TOKEN_STRING_INITIALIZER ++ (struct cmd_config_all_port_rx_offload_result, ++ offload, "all#vlan_strip#ipv4_cksum#udp_cksum#tcp_cksum#tcp_lro#" ++ "qinq_strip#outer_ipv4_cksum#macsec_strip#" ++ "vlan_filter#vlan_extend#" ++ "scatter#buffer_split#timestamp#security#" ++ "keep_crc#rss_hash"); ++static cmdline_parse_token_string_t cmd_config_all_port_rx_offload_result_on_off = ++ TOKEN_STRING_INITIALIZER ++ (struct cmd_config_all_port_rx_offload_result, ++ on_off, "on#off"); ++ ++static void ++cmd_config_all_port_rx_offload_parsed(void *parsed_result, ++ __rte_unused struct cmdline *cl, ++ __rte_unused void *data) ++{ ++ struct cmd_config_all_port_rx_offload_result *res = parsed_result; ++ bool on_off; ++ portid_t i; ++ ++ on_off = strcmp(res->on_off, "on") == 0; ++ RTE_ETH_FOREACH_DEV(i) ++ config_port_rx_offload(i, res->offload, on_off); ++ ++} ++ ++static cmdline_parse_inst_t cmd_config_all_port_rx_offload = { ++ .f = cmd_config_all_port_rx_offload_parsed, ++ .data = NULL, ++ .help_str = "port config all rx_offload all|vlan_strip|ipv4_cksum|" ++ "udp_cksum|tcp_cksum|tcp_lro|qinq_strip|outer_ipv4_cksum|" ++ "macsec_strip|vlan_filter|vlan_extend|" ++ "scatter|buffer_split|timestamp|security|" ++ "keep_crc|rss_hash on|off", ++ .tokens = { ++ (void *)&cmd_config_all_port_rx_offload_result_port, ++ (void *)&cmd_config_all_port_rx_offload_result_config, ++ (void *)&cmd_config_all_port_rx_offload_result_port_all, ++ (void *)&cmd_config_all_port_rx_offload_result_rx_offload, ++ (void *)&cmd_config_all_port_rx_offload_result_offload, ++ (void *)&cmd_config_all_port_rx_offload_result_on_off, ++ NULL, ++ } ++}; ++ + /* Enable/Disable a per queue offloading */ + struct cmd_config_per_queue_rx_offload_result { + cmdline_fixed_string_t port; +@@ -16641,12 +16722,8 @@ search_tx_offload(const char *name) + } + + static void +-cmd_config_per_port_tx_offload_parsed(void *parsed_result, +- __rte_unused struct cmdline *cl, +- __rte_unused void *data) ++config_port_tx_offload(portid_t port_id, char *name, bool on) + { +- struct cmd_config_per_port_tx_offload_result *res = parsed_result; +- portid_t port_id = res->port_id; + struct rte_eth_dev_info dev_info; + struct rte_port *port = &ports[port_id]; + uint16_t nb_tx_queues; +@@ -16665,18 +16742,18 @@ cmd_config_per_port_tx_offload_parsed(void *parsed_result, + if (ret != 0) + return; + +- if (!strcmp(res->offload, "all")) { ++ if (!strcmp(name, "all")) { + offload = dev_info.tx_offload_capa; + } else { +- offload = search_tx_offload(res->offload); ++ offload = search_tx_offload(name); + if (offload == 0) { +- fprintf(stderr, "Unknown offload name: %s\n", res->offload); ++ fprintf(stderr, "Unknown offload name: %s\n", name); + return; + } + } + + nb_tx_queues = dev_info.nb_tx_queues; +- if (!strcmp(res->on_off, "on")) { ++ if (on) { + port->dev_conf.txmode.offloads |= offload; + for (q = 0; q < nb_tx_queues; q++) + port->tx_conf[q].offloads |= offload; +@@ -16689,6 +16766,18 @@ cmd_config_per_port_tx_offload_parsed(void *parsed_result, + cmd_reconfig_device_queue(port_id, 1, 1); + } + ++static void ++cmd_config_per_port_tx_offload_parsed(void *parsed_result, ++ __rte_unused struct cmdline *cl, ++ __rte_unused void *data) ++{ ++ struct cmd_config_per_port_tx_offload_result *res = parsed_result; ++ bool on; ++ ++ on = strcmp(res->on_off, "on"); ++ config_port_tx_offload(res->port_id, res->offload, on); ++} ++ + cmdline_parse_inst_t cmd_config_per_port_tx_offload = { + .f = cmd_config_per_port_tx_offload_parsed, + .data = NULL, +@@ -16710,6 +16799,80 @@ cmdline_parse_inst_t cmd_config_per_port_tx_offload = { + } + }; + ++/* Enable/Disable all port Tx offloading */ ++struct cmd_config_all_port_tx_offload_result { ++ cmdline_fixed_string_t port; ++ cmdline_fixed_string_t config; ++ cmdline_fixed_string_t port_all; ++ cmdline_fixed_string_t tx_offload; ++ cmdline_fixed_string_t offload; ++ cmdline_fixed_string_t on_off; ++}; ++ ++static cmdline_parse_token_string_t cmd_config_all_port_tx_offload_result_port = ++ TOKEN_STRING_INITIALIZER ++ (struct cmd_config_all_port_tx_offload_result, ++ port, "port"); ++static cmdline_parse_token_string_t cmd_config_all_port_tx_offload_result_config = ++ TOKEN_STRING_INITIALIZER ++ (struct cmd_config_all_port_tx_offload_result, ++ config, "config"); ++static cmdline_parse_token_string_t cmd_config_all_port_tx_offload_result_port_all = ++ TOKEN_STRING_INITIALIZER(struct cmd_config_all_port_tx_offload_result, ++ port_all, "all"); ++static cmdline_parse_token_string_t cmd_config_all_port_tx_offload_result_tx_offload = ++ TOKEN_STRING_INITIALIZER ++ (struct cmd_config_all_port_tx_offload_result, ++ tx_offload, "tx_offload"); ++static cmdline_parse_token_string_t cmd_config_all_port_tx_offload_result_offload = ++ TOKEN_STRING_INITIALIZER ++ (struct cmd_config_all_port_tx_offload_result, ++ offload, "all#vlan_insert#ipv4_cksum#udp_cksum#tcp_cksum#" ++ "sctp_cksum#tcp_tso#udp_tso#outer_ipv4_cksum#" ++ "qinq_insert#vxlan_tnl_tso#gre_tnl_tso#" ++ "ipip_tnl_tso#geneve_tnl_tso#macsec_insert#" ++ "mt_lockfree#multi_segs#mbuf_fast_free#security#" ++ "send_on_timestamp"); ++static cmdline_parse_token_string_t cmd_config_all_port_tx_offload_result_on_off = ++ TOKEN_STRING_INITIALIZER ++ (struct cmd_config_all_port_tx_offload_result, ++ on_off, "on#off"); ++ ++static void ++cmd_config_all_port_tx_offload_parsed(void *parsed_result, ++ __rte_unused struct cmdline *cl, ++ __rte_unused void *data) ++{ ++ struct cmd_config_all_port_tx_offload_result *res = parsed_result; ++ portid_t i; ++ bool on_off; ++ ++ on_off = strcmp(res->on_off, "on") == 0; ++ RTE_ETH_FOREACH_DEV(i) ++ config_port_tx_offload(i, res->offload, on_off); ++} ++ ++static cmdline_parse_inst_t cmd_config_all_port_tx_offload = { ++ .f = cmd_config_all_port_tx_offload_parsed, ++ .data = NULL, ++ .help_str = "port config all tx_offload " ++ "all|vlan_insert|ipv4_cksum|udp_cksum|tcp_cksum|" ++ "sctp_cksum|tcp_tso|udp_tso|outer_ipv4_cksum|" ++ "qinq_insert|vxlan_tnl_tso|gre_tnl_tso|" ++ "ipip_tnl_tso|geneve_tnl_tso|macsec_insert|" ++ "mt_lockfree|multi_segs|mbuf_fast_free|security|" ++ "send_on_timestamp on|off", ++ .tokens = { ++ (void *)&cmd_config_all_port_tx_offload_result_port, ++ (void *)&cmd_config_all_port_tx_offload_result_config, ++ (void *)&cmd_config_all_port_tx_offload_result_port_all, ++ (void *)&cmd_config_all_port_tx_offload_result_tx_offload, ++ (void *)&cmd_config_all_port_tx_offload_result_offload, ++ (void *)&cmd_config_all_port_tx_offload_result_on_off, ++ NULL, ++ } ++}; ++ + /* Enable/Disable a per queue offloading */ + struct cmd_config_per_queue_tx_offload_result { + cmdline_fixed_string_t port; +@@ -18021,10 +18184,12 @@ cmdline_parse_ctx_t main_ctx[] = { + (cmdline_parse_inst_t *)&cmd_rx_offload_get_capa, + (cmdline_parse_inst_t *)&cmd_rx_offload_get_configuration, + (cmdline_parse_inst_t *)&cmd_config_per_port_rx_offload, ++ (cmdline_parse_inst_t *)&cmd_config_all_port_rx_offload, + (cmdline_parse_inst_t *)&cmd_config_per_queue_rx_offload, + (cmdline_parse_inst_t *)&cmd_tx_offload_get_capa, + (cmdline_parse_inst_t *)&cmd_tx_offload_get_configuration, + (cmdline_parse_inst_t *)&cmd_config_per_port_tx_offload, ++ (cmdline_parse_inst_t *)&cmd_config_all_port_tx_offload, + (cmdline_parse_inst_t *)&cmd_config_per_queue_tx_offload, + #ifdef RTE_LIB_BPF + (cmdline_parse_inst_t *)&cmd_operate_bpf_ld_parse, +diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst +index a81296d2ba..226569c545 100644 +--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst ++++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst +@@ -1767,9 +1767,9 @@ Reset ptype mapping table:: + config per port Rx offloading + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +-Enable or disable a per port Rx offloading on all Rx queues of a port:: ++Enable or disable port Rx offloading on all Rx queues of a port:: + +- testpmd> port config (port_id) rx_offload (offloading) on|off ++ testpmd> port config (port_id|all) rx_offload (offloading) on|off + + * ``offloading``: can be any of these offloading capability: + all, vlan_strip, ipv4_cksum, udp_cksum, tcp_cksum, tcp_lro, +@@ -1797,9 +1797,9 @@ This command should be run when the port is stopped, or else it will fail. + config per port Tx offloading + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +-Enable or disable a per port Tx offloading on all Tx queues of a port:: ++Enable or disable port Tx offloading on all Tx queues of a port:: + +- testpmd> port config (port_id) tx_offload (offloading) on|off ++ testpmd> port config (port_id|all) tx_offload (offloading) on|off + + * ``offloading``: can be any of these offloading capability: + all, vlan_insert, ipv4_cksum, udp_cksum, tcp_cksum, +-- +2.33.0 + diff --git a/0403-app-testpmd-fix-Tx-offload-command.patch b/0403-app-testpmd-fix-Tx-offload-command.patch new file mode 100644 index 0000000000000000000000000000000000000000..75b4038182824a0d204150051797a1f22aad205e --- /dev/null +++ b/0403-app-testpmd-fix-Tx-offload-command.patch @@ -0,0 +1,37 @@ +From ca98a6df1479ed5b04f1df45cd76b87f61f4be28 Mon Sep 17 00:00:00 2001 +From: Ferruh Yigit +Date: Thu, 16 Nov 2023 17:21:55 +0000 +Subject: [PATCH 403/410] app/testpmd: fix Tx offload command + +In command to set Tx offload: +"port config tx_offload on|off", + +there is a defect in "on|off" comparison, so command does opposite of +what is intended. Fixed comparison. + +Bugzilla ID: 1326 +Fixes: 6280fe565b44 ("app/testpmd: allow offload config for all ports") + +Signed-off-by: Ferruh Yigit +Reviewed-by: Chengwen Feng +Acked-by: Huisong Li +--- + app/test-pmd/cmdline.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c +index f380d35eec..b412452948 100644 +--- a/app/test-pmd/cmdline.c ++++ b/app/test-pmd/cmdline.c +@@ -16774,7 +16774,7 @@ cmd_config_per_port_tx_offload_parsed(void *parsed_result, + struct cmd_config_per_port_tx_offload_result *res = parsed_result; + bool on; + +- on = strcmp(res->on_off, "on"); ++ on = strcmp(res->on_off, "on") == 0; + config_port_tx_offload(res->port_id, res->offload, on); + } + +-- +2.33.0 + diff --git a/0404-app-testpmd-check-port-and-queue-Rx-Tx-offloads.patch b/0404-app-testpmd-check-port-and-queue-Rx-Tx-offloads.patch new file mode 100644 index 0000000000000000000000000000000000000000..6b7d214b7c3f9140a3f30e7967dded8a75c86049 --- /dev/null +++ b/0404-app-testpmd-check-port-and-queue-Rx-Tx-offloads.patch @@ -0,0 +1,72 @@ +From 40bc40d4e92ca9aefaf4e7ea2e859e582ca4559e Mon Sep 17 00:00:00 2001 +From: Huisong Li +Date: Wed, 15 Nov 2023 18:33:23 +0800 +Subject: [PATCH 404/410] app/testpmd: check port and queue Rx/Tx offloads + +[ upstream commit f4b0f86a9a0cffc5c5611f4e685bab71c8b47b12 ] + +This patch adds the check for port and per queue Rx/Tx offload to avoid +the failure of "port start all" when config a offload driver didn't +support. + +Signed-off-by: Huisong Li +Reviewed-by: Ferruh Yigit +--- + app/test-pmd/cmdline.c | 20 ++++++++++++++++++++ + 1 file changed, 20 insertions(+) + +diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c +index b412452948..c641e1f338 100644 +--- a/app/test-pmd/cmdline.c ++++ b/app/test-pmd/cmdline.c +@@ -16238,6 +16238,11 @@ config_port_rx_offload(portid_t port_id, char *name, bool on) + fprintf(stderr, "Unknown offload name: %s\n", name); + return; + } ++ if ((offload & dev_info.rx_offload_capa) == 0) { ++ fprintf(stderr, "Error: port %u doesn't support offload: %s.\n", ++ port_id, name); ++ return; ++ } + } + + nb_rx_queues = dev_info.nb_rx_queues; +@@ -16440,6 +16445,11 @@ cmd_config_per_queue_rx_offload_parsed(void *parsed_result, + fprintf(stderr, "Unknown offload name: %s\n", res->offload); + return; + } ++ if ((offload & dev_info.rx_queue_offload_capa) == 0) { ++ fprintf(stderr, "Error: port %u doesn't support per queue offload: %s.\n", ++ port_id, res->offload); ++ return; ++ } + } + + if (!strcmp(res->on_off, "on")) +@@ -16750,6 +16760,11 @@ config_port_tx_offload(portid_t port_id, char *name, bool on) + fprintf(stderr, "Unknown offload name: %s\n", name); + return; + } ++ if ((offload & dev_info.tx_offload_capa) == 0) { ++ fprintf(stderr, "Error: port %u doesn't support offload: %s.\n", ++ port_id, name); ++ return; ++ } + } + + nb_tx_queues = dev_info.nb_tx_queues; +@@ -16956,6 +16971,11 @@ cmd_config_per_queue_tx_offload_parsed(void *parsed_result, + fprintf(stderr, "Unknown offload name: %s\n", res->offload); + return; + } ++ if ((offload & dev_info.tx_queue_offload_capa) == 0) { ++ fprintf(stderr, "Error: port %u doesn't support per queue offload: %s.\n", ++ port_id, res->offload); ++ return; ++ } + } + + if (!strcmp(res->on_off, "on")) +-- +2.33.0 + diff --git a/0405-doc-fix-hns3-build-option-about-max-queue-number.patch b/0405-doc-fix-hns3-build-option-about-max-queue-number.patch new file mode 100644 index 0000000000000000000000000000000000000000..987c0a90b5caad579d975c3a11c318b7010aee99 --- /dev/null +++ b/0405-doc-fix-hns3-build-option-about-max-queue-number.patch @@ -0,0 +1,38 @@ +From 98d550e1521aaf9057161ada27911d79774a7e89 Mon Sep 17 00:00:00 2001 +From: Huisong Li +Date: Mon, 20 Nov 2023 19:14:02 +0800 +Subject: [PATCH 405/410] doc: fix hns3 build option about max queue number + +[ upstream commit f64a879dbb1f8b508d9cf25dd4a252597f72864c ] + +This patch fixes the description of compilation option about setting max +queue number. The maximum queue number of HIP09 and HIP10 is determined +by the RTE_LIBRTE_HNS3_MAX_TQP_NUM_PER_PF and the value the firmware +report. + +Fixes: 21938cf4e43e ("doc: add build config option in hns3 guide") +Cc: stable@dpdk.org + +Signed-off-by: Huisong Li +Acked-by: Jie Hai +--- + doc/guides/nics/hns3.rst | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/doc/guides/nics/hns3.rst b/doc/guides/nics/hns3.rst +index 8705845d8e..e3e6d3fbd8 100644 +--- a/doc/guides/nics/hns3.rst ++++ b/doc/guides/nics/hns3.rst +@@ -69,7 +69,8 @@ The following options can be modified in the ``config/rte_config.h`` file. + + - ``RTE_LIBRTE_HNS3_MAX_TQP_NUM_PER_PF`` (default ``256``) + +- Number of MAX queues reserved for PF. ++ Number of MAX queues reserved for PF on HIP09 and HIP10. ++ The MAX queue number is also determined by the value the firmware report. + + Runtime Configuration + ~~~~~~~~~~~~~~~~~~~~~ +-- +2.33.0 + diff --git a/0406-doc-update-features-in-hns3-guide.patch b/0406-doc-update-features-in-hns3-guide.patch new file mode 100644 index 0000000000000000000000000000000000000000..6ce4dca6334674a7dae5cb613e6ab13baea30199 --- /dev/null +++ b/0406-doc-update-features-in-hns3-guide.patch @@ -0,0 +1,69 @@ +From f7232006181c15d53a70a1c7a4fb142b6c9abec2 Mon Sep 17 00:00:00 2001 +From: Huisong Li +Date: Mon, 20 Nov 2023 19:14:03 +0800 +Subject: [PATCH 406/410] doc: update features in hns3 guide + +[ upstream commit 97d443f751441c71f8307aea9d9ac2752fa1045c ] + +Update the features for hns3. + +- "Basic stats" and "Extended stats" supported by +Fixes: 8839c5e202f3 ("net/hns3: support device stats") + +- "Traffic Management API" supported by +Fixes: c09c7847d892 ("net/hns3: support traffic management") + +- "Speed capabilities" supported by +Fixes: 09e0de1f411b ("net/hns3: report speed capability for PF") + +- "Link Auto-negotiation" supported by +Fixes: bdaf190f8235 ("net/hns3: support link speed autoneg for PF") + +- "Link flow control" supported by +Fixes: 62e3ccc2b94c ("net/hns3: support flow control") + +- "Dump private info from device" supported by +Fixes: 1a03c659cb9d ("net/hns3: dump device basic info") + +- "FW version" supported by +Fixes: 1f5ca0b460cd ("net/hns3: support some device operations") + +Cc: stable@dpdk.org + +Signed-off-by: Huisong Li +Acked-by: Jie Hai +--- + doc/guides/nics/hns3.rst | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +diff --git a/doc/guides/nics/hns3.rst b/doc/guides/nics/hns3.rst +index e3e6d3fbd8..d55c0930a2 100644 +--- a/doc/guides/nics/hns3.rst ++++ b/doc/guides/nics/hns3.rst +@@ -30,7 +30,6 @@ Features of the HNS3 PMD are: + - DCB + - Scattered and gather for TX and RX + - Vector Poll mode driver +-- Dump register + - SR-IOV VF + - Multi-process + - MAC/VLAN filter +@@ -38,6 +37,15 @@ Features of the HNS3 PMD are: + - NUMA support + - Generic flow API + - IEEE1588/802.1AS timestamping ++- Basic stats ++- Extended stats ++- Traffic Management API ++- Speed capabilities ++- Link Auto-negotiation ++- Link flow control ++- Dump register ++- Dump private info from device ++- FW version + + Prerequisites + ------------- +-- +2.33.0 + diff --git a/0407-doc-fix-RSS-flow-description-in-hns3-guide.patch b/0407-doc-fix-RSS-flow-description-in-hns3-guide.patch new file mode 100644 index 0000000000000000000000000000000000000000..8f9801f8ecfc93b2f9e21ccc85e6112bc701ecd9 --- /dev/null +++ b/0407-doc-fix-RSS-flow-description-in-hns3-guide.patch @@ -0,0 +1,93 @@ +From 0ff8cc564dd8483dfcf233063ea9144df37d9ebd Mon Sep 17 00:00:00 2001 +From: Huisong Li +Date: Mon, 20 Nov 2023 19:14:04 +0800 +Subject: [PATCH 407/410] doc: fix RSS flow description in hns3 guide + +[ upstream commit 9036f9fef8ed7002ba45d78ef1e5c604dfc9948a ] + +The hns3 driver supports for creating rule base on input tuple, hash +key, queues and hash algorithm. But hash key, queues and hash algorithm +are the global configuration for hardware which will affect other rules. +The rule just setting input tuple is completely independent. + +Fixes: 63a0f65c9572 ("doc: add more description in hns3 guide") +Cc: stable@dpdk.org + +Signed-off-by: Huisong Li +Acked-by: Jie Hai +--- + doc/guides/nics/hns3.rst | 42 ++++++++++++++++++++++++++-------------- + 1 file changed, 28 insertions(+), 14 deletions(-) + +diff --git a/doc/guides/nics/hns3.rst b/doc/guides/nics/hns3.rst +index d55c0930a2..5ac64495a6 100644 +--- a/doc/guides/nics/hns3.rst ++++ b/doc/guides/nics/hns3.rst +@@ -239,36 +239,50 @@ Generic flow API + + - ``RSS Flow`` + +- RSS Flow supports to set hash input set, hash function, enable hash +- and configure queues. +- For example: +- Configure queues as queue 0, 1, 2, 3. ++ RSS Flow supports for creating rule base on input tuple, hash key, queues ++ and hash algorithm. But hash key, queues and hash algorithm are the global ++ configuration for hardware which will affect other rules. ++ The rule just setting input tuple is completely independent. ++ ++ Run ``testpmd``: + + .. code-block:: console + +- testpmd> flow create 0 ingress pattern end actions rss types end \ +- queues 0 1 2 3 end / end ++ dpdk-testpmd -a 0000:7d:00.0 -l 10-18 -- -i --rxq=8 --txq=8 ++ ++ All IP packets can be distributed to 8 queues. + +- Enable hash and set input set for IPv4-TCP. ++ Set IPv4-TCP packet is distributed to 8 queues based on L3/L4 SRC only. + + .. code-block:: console + +- testpmd> flow create 0 ingress pattern eth / ipv4 / tcp / end \ +- actions rss types ipv4-tcp l3-src-only end queues end / end ++ testpmd> flow create 0 ingress pattern eth / ipv4 / tcp / end actions \ ++ rss types ipv4-tcp l4-src-only l3-src-only end queues end / end + +- Set symmetric hash enable for flow type IPv4-TCP. ++ Disable IPv4 packet RSS hash. + + .. code-block:: console + +- testpmd> flow create 0 ingress pattern eth / ipv4 / tcp / end \ +- actions rss types ipv4-tcp end queues end func symmetric_toeplitz / end ++ testpmd> flow create 0 ingress pattern eth / ipv4 / end actions rss \ ++ types none end queues end / end + +- Set hash function as simple xor. ++ Set hash function as symmetric Toeplitz. + + .. code-block:: console + + testpmd> flow create 0 ingress pattern end actions rss types end \ +- queues end func simple_xor / end ++ queues end func symmetric_toeplitz / end ++ ++ In this case, all packets that enabled RSS are hashed using symmetric ++ Toeplitz algorithm. ++ ++ Flush all RSS rules ++ ++ .. code-block:: console ++ ++ testpmd> flow flush 0 ++ ++ The RSS configurations of hardwre is back to the one ethdev ops set. + + Statistics + ---------- +-- +2.33.0 + diff --git a/0408-doc-fix-description-of-RSS-features.patch b/0408-doc-fix-description-of-RSS-features.patch new file mode 100644 index 0000000000000000000000000000000000000000..6ec46646318b6d42024d6fe4e112fd8ad72479b5 --- /dev/null +++ b/0408-doc-fix-description-of-RSS-features.patch @@ -0,0 +1,70 @@ +From 553a6b4c40f9cfd4e0b36cbce53cbd17079061f9 Mon Sep 17 00:00:00 2001 +From: Huisong Li +Date: Tue, 28 Nov 2023 13:59:25 +0800 +Subject: [PATCH 408/410] doc: fix description of RSS features + +[ upstream commit 46aa6b3cfca8818b8641026274c0a778f2e38a70 ] + +This patch fixes the description of RSS feature. +And the setting ot hash algorithm is introduced by 23.11, so add it. + +Fixes: 34ff088cc241 ("ethdev: set and query RSS hash algorithm") + +Signed-off-by: Huisong Li +Acked-by: Chengwen Feng +Acked-by: Ferruh Yigit +--- + doc/guides/nics/features.rst | 19 +++++++++++++++---- + 1 file changed, 15 insertions(+), 4 deletions(-) + +diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst +index dba985a105..9f2da6ac0c 100644 +--- a/doc/guides/nics/features.rst ++++ b/doc/guides/nics/features.rst +@@ -276,10 +276,20 @@ RSS hash + Supports RSS hashing on RX. + + * **[uses] user config**: ``dev_conf.rxmode.mq_mode`` = ``RTE_ETH_MQ_RX_RSS_FLAG``. +-* **[uses] user config**: ``dev_conf.rx_adv_conf.rss_conf``. ++* **[uses] user config**: ``rss_conf.rss_hf``. + * **[uses] rte_eth_rxconf,rte_eth_rxmode**: ``offloads:RTE_ETH_RX_OFFLOAD_RSS_HASH``. + * **[provides] rte_eth_dev_info**: ``flow_type_rss_offloads``. + * **[provides] mbuf**: ``mbuf.ol_flags:RTE_MBUF_F_RX_RSS_HASH``, ``mbuf.rss``. ++* **[related] API**: ``rte_eth_dev_configure()``, ``rte_eth_dev_rss_hash_update`` ++ ``rte_eth_dev_rss_hash_conf_get()``. ++ ++Supports RSS hash algorithm on Rx. ++ ++* **[implements] eth_dev_ops**: ``dev_configure``, ``rss_hash_update``, ``rss_hash_conf_get``. ++* **[uses] user config**: ``rss_conf.algorithm`` ++* **[provides] rte_eth_dev_info**: ``rss_algo_capa``. ++* **[related] API**: ``rte_eth_dev_configure()``, ``rte_eth_dev_rss_hash_update()``, ++ ``rte_eth_dev_rss_hash_conf_get()``. + + + .. _nic_features_inner_rss: +@@ -287,7 +297,7 @@ Supports RSS hashing on RX. + Inner RSS + --------- + +-Supports RX RSS hashing on Inner headers. ++Supports RSS hashing on inner headers with flow API. + + * **[uses] rte_flow_action_rss**: ``level``. + * **[uses] rte_eth_rxconf,rte_eth_rxmode**: ``offloads:RTE_ETH_RX_OFFLOAD_RSS_HASH``. +@@ -302,9 +312,10 @@ RSS key update + Supports configuration of Receive Side Scaling (RSS) hash computation. Updating + Receive Side Scaling (RSS) hash key. + +-* **[implements] eth_dev_ops**: ``rss_hash_update``, ``rss_hash_conf_get``. ++* **[implements] eth_dev_ops**: ``dev_configure``, ``rss_hash_update``, ``rss_hash_conf_get``. ++* **[uses] user config**: ``rss_conf.rss_key``, ``rss_conf.rss_key_len``. + * **[provides] rte_eth_dev_info**: ``hash_key_size``. +-* **[related] API**: ``rte_eth_dev_rss_hash_update()``, ++* **[related] API**: ``rte_eth_dev_configure()``, ``rte_eth_dev_rss_hash_update()``, + ``rte_eth_dev_rss_hash_conf_get()``. + + +-- +2.33.0 + diff --git a/0409-ethdev-add-new-API-to-get-RSS-hash-algorithm-by-name.patch b/0409-ethdev-add-new-API-to-get-RSS-hash-algorithm-by-name.patch new file mode 100644 index 0000000000000000000000000000000000000000..5e1584fbe2878171a5432b903ce758c9fab45ddf --- /dev/null +++ b/0409-ethdev-add-new-API-to-get-RSS-hash-algorithm-by-name.patch @@ -0,0 +1,93 @@ +From 8f2d27fad53653546a97da1f691575ed153bd12f Mon Sep 17 00:00:00 2001 +From: Jie Hai +Date: Fri, 1 Dec 2023 16:52:53 +0800 +Subject: [PATCH 409/410] ethdev: add new API to get RSS hash algorithm by name + +[ upstream commit c4b01b7cc50e1eb991310549455cc53bac6d47ad ] + +This patch supports conversion from names to hash algorithm +(see RTE_ETH_HASH_FUNCTION_XXX). + +Signed-off-by: Jie Hai +Reviewed-by: Huisong Li +Reviewed-by: Ferruh Yigit +--- + lib/ethdev/rte_ethdev.c | 15 +++++++++++++++ + lib/ethdev/rte_ethdev.h | 20 ++++++++++++++++++++ + lib/ethdev/version.map | 3 +++ + 3 files changed, 38 insertions(+) + +diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c +index 310b39775d..10312b3e13 100644 +--- a/lib/ethdev/rte_ethdev.c ++++ b/lib/ethdev/rte_ethdev.c +@@ -4321,6 +4321,21 @@ rte_eth_dev_rss_algo_name(enum rte_eth_hash_function rss_algo) + return name; + } + ++int ++rte_eth_find_rss_algo(const char *name, uint32_t *algo) ++{ ++ unsigned int i; ++ ++ for (i = 0; i < RTE_DIM(rte_eth_dev_rss_algo_names); i++) { ++ if (strcmp(name, rte_eth_dev_rss_algo_names[i].name) == 0) { ++ *algo = rte_eth_dev_rss_algo_names[i].algo; ++ return 0; ++ } ++ } ++ ++ return -EINVAL; ++} ++ + int + rte_eth_dev_udp_tunnel_port_add(uint16_t port_id, + struct rte_eth_udp_tunnel *udp_tunnel) +diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h +index 2880a55890..e0c132cebc 100644 +--- a/lib/ethdev/rte_ethdev.h ++++ b/lib/ethdev/rte_ethdev.h +@@ -4420,6 +4420,26 @@ __rte_experimental + const char * + rte_eth_dev_rss_algo_name(enum rte_eth_hash_function rss_algo); + ++/** ++ * @warning ++ * @b EXPERIMENTAL: this API may change, or be removed, without prior notice. ++ * ++ * Get RSS hash algorithm by its name. ++ * ++ * @param name ++ * RSS hash algorithm. ++ * ++ * @param algo ++ * return the RSS hash algorithm found, @see rte_eth_hash_function. ++ * ++ * @return ++ * - (0) if successful. ++ * - (-EINVAL) if not found. ++ */ ++__rte_experimental ++int ++rte_eth_find_rss_algo(const char *name, uint32_t *algo); ++ + /** + * Add UDP tunneling port for a type of tunnel. + * +diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map +index 1867016054..44cbe04e9b 100644 +--- a/lib/ethdev/version.map ++++ b/lib/ethdev/version.map +@@ -268,6 +268,9 @@ EXPERIMENTAL { + + # added in 23.11 + rte_eth_dev_rss_algo_name; ++ ++ # added in 24.03 ++ rte_eth_find_rss_algo; + }; + + INTERNAL { +-- +2.33.0 + diff --git a/0410-app-testpmd-support-set-RSS-hash-algorithm.patch b/0410-app-testpmd-support-set-RSS-hash-algorithm.patch new file mode 100644 index 0000000000000000000000000000000000000000..c9a01400fa118458ad1e57698de288bfaa4890fc --- /dev/null +++ b/0410-app-testpmd-support-set-RSS-hash-algorithm.patch @@ -0,0 +1,151 @@ +From 57956d5be671d99089e2ac8e16b8f21adced950c Mon Sep 17 00:00:00 2001 +From: Jie Hai +Date: Fri, 1 Dec 2023 16:52:54 +0800 +Subject: [PATCH 410/410] app/testpmd: support set RSS hash algorithm + +[ upstream commit 7516242a7c7fc7a5adbfbd7d71b4f28ebdb26ffb ] + +Since API rte_eth_dev_rss_hash_update() supports setting RSS hash +algorithm, add new command to support it: + +testpmd> port config 0 rss-hash-algo symmetric_toeplitz + +Signed-off-by: Jie Hai +Reviewed-by: Huisong Li +Reviewed-by: Ferruh Yigit +--- + app/test-pmd/cmdline.c | 81 +++++++++++++++++++++ + doc/guides/testpmd_app_ug/testpmd_funcs.rst | 11 +++ + 2 files changed, 92 insertions(+) + +diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c +index c641e1f338..ae0b47de72 100644 +--- a/app/test-pmd/cmdline.c ++++ b/app/test-pmd/cmdline.c +@@ -814,6 +814,10 @@ static void cmd_help_long_parsed(void *parsed_result, + "port config port-id rss reta (hash,queue)[,(hash,queue)]\n" + " Set the RSS redirection table.\n\n" + ++ "port config (port_id) rss-hash-algo (default|simple_xor|toeplitz|" ++ "symmetric_toeplitz|symmetric_toeplitz_sort)\n" ++ " Set the RSS hash algorithm.\n\n" ++ + "port config (port_id) dcb vt (on|off) (traffic_class)" + " pfc (on|off)\n" + " Set the DCB mode.\n\n" +@@ -2408,6 +2412,82 @@ cmdline_parse_inst_t cmd_config_rss_hash_key = { + }, + }; + ++/* *** configure rss hash algorithm *** */ ++struct cmd_config_rss_hash_algo { ++ cmdline_fixed_string_t port; ++ cmdline_fixed_string_t config; ++ portid_t port_id; ++ cmdline_fixed_string_t rss_hash_algo; ++ cmdline_fixed_string_t algo; ++}; ++ ++static void ++cmd_config_rss_hash_algo_parsed(void *parsed_result, ++ __rte_unused struct cmdline *cl, ++ __rte_unused void *data) ++{ ++ struct cmd_config_rss_hash_algo *res = parsed_result; ++ uint8_t rss_key[RSS_HASH_KEY_LENGTH]; ++ struct rte_eth_rss_conf rss_conf; ++ uint32_t algorithm; ++ int ret; ++ ++ rss_conf.rss_key_len = RSS_HASH_KEY_LENGTH; ++ rss_conf.rss_key = rss_key; ++ ret = rte_eth_dev_rss_hash_conf_get(res->port_id, &rss_conf); ++ if (ret != 0) { ++ fprintf(stderr, "failed to get port %u RSS configuration\n", ++ res->port_id); ++ return; ++ } ++ ++ algorithm = (uint32_t)rss_conf.algorithm; ++ ret = rte_eth_find_rss_algo(res->algo, &algorithm); ++ if (ret != 0) { ++ fprintf(stderr, "port %u configured invalid RSS hash algorithm: %s\n", ++ res->port_id, res->algo); ++ return; ++ } ++ ++ ret = rte_eth_dev_rss_hash_update(res->port_id, &rss_conf); ++ if (ret != 0) { ++ fprintf(stderr, "failed to set port %u RSS hash algorithm\n", ++ res->port_id); ++ return; ++ } ++} ++ ++static cmdline_parse_token_string_t cmd_config_rss_hash_algo_port = ++ TOKEN_STRING_INITIALIZER(struct cmd_config_rss_hash_algo, port, "port"); ++static cmdline_parse_token_string_t cmd_config_rss_hash_algo_config = ++ TOKEN_STRING_INITIALIZER(struct cmd_config_rss_hash_algo, config, ++ "config"); ++static cmdline_parse_token_num_t cmd_config_rss_hash_algo_port_id = ++ TOKEN_NUM_INITIALIZER(struct cmd_config_rss_hash_algo, port_id, ++ RTE_UINT16); ++static cmdline_parse_token_string_t cmd_config_rss_hash_algo_rss_hash_algo = ++ TOKEN_STRING_INITIALIZER(struct cmd_config_rss_hash_algo, ++ rss_hash_algo, "rss-hash-algo"); ++static cmdline_parse_token_string_t cmd_config_rss_hash_algo_algo = ++ TOKEN_STRING_INITIALIZER(struct cmd_config_rss_hash_algo, algo, ++ "default#simple_xor#toeplitz#" ++ "symmetric_toeplitz#symmetric_toeplitz_sort"); ++ ++static cmdline_parse_inst_t cmd_config_rss_hash_algo = { ++ .f = cmd_config_rss_hash_algo_parsed, ++ .data = NULL, ++ .help_str = "port config rss-hash-algo " ++ "default|simple_xor|toeplitz|symmetric_toeplitz|symmetric_toeplitz_sort", ++ .tokens = { ++ (void *)&cmd_config_rss_hash_algo_port, ++ (void *)&cmd_config_rss_hash_algo_config, ++ (void *)&cmd_config_rss_hash_algo_port_id, ++ (void *)&cmd_config_rss_hash_algo_rss_hash_algo, ++ (void *)&cmd_config_rss_hash_algo_algo, ++ NULL, ++ }, ++}; ++ + /* *** cleanup txq mbufs *** */ + struct cmd_cleanup_txq_mbufs_result { + cmdline_fixed_string_t port; +@@ -18084,6 +18164,7 @@ cmdline_parse_ctx_t main_ctx[] = { + (cmdline_parse_inst_t *)&cmd_showport_rss_hash_key, + (cmdline_parse_inst_t *)&cmd_showport_rss_hash_algo, + (cmdline_parse_inst_t *)&cmd_config_rss_hash_key, ++ (cmdline_parse_inst_t *)&cmd_config_rss_hash_algo, + (cmdline_parse_inst_t *)&cmd_cleanup_txq_mbufs, + (cmdline_parse_inst_t *)&cmd_dump, + (cmdline_parse_inst_t *)&cmd_dump_one, +diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst +index 226569c545..86938d53ee 100644 +--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst ++++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst +@@ -2445,6 +2445,17 @@ hash of input [IP] packets received on port:: + ipv6-udp-ex ) + ++ ++port config rss hash algorithm ++~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++ ++To configure the RSS hash algorithm used to compute the RSS ++hash of input packets received on port:: ++ ++ testpmd> port config rss-hash-algo (default|\ ++ simple_xor|toeplitz|symmetric_toeplitz|\ ++ symmetric_toeplitz_sort) ++ + port cleanup txq mbufs + ~~~~~~~~~~~~~~~~~~~~~~ + +-- +2.33.0 + diff --git a/dpdk.spec b/dpdk.spec index adc61419ad18f5c93d4ec369350d439273829d10..e0eedf31c287eba889500f1b69f590231b526a35 100644 --- a/dpdk.spec +++ b/dpdk.spec @@ -1,6 +1,6 @@ Name: dpdk Version: 21.11 -Release: 60 +Release: 61 Packager: packaging@6wind.com URL: http://dpdk.org %global source_version 21.11 @@ -428,6 +428,19 @@ Patch1001: 1001-add-sw_64-support-not-upstream-new.patch Patch6395: 0395-net-hns3-fix-ignored-reset-event.patch Patch6396: 0396-net-hns3-fix-reset-event-status.patch Patch6397: 0397-net-hns3-fix-VF-reset-handler-interruption.patch +Patch6398: 0398-app-testpmd-remove-useless-check-in-TSO-command.patch +Patch6399: 0399-app-testpmd-fix-tunnel-TSO-capability-check.patch +Patch6400: 0400-app-testpmd-add-explicit-check-for-tunnel-TSO.patch +Patch6401: 0401-app-testpmd-fix-tunnel-TSO-configuration.patch +Patch6402: 0402-app-testpmd-allow-offload-config-for-all-ports.patch +Patch6403: 0403-app-testpmd-fix-Tx-offload-command.patch +Patch6404: 0404-app-testpmd-check-port-and-queue-Rx-Tx-offloads.patch +Patch6405: 0405-doc-fix-hns3-build-option-about-max-queue-number.patch +Patch6406: 0406-doc-update-features-in-hns3-guide.patch +Patch6407: 0407-doc-fix-RSS-flow-description-in-hns3-guide.patch +Patch6408: 0408-doc-fix-description-of-RSS-features.patch +Patch6409: 0409-ethdev-add-new-API-to-get-RSS-hash-algorithm-by-name.patch +Patch6410: 0410-app-testpmd-support-set-RSS-hash-algorithm.patch Summary: Data Plane Development Kit core Group: System Environment/Libraries @@ -583,6 +596,23 @@ strip -g $RPM_BUILD_ROOT/lib/modules/%{kern_devel_ver}/extra/dpdk/igb_uio.ko /usr/sbin/depmod %changelog +* Fri Dec 8 2023 huangdengdui - 21.11-61 + Sync some bugfix from upstreaming about testpmd and doc, modifies + are as follow: + - support set RSS hash algorithm + - ethdev: add new API to get RSS hash algorithm by name + - doc: fix description of RSS features + - doc: fix RSS flow description in hns3 guide + - doc: update features in hns3 guide + - doc: fix hns3 build option about max queue number + - app/testpmd: check port and queue Rx/Tx offloads + - app/testpmd: fix Tx offload command + - app/testpmd: allow offload config for all ports + - app/testpmd: fix tunnel TSO configuration + - app/testpmd: add explicit check for tunnel TSO + - app/testpmd: fix tunnel TSO capability check + - app/testpmd: remove useless check in TSO command + * Fri Dec 8 2023 huangdengdui - 21.11-60 Sync some bugfix from upstreaming about hns3 reset and modifies are as follow: