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 C807DA0524 for ; Fri, 5 Feb 2021 12:33:03 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A80D11889A0; Fri, 5 Feb 2021 12:33:03 +0100 (CET) Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) by mails.dpdk.org (Postfix) with ESMTP id 8DFC5188A06 for ; Fri, 5 Feb 2021 12:33:02 +0100 (CET) Received: by mail-wm1-f45.google.com with SMTP id j11so5739651wmi.3 for ; Fri, 05 Feb 2021 03:33:02 -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=6jTyNoAmZ+esZdLu6YWG+7Iyq+wLSePkXy2eWmmAuF4=; b=PY/k9Pz3Da2+VG1SWFeogSL0n4HYqZv/rF2QylGC+JhngqBpgHuH5UdSDr0L0ZVYDT E7z0opFkwWRCoA9sOaPLTNrxWlNdrgzLvkiI2jbqV0xOY+CMsWvymQCgHFdO2pNY760R chZ6Fu4OBkfSlEfa5JhH2Ym8/GY1gQACN8KS4YOok6VgVP/1IoASDwpuDAaXUJxwJznj y3OkSaMrnsHqe6LBUPFItYOgZakv/7eown/wQeJG9Qo06ghWPy2HT13h2uGpNun02USO ZOUCoZHBbrpYQivVD36jDax0ywMgzwecMSMwXpWsj7KnNZTBU2moQsQF40GT41BmJKAF Jw8g== 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=6jTyNoAmZ+esZdLu6YWG+7Iyq+wLSePkXy2eWmmAuF4=; b=nl78I6STdgsghIl+ux0BXU5l8oVgW6w472kdVjBS/9a2sXzlCZoqkVDOtEajQtYmyK HZpvbGxt/RkTuO98YbFLlNI72+WLBvUEywqonmTMq+cMUGSx66LisdVF48Z5+R41c1UD YW9NO7MCn8rcG+ZPgiuI+UvtuLsjhguS2KQGrfao6f1mM1SicHkeRONAuWEtMUrY3XMl Itm+vpbm/utYhLfxyAwo82fIG1ugQ3Tuwls1pt5O0ErzZhANTcbAU5NqOMh/k/EGmEWa q0DbBFgiHF2ofcPMPfBdOJKAfnkZyOhZBo2WozeaP8N/d5ZRI+ctyr5A1oHCDILxGQuG BRhA== X-Gm-Message-State: AOAM531em/IX7Ug9B7Jd8hrkD24nbX+Irt3m43YMSM3L8vCBgQbTwdip HE0fbP8oWIEFSCj5vgga1Lg= X-Google-Smtp-Source: ABdhPJxCDLuDYfzkmzPY4ufbhxsmF2ciEplqc7jLUvSzZZRKr9aNMf1c5E2+05QQR1WDUiZO0bNSUw== X-Received: by 2002:a7b:c1ce:: with SMTP id a14mr3316840wmj.24.1612524782305; Fri, 05 Feb 2021 03:33:02 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id p18sm11989461wrx.84.2021.02.05.03.33.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 03:33:01 -0800 (PST) From: luca.boccassi@gmail.com To: Steve Yang Cc: Jeff Guo , dpdk stable Date: Fri, 5 Feb 2021 11:17:15 +0000 Message-Id: <20210205111920.1272063-149-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 'net/i40e: fix jumbo frame flag condition' 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/e4eafd1fe30bd40ebef6d4392868289b1ff102f1 Thanks. Luca Boccassi --- >From e4eafd1fe30bd40ebef6d4392868289b1ff102f1 Mon Sep 17 00:00:00 2001 From: Steve Yang Date: Mon, 18 Jan 2021 07:04:13 +0000 Subject: [PATCH] net/i40e: fix jumbo frame flag condition [ upstream commit c12f0976cb2e915ab7c93a46310ba826ffb5496b ] The jumbo frame uses the 'RTE_ETHER_MAX_LEN' as boundary condition, but the Ether overhead is larger than 18 when it supports dual VLAN tags. That will cause the jumbo flag rx offload is wrong when MTU size is 'RTE_ETHER_MTU'. This fix will change the boundary condition with 'RTE_ETHER_MTU' and overhead, that perhaps impacts the cases of the jumbo frame related. Fixes: c1715402df8f ("i40evf: fix jumbo frame support") Fixes: 43e5488c0ac6 ("net/i40e: support MTU configuration") Fixes: a778a1fa2e4e ("i40e: set up and initialize flow director") Fixes: c3ac7c5b0b8a ("net/i40e: convert to new Rx offloads API") Signed-off-by: Steve Yang Acked-by: Jeff Guo --- drivers/net/i40e/i40e_ethdev.c | 2 +- drivers/net/i40e/i40e_ethdev.h | 1 + drivers/net/i40e/i40e_ethdev_vf.c | 10 +++++----- drivers/net/i40e/i40e_fdir.c | 2 +- drivers/net/i40e/i40e_rxtx.c | 8 ++++---- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 213fb99ca9..ef4f28fe53 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -11782,7 +11782,7 @@ i40e_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) return -EBUSY; } - if (frame_size > RTE_ETHER_MAX_LEN) + if (frame_size > I40E_ETH_MAX_LEN) dev_data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_JUMBO_FRAME; else diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h index aac226999c..20d051db8b 100644 --- a/drivers/net/i40e/i40e_ethdev.h +++ b/drivers/net/i40e/i40e_ethdev.h @@ -281,6 +281,7 @@ struct rte_flow { */ #define I40E_ETH_OVERHEAD \ (RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN + I40E_VLAN_TAG_SIZE * 2) +#define I40E_ETH_MAX_LEN (RTE_ETHER_MTU + I40E_ETH_OVERHEAD) #define I40E_RXTX_BYTES_H_16_BIT(bytes) ((bytes) & ~I40E_48_BIT_MASK) #define I40E_RXTX_BYTES_L_48_BIT(bytes) ((bytes) & I40E_48_BIT_MASK) diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c index dc076ae552..bca8cb80e4 100644 --- a/drivers/net/i40e/i40e_ethdev_vf.c +++ b/drivers/net/i40e/i40e_ethdev_vf.c @@ -1899,22 +1899,22 @@ i40evf_rxq_init(struct rte_eth_dev *dev, struct i40e_rx_queue *rxq) * Check if the jumbo frame and maximum packet length are set correctly */ if (dev_data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_JUMBO_FRAME) { - if (rxq->max_pkt_len <= RTE_ETHER_MAX_LEN || + if (rxq->max_pkt_len <= I40E_ETH_MAX_LEN || rxq->max_pkt_len > I40E_FRAME_SIZE_MAX) { PMD_DRV_LOG(ERR, "maximum packet length must be " "larger than %u and smaller than %u, as jumbo " - "frame is enabled", (uint32_t)RTE_ETHER_MAX_LEN, + "frame is enabled", (uint32_t)I40E_ETH_MAX_LEN, (uint32_t)I40E_FRAME_SIZE_MAX); return I40E_ERR_CONFIG; } } else { if (rxq->max_pkt_len < RTE_ETHER_MIN_LEN || - rxq->max_pkt_len > RTE_ETHER_MAX_LEN) { + rxq->max_pkt_len > I40E_ETH_MAX_LEN) { PMD_DRV_LOG(ERR, "maximum packet length must be " "larger than %u and smaller than %u, as jumbo " "frame is disabled", (uint32_t)RTE_ETHER_MIN_LEN, - (uint32_t)RTE_ETHER_MAX_LEN); + (uint32_t)I40E_ETH_MAX_LEN); return I40E_ERR_CONFIG; } } @@ -2836,7 +2836,7 @@ i40evf_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) return -EBUSY; } - if (frame_size > RTE_ETHER_MAX_LEN) + if (frame_size > I40E_ETH_MAX_LEN) dev_data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_JUMBO_FRAME; else diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c index 0343e8b09a..f5defcf585 100644 --- a/drivers/net/i40e/i40e_fdir.c +++ b/drivers/net/i40e/i40e_fdir.c @@ -116,7 +116,7 @@ i40e_fdir_rx_queue_init(struct i40e_rx_queue *rxq) #endif rx_ctx.dtype = i40e_header_split_none; rx_ctx.hsplit_0 = I40E_HEADER_SPLIT_NONE; - rx_ctx.rxmax = RTE_ETHER_MAX_LEN; + rx_ctx.rxmax = I40E_ETH_MAX_LEN; rx_ctx.tphrdesc_ena = 1; rx_ctx.tphwdesc_ena = 1; rx_ctx.tphdata_ena = 1; diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c index 5df9a9df56..b8859bbff2 100644 --- a/drivers/net/i40e/i40e_rxtx.c +++ b/drivers/net/i40e/i40e_rxtx.c @@ -2797,23 +2797,23 @@ i40e_rx_queue_config(struct i40e_rx_queue *rxq) RTE_MIN((uint32_t)(hw->func_caps.rx_buf_chain_len * rxq->rx_buf_len), data->dev_conf.rxmode.max_rx_pkt_len); if (data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_JUMBO_FRAME) { - if (rxq->max_pkt_len <= RTE_ETHER_MAX_LEN || + if (rxq->max_pkt_len <= I40E_ETH_MAX_LEN || rxq->max_pkt_len > I40E_FRAME_SIZE_MAX) { PMD_DRV_LOG(ERR, "maximum packet length must " "be larger than %u and smaller than %u," "as jumbo frame is enabled", - (uint32_t)RTE_ETHER_MAX_LEN, + (uint32_t)I40E_ETH_MAX_LEN, (uint32_t)I40E_FRAME_SIZE_MAX); return I40E_ERR_CONFIG; } } else { if (rxq->max_pkt_len < RTE_ETHER_MIN_LEN || - rxq->max_pkt_len > RTE_ETHER_MAX_LEN) { + rxq->max_pkt_len > I40E_ETH_MAX_LEN) { PMD_DRV_LOG(ERR, "maximum packet length must be " "larger than %u and smaller than %u, " "as jumbo frame is disabled", (uint32_t)RTE_ETHER_MIN_LEN, - (uint32_t)RTE_ETHER_MAX_LEN); + (uint32_t)I40E_ETH_MAX_LEN); return I40E_ERR_CONFIG; } } -- 2.29.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-02-05 11:18:35.983420719 +0000 +++ 0149-net-i40e-fix-jumbo-frame-flag-condition.patch 2021-02-05 11:18:29.074696214 +0000 @@ -1 +1 @@ -From c12f0976cb2e915ab7c93a46310ba826ffb5496b Mon Sep 17 00:00:00 2001 +From e4eafd1fe30bd40ebef6d4392868289b1ff102f1 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit c12f0976cb2e915ab7c93a46310ba826ffb5496b ] + @@ -18 +19,0 @@ -Cc: stable@dpdk.org @@ -31 +32 @@ -index 42987c5dab..946994b80a 100644 +index 213fb99ca9..ef4f28fe53 100644 @@ -34 +35 @@ -@@ -11687,7 +11687,7 @@ i40e_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) +@@ -11782,7 +11782,7 @@ i40e_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) @@ -44 +45 @@ -index cd484710b0..1e8f5d3a87 100644 +index aac226999c..20d051db8b 100644 @@ -47 +48 @@ -@@ -283,6 +283,7 @@ struct rte_flow { +@@ -281,6 +281,7 @@ struct rte_flow { @@ -56 +57 @@ -index 346ec29cbe..5d7db7fe13 100644 +index dc076ae552..bca8cb80e4 100644 @@ -59 +60 @@ -@@ -1900,22 +1900,22 @@ i40evf_rxq_init(struct rte_eth_dev *dev, struct i40e_rx_queue *rxq) +@@ -1899,22 +1899,22 @@ i40evf_rxq_init(struct rte_eth_dev *dev, struct i40e_rx_queue *rxq) @@ -86 +87 @@ -@@ -2837,7 +2837,7 @@ i40evf_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) +@@ -2836,7 +2836,7 @@ i40evf_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) @@ -109 +110 @@ -index 3574867685..1ae62d4334 100644 +index 5df9a9df56..b8859bbff2 100644 @@ -112 +113 @@ -@@ -2845,23 +2845,23 @@ i40e_rx_queue_config(struct i40e_rx_queue *rxq) +@@ -2797,23 +2797,23 @@ i40e_rx_queue_config(struct i40e_rx_queue *rxq)