From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5D8E7A0487 for ; Thu, 4 Jul 2019 08:06:13 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 28418160; Thu, 4 Jul 2019 08:06:13 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 17297160; Thu, 4 Jul 2019 08:06:10 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Jul 2019 23:06:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,449,1557212400"; d="scan'208";a="315779495" Received: from dpdk6.bj.intel.com ([172.16.182.192]) by orsmga004.jf.intel.com with ESMTP; 03 Jul 2019 23:06:08 -0700 From: Wei Zhao To: dev@dpdk.org Cc: stable@dpdk.org, bernard.iremonger@intel.com, wei zhao Date: Thu, 4 Jul 2019 13:35:37 +0800 Message-Id: <1562218537-33583-1-git-send-email-wei.zhao1@intel.com> X-Mailer: git-send-email 2.7.5 In-Reply-To: <1562131464-58732-1-git-send-email-wei.zhao1@intel.com> References: <1562131464-58732-1-git-send-email-wei.zhao1@intel.com> Subject: [dpdk-stable] [PATCH v2] app/testpmd: fix to add offloads confguration for queue X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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 --- v2: merge to one function for apply offloads configguration --- 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 d1e0d44..6a69f90 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(); @@ -4360,6 +4365,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, __attribute__((unused)) void *data) @@ -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.7.5