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 900BCA0C47 for ; Mon, 26 Jul 2021 15:55:52 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8567F410EC; Mon, 26 Jul 2021 15:55:52 +0200 (CEST) Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) by mails.dpdk.org (Postfix) with ESMTP id 647EE40DDA for ; Mon, 26 Jul 2021 15:55:51 +0200 (CEST) Received: by mail-wm1-f41.google.com with SMTP id u15-20020a05600c19cfb02902501bdb23cdso3364056wmq.0 for ; Mon, 26 Jul 2021 06:55:51 -0700 (PDT) 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=LUTBJ0RkKPI1hb1X5mYF6Of68NaT6CU9AGN/fJs1M7M=; b=DKZ9smVC0HzaLYjWGBV4KU5f5Iy42i7HeLF3SbDk3l/ckE5gpJaYNo5JTxAv5uXBD6 fRlX5nzeCFHfAhnu1sOAboWm/JtLPHCzoCvD+mtN1V8SgUcY6q0ZmPz+z6zxXzBZVt/5 S/FOm6+atFc6FN/4bFFBwV8iQZwxITnGLWhcaa7tpM+WwyeIbSC9hp9jLp73mQ+RrdTT HmRuBWoUWT/65Lmgb6su7xPQE+/ZnRyrrzB/EhpBDm1KctlqmgCa4+osLmia1qLawd0b RZl1IEB9AEgGU0IuQ+58c2HIPueTc0F8ZuyomaEatXQCkSaVMfTnoOOkywWcdELVy2zF ZcDw== 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=LUTBJ0RkKPI1hb1X5mYF6Of68NaT6CU9AGN/fJs1M7M=; b=JsMSu6EdVn9fQSTIif2vjhs1p62PvGRAe6ZogNvlcK4k0ahIcjCMwtimnh1mMlDHq4 fe/kXmz4ZCqqnwLLl/mIR6mjKWiv8dDxIyZSpIIkS58cUoqK0IolnGbAjYJP2+v2Yi+Q sUqzG5qWc2pnvIYtL5pH+9lcI/SW5T2sOSBpAK6YJN9BPRXFvW+oBAWGaVVABiZHACY+ TQmo/dwuWBaNVg+OM/DeSMGOZ1dmEc21oRkzyyV0wxD8qLHm81Qr98YErGXYFSdNVgSb qnpKMHX8ACNspOoXFw5JNtiTjF0eHsNLcprIZq1no4PIfxUA4hnOmsaQB3CUAp+27U1M Wbmg== X-Gm-Message-State: AOAM532ek7lyfCBRZSDoOqMwsO6uPrQwFTsnU/sDwyXqtPAjRSgd6pd1 DAlbUIS0eKkCGCnHcvlsxI4= X-Google-Smtp-Source: ABdhPJxY/ONesrM+g3Vn/HY88S2puJlfwnmx5q9owlfmvi7/NUXnMjeGrBKG9uiKeRMp6iJ1rwk0pw== X-Received: by 2002:a7b:c150:: with SMTP id z16mr26840011wmi.104.1627307751148; Mon, 26 Jul 2021 06:55:51 -0700 (PDT) Received: from localhost ([137.220.125.106]) by smtp.gmail.com with ESMTPSA id n5sm41325917wri.31.2021.07.26.06.55.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jul 2021 06:55:50 -0700 (PDT) From: luca.boccassi@gmail.com To: Guoyang Zhou Cc: dpdk stable Date: Mon, 26 Jul 2021 14:53:10 +0100 Message-Id: <20210726135322.149850-47-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210726135322.149850-1-luca.boccassi@gmail.com> References: <20210712130551.2462159-1-luca.boccassi@gmail.com> <20210726135322.149850-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/hinic: fix MTU consistency with firmware' has been queued to stable release 20.11.3 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.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/28/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/f91f60bb479060ca3683744d16cd053374b0e9a8 Thanks. Luca Boccassi --- >From f91f60bb479060ca3683744d16cd053374b0e9a8 Mon Sep 17 00:00:00 2001 From: Guoyang Zhou Date: Fri, 16 Jul 2021 17:54:30 +0800 Subject: [PATCH] net/hinic: fix MTU consistency with firmware [ upstream commit 3596d7b607831205048efcf818e451526f6c9598 ] The configuration of MTU is inconsistent in the driver and firmware when the port is stopped, started and reconfigured. Before, HINIC_MAX_JUMBO_FRAME_SIZE include VLAN tag, but when frame and pktlen are converted to each other do not include VLAN tag. And port_mtu_set function will use HINIC_MAX_JUMBO_FRAME_SIZE to calculate eth_overhead, so MTU will be inconsistent in the driver and firmware. Fixes: e542ab51ab27 ("net/hinic: fix jumbo frame flag condition for MTU set") Signed-off-by: Guoyang Zhou --- drivers/net/hinic/base/hinic_pmd_niccfg.h | 9 --------- drivers/net/hinic/hinic_pmd_ethdev.c | 9 --------- drivers/net/hinic/hinic_pmd_ethdev.h | 17 +++++++++++++++++ 3 files changed, 17 insertions(+), 18 deletions(-) diff --git a/drivers/net/hinic/base/hinic_pmd_niccfg.h b/drivers/net/hinic/base/hinic_pmd_niccfg.h index 04cd374ca6..0d0a6700d4 100644 --- a/drivers/net/hinic/base/hinic_pmd_niccfg.h +++ b/drivers/net/hinic/base/hinic_pmd_niccfg.h @@ -116,15 +116,6 @@ enum hinic_link_mode { #define HINIC_DEFAULT_RX_MODE (HINIC_RX_MODE_UC | HINIC_RX_MODE_MC | \ HINIC_RX_MODE_BC) -#define HINIC_MAX_MTU_SIZE (9600) -#define HINIC_MIN_MTU_SIZE (256) - -/* MIN_MTU + ETH_HLEN + CRC (256+14+4) */ -#define HINIC_MIN_FRAME_SIZE 274 - -/* MAX_MTU + ETH_HLEN + CRC + VLAN(9600+14+4+4) */ -#define HINIC_MAX_JUMBO_FRAME_SIZE (9622) - #define HINIC_PORT_DISABLE 0x0 #define HINIC_PORT_ENABLE 0x3 diff --git a/drivers/net/hinic/hinic_pmd_ethdev.c b/drivers/net/hinic/hinic_pmd_ethdev.c index 369d5003cd..1a43597249 100644 --- a/drivers/net/hinic/hinic_pmd_ethdev.c +++ b/drivers/net/hinic/hinic_pmd_ethdev.c @@ -69,15 +69,6 @@ #define HINIC_VLAN_FILTER_EN (1U << 0) -#define HINIC_MTU_TO_PKTLEN(mtu) \ - ((mtu) + ETH_HLEN + ETH_CRC_LEN) - -#define HINIC_PKTLEN_TO_MTU(pktlen) \ - ((pktlen) - (ETH_HLEN + ETH_CRC_LEN)) - -/* The max frame size with default MTU */ -#define HINIC_ETH_MAX_LEN (RTE_ETHER_MTU + ETH_HLEN + ETH_CRC_LEN) - /* lro numer limit for one packet */ #define HINIC_LRO_WQE_NUM_DEFAULT 8 diff --git a/drivers/net/hinic/hinic_pmd_ethdev.h b/drivers/net/hinic/hinic_pmd_ethdev.h index c7338d83be..fafccb90db 100644 --- a/drivers/net/hinic/hinic_pmd_ethdev.h +++ b/drivers/net/hinic/hinic_pmd_ethdev.h @@ -32,6 +32,23 @@ #define HINIC_UINT32_BIT_SIZE (CHAR_BIT * sizeof(uint32_t)) #define HINIC_VFTA_SIZE (4096 / HINIC_UINT32_BIT_SIZE) +#define HINIC_MAX_MTU_SIZE 9600 +#define HINIC_MIN_MTU_SIZE 256 + +#define HINIC_VLAN_TAG_SIZE 4 +#define HINIC_ETH_OVERHEAD \ + (RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN + HINIC_VLAN_TAG_SIZE * 2) + +#define HINIC_MIN_FRAME_SIZE (HINIC_MIN_MTU_SIZE + HINIC_ETH_OVERHEAD) +#define HINIC_MAX_JUMBO_FRAME_SIZE (HINIC_MAX_MTU_SIZE + HINIC_ETH_OVERHEAD) + +#define HINIC_MTU_TO_PKTLEN(mtu) ((mtu) + HINIC_ETH_OVERHEAD) + +#define HINIC_PKTLEN_TO_MTU(pktlen) ((pktlen) - HINIC_ETH_OVERHEAD) + +/* The max frame size with default MTU */ +#define HINIC_ETH_MAX_LEN (RTE_ETHER_MTU + HINIC_ETH_OVERHEAD) + enum hinic_dev_status { HINIC_DEV_INIT, HINIC_DEV_CLOSE, -- 2.30.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-07-26 13:53:18.514049745 +0100 +++ 0047-net-hinic-fix-MTU-consistency-with-firmware.patch 2021-07-26 13:53:15.945294641 +0100 @@ -1 +1 @@ -From 3596d7b607831205048efcf818e451526f6c9598 Mon Sep 17 00:00:00 2001 +From f91f60bb479060ca3683744d16cd053374b0e9a8 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 3596d7b607831205048efcf818e451526f6c9598 ] + @@ -15 +16,0 @@ -Cc: stable@dpdk.org @@ -45 +46 @@ -index 75849f28be..1a72401546 100644 +index 369d5003cd..1a43597249 100644 @@ -65 +66 @@ -index 70b4d32ff2..8f1b3d5888 100644 +index c7338d83be..fafccb90db 100644