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 9AB6BA04F2; Mon, 8 Jun 2020 16:17:57 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E8D61322C; Mon, 8 Jun 2020 16:17:56 +0200 (CEST) Received: from git-send-mailer.rdmz.labs.mlnx (unknown [37.142.13.130]) by dpdk.org (Postfix) with ESMTP id 7E4DA31FC for ; Mon, 8 Jun 2020 16:17:55 +0200 (CEST) From: Shy Shyman To: dev@dpdk.org Cc: wenzhuo.lu@intel.com, beilei.xing@intel.com, bernard.iremonger@intel.com, xavier.huwei@huawei.com Date: Mon, 8 Jun 2020 17:17:47 +0300 Message-Id: <20200608141747.157249-1-shys@mellanox.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200518092704.188832-1-shys@mellanox.com> References: <20200518092704.188832-1-shys@mellanox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2] app/testpmd: fix error detection in MTU command X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" MTU is used in testpmd to set the maximum payload size for packets. According to testpmd, the setting influnce RX only. In rte_ethdev there's no relation between MTU setting and JUMBO offload or rx_max_pkt_len. The previous fix in patch referenced below was meant to update the correlated variables of max_pkt_len and JUMBO offload, but by doing so it assumes that MTU setting can only exist when JUMBO offload supported in the device. For example fail-safe device does supports set MTU and doesn't support JUMBO offload, and in this case, though set MTU succeeds, an error message is still printed since the JUMBO packet offload is disabled. The fix separates the two conditions to make sure the error triggers only in case the set_mtu action actually failed. Fixes: 150c9ac2df13 ("app/testpmd: update Rx offload after setting MTU") Cc: xavier.huwei@huawei.com Signed-off-by: Shy Shyman --- v2 - removed warning message. --- app/test-pmd/config.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 5381207cc..3b54fb6a0 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -1277,8 +1277,9 @@ port_mtu_set(portid_t port_id, uint16_t mtu) return; } diag = rte_eth_dev_set_mtu(port_id, mtu); - if (diag == 0 && - dev_info.rx_offload_capa & DEV_RX_OFFLOAD_JUMBO_FRAME) { + if (diag) + printf("Set MTU failed. diag=%d\n", diag); + else if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_JUMBO_FRAME) { /* * Ether overhead in driver is equal to the difference of * max_rx_pktlen and max_mtu in rte_eth_dev_info when the @@ -1293,10 +1294,7 @@ port_mtu_set(portid_t port_id, uint16_t mtu) } else rte_port->dev_conf.rxmode.offloads &= ~DEV_RX_OFFLOAD_JUMBO_FRAME; - - return; } - printf("Set MTU failed. diag=%d\n", diag); } /* Generic flow management functions. */ -- 2.21.0