From 74453ac9ef67575284e0449ca24aada540505a89 Mon Sep 17 00:00:00 2001 From: Wei Zhao Date: Thu, 4 Jul 2019 13:35:37 +0800 Subject: [PATCH] app/testpmd: fix queue offload configuration When adding offloads from commandline, not only port related configuration bits should be set, but also queue related offloads configuration bits, or it will cause error. For example, test in this process for ixgbe: (1)./x86_64-native-linuxapp-gcc/app/testpmd -c 0x6 -n 4 -- -i --portmask=0x1 --port-topology=loop --disable-crc-strip (2)port stop all (3)port config all crc-strip on (4)port start all we will see "Fail to configure port 0 rx queues" of warning info. Fixes: 0074d02fca21 ("app/testpmd: convert to new Rx offloads API") Cc: stable@dpdk.org Signed-off-by: Wei Zhao Acked-by: Bernard Iremonger --- app/test-pmd/cmdline.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index cbde5d2ae9..01dd45f27c 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -2047,6 +2047,7 @@ cmd_config_rx_mode_flag_parsed(void *parsed_result, { struct cmd_config_rx_mode_flag *res = parsed_result; portid_t pid; + int k; if (!all_ports_stopped()) { printf("Please stop all ports first\n"); @@ -2147,6 +2148,10 @@ cmd_config_rx_mode_flag_parsed(void *parsed_result, return; } port->dev_conf.rxmode.offloads = rx_offloads; + /* Apply Rx offloads configuration */ + for (k = 0; k < port->dev_info.max_rx_queues; k++) + port->rx_conf[k].offloads = + port->dev_conf.rxmode.offloads; } init_port_config(); @@ -4359,6 +4364,17 @@ csum_show(int port_id) } } +static void +cmd_config_queue_tx_offloads(struct rte_port *port) +{ + int k; + + /* Apply queue tx offloads configuration */ + for (k = 0; k < port->dev_info.max_rx_queues; k++) + port->tx_conf[k].offloads = + port->dev_conf.txmode.offloads; +} + static void cmd_csum_parsed(void *parsed_result, __attribute__((unused)) struct cmdline *cl, @@ -4443,6 +4459,7 @@ cmd_csum_parsed(void *parsed_result, ports[res->port_id].dev_conf.txmode.offloads &= (~csum_offloads); } + cmd_config_queue_tx_offloads(&ports[res->port_id]); } csum_show(res->port_id); @@ -4594,6 +4611,7 @@ cmd_tso_set_parsed(void *parsed_result, printf("TSO segment size for non-tunneled packets is %d\n", 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 */ rte_eth_dev_info_get(res->port_id, &dev_info); @@ -4749,6 +4767,7 @@ cmd_tunnel_tso_set_parsed(void *parsed_result, "if outer L3 is IPv4; not necessary for IPv6\n"); } + cmd_config_queue_tx_offloads(&ports[res->port_id]); cmd_reconfig_device_queue(res->port_id, 1, 1); } -- 2.20.1