From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id E3576A00E6 for ; Tue, 16 Apr 2019 16:38:13 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D77FA1B4EA; Tue, 16 Apr 2019 16:38:13 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 57B2D1B4F8 for ; Tue, 16 Apr 2019 16:38:12 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BF9AC8046D; Tue, 16 Apr 2019 14:38:11 +0000 (UTC) Received: from rh.redhat.com (ovpn-117-214.ams2.redhat.com [10.36.117.214]) by smtp.corp.redhat.com (Postfix) with ESMTP id B64031001E92; Tue, 16 Apr 2019 14:38:10 +0000 (UTC) From: Kevin Traynor To: Hyong Youb Kim Cc: John Daley , dpdk stable Date: Tue, 16 Apr 2019 15:36:45 +0100 Message-Id: <20190416143719.21601-27-ktraynor@redhat.com> In-Reply-To: <20190416143719.21601-1-ktraynor@redhat.com> References: <20190416143719.21601-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 16 Apr 2019 14:38:11 +0000 (UTC) Subject: [dpdk-stable] patch 'net/enic: fix max MTU calculation' has been queued to LTS release 18.11.2 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 LTS release 18.11.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 04/24/19. 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. Thanks. Kevin Traynor --- >From 55d63bf043aa4a1f1167759f28d3c65819b1021f Mon Sep 17 00:00:00 2001 From: Hyong Youb Kim Date: Thu, 14 Mar 2019 04:05:32 -0700 Subject: [PATCH] net/enic: fix max MTU calculation [ upstream commit c09eb9352978fc0344e1865a1857e6e1c9cf266f ] The maximum packet length (max_pkt_len) from the firmware does not include CRC, so do not subtract 4 when deriving the max MTU. This change effectively increases the max MTU by 4B. Apps often assume max MTU = max_rx_pkt_len - 14 (ethernet header), and attempt to set the MTU to that value (i.e. set MTU to max HW value). This change incidentally allows such apps to change MTU to max value successfully. Fixes: bb34ffb848a0 ("net/enic: determine max egress packet size and max MTU") Signed-off-by: Hyong Youb Kim Reviewed-by: John Daley --- drivers/net/enic/enic.h | 4 ++-- drivers/net/enic/enic_res.c | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/net/enic/enic.h b/drivers/net/enic/enic.h index e57f90985..377f607f7 100644 --- a/drivers/net/enic/enic.h +++ b/drivers/net/enic/enic.h @@ -202,6 +202,6 @@ struct enic { static inline uint32_t enic_mtu_to_max_rx_pktlen(uint32_t mtu) { - /* ethdev max size includes eth and crc whereas NIC MTU does not */ - return mtu + ETHER_HDR_LEN + ETHER_CRC_LEN; + /* ethdev max size includes eth whereas NIC MTU does not */ + return mtu + ETHER_HDR_LEN; } diff --git a/drivers/net/enic/enic_res.c b/drivers/net/enic/enic_res.c index 24b2844f3..78bb6b8f1 100644 --- a/drivers/net/enic/enic_res.c +++ b/drivers/net/enic/enic_res.c @@ -62,8 +62,7 @@ int enic_get_vnic_config(struct enic *enic) */ if (c->max_pkt_size > ENIC_DEFAULT_RX_MAX_PKT_SIZE) - enic->max_mtu = c->max_pkt_size - (ETHER_HDR_LEN + 4); + enic->max_mtu = c->max_pkt_size - ETHER_HDR_LEN; else - enic->max_mtu = ENIC_DEFAULT_RX_MAX_PKT_SIZE - - (ETHER_HDR_LEN + 4); + enic->max_mtu = ENIC_DEFAULT_RX_MAX_PKT_SIZE - ETHER_HDR_LEN; if (c->mtu == 0) c->mtu = 1500; -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2019-04-16 15:34:26.404177841 +0100 +++ 0027-net-enic-fix-max-MTU-calculation.patch 2019-04-16 15:34:25.172180127 +0100 @@ -1,8 +1,10 @@ -From c09eb9352978fc0344e1865a1857e6e1c9cf266f Mon Sep 17 00:00:00 2001 +From 55d63bf043aa4a1f1167759f28d3c65819b1021f Mon Sep 17 00:00:00 2001 From: Hyong Youb Kim Date: Thu, 14 Mar 2019 04:05:32 -0700 Subject: [PATCH] net/enic: fix max MTU calculation +[ upstream commit c09eb9352978fc0344e1865a1857e6e1c9cf266f ] + The maximum packet length (max_pkt_len) from the firmware does not include CRC, so do not subtract 4 when deriving the max MTU. This change effectively increases the max MTU by 4B. Apps often assume max @@ -11,7 +13,6 @@ incidentally allows such apps to change MTU to max value successfully. Fixes: bb34ffb848a0 ("net/enic: determine max egress packet size and max MTU") -Cc: stable@dpdk.org Signed-off-by: Hyong Youb Kim Reviewed-by: John Daley @@ -21,10 +22,10 @@ 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/net/enic/enic.h b/drivers/net/enic/enic.h -index fa4d5590e..9193fb038 100644 +index e57f90985..377f607f7 100644 --- a/drivers/net/enic/enic.h +++ b/drivers/net/enic/enic.h -@@ -204,6 +204,6 @@ struct enic { +@@ -202,6 +202,6 @@ struct enic { static inline uint32_t enic_mtu_to_max_rx_pktlen(uint32_t mtu) { - /* ethdev max size includes eth and crc whereas NIC MTU does not */ @@ -34,7 +35,7 @@ } diff --git a/drivers/net/enic/enic_res.c b/drivers/net/enic/enic_res.c -index d289f3da8..f7cbc90fb 100644 +index 24b2844f3..78bb6b8f1 100644 --- a/drivers/net/enic/enic_res.c +++ b/drivers/net/enic/enic_res.c @@ -62,8 +62,7 @@ int enic_get_vnic_config(struct enic *enic)