Received: by 10.223.176.5 with SMTP id f5csp779224wra; Sat, 3 Feb 2018 10:05:14 -0800 (PST) X-Google-Smtp-Source: AH8x224PgFaIfwTfa63aeohnyyUEpUO7Z3sAY8S1d/oIM9oJUMm1nEUIh53aQoX2kLb3rJf805ci X-Received: by 10.98.87.2 with SMTP id l2mr43030934pfb.46.1517681114186; Sat, 03 Feb 2018 10:05:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517681114; cv=none; d=google.com; s=arc-20160816; b=Ysyp831E0VbZV1TjT0Qd9LWVmWGKnKQibcTyRtHz1iPm3/hnKerkOneThoLayk4Sgh xtF+XibPB3KAnjThKaZCiOTFlZ0w/mJMCCkz1vjMJzCYumjS8b9dES/wG7HQ+Yp47uWe 1OXvnEE4mHKS7aXRXfCS64bwEBjYr4VSHYGpEY7Ubvk7kFwvPngfDFskRHNNt+mJaR74 8kK77VDWpw279b7k9qoH1LpWpQoqS2vrUrlFSQxeGmi/MHYrjsAraSFxvaGidihvKT3X 1tTn00YA1hbd+cyXIMtJmgit57KBAijQh9x4KhPoMM51LPf6kQE153sMDXBGXu1wftIb QgbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=SecAV7m7CekgFyttKgSwNXQT4AdRxODyPorGYF4fcG8=; b=v/DgFosHtF6brgy002VIlNSdxZ6R0QupRjvVqfG1LzEpAu9LkVGt75LtacIgw3Kydc 38MtNUFWVx/+FTfPbMo171YXCwi1Sznnt6wbGAL4E09HHqF1bkDYIj9QdFz3wpEHPux/ jeu5M+EyTij6p71zvm6CPUZr3i9E8W42RkMoeT+jtsTdg0C0dAHh9D2CA887AZTcwBEq ROJaINlfzXEldPg/MGsWKtbO5VxRY6HQBPabkZBh6yUb+BFcCCBclHsLvqvZtynDlOp8 r0fA3GeNFGXLSlry2uOGTTmL8+Zuob3RwwLAZmIbglahQJENwzhQZXYFQSENlSg/gDpY umyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=Rhqle2Ss; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e12-v6si4073231pls.381.2018.02.03.10.04.59; Sat, 03 Feb 2018 10:05:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=Rhqle2Ss; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753289AbeBCSEC (ORCPT + 99 others); Sat, 3 Feb 2018 13:04:02 -0500 Received: from mail-co1nam03on0122.outbound.protection.outlook.com ([104.47.40.122]:24267 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752817AbeBCSA5 (ORCPT ); Sat, 3 Feb 2018 13:00:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=SecAV7m7CekgFyttKgSwNXQT4AdRxODyPorGYF4fcG8=; b=Rhqle2Ssy6/0Yggjh8IlQ8TwG9uwdHnQ8R6EYD4QJjsFfm2RbOJND6UReHZ7VOGMQfXnXA88LVAcGysu/U+vus1lxQ7uM6TNzDhgtlQwFu5S40amRmOqOBKzCvegGJKuUs3V48zYpmIYJnfLuJWsIeHn3gkoDuxRi4JdJRo1uOs= Received: from BL0PR2101MB1027.namprd21.prod.outlook.com (52.132.20.161) by BL0PR2101MB1043.namprd21.prod.outlook.com (52.132.24.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.506.3; Sat, 3 Feb 2018 18:00:33 +0000 Received: from BL0PR2101MB1027.namprd21.prod.outlook.com ([fe80::a8da:b5d9:d710:9bf9]) by BL0PR2101MB1027.namprd21.prod.outlook.com ([fe80::a8da:b5d9:d710:9bf9%3]) with mapi id 15.20.0485.006; Sat, 3 Feb 2018 18:00:33 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Igor Russkikh , Pavel Belous , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL for 4.14 011/110] net: aquantia: Fix hardware DMA stream overload on large MRRS Thread-Topic: [PATCH AUTOSEL for 4.14 011/110] net: aquantia: Fix hardware DMA stream overload on large MRRS Thread-Index: AQHTnRjhg/BwjHUIsUGY0+ZjKUhQwA== Date: Sat, 3 Feb 2018 18:00:31 +0000 Message-ID: <20180203180015.29073-11-alexander.levin@microsoft.com> References: <20180203180015.29073-1-alexander.levin@microsoft.com> In-Reply-To: <20180203180015.29073-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BL0PR2101MB1043;7:a41RSPfp7ghC8s7boOCXUoqN7cYl1ZkFBlJVnw8hBwZYsVOLOSED3VvrtvgCNQBt6XU9s3iRMuh5huGv1Ajrdj66X4mBbTIEH7lKpQarGSRFArPiApXbVZaPMKPYS254svq7zgn6ZT6xCWsWhsldBPzzrWGpT7oaFPDzeGjeyZBJKb+0DaqIslkWcqvtRc8DDG+CKJ3894UbJT5LnjA2HZg+xVHUmm/3XuRlSEl2K3K6O3tY0leU8F71/UUjFyVF x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: fe336544-a367-4cea-6211-08d56b300593 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(3008032)(2017052603307)(7193020);SRVR:BL0PR2101MB1043; x-ms-traffictypediagnostic: BL0PR2101MB1043: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(61425038)(6040501)(2401047)(5005006)(8121501046)(3231101)(2400082)(944501161)(93006095)(93001095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041288)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123562045)(20161123564045)(6072148)(201708071742011);SRVR:BL0PR2101MB1043;BCL:0;PCL:0;RULEID:;SRVR:BL0PR2101MB1043; x-forefront-prvs: 05724A8921 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(979002)(39380400002)(376002)(39860400002)(366004)(346002)(396003)(189003)(199004)(59450400001)(10290500003)(186003)(6486002)(14454004)(1076002)(102836004)(6506007)(76176011)(26005)(6346003)(66066001)(10090500001)(8666007)(5250100002)(36756003)(6512007)(2501003)(110136005)(99286004)(54906003)(478600001)(551934003)(53936002)(72206003)(6436002)(316002)(305945005)(7736002)(2950100002)(2906002)(5660300001)(4326008)(106356001)(575784001)(86362001)(97736004)(25786009)(22452003)(2900100001)(3846002)(107886003)(8676002)(8936002)(6116002)(3280700002)(105586002)(81156014)(81166006)(3660700001)(86612001)(68736007)(22906009)(217873001)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1102;SCL:1;SRVR:BL0PR2101MB1043;H:BL0PR2101MB1027.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-message-info: BKTE99ZIesXBKRxL2x+kHWIqv5ENSQXnbTcIQLNt88tGUpBb/7WCHF2GuzmZ+JaRlUiR+nf7yYyeKPN0qwOKPg== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: fe336544-a367-4cea-6211-08d56b300593 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Feb 2018 18:00:31.5815 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR2101MB1043 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Igor Russkikh [ Upstream commit 1e366161510f266516107a69db91f1f2edaea11c ] Systems with large MRRS on device (2K, 4K) with high data rates and/or large MTU, atlantic observes DMA packet buffer overflow. On some systems that causes PCIe transaction errors, hardware NMIs or datapath freeze. This patch 1) Limits MRRS from device side to 2K (thats maximum our hardware supports) 2) Limit maximum size of outstanding TX DMA data read requests. This makes hardware buffers running fine. Signed-off-by: Pavel Belous Signed-off-by: Igor Russkikh Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c | 12 ++++++++= ++++ .../ethernet/aquantia/atlantic/hw_atl/hw_atl_llh_internal.h | 6 ++++++ 2 files changed, 18 insertions(+) diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c b/dr= ivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c index e4e3b8e2d67e..36fddb199160 100644 --- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c +++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c @@ -16,6 +16,7 @@ #include "hw_atl_utils.h" #include "hw_atl_llh.h" #include "hw_atl_b0_internal.h" +#include "hw_atl_llh_internal.h" =20 static int hw_atl_b0_get_hw_caps(struct aq_hw_s *self, struct aq_hw_caps_s *aq_hw_caps, @@ -368,6 +369,7 @@ static int hw_atl_b0_hw_init(struct aq_hw_s *self, }; =20 int err =3D 0; + u32 val; =20 self->aq_nic_cfg =3D aq_nic_cfg; =20 @@ -385,6 +387,16 @@ static int hw_atl_b0_hw_init(struct aq_hw_s *self, hw_atl_b0_hw_rss_set(self, &aq_nic_cfg->aq_rss); hw_atl_b0_hw_rss_hash_set(self, &aq_nic_cfg->aq_rss); =20 + /* Force limit MRRS on RDM/TDM to 2K */ + val =3D aq_hw_read_reg(self, pci_reg_control6_adr); + aq_hw_write_reg(self, pci_reg_control6_adr, (val & ~0x707) | 0x404); + + /* TX DMA total request limit. B0 hardware is not capable to + * handle more than (8K-MRRS) incoming DMA data. + * Value 24 in 256byte units + */ + aq_hw_write_reg(self, tx_dma_total_req_limit_adr, 24); + err =3D aq_hw_err_from_flags(self); if (err < 0) goto err_exit; diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh_inter= nal.h b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh_internal.h index 5527fc0e5942..93450ec930e8 100644 --- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh_internal.h +++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh_internal.h @@ -2343,6 +2343,9 @@ #define tx_dma_desc_base_addrmsw_adr(descriptor) \ (0x00007c04u + (descriptor) * 0x40) =20 +/* tx dma total request limit */ +#define tx_dma_total_req_limit_adr 0x00007b20u + /* tx interrupt moderation control register definitions * Preprocessor definitions for TX Interrupt Moderation Control Register * Base Address: 0x00008980 @@ -2369,6 +2372,9 @@ /* default value of bitfield reg_res_dsbl */ #define pci_reg_res_dsbl_default 0x1 =20 +/* PCI core control register */ +#define pci_reg_control6_adr 0x1014u + /* global microprocessor scratch pad definitions */ #define glb_cpu_scratch_scp_adr(scratch_scp) (0x00000300u + (scratch_scp) = * 0x4) =20 --=20 2.11.0