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 8F6E0A0524 for ; Fri, 5 Feb 2021 12:34:37 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 559AF188A12; Fri, 5 Feb 2021 12:34:37 +0100 (CET) Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) by mails.dpdk.org (Postfix) with ESMTP id 2203540682 for ; Fri, 5 Feb 2021 12:34:36 +0100 (CET) Received: by mail-wr1-f41.google.com with SMTP id m13so7273402wro.12 for ; Fri, 05 Feb 2021 03:34:36 -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=QxJeb3lqDWdHHK5NiL0Y4dOQk/82czV/cvSYgDdq7vs=; b=srhjlMpRakdRVkCeXYuC4Eu0NbV1j5TFk+Ejy1kAJET4esPgTL/cd048upkTw5bQ7W tGcMPh+eRE7Q38C8xQtF1Gcn4QUSJ6/edfnbEHwWKX26r3s0K57HZ1OteQF+trZUMnLQ B/G3P+V2wgRAheKiOs8YEFGhocxrbxXDWZ1YaxKB/BziIN4vWaFFecGa/hTGIcfUk5nJ VB8o7Xgzc/Pj29SZZaUzyN/yLGMeMEEinv3y1Gi1z6UZr10Eg05Nt1iwPG2Nmnv9EuSu Jwfso42HcNuoPzL7sh4BEaU/yKu6jO3D20R9R8VyR+mNnf7/pBrikOEvbKvtUzloSsv/ dPQg== 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=QxJeb3lqDWdHHK5NiL0Y4dOQk/82czV/cvSYgDdq7vs=; b=sEa6dZiT9WaAiellu9LRC7thko3pvfle/ovgKrsARdxeMfrfS+Se4coEJZH2uYUPkg zhHmjHsmUNCktX/TPvLd9lbDCeEq1I9rQt39wpDaOv5DUnFbD6BQiZdYGz+p/pgPV0Yg BafpgUNX4U2grP/jUpyB3H/rijHoHvAkyb7D3A3PDX00dbgFbZoEJBHLf3Gs4jy19Bfd rtXaBoAy72rWNBVgO1erJmOenOLV5Pc+b56C1OXZ5RmqxmXgb4GxaZJOMaMtntjw20y8 dqJhvUxUN6FKqdLR/wodZQ2ObZQqtPnFuTCtxhOtLjzR4IoFuQm0sgmeK6kSZyk6ff3Y zFeg== X-Gm-Message-State: AOAM531PVrLx2UOd7gIXhNTnhU4W3F7uEoMXNTJOvxRUbcdNkNSWqBPt wXg+932t+I5WKpmPOqoSGAXFEL9PViJzkOj/ X-Google-Smtp-Source: ABdhPJyJRjvKlp+suna9zQpcuGSW0IK+3Wb97mNhQPXlufWAk+tx+B7pBa0qLpzQQgvkS2a5JEV0ug== X-Received: by 2002:a5d:5384:: with SMTP id d4mr4356658wrv.177.1612524875804; Fri, 05 Feb 2021 03:34:35 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id c62sm8299519wme.16.2021.02.05.03.34.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 03:34:35 -0800 (PST) From: luca.boccassi@gmail.com To: Alvin Zhang Cc: Jeff Guo , dpdk stable Date: Fri, 5 Feb 2021 11:17:42 +0000 Message-Id: <20210205111920.1272063-176-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/ixgbe: fix configuration of max frame size' 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/9129f6275b6f856e064624d71fbba76ea57e4530 Thanks. Luca Boccassi --- >From 9129f6275b6f856e064624d71fbba76ea57e4530 Mon Sep 17 00:00:00 2001 From: Alvin Zhang Date: Tue, 19 Jan 2021 13:25:51 +0800 Subject: [PATCH] net/ixgbe: fix configuration of max frame size [ upstream commit 15cfb0bfc4968e8a9da49c07ee2e57c9cd947473 ] For some types of NIC, jumbo frame is not supported in IOV mode, so if a VF requests to configure the frame size to not bigger than IXGBE_ETH_MAX_LEN, the kernel driver returns 0, but the DPDK ixgbe PMD returns -1, this will cause the VF to fail to start when the PF driven by DPDK ixgbe PMD. This patch keeps ixgbe PMD's handling mode consistent with kernel driver in above situation. In addition, the value set by the command IXGBE_VF_SET_LPE represents the max frame size, not the mtu. Fixes: 1b9ea09c067b ("ixgbe: support X550") Fixes: 95a27b3ba5f5 ("net/ixgbe: enable jumbo frame for VF") Signed-off-by: Alvin Zhang Acked-by: Jeff Guo --- drivers/net/ixgbe/ixgbe_pf.c | 43 +++++++++++++++++++++++++++++------- 1 file changed, 35 insertions(+), 8 deletions(-) diff --git a/drivers/net/ixgbe/ixgbe_pf.c b/drivers/net/ixgbe/ixgbe_pf.c index 89698e8470..15982af8da 100644 --- a/drivers/net/ixgbe/ixgbe_pf.c +++ b/drivers/net/ixgbe/ixgbe_pf.c @@ -552,20 +552,47 @@ ixgbe_vf_set_vlan(struct rte_eth_dev *dev, uint32_t vf, uint32_t *msgbuf) } static int -ixgbe_set_vf_lpe(struct rte_eth_dev *dev, __rte_unused uint32_t vf, uint32_t *msgbuf) +ixgbe_set_vf_lpe(struct rte_eth_dev *dev, uint32_t vf, uint32_t *msgbuf) { struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); - uint32_t new_mtu = msgbuf[1]; + uint32_t max_frame = msgbuf[1]; uint32_t max_frs; uint32_t hlreg0; - int max_frame = new_mtu + RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN; /* X540 and X550 support jumbo frames in IOV mode */ if (hw->mac.type != ixgbe_mac_X540 && hw->mac.type != ixgbe_mac_X550 && hw->mac.type != ixgbe_mac_X550EM_x && - hw->mac.type != ixgbe_mac_X550EM_a) - return -1; + hw->mac.type != ixgbe_mac_X550EM_a) { + struct ixgbe_vf_info *vfinfo = + *IXGBE_DEV_PRIVATE_TO_P_VFDATA(dev->data->dev_private); + + switch (vfinfo[vf].api_version) { + case ixgbe_mbox_api_11: + case ixgbe_mbox_api_12: + case ixgbe_mbox_api_13: + /** + * Version 1.1&1.2&1.3 supports jumbo frames on VFs + * if PF has jumbo frames enabled which means legacy + * VFs are disabled. + */ + if (dev->data->dev_conf.rxmode.max_rx_pkt_len > + IXGBE_ETH_MAX_LEN) + break; + /* fall through */ + default: + /** + * If the PF or VF are running w/ jumbo frames enabled, + * we return -1 as we cannot support jumbo frames on + * legacy VFs. + */ + if (max_frame > IXGBE_ETH_MAX_LEN || + dev->data->dev_conf.rxmode.max_rx_pkt_len > + IXGBE_ETH_MAX_LEN) + return -1; + break; + } + } if (max_frame < RTE_ETHER_MIN_LEN || max_frame > RTE_ETHER_MAX_JUMBO_FRAME_LEN) @@ -573,9 +600,9 @@ ixgbe_set_vf_lpe(struct rte_eth_dev *dev, __rte_unused uint32_t vf, uint32_t *ms max_frs = (IXGBE_READ_REG(hw, IXGBE_MAXFRS) & IXGBE_MHADD_MFS_MASK) >> IXGBE_MHADD_MFS_SHIFT; - if (max_frs < new_mtu) { + if (max_frs < max_frame) { hlreg0 = IXGBE_READ_REG(hw, IXGBE_HLREG0); - if (new_mtu > IXGBE_ETH_MAX_LEN) { + if (max_frame > IXGBE_ETH_MAX_LEN) { dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_JUMBO_FRAME; hlreg0 |= IXGBE_HLREG0_JUMBOEN; @@ -586,7 +613,7 @@ ixgbe_set_vf_lpe(struct rte_eth_dev *dev, __rte_unused uint32_t vf, uint32_t *ms } IXGBE_WRITE_REG(hw, IXGBE_HLREG0, hlreg0); - max_frs = new_mtu << IXGBE_MHADD_MFS_SHIFT; + max_frs = max_frame << IXGBE_MHADD_MFS_SHIFT; IXGBE_WRITE_REG(hw, IXGBE_MAXFRS, max_frs); } -- 2.29.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-02-05 11:18:37.114438259 +0000 +++ 0176-net-ixgbe-fix-configuration-of-max-frame-size.patch 2021-02-05 11:18:29.138697432 +0000 @@ -1 +1 @@ -From 15cfb0bfc4968e8a9da49c07ee2e57c9cd947473 Mon Sep 17 00:00:00 2001 +From 9129f6275b6f856e064624d71fbba76ea57e4530 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 15cfb0bfc4968e8a9da49c07ee2e57c9cd947473 ] + @@ -20 +21,0 @@ -Cc: stable@dpdk.org