From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 02B0EA0524 for ; Fri, 5 Feb 2021 12:32:47 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F11E7188A03; Fri, 5 Feb 2021 12:32:46 +0100 (CET) Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) by mails.dpdk.org (Postfix) with ESMTP id EF0AA188A05 for ; Fri, 5 Feb 2021 12:32:45 +0100 (CET) Received: by mail-wm1-f44.google.com with SMTP id j11so5738979wmi.3 for ; Fri, 05 Feb 2021 03:32:45 -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=dZBpyfDmny9aeDSoXnRXFoT1QkVaxbmybfYkLglfKjk=; b=GYL4hd0OD60HDNilscN8vmXfz3eueNMhU17pd/6ENpQkYaTrf0LR3SUuH3Mk8w3Me2 3QAacTIRImz9kW/gCQdJOgSFJI5Yy55VFRZztUs257CNSm2/fBDxNrwHMxO/6Xmm1wIK h/crDh4IxxKpIMrIsQlynun1EZ1WmvUVdAhxpSUN9l4g9asWNmPHDK5/58PvUebbg+xM PRMoVvT/u9qpH841atFwdW31G9JB22rPJbVp7uRMjCK/OIq50OkDV6Pxq4Mh1Qr4XOjf abbVkUFEN/s3JdbAJYesb0HILFvQMMfOCNd5wfthi8z/MmvnlZFl+qCCn363Q4S/A/Ir LPug== 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=dZBpyfDmny9aeDSoXnRXFoT1QkVaxbmybfYkLglfKjk=; b=TqMc6g0s8Ba0/5kP/bZGjDBobWRFiLnAyd1vMU8qhv4w8MQe57W8E7TbSu/pfcryTa bO+LPCAt9Xefp99wRU7ZH/pOPAv6YBzDmpi/uAVrSag3E+fY1nb8I6Fr5jCtQ7q3K3QG Rj+xHFJ/hG8aI88w1W2TsLo+MadKo9ieHs61TYKl55W/HnGzNnDCNqG6i/ho1mhiCUxR hfNwWuKBMkq6D+TSA01X50YSvEE4khV0pPQ6rwUxQtTOatSLdv0p8DorjlwTvlBzQUpY GRu8K/Kj0RsRI3+33gZz8sR8Ti0fS/9zF7/to3v0SYLxnoqfvV1oV0tDuMI9uIYmjbqj Xiyw== X-Gm-Message-State: AOAM5307/bMr5K9vOrYIbvNRrIdp2h9T4t854m6HzchGix4BD2ImbWOM SHb+bG1dwxDoZIEmtFy9Fq0= X-Google-Smtp-Source: ABdhPJy5qAUVM6gDfWRiFMHtMoPY86NXgSu6c7C+M3CF6M+iklEdcxmZ1qu8fB9P//h8CRMn1/2cIA== X-Received: by 2002:a1c:6a02:: with SMTP id f2mr3299442wmc.36.1612524765756; Fri, 05 Feb 2021 03:32:45 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id c9sm8897361wmb.33.2021.02.05.03.32.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 03:32:45 -0800 (PST) From: luca.boccassi@gmail.com To: Steve Yang Cc: Ferruh Yigit , dpdk stable Date: Fri, 5 Feb 2021 11:17:10 +0000 Message-Id: <20210205111920.1272063-144-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210205111920.1272063-1-luca.boccassi@gmail.com> References: <20210205111920.1272063-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'app/testpmd: fix max Rx packet length for VLAN packets' has been queued to stable release 20.11.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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 20.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/07/21. 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/613019ac4195ba77942ee7c4af5f1a3eaaef01d2 Thanks. Luca Boccassi --- >From 613019ac4195ba77942ee7c4af5f1a3eaaef01d2 Mon Sep 17 00:00:00 2001 From: Steve Yang Date: Mon, 18 Jan 2021 07:04:08 +0000 Subject: [PATCH] app/testpmd: fix max Rx packet length for VLAN packets [ upstream commit 761c4d66900fd7db6927f57eb610f543cc0908e4 ] When the max rx packet length is smaller than the sum of mtu size and ether overhead size, it should be enlarged, otherwise the VLAN packets will be dropped. Removed the rx_offloads assignment for jumbo frame during command line parsing, and set the correct jumbo frame flag if MTU size is larger than the default value 'RTE_ETHER_MTU' within 'init_config()'. Fixes: 384161e00627 ("app/testpmd: adjust on the fly VLAN configuration") Fixes: 35b2d13fd6fd ("net: add rte prefix to ether defines") Fixes: ce17eddefc20 ("ethdev: introduce Rx queue offloads API") Fixes: 150c9ac2df13 ("app/testpmd: update Rx offload after setting MTU") Signed-off-by: Steve Yang Reviewed-by: Ferruh Yigit --- app/test-pmd/cmdline.c | 6 ------ app/test-pmd/config.c | 2 +- app/test-pmd/parameters.c | 7 ++----- app/test-pmd/testpmd.c | 18 ++++++++++++++++++ 4 files changed, 21 insertions(+), 12 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 2ccbaa039e..65042fcff5 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -1886,7 +1886,6 @@ cmd_config_max_pkt_len_parsed(void *parsed_result, RTE_ETH_FOREACH_DEV(pid) { struct rte_port *port = &ports[pid]; - uint64_t rx_offloads = port->dev_conf.rxmode.offloads; if (!strcmp(res->name, "max-pkt-len")) { if (res->value < RTE_ETHER_MIN_LEN) { @@ -1898,11 +1897,6 @@ cmd_config_max_pkt_len_parsed(void *parsed_result, return; port->dev_conf.rxmode.max_rx_pkt_len = res->value; - if (res->value > RTE_ETHER_MAX_LEN) - rx_offloads |= DEV_RX_OFFLOAD_JUMBO_FRAME; - else - rx_offloads &= ~DEV_RX_OFFLOAD_JUMBO_FRAME; - port->dev_conf.rxmode.offloads = rx_offloads; } else { printf("Unknown parameter\n"); return; diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index a6a5baa4e1..0e2b9f7d3c 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -1434,7 +1434,7 @@ port_mtu_set(portid_t port_id, uint16_t mtu) * device supports jumbo frame. */ eth_overhead = dev_info.max_rx_pktlen - dev_info.max_mtu; - if (mtu > RTE_ETHER_MAX_LEN - eth_overhead) { + if (mtu > RTE_ETHER_MTU) { rte_port->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_JUMBO_FRAME; rte_port->dev_conf.rxmode.max_rx_pkt_len = diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c index 414a0068fb..df5eb10d84 100644 --- a/app/test-pmd/parameters.c +++ b/app/test-pmd/parameters.c @@ -834,12 +834,9 @@ launch_args_parse(int argc, char** argv) } if (!strcmp(lgopts[opt_idx].name, "max-pkt-len")) { n = atoi(optarg); - if (n >= RTE_ETHER_MIN_LEN) { + if (n >= RTE_ETHER_MIN_LEN) rx_mode.max_rx_pkt_len = (uint32_t) n; - if (n > RTE_ETHER_MAX_LEN) - rx_offloads |= - DEV_RX_OFFLOAD_JUMBO_FRAME; - } else + else rte_exit(EXIT_FAILURE, "Invalid max-pkt-len=%d - should be > %d\n", n, RTE_ETHER_MIN_LEN); diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 2b60f6c5d3..c256e719ae 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -1410,6 +1410,7 @@ init_config(void) struct rte_gro_param gro_param; uint32_t gso_types; uint16_t data_size; + uint16_t eth_overhead; bool warning = 0; int k; int ret; @@ -1446,6 +1447,23 @@ init_config(void) rte_exit(EXIT_FAILURE, "rte_eth_dev_info_get() failed\n"); + /* Update the max_rx_pkt_len to have MTU as RTE_ETHER_MTU */ + if (port->dev_info.max_mtu != UINT16_MAX && + port->dev_info.max_rx_pktlen > port->dev_info.max_mtu) + eth_overhead = port->dev_info.max_rx_pktlen - + port->dev_info.max_mtu; + else + eth_overhead = + RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN; + + if (port->dev_conf.rxmode.max_rx_pkt_len <= + (uint32_t)(RTE_ETHER_MTU + eth_overhead)) + port->dev_conf.rxmode.max_rx_pkt_len = + RTE_ETHER_MTU + eth_overhead; + else + port->dev_conf.rxmode.offloads |= + DEV_RX_OFFLOAD_JUMBO_FRAME; + if (!(port->dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)) port->dev_conf.txmode.offloads &= -- 2.29.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-02-05 11:18:35.740844898 +0000 +++ 0144-app-testpmd-fix-max-Rx-packet-length-for-VLAN-packet.patch 2021-02-05 11:18:29.046695681 +0000 @@ -1 +1 @@ -From 761c4d66900fd7db6927f57eb610f543cc0908e4 Mon Sep 17 00:00:00 2001 +From 613019ac4195ba77942ee7c4af5f1a3eaaef01d2 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 761c4d66900fd7db6927f57eb610f543cc0908e4 ] + @@ -18 +19,0 @@ -Cc: stable@dpdk.org @@ -30 +31 @@ -index 855dbc2dec..89034c8b72 100644 +index 2ccbaa039e..65042fcff5 100644