From patchwork Tue Apr 26 07:45:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tan Tee Min X-Patchwork-Id: 12826591 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B71EDC4332F for ; Tue, 26 Apr 2022 07:38:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344115AbiDZHmC (ORCPT ); Tue, 26 Apr 2022 03:42:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344108AbiDZHl7 (ORCPT ); Tue, 26 Apr 2022 03:41:59 -0400 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39CD71331BC; Tue, 26 Apr 2022 00:38:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1650958733; x=1682494733; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=cK/K2uq2ENY0coZBc+dYKektq/VAXohMS2xxTvJhnWs=; b=hm6NCVZxdqpNk2o8SFiBCiYqdyIGAxcOkc6bGY16eGJs+fbr3PVZheZa 5K75KZvy3hH6DYSU9xhneczfRNsXYSUSFWLxvvyQEWXhws5h1QmNwYXsj Kb9iE2vhW6RVOBeOe9M3OcnORRpV2w8OuxlM65sZXFapBhkjLa3S9MYH4 H2UsIBAXytPBTcF8yLyDqQ6V6RrtZY2ICGjN+rp0NisWL296gW84wV0bh b2xeoy7gb/RunVyR1K1nClaoj2wOH0fCNhF1gKWd0EDfIUpPC/lt/vwMB rE7UzTTIZf7A2vsNfbY/N44+SZsTNN25DWCGoc3ydDzDOvq8agYOMKoc0 w==; X-IronPort-AV: E=McAfee;i="6400,9594,10328"; a="246048447" X-IronPort-AV: E=Sophos;i="5.90,290,1643702400"; d="scan'208";a="246048447" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Apr 2022 00:38:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,290,1643702400"; d="scan'208";a="660537394" Received: from p12hl01tmin.png.intel.com ([10.158.65.175]) by fmsmga002.fm.intel.com with ESMTP; 26 Apr 2022 00:38:46 -0700 From: Tan Tee Min To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S . Miller" , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Michael Sit Wei Hong , Xiaoliang Yang , Wong Vee Khee , Tan Tee Min , Ling Pei Lee , Bhupesh Sharma , Kurt Kanzenbach Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Voon Wei Feng , Song Yoong Siang , Ong@vger.kernel.org, Boon Leong , Tan Tee Min Subject: [PATCH net 1/1] net: stmmac: disable Split Header (SPH) for Intel platforms Date: Tue, 26 Apr 2022 15:45:31 +0800 Message-Id: <20220426074531.4115683-1-tee.min.tan@linux.intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Based on DesignWare Ethernet QoS datasheet, we are seeing the limitation of Split Header (SPH) feature is not supported for Ipv4 fragmented packet. This SPH limitation will cause ping failure when the packets size exceed the MTU size. For example, the issue happens once the basic ping packet size is larger than the configured MTU size and the data is lost inside the fragmented packet, replaced by zeros/corrupted values, and leads to ping fail. So, disable the Split Header for Intel platforms. Cc: # 5.10.x Suggested-by: Ong, Boon Leong Signed-off-by: Mohammad Athari Bin Ismail Signed-off-by: Wong Vee Khee Signed-off-by: Tan Tee Min --- drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c | 1 + drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +- include/linux/stmmac.h | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c index 63754a9c4ba7..0b0be0898ac5 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c @@ -454,6 +454,7 @@ static int intel_mgbe_common_data(struct pci_dev *pdev, plat->has_gmac4 = 1; plat->force_sf_dma_mode = 0; plat->tso_en = 1; + plat->sph_disable = 1; /* Multiplying factor to the clk_eee_i clock time * period to make it closer to 100 ns. This value diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 4a4b3651ab3e..2525a80353b7 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -7021,7 +7021,7 @@ int stmmac_dvr_probe(struct device *device, dev_info(priv->device, "TSO feature enabled\n"); } - if (priv->dma_cap.sphen) { + if (priv->dma_cap.sphen && !priv->plat->sph_disable) { ndev->hw_features |= NETIF_F_GRO; priv->sph_cap = true; priv->sph = priv->sph_cap; diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index 24eea1b05ca2..29917850f079 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -270,5 +270,6 @@ struct plat_stmmacenet_data { int msi_rx_base_vec; int msi_tx_base_vec; bool use_phy_wol; + bool sph_disable; }; #endif