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 B467FA04DB for ; Tue, 17 Nov 2020 12:16:07 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AE80DF3E; Tue, 17 Nov 2020 12:16:06 +0100 (CET) Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) by dpdk.org (Postfix) with ESMTP id B8AC8F3E for ; Tue, 17 Nov 2020 12:16:04 +0100 (CET) Received: by mail-wm1-f41.google.com with SMTP id p22so2852003wmg.3 for ; Tue, 17 Nov 2020 03:16:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kn29hCuRB1Iw8x040+MnkVQvtIh9cQR7Jga44Q/deJA=; b=pQ0S0dh1y6r2Q0RSBjDEXTPtgEO0EfTWfaRiSAkAJ/M8OypwmER7vNuXo29yMw+2KA g2MYK+3OHAjse94pqkV29YafN9mwNmJYT17Ux1cob0Y2+xQuaRNkdMlRX47SsI9SyJeb ChiMIpMog6EN5huB52bvflkzWlXYNbnsE6fLUp8JpVKgZQV1quNzb6NU2xGWVsU5OjR+ 0CWRV+bOAmMUwZTpu5P5JzS7ZTESRDL8626w2sGZ6TJ+BL+lo6xMqpt0NfvbpFOcZdTw /j+wtHUj7j6AwEt8ZL4tlbX0g/0pPXe8nFAixvS62Esl/h3DN/HCMvmpMqP52nSdQR9i eHbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kn29hCuRB1Iw8x040+MnkVQvtIh9cQR7Jga44Q/deJA=; b=cjIOntCWzILLblyITuacCZG0EvE5C/gUo+66CNTP4xWWFUAU+dmdwPcNH2ZtLDenNk fSRIATll1x+/iBSkHBBuiVMqtq7qv4YQaJZ5xfSn6Z2JxxxhVcaVNBXGkYrrDhsmBzKu WHBc7r3TlIYgfJP6JZSml0cFTk6AW1bPyRBTyopnGrdZ2J4P19GHiFJ9X+90nA7LwAHc 7nWyLdUyxQ/eLy1KXK1ELTpMt8z8WyUAxjnE1F9XAWWh++kvv571ub2c81ZnXtAQDV3c P3mTwX0W0ctrtfao5ZQcOn8yxxnw8f5bCKJLdCAtDw58P45lzqcccczRiifR/f55f4i5 wYhA== X-Gm-Message-State: AOAM530pSHSzsuOkGmKUopBB6HHGErUZ7ffDhOS3DFGBHQwyuhoOCs/6 uGbChUUl6QJ6GIXnRiwLZfo= X-Google-Smtp-Source: ABdhPJy9qAj0ADXD31VaUIc3/eMxuV64gwpqOegY+EGhfrGKXUL/4BHoMtrBETi2dlRwnAd6iCtltw== X-Received: by 2002:a05:600c:21d5:: with SMTP id x21mr3999924wmj.133.1605611763507; Tue, 17 Nov 2020 03:16:03 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id z19sm3028964wmk.12.2020.11.17.03.16.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2020 03:16:02 -0800 (PST) From: luca.boccassi@gmail.com To: Ferruh Yigit Cc: Qi Zhang , Andrew Rybchenko , Igor Romanov , dpdk stable Date: Tue, 17 Nov 2020 11:14:05 +0000 Message-Id: <20201117111416.1961049-31-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201117111416.1961049-1-luca.boccassi@gmail.com> References: <20201109185030.3478760-2-luca.boccassi@gmail.com> <20201117111416.1961049-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'app/testpmd: fix MTU after device configure' has been queued to stable release 19.11.6 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" Hi, FYI, your patch has been queued to stable release 19.11.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/19/20. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/3c70f73579e1da8b53853f2c8379eaeb997ae40e Thanks. Luca Boccassi --- >From 3c70f73579e1da8b53853f2c8379eaeb997ae40e Mon Sep 17 00:00:00 2001 From: Ferruh Yigit Date: Fri, 13 Nov 2020 11:44:00 +0000 Subject: [PATCH] app/testpmd: fix MTU after device configure [ upstream commit 1c21ee95cf5298fe7b6a8b7d8a997ff3c402a08f ] In 'rte_eth_dev_configure()', if 'DEV_RX_OFFLOAD_JUMBO_FRAME' is not set the max frame size is limited to 'RTE_ETHER_MAX_LEN' (1518). This is mistake because for the PMDs that has frame size bigger than "RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN" (18 bytes), the MTU becomes less than 1500, causing a valid frame with 1500 bytes payload to be dropped. Since 'rte_eth_dev_set_mtu()' works as expected, it is called after 'rte_eth_dev_configure()' to fix the MTU. It may look redundant to set MTU after 'rte_eth_dev_configure()', both with default values, but it is not, the resulting MTU config can be different in the device based on frame overhead of the PMD. And instead of setting the MTU to default value, it is first get via 'rte_eth_dev_get_mtu()' and set again, this is to cover cases MTU changed from testpmd command line. 'rte_eth_dev_set_mtu()', '-ENOTSUP' error is ignored to prevent irrelevant warning messages for the virtual PMDs. Fixes: af75078fece3 ("first public release") Signed-off-by: Ferruh Yigit Reviewed-by: Qi Zhang Acked-by: Andrew Rybchenko Tested-by: Igor Romanov --- app/test-pmd/testpmd.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 8d3b7b2a3b..7b08bd2f59 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -2334,6 +2334,8 @@ start_port(portid_t pid) } if (port->need_reconfig > 0) { + uint16_t mtu = RTE_ETHER_MTU; + port->need_reconfig = 0; if (flow_isolate_all) { @@ -2367,6 +2369,23 @@ start_port(portid_t pid) port->need_reconfig = 1; return -1; } + + /* + * Workaround for rte_eth_dev_configure(), max_rx_pkt_len + * set MTU wrong for the PMDs that have frame overhead + * bigger than RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN. + * For a PMD that has 26 bytes overhead, rte_eth_dev_configure() + * can set MTU to max 1492, not to expected 1500 bytes. + * Using rte_eth_dev_set_mtu() to be able to set MTU correctly, + * default MTU value is 1500. + */ + diag = rte_eth_dev_get_mtu(pi, &mtu); + if (diag) + printf("Failed to get MTU for port %d\n", pi); + diag = rte_eth_dev_set_mtu(pi, mtu); + if (diag != 0 && diag != -ENOTSUP) + printf("Failed to set MTU to %u for port %d\n", + mtu, pi); } if (port->need_reconfig_queues > 0) { port->need_reconfig_queues = 0; -- 2.27.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-11-17 11:13:14.293311684 +0000 +++ 0031-app-testpmd-fix-MTU-after-device-configure.patch 2020-11-17 11:13:12.941117012 +0000 @@ -1 +1 @@ -From 1c21ee95cf5298fe7b6a8b7d8a997ff3c402a08f Mon Sep 17 00:00:00 2001 +From 3c70f73579e1da8b53853f2c8379eaeb997ae40e Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 1c21ee95cf5298fe7b6a8b7d8a997ff3c402a08f ] + @@ -27 +28,0 @@ -Cc: stable@dpdk.org @@ -38 +39 @@ -index 33fc0fddf5..48e9647fc7 100644 +index 8d3b7b2a3b..7b08bd2f59 100644 @@ -41 +42 @@ -@@ -2537,6 +2537,8 @@ start_port(portid_t pid) +@@ -2334,6 +2334,8 @@ start_port(portid_t pid) @@ -50 +51 @@ -@@ -2570,6 +2572,23 @@ start_port(portid_t pid) +@@ -2367,6 +2369,23 @@ start_port(portid_t pid)