From patchwork Mon Jun 24 15:10:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Russkikh X-Patchwork-Id: 1121380 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aquantia.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=AQUANTIA1COM.onmicrosoft.com header.i=@AQUANTIA1COM.onmicrosoft.com header.b="hPOylXbY"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 45XXmW32Jyz9sPP for ; Tue, 25 Jun 2019 01:10:51 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729395AbfFXPKt (ORCPT ); Mon, 24 Jun 2019 11:10:49 -0400 Received: from mail-eopbgr810087.outbound.protection.outlook.com ([40.107.81.87]:22483 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730437AbfFXPKr (ORCPT ); Mon, 24 Jun 2019 11:10:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=AQUANTIA1COM.onmicrosoft.com; s=selector1-AQUANTIA1COM-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zSGGHSQ6AM5p+NSTlG5A3O14awBNhuz0hdOV6aANrJw=; b=hPOylXbYOr5W0+N1XY96Gb1aYy5DFSSDCI1rvdNvSJ6Kj519ktNMIDB1LeJS/VMnfYAxmdcAJY5NYles+08Fym9bONb0v1BCrJi58l4Spf+3tGkwoHM2GyDLgf6hF9L55pVxIqF9v8Gi3ibz3uxDvVIMGxMGPwobITXskYmH/5A= Received: from MWHPR11MB1968.namprd11.prod.outlook.com (10.175.55.144) by MWHPR11MB1614.namprd11.prod.outlook.com (10.172.56.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2008.16; Mon, 24 Jun 2019 15:10:45 +0000 Received: from MWHPR11MB1968.namprd11.prod.outlook.com ([fe80::eda4:c685:f6f8:8a1b]) by MWHPR11MB1968.namprd11.prod.outlook.com ([fe80::eda4:c685:f6f8:8a1b%7]) with mapi id 15.20.2008.017; Mon, 24 Jun 2019 15:10:45 +0000 From: Igor Russkikh To: "David S . Miller" CC: "netdev@vger.kernel.org" , Igor Russkikh Subject: [PATCH net-next v2 1/8] net: aquantia: replace internal driver version code with uts Thread-Topic: [PATCH net-next v2 1/8] net: aquantia: replace internal driver version code with uts Thread-Index: AQHVKp7/8jq2AWmJOECcP2qm88zlyA== Date: Mon, 24 Jun 2019 15:10:45 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HE1P192CA0004.EURP192.PROD.OUTLOOK.COM (2603:10a6:3:fe::14) To MWHPR11MB1968.namprd11.prod.outlook.com (2603:10b6:300:113::16) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Igor.Russkikh@aquantia.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [95.79.108.179] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a4d1d816-e985-4f09-27d4-08d6f8b6214f x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020); SRVR:MWHPR11MB1614; x-ms-traffictypediagnostic: MWHPR11MB1614: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3968; x-forefront-prvs: 007814487B x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(136003)(396003)(366004)(376002)(39840400004)(189003)(199004)(186003)(8676002)(99286004)(26005)(72206003)(102836004)(6916009)(316002)(81156014)(478600001)(2616005)(476003)(66066001)(76176011)(81166006)(52116002)(66446008)(64756008)(73956011)(66946007)(6506007)(386003)(44832011)(50226002)(446003)(11346002)(486006)(8936002)(54906003)(6436002)(5660300002)(71200400001)(68736007)(107886003)(53936002)(6512007)(71190400001)(2906002)(66476007)(66556008)(86362001)(305945005)(36756003)(25786009)(256004)(118296001)(4326008)(14454004)(6116002)(3846002)(6486002)(7736002); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR11MB1614; H:MWHPR11MB1968.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: aquantia.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: gW/ot4IvkhNMvPy40pE1dKgKI9doJkbF2nt1EQK5uKVNlzdRccaDiH+1YqcUeqI6PA9OwWDcoPl4qwJDZ9ShVOq9cxmQ/fiP7/6bSQK1v/Dlz0Pz/KSllH83JZaHTmRU2OAEhAvHZb/LCpVPKHqc9Dum9Dp+SGP+a18ixyoYiOV4ISItA4PSv/7Rty9Vy6MIJ4xyEa+zrwDR34pvio3UJDqOF5uy/A4+O5RFrgH6Y64/WErZNU2QAU3kx/m4p0wZcEYlZ2xo8MCtcbHvLwOgBQkFxBx5t6KRs07tk8BN04w8x6K3rTbn/ssJPziD4wrm3+Fg/Orh8n8gY65nY0XTrPJqJdw5IfSNoEwPClHY85gA1trfjiylXjbaQAq9wZeYhIV86C7RON6s1ehquZlksK+KI6g4uPjnQ0gKGOWNaP0= MIME-Version: 1.0 X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-Network-Message-Id: a4d1d816-e985-4f09-27d4-08d6f8b6214f X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Jun 2019 15:10:45.0139 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 83e2e134-991c-4ede-8ced-34d47e38e6b1 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: irusski@aquantia.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1614 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org As it was discussed some time previously, driver is better to report kernel version string, as it in a best way identifies the codebase. Signed-off-by: Igor Russkikh --- drivers/net/ethernet/aquantia/atlantic/aq_cfg.h | 7 +++---- drivers/net/ethernet/aquantia/atlantic/ver.h | 5 ----- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_cfg.h b/drivers/net/ethernet/aquantia/atlantic/aq_cfg.h index 173be45463ee..02f1b70c4e25 100644 --- a/drivers/net/ethernet/aquantia/atlantic/aq_cfg.h +++ b/drivers/net/ethernet/aquantia/atlantic/aq_cfg.h @@ -9,6 +9,8 @@ #ifndef AQ_CFG_H #define AQ_CFG_H +#include + #define AQ_CFG_VECS_DEF 8U #define AQ_CFG_TCS_DEF 1U @@ -86,10 +88,7 @@ #define AQ_CFG_DRV_AUTHOR "aQuantia" #define AQ_CFG_DRV_DESC "aQuantia Corporation(R) Network Driver" #define AQ_CFG_DRV_NAME "atlantic" -#define AQ_CFG_DRV_VERSION __stringify(NIC_MAJOR_DRIVER_VERSION)"."\ - __stringify(NIC_MINOR_DRIVER_VERSION)"."\ - __stringify(NIC_BUILD_DRIVER_VERSION)"."\ - __stringify(NIC_REVISION_DRIVER_VERSION) \ +#define AQ_CFG_DRV_VERSION UTS_RELEASE \ AQ_CFG_DRV_VERSION_SUFFIX #endif /* AQ_CFG_H */ diff --git a/drivers/net/ethernet/aquantia/atlantic/ver.h b/drivers/net/ethernet/aquantia/atlantic/ver.h index 23374bffa92b..597654b51e01 100644 --- a/drivers/net/ethernet/aquantia/atlantic/ver.h +++ b/drivers/net/ethernet/aquantia/atlantic/ver.h @@ -7,11 +7,6 @@ #ifndef VER_H #define VER_H -#define NIC_MAJOR_DRIVER_VERSION 2 -#define NIC_MINOR_DRIVER_VERSION 0 -#define NIC_BUILD_DRIVER_VERSION 4 -#define NIC_REVISION_DRIVER_VERSION 0 - #define AQ_CFG_DRV_VERSION_SUFFIX "-kern" #endif /* VER_H */ From patchwork Mon Jun 24 15:10:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Russkikh X-Patchwork-Id: 1121381 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aquantia.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=AQUANTIA1COM.onmicrosoft.com header.i=@AQUANTIA1COM.onmicrosoft.com header.b="Oh65tT76"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 45XXmX2HBjz9sPS for ; Tue, 25 Jun 2019 01:10:52 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730575AbfFXPKv (ORCPT ); Mon, 24 Jun 2019 11:10:51 -0400 Received: from mail-eopbgr710043.outbound.protection.outlook.com ([40.107.71.43]:31471 "EHLO NAM05-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730503AbfFXPKu (ORCPT ); Mon, 24 Jun 2019 11:10:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=AQUANTIA1COM.onmicrosoft.com; s=selector1-AQUANTIA1COM-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=N4fM0UQRKElgAzy2BJehqCGKOYnvjaDGtkdjhJkFDyM=; b=Oh65tT76DCvqAY8bZthpz4LvqHsqhhUJ2aU3jZ515FpImQpKUqoNCEtljp9HU6xah8Txs1brx6haZVDRTr9/KYsYL1K5CPkL1E/LebrOrZLA84K7ylRGlzx38mwh+cJ4nGRcROvq76Y14Ifz3JHBZFeZMZSd0axlugErThj5wy4= Received: from MWHPR11MB1968.namprd11.prod.outlook.com (10.175.55.144) by MWHPR11MB1614.namprd11.prod.outlook.com (10.172.56.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2008.16; Mon, 24 Jun 2019 15:10:47 +0000 Received: from MWHPR11MB1968.namprd11.prod.outlook.com ([fe80::eda4:c685:f6f8:8a1b]) by MWHPR11MB1968.namprd11.prod.outlook.com ([fe80::eda4:c685:f6f8:8a1b%7]) with mapi id 15.20.2008.017; Mon, 24 Jun 2019 15:10:47 +0000 From: Igor Russkikh To: "David S . Miller" CC: "netdev@vger.kernel.org" , Igor Russkikh Subject: [PATCH net-next v2 2/8] net: aquantia: add documentation for the atlantic driver Thread-Topic: [PATCH net-next v2 2/8] net: aquantia: add documentation for the atlantic driver Thread-Index: AQHVKp8Am411tn0Ybkaomem/bFWFqA== Date: Mon, 24 Jun 2019 15:10:47 +0000 Message-ID: <438b6899b5c2d82474a0dcee543b2ae6c4ee7b1f.1561388549.git.igor.russkikh@aquantia.com> References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HE1P192CA0004.EURP192.PROD.OUTLOOK.COM (2603:10a6:3:fe::14) To MWHPR11MB1968.namprd11.prod.outlook.com (2603:10b6:300:113::16) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Igor.Russkikh@aquantia.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [95.79.108.179] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 4b6e45ef-b585-44ea-deec-08d6f8b62282 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020); SRVR:MWHPR11MB1614; x-ms-traffictypediagnostic: MWHPR11MB1614: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2089; x-forefront-prvs: 007814487B x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(136003)(396003)(366004)(376002)(39840400004)(189003)(199004)(186003)(8676002)(99286004)(26005)(72206003)(102836004)(6916009)(30864003)(316002)(81156014)(478600001)(2616005)(476003)(66066001)(76176011)(81166006)(52116002)(66446008)(64756008)(73956011)(66946007)(6506007)(386003)(44832011)(50226002)(446003)(11346002)(486006)(8936002)(54906003)(6436002)(5660300002)(71200400001)(68736007)(107886003)(53936002)(6512007)(71190400001)(2906002)(66476007)(66556008)(86362001)(305945005)(36756003)(25786009)(256004)(118296001)(4326008)(14454004)(6116002)(3846002)(53946003)(6486002)(7736002)(14444005)(5024004)(448954002)(2004002); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR11MB1614; H:MWHPR11MB1968.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: aquantia.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: N9gHNfG6zGqXlPEMI+t2Sfaa03epitHUf5Hw8KXL/hrfnYB33vrO8SAMO7+sSX1zihnXrsEiMQu6n9N/pv+3INp22zAy0GGlFGyIFYZiRCr4Z5e0fystzB6WymnPL0UcU2nenn9HvX8cnrWzqXbK2oR7RXWv5pfFrPoZ6XrWKauHURYLU8e0Cj8620eLMsw0xvXqo5F+tdwglqXhDcf7fuAda02gz1MwJCH7UbeaESFXFiaRPwBO5Gp6fsmjFUuLTgzwGIz6swfOHsPqCQBHiBuVbbbj/DxGNiOD9OWBeUWTG5UmFZynSWCfoW/xKXp5mviAUe27qqlmZSv3Bu2UQmjYsjks57LKG+M+rhjP/mt6NTn7cpgrgUZVbxM/LupubTFtHjeF9KIfj9nMIliI52/W1MvJeL4sYJ+lLIcUrI8= MIME-Version: 1.0 X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4b6e45ef-b585-44ea-deec-08d6f8b62282 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Jun 2019 15:10:47.0615 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 83e2e134-991c-4ede-8ced-34d47e38e6b1 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: irusski@aquantia.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1614 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Document contains configuration options description, details and examples of driver various settings. Signed-off-by: Igor Russkikh --- .../device_drivers/aquantia/atlantic.txt | 437 ++++++++++++++++++ 1 file changed, 437 insertions(+) create mode 100644 Documentation/networking/device_drivers/aquantia/atlantic.txt diff --git a/Documentation/networking/device_drivers/aquantia/atlantic.txt b/Documentation/networking/device_drivers/aquantia/atlantic.txt new file mode 100644 index 000000000000..45b93f8143b4 --- /dev/null +++ b/Documentation/networking/device_drivers/aquantia/atlantic.txt @@ -0,0 +1,437 @@ +aQuantia AQtion Driver for the aQuantia Multi-Gigabit PCI Express Family of +Ethernet Adapters +============================================================================= + +Contents +======== + +- Important Note +- Identifying Your Adapter +- Command Line Parameters +- Additional Configurations +- Support + +Identifying Your Adapter +======================== + +The driver in this release is compatible with AQC-100, AQC-107, AQC-108 based ethernet adapters. + + +SFP+ Devices (for AQC-100 based adapters) +---------------------------------- + +This release tested with passive Direct Attach Cables (DAC) and SFP+/LC Optical Transceiver. + +Config file parameters +======================= +For some fine tuning and performance optimizations, +some parameters can be changed in the {source_dir}/aq_cfg.h file. + +AQ_CFG_RX_PAGEORDER +---------------------------------------- +Default value: 0 +RX page order override. Thats a power of 2 number of RX pages allocated for +each descriptor. Received descriptor size is still limited by AQ_CFG_RX_FRAME_MAX. +Increasing pageorder makes page reuse better (actual on iommu enabled systems). + +AQ_CFG_RX_REFILL_THRES +---------------------------------------- +Default value: 32 +RX refill threshold. RX path will not refill freed descriptors until the +specified number of free descriptors is observed. Larger values may help +better page reuse but may lead to packet drops as well. + +AQ_CFG_VECS_DEF +------------------------------------------------------------ +Number of queues +Valid Range: 0 - 8 (up to AQ_CFG_VECS_MAX) +Default value: 8 +Notice this value will be capped by the number of cores available on the system. + +AQ_CFG_IS_RSS_DEF +------------------------------------------------------------ +Enable/disable Receive Side Scaling + +This feature allows the adapter to distribute receive processing +across multiple CPU-cores and to prevent from overloading a single CPU core. + +Valid values +0 - disabled +1 - enabled + +Default value: 1 + +AQ_CFG_NUM_RSS_QUEUES_DEF +------------------------------------------------------------ +Number of queues for Receive Side Scaling +Valid Range: 0 - 8 (up to AQ_CFG_VECS_DEF) + +Default value: AQ_CFG_VECS_DEF + +AQ_CFG_IS_LRO_DEF +------------------------------------------------------------ +Enable/disable Large Receive Offload + +This offload enables the adapter to coalesce multiple TCP segments and indicate +them as a single coalesced unit to the OS networking subsystem. +The system consumes less energy but it also introduces more latency in packets processing. + +Valid values +0 - disabled +1 - enabled + +Default value: 1 + +AQ_CFG_TX_CLEAN_BUDGET +---------------------------------------- +Maximum descriptors to cleanup on TX at once. +Default value: 256 + +After the aq_cfg.h file changed the driver must be rebuilt to take effect. + +Additional Configurations +========================= + Viewing Link Messages + --------------------- + Link messages will not be displayed to the console if the distribution is + restricting system messages. In order to see network driver link messages on + your console, set dmesg to eight by entering the following: + + dmesg -n 8 + + NOTE: This setting is not saved across reboots. + + Jumbo Frames + ------------ + The driver supports Jumbo Frames for all adapters. Jumbo Frames support is + enabled by changing the MTU to a value larger than the default of 1500. + The maximum value for the MTU is 16000. Use the `ip` command to + increase the MTU size. For example: + + ip link set mtu 16000 dev enp1s0 + + ethtool + ------- + The driver utilizes the ethtool interface for driver configuration and + diagnostics, as well as displaying statistical information. The latest + ethtool version is required for this functionality. + + NAPI + ---- + NAPI (Rx polling mode) is supported in the atlantic driver. + +Supported ethtool options +============================ + Viewing adapter settings + --------------------- + ethtool + + Output example: + + Settings for enp1s0: + Supported ports: [ TP ] + Supported link modes: 100baseT/Full + 1000baseT/Full + 10000baseT/Full + 2500baseT/Full + 5000baseT/Full + Supported pause frame use: Symmetric + Supports auto-negotiation: Yes + Supported FEC modes: Not reported + Advertised link modes: 100baseT/Full + 1000baseT/Full + 10000baseT/Full + 2500baseT/Full + 5000baseT/Full + Advertised pause frame use: Symmetric + Advertised auto-negotiation: Yes + Advertised FEC modes: Not reported + Speed: 10000Mb/s + Duplex: Full + Port: Twisted Pair + PHYAD: 0 + Transceiver: internal + Auto-negotiation: on + MDI-X: Unknown + Supports Wake-on: g + Wake-on: d + Link detected: yes + + --- + Note: AQrate speeds (2.5/5 Gb/s) will be displayed only with linux kernels > 4.10. + But you can still use these speeds: + ethtool -s eth0 autoneg off speed 2500 + + Viewing adapter information + --------------------- + ethtool -i + + Output example: + + driver: atlantic + version: 5.2.0-050200rc5-generic-kern + firmware-version: 3.1.78 + expansion-rom-version: + bus-info: 0000:01:00.0 + supports-statistics: yes + supports-test: no + supports-eeprom-access: no + supports-register-dump: yes + supports-priv-flags: no + + + Viewing Ethernet adapter statistics: + --------------------- + ethtool -S + + Output example: + NIC statistics: + InPackets: 13238607 + InUCast: 13293852 + InMCast: 52 + InBCast: 3 + InErrors: 0 + OutPackets: 23703019 + OutUCast: 23704941 + OutMCast: 67 + OutBCast: 11 + InUCastOctects: 213182760 + OutUCastOctects: 22698443 + InMCastOctects: 6600 + OutMCastOctects: 8776 + InBCastOctects: 192 + OutBCastOctects: 704 + InOctects: 2131839552 + OutOctects: 226938073 + InPacketsDma: 95532300 + OutPacketsDma: 59503397 + InOctetsDma: 1137102462 + OutOctetsDma: 2394339518 + InDroppedDma: 0 + Queue[0] InPackets: 23567131 + Queue[0] OutPackets: 20070028 + Queue[0] InJumboPackets: 0 + Queue[0] InLroPackets: 0 + Queue[0] InErrors: 0 + Queue[1] InPackets: 45428967 + Queue[1] OutPackets: 11306178 + Queue[1] InJumboPackets: 0 + Queue[1] InLroPackets: 0 + Queue[1] InErrors: 0 + Queue[2] InPackets: 3187011 + Queue[2] OutPackets: 13080381 + Queue[2] InJumboPackets: 0 + Queue[2] InLroPackets: 0 + Queue[2] InErrors: 0 + Queue[3] InPackets: 23349136 + Queue[3] OutPackets: 15046810 + Queue[3] InJumboPackets: 0 + Queue[3] InLroPackets: 0 + Queue[3] InErrors: 0 + + Interrupt coalescing support + --------------------------------- + ITR mode, TX/RX coalescing timings could be viewed with: + + ethtool -c + + and changed with: + + ethtool -C tx-usecs rx-usecs + + To disable coalescing: + + ethtool -C tx-usecs 0 rx-usecs 0 tx-max-frames 1 tx-max-frames 1 + + Wake on LAN support + --------------------------------- + + WOL support by magic packet: + + ethtool -s wol g + + To disable WOL: + + ethtool -s wol d + + Set and check the driver message level + --------------------------------- + + Set message level + + ethtool -s msglvl + + Level values: + + 0x0001 - general driver status. + 0x0002 - hardware probing. + 0x0004 - link state. + 0x0008 - periodic status check. + 0x0010 - interface being brought down. + 0x0020 - interface being brought up. + 0x0040 - receive error. + 0x0080 - transmit error. + 0x0200 - interrupt handling. + 0x0400 - transmit completion. + 0x0800 - receive completion. + 0x1000 - packet contents. + 0x2000 - hardware status. + 0x4000 - Wake-on-LAN status. + + By default, the level of debugging messages is set 0x0001(general driver status). + + Check message level + + ethtool | grep "Current message level" + + If you want to disable the output of messages + + ethtool -s msglvl 0 + + RX flow rules (ntuple filters) + --------------------------------- + There are separate rules supported, that applies in that order: + 1. 16 VLAN ID rules + 2. 16 L2 EtherType rules + 3. 8 L3/L4 5-Tuple rules + + + The driver utilizes the ethtool interface for configuring ntuple filters, + via "ethtool -N ". + + To enable or disable the RX flow rules: + + ethtool -K ethX ntuple + + When disabling ntuple filters, all the user programed filters are + flushed from the driver cache and hardware. All needed filters must + be re-added when ntuple is re-enabled. + + Because of the fixed order of the rules, the location of filters is also fixed: + - Locations 0 - 15 for VLAN ID filters + - Locations 16 - 31 for L2 EtherType filters + - Locations 32 - 39 for L3/L4 5-tuple filters (locations 32, 36 for IPv6) + + The L3/L4 5-tuple (protocol, source and destination IP address, source and + destination TCP/UDP/SCTP port) is compared against 8 filters. For IPv4, up to + 8 source and destination addresses can be matched. For IPv6, up to 2 pairs of + addresses can be supported. Source and destination ports are only compared for + TCP/UDP/SCTP packets. + + To add a filter that directs packet to queue 5, use <-N|-U|--config-nfc|--config-ntuple> switch: + + ethtool -N flow-type udp4 src-ip 10.0.0.1 dst-ip 10.0.0.2 src-port 2000 dst-port 2001 action 5 + + - action is the queue number. + - loc is the rule number. + + For "flow-type ip4|udp4|tcp4|sctp4|ip6|udp6|tcp6|sctp6" you must set the loc + number within 32 - 39. + For "flow-type ip4|udp4|tcp4|sctp4|ip6|udp6|tcp6|sctp6" you can set 8 rules + for traffic IPv4 or you can set 2 rules for traffic IPv6. Loc number traffic + IPv6 is 32 and 36. + At the moment you can not use IPv4 and IPv6 filters at the same time. + + Example filter for IPv6 filter traffic: + + sudo ethtool -N flow-type tcp6 src-ip 2001:db8:0:f101::1 dst-ip 2001:db8:0:f101::2 action 1 loc 32 + sudo ethtool -N flow-type ip6 src-ip 2001:db8:0:f101::2 dst-ip 2001:db8:0:f101::5 action -1 loc 36 + + Example filter for IPv4 filter traffic: + + sudo ethtool -N flow-type udp4 src-ip 10.0.0.4 dst-ip 10.0.0.7 src-port 2000 dst-port 2001 loc 32 + sudo ethtool -N flow-type tcp4 src-ip 10.0.0.3 dst-ip 10.0.0.9 src-port 2000 dst-port 2001 loc 33 + sudo ethtool -N flow-type ip4 src-ip 10.0.0.6 dst-ip 10.0.0.4 loc 34 + + If you set action -1, then all traffic corresponding to the filter will be discarded. + The maximum value action is 31. + + + The VLAN filter (VLAN id) is compared against 16 filters. + VLAN id must be accompanied by mask 0xF000. That is to distinguish VLAN filter + from L2 Ethertype filter with UserPriority since both User Priority and VLAN ID + are passed in the same 'vlan' parameter. + + To add a filter that directs packets from VLAN 2001 to queue 5: + ethtool -N flow-type ip4 vlan 2001 m 0xF000 action 1 loc 0 + + + L2 EtherType filters allows filter packet by EtherType field or both EtherType + and User Priority (PCP) field of 802.1Q. + UserPriority (vlan) parameter must be accompanied by mask 0x1FFF. That is to + distinguish VLAN filter from L2 Ethertype filter with UserPriority since both + User Priority and VLAN ID are passed in the same 'vlan' parameter. + + To add a filter that directs IP4 packess of priority 3 to queue 3: + ethtool -N flow-type ether proto 0x800 vlan 0x600 m 0x1FFF action 3 loc 16 + + + To see the list of filters currently present: + + ethtool <-u|-n|--show-nfc|--show-ntuple> + + Rules may be deleted from the table itself. This is done using: + + sudo ethtool <-N|-U|--config-nfc|--config-ntuple> delete + + - loc is the rule number to be deleted. + + Rx filters is an interface to load the filter table that funnels all flow + into queue 0 unless an alternative queue is specified using "action". In that + case, any flow that matches the filter criteria will be directed to the + appropriate queue. RX filters is supported on all kernels 2.6.30 and later. + + RSS for UDP + --------------------------------- + Currently, NIC does not support RSS for fragmented IP packets, which leads to + incorrect working of RSS for fragmented UDP traffic. To disable RSS for UDP the + RX Flow L3/L4 rule may be used. + + Example: + ethtool -N eth0 flow-type udp4 action 0 loc 32 + +Command Line Parameters +======================= +The following command line parameters are available on atlantic driver: + +aq_itr -Interrupt throttling mode +---------------------------------------- +Accepted values: 0, 1, 0xFFFF +Default value: 0xFFFF +0 - Disable interrupt throttling. +1 - Enable interrupt throttling and use specified tx and rx rates. +0xFFFF - Auto throttling mode. Driver will choose the best RX and TX + interrupt throtting settings based on link speed. + +aq_itr_tx - TX interrupt throttle rate +---------------------------------------- +Accepted values: 0 - 0x1FF +Default value: 0 +TX side throttling in microseconds. Adapter will setup maximum interrupt delay +to this value. Minimum interrupt delay will be a half of this value + +aq_itr_rx - RX interrupt throttle rate +---------------------------------------- +Accepted values: 0 - 0x1FF +Default value: 0 +RX side throttling in microseconds. Adapter will setup maximum interrupt delay +to this value. Minimum interrupt delay will be a half of this value + +Note: ITR settings could be changed in runtime by ethtool -c means (see below) + +Support +======= + +If an issue is identified with the released source code on the supported +kernel with a supported adapter, email the specific information related +to the issue to support@aquantia.com + +License +======= + +aQuantia Corporation Network Driver +Copyright(c) 2014 - 2019 aQuantia Corporation. + +This program is free software; you can redistribute it and/or modify it +under the terms and conditions of the GNU General Public License, +version 2, as published by the Free Software Foundation. From patchwork Mon Jun 24 15:10:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Russkikh X-Patchwork-Id: 1121382 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aquantia.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=AQUANTIA1COM.onmicrosoft.com header.i=@AQUANTIA1COM.onmicrosoft.com header.b="SAf3OCKz"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 45XXmY4VgWz9sNk for ; Tue, 25 Jun 2019 01:10:53 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730536AbfFXPKw (ORCPT ); Mon, 24 Jun 2019 11:10:52 -0400 Received: from mail-eopbgr710043.outbound.protection.outlook.com ([40.107.71.43]:31471 "EHLO NAM05-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730364AbfFXPKv (ORCPT ); Mon, 24 Jun 2019 11:10:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=AQUANTIA1COM.onmicrosoft.com; s=selector1-AQUANTIA1COM-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MlW3rIXMPl4qNlQ7Gr9dnIkLMOlu/C4M6i65EuDnz88=; b=SAf3OCKzCTSpRY1zFQhymgjugy6IWoZ91YemYkIUD8cUcUlv0N0WTzkrTXbhCCzWCmTzOOF7ICxsSeDjYmQIaBg+l3fwGPN3Ka05nmg2UQxp1E4T05RuqhNM6KZ27DDPzSVICielK1HXZc+XitRO1Rm1Khkep+dlHPcorOLCWts= Received: from MWHPR11MB1968.namprd11.prod.outlook.com (10.175.55.144) by MWHPR11MB1614.namprd11.prod.outlook.com (10.172.56.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2008.16; Mon, 24 Jun 2019 15:10:49 +0000 Received: from MWHPR11MB1968.namprd11.prod.outlook.com ([fe80::eda4:c685:f6f8:8a1b]) by MWHPR11MB1968.namprd11.prod.outlook.com ([fe80::eda4:c685:f6f8:8a1b%7]) with mapi id 15.20.2008.017; Mon, 24 Jun 2019 15:10:49 +0000 From: Igor Russkikh To: "David S . Miller" CC: "netdev@vger.kernel.org" , Igor Russkikh Subject: [PATCH net-next v2 3/8] maintainers: declare aquantia atlantic driver maintenance Thread-Topic: [PATCH net-next v2 3/8] maintainers: declare aquantia atlantic driver maintenance Thread-Index: AQHVKp8BPssYYOo04UmFkEuoj99wog== Date: Mon, 24 Jun 2019 15:10:49 +0000 Message-ID: <2b413d26ebc04cfca7f7dfa5422f1ea28d9cd76d.1561388549.git.igor.russkikh@aquantia.com> References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HE1P192CA0004.EURP192.PROD.OUTLOOK.COM (2603:10a6:3:fe::14) To MWHPR11MB1968.namprd11.prod.outlook.com (2603:10b6:300:113::16) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Igor.Russkikh@aquantia.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [95.79.108.179] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a41be2d4-e5a0-4219-d2af-08d6f8b623b5 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020); SRVR:MWHPR11MB1614; x-ms-traffictypediagnostic: MWHPR11MB1614: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1201; x-forefront-prvs: 007814487B x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(136003)(396003)(366004)(376002)(39840400004)(189003)(199004)(186003)(8676002)(99286004)(4744005)(26005)(72206003)(102836004)(6916009)(316002)(81156014)(478600001)(2616005)(476003)(66066001)(76176011)(81166006)(52116002)(66446008)(64756008)(73956011)(66946007)(6506007)(386003)(44832011)(50226002)(446003)(11346002)(486006)(8936002)(54906003)(6436002)(5660300002)(71200400001)(68736007)(107886003)(53936002)(6512007)(6306002)(71190400001)(2906002)(66476007)(66556008)(86362001)(305945005)(36756003)(25786009)(256004)(118296001)(4326008)(14454004)(6116002)(3846002)(6486002)(7736002); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR11MB1614; H:MWHPR11MB1968.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: aquantia.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: F2q88yWfMil8zQZARLTvk6i8NnK6CoL6RYtBD+4lzHlEydD+A63isKuNsWP8o+N0QJubqinGXSNH314To+iF0TLjLPnMq/5dVobsoawVtZYmHKRj6o5PKTwlvqq3eO+TzwHWc+VZd8elbyjEgXN7lF9i0v6DTRaECOoqZiKzD16AZDVY9+SQGW1LGojHu63B8gzoEON5TCdWM+rqrQYLzhXQBqWnQZIcaji31Lnrl3LERKnr2iaO5E49RdAX6VNk4Nxay+e+UHhCwtrRDTZy8FCjOoCN/wx+sNgIee6uRPjF3Bipo2NO8q5gsGSH/G+yLtsWIFrRiOme1WaaF5Wun0LiYRHpbIoihhjf3WfFWpf+0Nh3/v8IEoqd6Jt2h+RvjrK0ONK/QwPTPQSNmuQgs5fyNysQbgHBxHO3ZD6Hu6c= MIME-Version: 1.0 X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-Network-Message-Id: a41be2d4-e5a0-4219-d2af-08d6f8b623b5 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Jun 2019 15:10:49.1713 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 83e2e134-991c-4ede-8ced-34d47e38e6b1 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: irusski@aquantia.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1614 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Aquantia is resposible now for all new features and bugfixes. Reflect that in MAINTAINERS. Signed-off-by: Igor Russkikh Reviewed-by: Andrew Lunn --- MAINTAINERS | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 606d1f80bc49..82f762ddbe7a 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1140,6 +1140,15 @@ L: linux-media@vger.kernel.org S: Maintained F: drivers/media/i2c/aptina-pll.* +AQUANTIA ETHERNET DRIVER (atlantic) +M: Igor Russkikh +L: netdev@vger.kernel.org +S: Supported +W: http://www.aquantia.com +Q: http://patchwork.ozlabs.org/project/netdev/list/ +F: drivers/net/ethernet/aquantia/atlantic/ +F: Documentation/networking/device_drivers/aquantia/atlantic.txt + ARC FRAMEBUFFER DRIVER M: Jaya Kumar S: Maintained From patchwork Mon Jun 24 15:10:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Russkikh X-Patchwork-Id: 1121383 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aquantia.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=AQUANTIA1COM.onmicrosoft.com header.i=@AQUANTIA1COM.onmicrosoft.com header.b="tK7yP0US"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 45XXmb0cgfz9sPH for ; Tue, 25 Jun 2019 01:10:55 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731134AbfFXPKy (ORCPT ); Mon, 24 Jun 2019 11:10:54 -0400 Received: from mail-eopbgr810057.outbound.protection.outlook.com ([40.107.81.57]:43046 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730503AbfFXPKx (ORCPT ); Mon, 24 Jun 2019 11:10:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=AQUANTIA1COM.onmicrosoft.com; s=selector1-AQUANTIA1COM-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kDfoNd8tEjCO0wpMj2qI1lEDVaw+6BCO0VXpeRHnrXo=; b=tK7yP0USZtBwiU5R5Qa3S4/Nk7Ei3Eki0Ayjm9JcmRxz7FvbPa1g3hbEwuoW0t/Zcetxd0vG3QQ6q9K10IGFfgmpO2UX2kJQJi+pGEk6GIfP0FfSOgntw14EwG6nlXMV4OVBOP+f0qGTFyZ3RAHEM+RY+UyXorN31oL6ULp9UtE= Received: from MWHPR11MB1968.namprd11.prod.outlook.com (10.175.55.144) by MWHPR11MB1614.namprd11.prod.outlook.com (10.172.56.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2008.16; Mon, 24 Jun 2019 15:10:51 +0000 Received: from MWHPR11MB1968.namprd11.prod.outlook.com ([fe80::eda4:c685:f6f8:8a1b]) by MWHPR11MB1968.namprd11.prod.outlook.com ([fe80::eda4:c685:f6f8:8a1b%7]) with mapi id 15.20.2008.017; Mon, 24 Jun 2019 15:10:51 +0000 From: Igor Russkikh To: "David S . Miller" CC: "netdev@vger.kernel.org" , Igor Russkikh Subject: [PATCH net-next v2 4/8] net: aquantia: make all files GPL-2.0-only Thread-Topic: [PATCH net-next v2 4/8] net: aquantia: make all files GPL-2.0-only Thread-Index: AQHVKp8C67nTe80OdES6M3LJwv02KA== Date: Mon, 24 Jun 2019 15:10:51 +0000 Message-ID: <795f0f66ddf604a91de0f4a7734d0e9b282c7a3d.1561388549.git.igor.russkikh@aquantia.com> References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HE1P192CA0004.EURP192.PROD.OUTLOOK.COM (2603:10a6:3:fe::14) To MWHPR11MB1968.namprd11.prod.outlook.com (2603:10b6:300:113::16) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Igor.Russkikh@aquantia.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [95.79.108.179] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b99a71cd-d8f0-462a-bd81-08d6f8b624f7 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020); SRVR:MWHPR11MB1614; x-ms-traffictypediagnostic: MWHPR11MB1614: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2201; x-forefront-prvs: 007814487B x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(136003)(396003)(366004)(376002)(39840400004)(189003)(199004)(186003)(8676002)(99286004)(26005)(72206003)(102836004)(6916009)(316002)(81156014)(478600001)(2616005)(476003)(66066001)(76176011)(81166006)(52116002)(66446008)(64756008)(73956011)(66946007)(6506007)(386003)(44832011)(50226002)(446003)(11346002)(486006)(8936002)(54906003)(6436002)(5660300002)(71200400001)(68736007)(107886003)(53936002)(6512007)(71190400001)(2906002)(66476007)(66556008)(86362001)(305945005)(36756003)(25786009)(256004)(118296001)(4326008)(14454004)(6116002)(3846002)(6486002)(7736002); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR11MB1614; H:MWHPR11MB1968.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: aquantia.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 2+kh/LIQ2CkTxiyeRVwowletNAgJg/4XiLt/GTfSa16IL8tjoIf5xX0uZojnlGAGUWv27nxmGj2VHiAUEV390TA34UupqyHmUO6wirMKhZH1JuLigU2JXcX14oGwYjRyjArf3XGKIBvHTcVVsh9UTasnPVU3i7SDi8L8sRa/D38MFZ1DgVYB9ro90gGHj+7GD7vuT79zHHiB7qTqKBcNx5xjRnAR8klR2eFq7px6y6guU5/s9ju1ekXCGLm7gV9Xch0yCr7EHjME9Uitzfj1YXMKosrYhBHdxXInt/GKQ7XwGVr+whU56tITJmGUz3AQsDcUrdjNszjGv0vHWh4Ia4HWwjkmikQLWsxpQhDQ8UHuBQGx5B+8L7XHCHVc2C4qDa0AjJ/M8jCZE4jr/nMzwq8Sj/6zNjuhqaOkMGCdhEw= MIME-Version: 1.0 X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-Network-Message-Id: b99a71cd-d8f0-462a-bd81-08d6f8b624f7 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Jun 2019 15:10:51.1649 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 83e2e134-991c-4ede-8ced-34d47e38e6b1 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: irusski@aquantia.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1614 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org It was noticed some files had -or-later, however overall driver has -only license. Clean this up. Signed-off-by: Igor Russkikh Reviewed-by: Andrew Lunn --- drivers/net/ethernet/aquantia/atlantic/aq_drvinfo.c | 2 +- drivers/net/ethernet/aquantia/atlantic/aq_drvinfo.h | 2 +- drivers/net/ethernet/aquantia/atlantic/aq_filters.c | 2 +- drivers/net/ethernet/aquantia/atlantic/aq_filters.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_drvinfo.c b/drivers/net/ethernet/aquantia/atlantic/aq_drvinfo.c index adad6a7acabe..6da65099047d 100644 --- a/drivers/net/ethernet/aquantia/atlantic/aq_drvinfo.c +++ b/drivers/net/ethernet/aquantia/atlantic/aq_drvinfo.c @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0-or-later +// SPDX-License-Identifier: GPL-2.0-only /* Copyright (C) 2014-2019 aQuantia Corporation. */ /* File aq_drvinfo.c: Definition of common code for firmware info in sys.*/ diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_drvinfo.h b/drivers/net/ethernet/aquantia/atlantic/aq_drvinfo.h index 41fbb1358068..23a0487893a7 100644 --- a/drivers/net/ethernet/aquantia/atlantic/aq_drvinfo.h +++ b/drivers/net/ethernet/aquantia/atlantic/aq_drvinfo.h @@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* SPDX-License-Identifier: GPL-2.0-only */ /* Copyright (C) 2014-2017 aQuantia Corporation. */ /* File aq_drvinfo.h: Declaration of common code for firmware info in sys.*/ diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_filters.c b/drivers/net/ethernet/aquantia/atlantic/aq_filters.c index 18bc035da850..04a4cb7cfcc5 100644 --- a/drivers/net/ethernet/aquantia/atlantic/aq_filters.c +++ b/drivers/net/ethernet/aquantia/atlantic/aq_filters.c @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0-or-later +// SPDX-License-Identifier: GPL-2.0-only /* Copyright (C) 2014-2017 aQuantia Corporation. */ /* File aq_filters.c: RX filters related functions. */ diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_filters.h b/drivers/net/ethernet/aquantia/atlantic/aq_filters.h index c6a08c6585d5..122e06c88a33 100644 --- a/drivers/net/ethernet/aquantia/atlantic/aq_filters.h +++ b/drivers/net/ethernet/aquantia/atlantic/aq_filters.h @@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* SPDX-License-Identifier: GPL-2.0-only */ /* Copyright (C) 2014-2017 aQuantia Corporation. */ /* File aq_filters.h: RX filters related functions. */ From patchwork Mon Jun 24 15:10:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Russkikh X-Patchwork-Id: 1121384 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aquantia.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=AQUANTIA1COM.onmicrosoft.com header.i=@AQUANTIA1COM.onmicrosoft.com header.b="e1pkDJXc"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 45XXmf00sTz9sNk for ; Tue, 25 Jun 2019 01:10:58 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731137AbfFXPK4 (ORCPT ); Mon, 24 Jun 2019 11:10:56 -0400 Received: from mail-eopbgr710073.outbound.protection.outlook.com ([40.107.71.73]:14080 "EHLO NAM05-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731125AbfFXPKy (ORCPT ); Mon, 24 Jun 2019 11:10:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=AQUANTIA1COM.onmicrosoft.com; s=selector1-AQUANTIA1COM-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ePL4sOM2zKahITwS0n0cL35Gz3tyaDP+PgJHG0ERgW4=; b=e1pkDJXcRQ82AMOp7WBkOH9llZ/Tc8iCMK4FAP8LsNNyb3oA/Q06pfuMs7C4b7uT2ODaUT0ZOE2+2fcpdk4xiGF2iO5aP7G6CPfOZyvKK8dihYiuf1UDPzIGaIqW4RQWW1MxXs2g8SKCmol/7CAiyJEieS8ug8XJ/RBd4Cr3e8U= Received: from MWHPR11MB1968.namprd11.prod.outlook.com (10.175.55.144) by MWHPR11MB1614.namprd11.prod.outlook.com (10.172.56.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2008.16; Mon, 24 Jun 2019 15:10:53 +0000 Received: from MWHPR11MB1968.namprd11.prod.outlook.com ([fe80::eda4:c685:f6f8:8a1b]) by MWHPR11MB1968.namprd11.prod.outlook.com ([fe80::eda4:c685:f6f8:8a1b%7]) with mapi id 15.20.2008.017; Mon, 24 Jun 2019 15:10:53 +0000 From: Igor Russkikh To: "David S . Miller" CC: "netdev@vger.kernel.org" , Igor Russkikh Subject: [PATCH net-next v2 5/8] net: aquantia: added vlan offload related macros and functions Thread-Topic: [PATCH net-next v2 5/8] net: aquantia: added vlan offload related macros and functions Thread-Index: AQHVKp8Df8SKcHdxXk24bBjzBi6sqg== Date: Mon, 24 Jun 2019 15:10:53 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HE1P192CA0004.EURP192.PROD.OUTLOOK.COM (2603:10a6:3:fe::14) To MWHPR11MB1968.namprd11.prod.outlook.com (2603:10b6:300:113::16) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Igor.Russkikh@aquantia.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [95.79.108.179] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e1687b20-1555-4668-66f1-08d6f8b62628 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020); SRVR:MWHPR11MB1614; x-ms-traffictypediagnostic: MWHPR11MB1614: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:299; x-forefront-prvs: 007814487B x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(136003)(396003)(366004)(376002)(39840400004)(189003)(199004)(186003)(8676002)(99286004)(26005)(72206003)(102836004)(6916009)(316002)(81156014)(478600001)(2616005)(476003)(66066001)(76176011)(81166006)(52116002)(66446008)(64756008)(73956011)(66946007)(6506007)(386003)(44832011)(50226002)(446003)(11346002)(486006)(8936002)(54906003)(6436002)(5660300002)(71200400001)(68736007)(107886003)(53936002)(6512007)(71190400001)(2906002)(66476007)(66556008)(86362001)(305945005)(36756003)(25786009)(256004)(118296001)(4326008)(14454004)(6116002)(3846002)(6486002)(7736002); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR11MB1614; H:MWHPR11MB1968.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: aquantia.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: WX7qZ6y/s0f67Pvo7vBWUdp0RUdXf/l/poo89cgPI6Sx+M390iVuOxvcdvWMorMQux/wN4Kv2cpgc5LDl+DwxXM3O2SCGihgv57Lqf9W22dY8t7MSzCuW5uUvjEPcGJXgXl1Owuon7nM9aeQHvNtzoMlloGmJnWEVG6a5g/NRoADZhAlFBO+qoGIRdjZdaxipHJkrMvBVfDeYVzsQ+AboCGTkdFPpOJ09gnNnXAWbf9D5zoTh0VdP/rBSxqw7Ki6mbYTcnzp7eH24en2fFXQpBVMJVw2jVKcvHQm/OwmMiIAJgqVrM5KZnWRSoHE+ZYGlh3RWSHQJOFyjaJiQ4GKDGHwCwSZKXhJncrGY0BAAjLSluTZzcS/ss1qsMNcm1U3WHrLXq3vk0HHDEyYewzgnQyb9Pouwe8CUrznM1c6fL8= MIME-Version: 1.0 X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-Network-Message-Id: e1687b20-1555-4668-66f1-08d6f8b62628 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Jun 2019 15:10:53.0394 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 83e2e134-991c-4ede-8ced-34d47e38e6b1 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: irusski@aquantia.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1614 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Register declaration macros required to work with vlan offload mode. Tested-by: Nikita Danilov Signed-off-by: Igor Russkikh --- .../atlantic/hw_atl/hw_atl_b0_internal.h | 7 +++++++ .../aquantia/atlantic/hw_atl/hw_atl_llh.c | 16 ++++++++++++++++ .../aquantia/atlantic/hw_atl/hw_atl_llh.h | 5 +++++ .../atlantic/hw_atl/hw_atl_llh_internal.h | 18 ++++++++++++++++++ 4 files changed, 46 insertions(+) diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0_internal.h b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0_internal.h index e4ba2ccf9830..808d8cd4252a 100644 --- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0_internal.h +++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0_internal.h @@ -107,10 +107,17 @@ #define HW_ATL_B0_RXD_NCEA0 (0x1) #define HW_ATL_B0_RXD_WB_STAT_RSSTYPE (0x0000000F) +#define HW_ATL_B0_RXD_WB_STAT_RSSTYPE_SHIFT (0x0) #define HW_ATL_B0_RXD_WB_STAT_PKTTYPE (0x00000FF0) +#define HW_ATL_B0_RXD_WB_STAT_PKTTYPE_SHIFT (0x4) #define HW_ATL_B0_RXD_WB_STAT_RXCTRL (0x00180000) +#define HW_ATL_B0_RXD_WB_STAT_RXCTRL_SHIFT (0x13) #define HW_ATL_B0_RXD_WB_STAT_SPLHDR (0x00200000) #define HW_ATL_B0_RXD_WB_STAT_HDRLEN (0xFFC00000) +#define HW_ATL_B0_RXD_WB_STAT_HDRLEN_SHIFT (0x16) + +#define HW_ATL_B0_RXD_WB_PKTTYPE_VLAN BIT(5) +#define HW_ATL_B0_RXD_WB_PKTTYPE_VLAN_DOUBLE BIT(6) #define HW_ATL_B0_RXD_WB_STAT2_DD (0x0001) #define HW_ATL_B0_RXD_WB_STAT2_EOP (0x0002) diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.c index 451529069f28..1149812ae463 100644 --- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.c +++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.c @@ -1004,6 +1004,22 @@ void hw_atl_rpo_rx_desc_vlan_stripping_set(struct aq_hw_s *aq_hw, rx_desc_vlan_stripping); } +void hw_atl_rpo_outer_vlan_tag_mode_set(void *context, + u32 outervlantagmode) +{ + aq_hw_write_reg_bit(context, HW_ATL_RPO_OUTER_VL_INS_MODE_ADR, + HW_ATL_RPO_OUTER_VL_INS_MODE_MSK, + HW_ATL_RPO_OUTER_VL_INS_MODE_SHIFT, + outervlantagmode); +} + +u32 hw_atl_rpo_outer_vlan_tag_mode_get(void *context) +{ + return aq_hw_read_reg_bit(context, HW_ATL_RPO_OUTER_VL_INS_MODE_ADR, + HW_ATL_RPO_OUTER_VL_INS_MODE_MSK, + HW_ATL_RPO_OUTER_VL_INS_MODE_SHIFT); +} + void hw_atl_rpo_tcp_udp_crc_offload_en_set(struct aq_hw_s *aq_hw, u32 tcp_udp_crc_offload_en) { diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.h b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.h index 34b42ce43512..0c37abbabca5 100644 --- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.h +++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.h @@ -488,6 +488,11 @@ void hw_atl_rpo_rx_desc_vlan_stripping_set(struct aq_hw_s *aq_hw, u32 rx_desc_vlan_stripping, u32 descriptor); +void hw_atl_rpo_outer_vlan_tag_mode_set(void *context, + u32 outervlantagmode); + +u32 hw_atl_rpo_outer_vlan_tag_mode_get(void *context); + /* set tcp/udp checksum offload enable */ void hw_atl_rpo_tcp_udp_crc_offload_en_set(struct aq_hw_s *aq_hw, u32 tcp_udp_crc_offload_en); diff --git 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 index fc1446f737bb..c3febcdfa92e 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 @@ -1383,6 +1383,24 @@ /* default value of bitfield l4_chk_en */ #define HW_ATL_RPOL4CHK_EN_DEFAULT 0x0 +/* RX outer_vl_ins_mode Bitfield Definitions + * Preprocessor definitions for the bitfield "outer_vl_ins_mode". + * PORT="pif_rpo_outer_vl_mode_i" + */ + +/* Register address for bitfield outer_vl_ins_mode */ +#define HW_ATL_RPO_OUTER_VL_INS_MODE_ADR 0x00005580 +/* Bitmask for bitfield outer_vl_ins_mode */ +#define HW_ATL_RPO_OUTER_VL_INS_MODE_MSK 0x00000004 +/* Inverted bitmask for bitfield outer_vl_ins_mode */ +#define HW_ATL_RPO_OUTER_VL_INS_MODE_MSKN 0xFFFFFFFB +/* Lower bit position of bitfield outer_vl_ins_mode */ +#define HW_ATL_RPO_OUTER_VL_INS_MODE_SHIFT 2 +/* Width of bitfield outer_vl_ins_mode */ +#define HW_ATL_RPO_OUTER_VL_INS_MODE_WIDTH 1 +/* Default value of bitfield outer_vl_ins_mode */ +#define HW_ATL_RPO_OUTER_VL_INS_MODE_DEFAULT 0x0 + /* rx reg_res_dsbl bitfield definitions * preprocessor definitions for the bitfield "reg_res_dsbl". * port="pif_rx_reg_res_dsbl_i" From patchwork Mon Jun 24 15:10:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Russkikh X-Patchwork-Id: 1121385 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aquantia.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=AQUANTIA1COM.onmicrosoft.com header.i=@AQUANTIA1COM.onmicrosoft.com header.b="Yk5qDcbO"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 45XXml26G6z9sNk for ; Tue, 25 Jun 2019 01:11:03 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731164AbfFXPLB (ORCPT ); Mon, 24 Jun 2019 11:11:01 -0400 Received: from mail-eopbgr810078.outbound.protection.outlook.com ([40.107.81.78]:6080 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730548AbfFXPLB (ORCPT ); Mon, 24 Jun 2019 11:11:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=AQUANTIA1COM.onmicrosoft.com; s=selector1-AQUANTIA1COM-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=64DkFTJqij1XkRIC2Tg9lK1B4SpckEnV8YEPa6VrxcE=; b=Yk5qDcbOQowNRn2FhVI11GEOo1MgRShU6iwqTYghMXj5MUvyCIZdaLLcFSw9MPW2dGSCiJu8ZWAInGutUXKuBA+D5C9cG2Ef596PZugx89DH97dbsMcds1tw+7wSl02WA1ds8zM5Fn+uksuGbizG6tlEP5zGAElWmUwyex4reXs= Received: from MWHPR11MB1968.namprd11.prod.outlook.com (10.175.55.144) by MWHPR11MB1614.namprd11.prod.outlook.com (10.172.56.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2008.16; Mon, 24 Jun 2019 15:10:55 +0000 Received: from MWHPR11MB1968.namprd11.prod.outlook.com ([fe80::eda4:c685:f6f8:8a1b]) by MWHPR11MB1968.namprd11.prod.outlook.com ([fe80::eda4:c685:f6f8:8a1b%7]) with mapi id 15.20.2008.017; Mon, 24 Jun 2019 15:10:55 +0000 From: Igor Russkikh To: "David S . Miller" CC: "netdev@vger.kernel.org" , Igor Russkikh Subject: [PATCH net-next v2 6/8] net: aquantia: adding fields and device features for vlan offload Thread-Topic: [PATCH net-next v2 6/8] net: aquantia: adding fields and device features for vlan offload Thread-Index: AQHVKp8FpYOKAl6gKUamwyKO3Udf/A== Date: Mon, 24 Jun 2019 15:10:55 +0000 Message-ID: <0651b2abdc0dae23562e70ec54c21c08f86a8aea.1561388549.git.igor.russkikh@aquantia.com> References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HE1P192CA0004.EURP192.PROD.OUTLOOK.COM (2603:10a6:3:fe::14) To MWHPR11MB1968.namprd11.prod.outlook.com (2603:10b6:300:113::16) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Igor.Russkikh@aquantia.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [95.79.108.179] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 959ab2b5-ef7e-4844-591a-08d6f8b62747 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020); SRVR:MWHPR11MB1614; x-ms-traffictypediagnostic: MWHPR11MB1614: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:62; x-forefront-prvs: 007814487B x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(136003)(396003)(366004)(376002)(39840400004)(189003)(199004)(186003)(8676002)(99286004)(26005)(72206003)(102836004)(6916009)(316002)(81156014)(478600001)(2616005)(476003)(66066001)(76176011)(81166006)(52116002)(66446008)(64756008)(73956011)(66946007)(6506007)(386003)(44832011)(50226002)(446003)(11346002)(486006)(8936002)(54906003)(6436002)(5660300002)(71200400001)(68736007)(107886003)(53936002)(6512007)(71190400001)(2906002)(66476007)(66556008)(86362001)(305945005)(36756003)(25786009)(256004)(118296001)(4326008)(14454004)(6116002)(3846002)(6486002)(7736002)(14444005)(309714004); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR11MB1614; H:MWHPR11MB1968.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: aquantia.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: WFlREOqHjngnxTvYRvwEgHAtpQYvukcqi8nc1eK82jrqZQlJKcPFbrY9fnprtEQ3+XoMIS2uoffP55N++MBR8cXsUa+/2hf9xFyrpJFvHlfV0lqlecIWjk7OB7cKGueZdiOx8UH4x3VrtT2pvblmwX+jVNIAP+m8tqFWX5lFGEuM+SUDwQkxNrrQezbyOJ2cGtNw0ftpJ3Y2jc8TwuBIbM0QJkD5aj+vcxRZDutfP0mOMJbxkDqbqUWhG/gVq1A1P0ZNwT0ianF8qlYtECoRddXwIXfEo3HLQxysNyF0J6uWSaXEBNhJy6JGnpIghcV9dXmF7p33BrcjxeoXKdTvWS0PScGo5ogm9iGWWeMFEnBF/Y4XtMZOwUy+tHEXpmJr0XnF6eE2/jRxdb+n2jjvoWSZZzA0LWmfOzZzaQGZgCQ= MIME-Version: 1.0 X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 959ab2b5-ef7e-4844-591a-08d6f8b62747 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Jun 2019 15:10:55.0771 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 83e2e134-991c-4ede-8ced-34d47e38e6b1 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: irusski@aquantia.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1614 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Updating features and vlan_features with vlan HW offload. Added vlan_tag fields to rx/tx ring_buff to track vlan related data. Tested-by: Nikita Danilov Signed-off-by: Igor Russkikh --- drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 9 ++++++--- drivers/net/ethernet/aquantia/atlantic/aq_nic.h | 2 ++ drivers/net/ethernet/aquantia/atlantic/aq_ring.h | 9 ++++++--- .../net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c | 2 +- .../net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c | 10 +++++++--- 5 files changed, 22 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c index 0da5e161ec5d..aa0521e8e71a 100644 --- a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c +++ b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c @@ -126,6 +126,8 @@ void aq_nic_cfg_start(struct aq_nic_s *self) cfg->link_speed_msk &= cfg->aq_hw_caps->link_speed_msk; cfg->features = cfg->aq_hw_caps->hw_features; + cfg->is_vlan_rx_strip = !!(cfg->features & NETIF_F_HW_VLAN_CTAG_RX); + cfg->is_vlan_tx_insert = !!(cfg->features & NETIF_F_HW_VLAN_CTAG_TX); } static int aq_nic_update_link_status(struct aq_nic_s *self) @@ -285,7 +287,8 @@ void aq_nic_ndev_init(struct aq_nic_s *self) self->ndev->hw_features |= aq_hw_caps->hw_features; self->ndev->features = aq_hw_caps->hw_features; self->ndev->vlan_features |= NETIF_F_HW_CSUM | NETIF_F_RXCSUM | - NETIF_F_RXHASH | NETIF_F_SG | NETIF_F_LRO; + NETIF_F_RXHASH | NETIF_F_SG | + NETIF_F_LRO | NETIF_F_TSO; self->ndev->priv_flags = aq_hw_caps->hw_priv_flags; self->ndev->priv_flags |= IFF_LIVE_ADDR_CHANGE; @@ -434,7 +437,7 @@ static unsigned int aq_nic_map_skb(struct aq_nic_s *self, dx_buff->len_l3 = ip_hdrlen(skb); dx_buff->len_l4 = tcp_hdrlen(skb); dx_buff->mss = skb_shinfo(skb)->gso_size; - dx_buff->is_txc = 1U; + dx_buff->is_gso = 1U; dx_buff->eop_index = 0xffffU; dx_buff->is_ipv6 = @@ -534,7 +537,7 @@ static unsigned int aq_nic_map_skb(struct aq_nic_s *self, --ret, dx = aq_ring_next_dx(ring, dx)) { dx_buff = &ring->buff_ring[dx]; - if (!dx_buff->is_txc && dx_buff->pa) { + if (!dx_buff->is_gso && dx_buff->pa) { if (unlikely(dx_buff->is_sop)) { dma_unmap_single(aq_nic_get_dev(self), dx_buff->pa, diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_nic.h b/drivers/net/ethernet/aquantia/atlantic/aq_nic.h index eb2e3c7c36f9..26c72f298684 100644 --- a/drivers/net/ethernet/aquantia/atlantic/aq_nic.h +++ b/drivers/net/ethernet/aquantia/atlantic/aq_nic.h @@ -35,6 +35,8 @@ struct aq_nic_cfg_s { u32 flow_control; u32 link_speed_msk; u32 wol; + u8 is_vlan_rx_strip; + u8 is_vlan_tx_insert; u16 is_mc_list_enabled; u16 mc_list_count; bool is_autoneg; diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_ring.h b/drivers/net/ethernet/aquantia/atlantic/aq_ring.h index 6bd67210d0b7..47abd09d06c2 100644 --- a/drivers/net/ethernet/aquantia/atlantic/aq_ring.h +++ b/drivers/net/ethernet/aquantia/atlantic/aq_ring.h @@ -27,7 +27,7 @@ struct aq_rxpage { * +----------+----------+----------+----------- * 4/8bytes|len pkt |len pkt | | skb * +----------+----------+----------+----------- - * 4/8bytes|is_txc |len,flags |len |len,is_eop + * 4/8bytes|is_gso |len,flags |len |len,is_eop * +----------+----------+----------+----------- * * This aq_ring_buff_s doesn't have endianness dependency. @@ -44,6 +44,7 @@ struct __packed aq_ring_buff_s { u8 is_hash_l4; u8 rsvd1; struct aq_rxpage rxdata; + u16 vlan_rx_tag; }; /* EOP */ struct { @@ -59,6 +60,7 @@ struct __packed aq_ring_buff_s { u8 is_ipv6:1; u8 rsvd2:7; u32 len_pkt; + u16 vlan_tx_tag; }; }; union { @@ -70,11 +72,12 @@ struct __packed aq_ring_buff_s { u32 is_cso_err:1; u32 is_sop:1; u32 is_eop:1; - u32 is_txc:1; + u32 is_gso:1; u32 is_mapped:1; u32 is_cleaned:1; u32 is_error:1; - u32 rsvd3:6; + u32 is_vlan:1; + u32 rsvd3:5; u16 eop_index; u16 rsvd4; }; diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c index 0f140a9fe404..359a4d387185 100644 --- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c +++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c @@ -451,7 +451,7 @@ static int hw_atl_a0_hw_ring_tx_xmit(struct aq_hw_s *self, buff = &ring->buff_ring[ring->sw_tail]; - if (buff->is_txc) { + if (buff->is_gso) { txd->ctl |= (buff->len_l3 << 31) | (buff->len_l2 << 24) | HW_ATL_A0_TXD_CTL_CMD_TCP | diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c index 1c7593d54035..773345371bcf 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 @@ -40,7 +40,9 @@ NETIF_F_TSO | \ NETIF_F_LRO | \ NETIF_F_NTUPLE | \ - NETIF_F_HW_VLAN_CTAG_FILTER, \ + NETIF_F_HW_VLAN_CTAG_FILTER | \ + NETIF_F_HW_VLAN_CTAG_RX | \ + NETIF_F_HW_VLAN_CTAG_TX, \ .hw_priv_flags = IFF_UNICAST_FLT, \ .flow_control = true, \ .mtu = HW_ATL_B0_MTU_JUMBO, \ @@ -501,7 +503,7 @@ static int hw_atl_b0_hw_ring_tx_xmit(struct aq_hw_s *self, buff = &ring->buff_ring[ring->sw_tail]; - if (buff->is_txc) { + if (buff->is_gso) { txd->ctl |= (buff->len_l3 << 31) | (buff->len_l2 << 24) | HW_ATL_B0_TXD_CTL_CMD_TCP | @@ -559,6 +561,7 @@ static int hw_atl_b0_hw_ring_rx_init(struct aq_hw_s *self, { u32 dma_desc_addr_lsw = (u32)aq_ring->dx_ring_pa; u32 dma_desc_addr_msw = (u32)(((u64)aq_ring->dx_ring_pa) >> 32); + u32 vlan_rx_stripping = self->aq_nic_cfg->is_vlan_rx_strip; hw_atl_rdm_rx_desc_en_set(self, false, aq_ring->idx); @@ -578,7 +581,8 @@ static int hw_atl_b0_hw_ring_rx_init(struct aq_hw_s *self, hw_atl_rdm_rx_desc_head_buff_size_set(self, 0U, aq_ring->idx); hw_atl_rdm_rx_desc_head_splitting_set(self, 0U, aq_ring->idx); - hw_atl_rpo_rx_desc_vlan_stripping_set(self, 0U, aq_ring->idx); + hw_atl_rpo_rx_desc_vlan_stripping_set(self, !!vlan_rx_stripping, + aq_ring->idx); /* Rx ring set mode */ From patchwork Mon Jun 24 15:10:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Russkikh X-Patchwork-Id: 1121386 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aquantia.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=AQUANTIA1COM.onmicrosoft.com header.i=@AQUANTIA1COM.onmicrosoft.com header.b="I9j/wQtl"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 45XXmm2JBVz9sPP for ; Tue, 25 Jun 2019 01:11:04 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731169AbfFXPLD (ORCPT ); Mon, 24 Jun 2019 11:11:03 -0400 Received: from mail-eopbgr810078.outbound.protection.outlook.com ([40.107.81.78]:6080 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726749AbfFXPLC (ORCPT ); Mon, 24 Jun 2019 11:11:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=AQUANTIA1COM.onmicrosoft.com; s=selector1-AQUANTIA1COM-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jEbELdY2DtN086QfNtCd6aobfuXl7KXiicnDLObv8JQ=; b=I9j/wQtlseMHs9JWnIDStH/JlBvmDCjhfD/gDu0BZjx7tDHNufBUcQXm/+g7t+sOqsDUYQPFjrZ8zQWuXVh32oQpUQKhiRB0epl+42WHlc5kVsBHVZLAaVopDKIq8qHEnUn3CQ7mn6/XFXhWfKk2mv6eFDPmAhMEaaGQuOPLsAs= Received: from MWHPR11MB1968.namprd11.prod.outlook.com (10.175.55.144) by MWHPR11MB1614.namprd11.prod.outlook.com (10.172.56.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2008.16; Mon, 24 Jun 2019 15:10:57 +0000 Received: from MWHPR11MB1968.namprd11.prod.outlook.com ([fe80::eda4:c685:f6f8:8a1b]) by MWHPR11MB1968.namprd11.prod.outlook.com ([fe80::eda4:c685:f6f8:8a1b%7]) with mapi id 15.20.2008.017; Mon, 24 Jun 2019 15:10:57 +0000 From: Igor Russkikh To: "David S . Miller" CC: "netdev@vger.kernel.org" , Igor Russkikh Subject: [PATCH net-next v2 7/8] net: aquantia: vlan offloads logic in datapath Thread-Topic: [PATCH net-next v2 7/8] net: aquantia: vlan offloads logic in datapath Thread-Index: AQHVKp8G/Z2cQ2IaqEKKws/KBgLzkg== Date: Mon, 24 Jun 2019 15:10:56 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HE1P192CA0004.EURP192.PROD.OUTLOOK.COM (2603:10a6:3:fe::14) To MWHPR11MB1968.namprd11.prod.outlook.com (2603:10b6:300:113::16) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Igor.Russkikh@aquantia.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [95.79.108.179] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 7e4e79c2-ebbd-4ce9-5a9b-08d6f8b6287d x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020); SRVR:MWHPR11MB1614; x-ms-traffictypediagnostic: MWHPR11MB1614: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:62; x-forefront-prvs: 007814487B x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(136003)(39850400004)(396003)(366004)(376002)(189003)(199004)(186003)(8676002)(99286004)(26005)(72206003)(102836004)(6916009)(316002)(81156014)(478600001)(2616005)(476003)(66066001)(76176011)(81166006)(52116002)(66446008)(64756008)(73956011)(66946007)(6506007)(386003)(44832011)(50226002)(446003)(11346002)(486006)(8936002)(54906003)(6436002)(5660300002)(71200400001)(68736007)(107886003)(53936002)(6512007)(71190400001)(2906002)(66476007)(66556008)(86362001)(305945005)(36756003)(25786009)(256004)(118296001)(4326008)(14454004)(6116002)(3846002)(6486002)(7736002)(14444005); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR11MB1614; H:MWHPR11MB1968.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: aquantia.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: X2wLxCm1HktEVo5j+krulAG6/6jlU/Xii79wt5vyFam2D3kdcvXQNF6BDnEVWg9moYKBe/vJ0bXnraXilRU/RNovKqyF3WSajzcJ7XUr5J83sazb2rkpsIbm+eQfecH3B4KNIq30hfK7Ido40qJqJ6nSXwLcBS1nqi+IeJkhAwYNJ8+YD0YkrkX2U5DvuivNefx0ykv47J4+vAMdZBvnFHPrdBAIDLoA7AXFVMXXgGHdaJ9V7KrSOKUHwxozVczkMYDkjSywWuKrTK985DF5uFf99lih0hCI3wpuxqr6285QvXipZglurCmoZ2rMKQ/XvwsKNytTTk6cZkOY87tehYJmmPDCNdTcVWrOC6M1wLEGpmo3UZMLKRHMLktqFXjVN3i4Sdaf5acK606UD/NbI0frMZDdDZDOEzZNgVWClno= MIME-Version: 1.0 X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7e4e79c2-ebbd-4ce9-5a9b-08d6f8b6287d X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Jun 2019 15:10:56.9346 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 83e2e134-991c-4ede-8ced-34d47e38e6b1 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: irusski@aquantia.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1614 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Update datapath by adding logic related to hardware assisted vlan strip/insert behaviour. Tested-by: Nikita Danilov Signed-off-by: Igor Russkikh --- .../net/ethernet/aquantia/atlantic/aq_nic.c | 23 +++++--- .../net/ethernet/aquantia/atlantic/aq_ring.c | 4 ++ .../aquantia/atlantic/hw_atl/hw_atl_b0.c | 52 ++++++++++++++----- 3 files changed, 60 insertions(+), 19 deletions(-) diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c index aa0521e8e71a..746f85e6de13 100644 --- a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c +++ b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c @@ -429,26 +429,37 @@ static unsigned int aq_nic_map_skb(struct aq_nic_s *self, unsigned int dx = ring->sw_tail; struct aq_ring_buff_s *first = NULL; struct aq_ring_buff_s *dx_buff = &ring->buff_ring[dx]; + bool need_context_tag = false; + + dx_buff->flags = 0U; if (unlikely(skb_is_gso(skb))) { - dx_buff->flags = 0U; + dx_buff->mss = skb_shinfo(skb)->gso_size; + dx_buff->is_gso = 1U; dx_buff->len_pkt = skb->len; dx_buff->len_l2 = ETH_HLEN; dx_buff->len_l3 = ip_hdrlen(skb); dx_buff->len_l4 = tcp_hdrlen(skb); - dx_buff->mss = skb_shinfo(skb)->gso_size; - dx_buff->is_gso = 1U; dx_buff->eop_index = 0xffffU; - dx_buff->is_ipv6 = (ip_hdr(skb)->version == 6) ? 1U : 0U; + need_context_tag = true; + } + if (self->aq_nic_cfg.is_vlan_tx_insert && skb_vlan_tag_present(skb)) { + dx_buff->vlan_tx_tag = skb_vlan_tag_get(skb); + dx_buff->len_pkt = skb->len; + dx_buff->is_vlan = 1U; + need_context_tag = true; + } + + if (need_context_tag) { dx = aq_ring_next_dx(ring, dx); dx_buff = &ring->buff_ring[dx]; + dx_buff->flags = 0U; ++ret; } - dx_buff->flags = 0U; dx_buff->len = skb_headlen(skb); dx_buff->pa = dma_map_single(aq_nic_get_dev(self), skb->data, @@ -537,7 +548,7 @@ static unsigned int aq_nic_map_skb(struct aq_nic_s *self, --ret, dx = aq_ring_next_dx(ring, dx)) { dx_buff = &ring->buff_ring[dx]; - if (!dx_buff->is_gso && dx_buff->pa) { + if (!dx_buff->is_gso && !dx_buff->is_vlan && dx_buff->pa) { if (unlikely(dx_buff->is_sop)) { dma_unmap_single(aq_nic_get_dev(self), dx_buff->pa, diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_ring.c b/drivers/net/ethernet/aquantia/atlantic/aq_ring.c index 2a7b91ed17c5..3901d7994ca1 100644 --- a/drivers/net/ethernet/aquantia/atlantic/aq_ring.c +++ b/drivers/net/ethernet/aquantia/atlantic/aq_ring.c @@ -409,6 +409,10 @@ int aq_ring_rx_clean(struct aq_ring_s *self, } } + if (buff->is_vlan) + __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), + buff->vlan_rx_tag); + skb->protocol = eth_type_trans(skb, ndev); aq_rx_checksum(self, buff, skb); diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c index 773345371bcf..1d216757bb9d 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 @@ -247,6 +247,9 @@ static int hw_atl_b0_hw_offload_set(struct aq_hw_s *self, /* LSO offloads*/ hw_atl_tdm_large_send_offload_en_set(self, 0xFFFFFFFFU); + /* Outer VLAN tag offload */ + hw_atl_rpo_outer_vlan_tag_mode_set(self, 1U); + /* LRO offloads */ { unsigned int val = (8U < HW_ATL_B0_LRO_RXD_MAX) ? 0x3U : @@ -489,6 +492,7 @@ static int hw_atl_b0_hw_ring_tx_xmit(struct aq_hw_s *self, unsigned int buff_pa_len = 0U; unsigned int pkt_len = 0U; unsigned int frag_count = 0U; + bool is_vlan = false; bool is_gso = false; buff = &ring->buff_ring[ring->sw_tail]; @@ -504,35 +508,43 @@ static int hw_atl_b0_hw_ring_tx_xmit(struct aq_hw_s *self, buff = &ring->buff_ring[ring->sw_tail]; if (buff->is_gso) { + txd->ctl |= HW_ATL_B0_TXD_CTL_CMD_TCP; + txd->ctl |= HW_ATL_B0_TXD_CTL_DESC_TYPE_TXC; txd->ctl |= (buff->len_l3 << 31) | - (buff->len_l2 << 24) | - HW_ATL_B0_TXD_CTL_CMD_TCP | - HW_ATL_B0_TXD_CTL_DESC_TYPE_TXC; - txd->ctl2 |= (buff->mss << 16) | - (buff->len_l4 << 8) | - (buff->len_l3 >> 1); + (buff->len_l2 << 24); + txd->ctl2 |= (buff->mss << 16); + is_gso = true; pkt_len -= (buff->len_l4 + buff->len_l3 + buff->len_l2); - is_gso = true; - if (buff->is_ipv6) txd->ctl |= HW_ATL_B0_TXD_CTL_CMD_IPV6; - } else { + txd->ctl2 |= (buff->len_l4 << 8) | + (buff->len_l3 >> 1); + } + if (buff->is_vlan) { + txd->ctl |= HW_ATL_B0_TXD_CTL_DESC_TYPE_TXC; + txd->ctl |= buff->vlan_tx_tag << 4; + is_vlan = true; + } + if (!buff->is_gso && !buff->is_vlan) { buff_pa_len = buff->len; txd->buf_addr = buff->pa; txd->ctl |= (HW_ATL_B0_TXD_CTL_BLEN & ((u32)buff_pa_len << 4)); txd->ctl |= HW_ATL_B0_TXD_CTL_DESC_TYPE_TXD; + /* PAY_LEN */ txd->ctl2 |= HW_ATL_B0_TXD_CTL2_LEN & (pkt_len << 14); - if (is_gso) { - txd->ctl |= HW_ATL_B0_TXD_CTL_CMD_LSO; + if (is_gso || is_vlan) { + /* enable tx context */ txd->ctl2 |= HW_ATL_B0_TXD_CTL2_CTX_EN; } + if (is_gso) + txd->ctl |= HW_ATL_B0_TXD_CTL_CMD_LSO; /* Tx checksum offloads */ if (buff->is_ip_cso) @@ -541,13 +553,16 @@ static int hw_atl_b0_hw_ring_tx_xmit(struct aq_hw_s *self, if (buff->is_udp_cso || buff->is_tcp_cso) txd->ctl |= HW_ATL_B0_TXD_CTL_CMD_TUCSO; + if (is_vlan) + txd->ctl |= HW_ATL_B0_TXD_CTL_CMD_VLAN; + if (unlikely(buff->is_eop)) { txd->ctl |= HW_ATL_B0_TXD_CTL_EOP; txd->ctl |= HW_ATL_B0_TXD_CTL_CMD_WB; is_gso = false; + is_vlan = false; } } - ring->sw_tail = aq_ring_next_dx(ring, ring->sw_tail); } @@ -685,11 +700,15 @@ static int hw_atl_b0_hw_ring_rx_receive(struct aq_hw_s *self, buff = &ring->buff_ring[ring->hw_head]; + buff->flags = 0U; + buff->is_hash_l4 = 0U; + rx_stat = (0x0000003CU & rxd_wb->status) >> 2; is_rx_check_sum_enabled = (rxd_wb->type >> 19) & 0x3U; - pkt_type = 0xFFU & (rxd_wb->type >> 4); + pkt_type = (rxd_wb->type & HW_ATL_B0_RXD_WB_STAT_PKTTYPE) >> + HW_ATL_B0_RXD_WB_STAT_PKTTYPE_SHIFT; if (is_rx_check_sum_enabled & BIT(0) && (0x0U == (pkt_type & 0x3U))) @@ -710,6 +729,13 @@ static int hw_atl_b0_hw_ring_rx_receive(struct aq_hw_s *self, buff->is_cso_err = 0U; } + if (self->aq_nic_cfg->is_vlan_rx_strip && + ((pkt_type & HW_ATL_B0_RXD_WB_PKTTYPE_VLAN) || + (pkt_type & HW_ATL_B0_RXD_WB_PKTTYPE_VLAN_DOUBLE))) { + buff->is_vlan = 1; + buff->vlan_rx_tag = le16_to_cpu(rxd_wb->vlan); + } + if ((rx_stat & BIT(0)) || rxd_wb->type & 0x1000U) { /* MAC error or DMA error */ buff->is_error = 1U; From patchwork Mon Jun 24 15:10:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Russkikh X-Patchwork-Id: 1121387 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aquantia.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=AQUANTIA1COM.onmicrosoft.com header.i=@AQUANTIA1COM.onmicrosoft.com header.b="lD1bfci4"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 45XXmp08sGz9sNk for ; Tue, 25 Jun 2019 01:11:06 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731171AbfFXPLF (ORCPT ); Mon, 24 Jun 2019 11:11:05 -0400 Received: from mail-eopbgr810078.outbound.protection.outlook.com ([40.107.81.78]:6080 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730548AbfFXPLD (ORCPT ); Mon, 24 Jun 2019 11:11:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=AQUANTIA1COM.onmicrosoft.com; s=selector1-AQUANTIA1COM-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DXMxDLLfUaL/z2efHMhmhKYK8skQzUuToBYNbZOWXDo=; b=lD1bfci4z0Inv096HOfS9LjmpKIO7dyZIBv90uQdTi+7RY4vISFXSCEiU26I1LRRjidGYyHX9zea2ZnZalnn9PnquW9obQEX2rpHfDIkyHFss2YhzxqFJhLvfxcHkmTkbA2LsTtWL0w7B2MHpYPGMzrM1AC7s2xUnxiJ1jChQjE= Received: from MWHPR11MB1968.namprd11.prod.outlook.com (10.175.55.144) by MWHPR11MB1614.namprd11.prod.outlook.com (10.172.56.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2008.16; Mon, 24 Jun 2019 15:10:59 +0000 Received: from MWHPR11MB1968.namprd11.prod.outlook.com ([fe80::eda4:c685:f6f8:8a1b]) by MWHPR11MB1968.namprd11.prod.outlook.com ([fe80::eda4:c685:f6f8:8a1b%7]) with mapi id 15.20.2008.017; Mon, 24 Jun 2019 15:10:59 +0000 From: Igor Russkikh To: "David S . Miller" CC: "netdev@vger.kernel.org" , Igor Russkikh Subject: [PATCH net-next v2 8/8] net: aquantia: implement vlan offload configuration Thread-Topic: [PATCH net-next v2 8/8] net: aquantia: implement vlan offload configuration Thread-Index: AQHVKp8HZdf/Y0m1EEak+U+mfZ+VJg== Date: Mon, 24 Jun 2019 15:10:58 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HE1P192CA0004.EURP192.PROD.OUTLOOK.COM (2603:10a6:3:fe::14) To MWHPR11MB1968.namprd11.prod.outlook.com (2603:10b6:300:113::16) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Igor.Russkikh@aquantia.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [95.79.108.179] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 6b9f3b83-22b0-449c-a2c1-08d6f8b62998 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020); SRVR:MWHPR11MB1614; x-ms-traffictypediagnostic: MWHPR11MB1614: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:78; x-forefront-prvs: 007814487B x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(136003)(39850400004)(396003)(366004)(376002)(189003)(199004)(186003)(8676002)(99286004)(26005)(72206003)(102836004)(6916009)(316002)(81156014)(478600001)(2616005)(476003)(66066001)(76176011)(81166006)(52116002)(66446008)(64756008)(73956011)(66946007)(6506007)(386003)(44832011)(50226002)(446003)(11346002)(486006)(8936002)(54906003)(6436002)(5660300002)(71200400001)(68736007)(107886003)(53936002)(6512007)(71190400001)(2906002)(66476007)(66556008)(86362001)(305945005)(36756003)(25786009)(256004)(118296001)(4326008)(14454004)(6116002)(3846002)(6486002)(7736002)(14444005); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR11MB1614; H:MWHPR11MB1968.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: aquantia.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 2L+3NoBP9SDSM2Qct71Hli7Fe5N/D7ZKVYA9kDfeLwn9Lmd0HOpPH9Nm+wjtrMvum9xYowZDP0hIqUkySB+zohPIHL9/PUClF1xbFwSOgCAgrkZbnxdkK95FyS756CvhcKCZz6cX8YeiwyP3WO+qDSl3zX5XABTXXa8qzNPHGCCIMsH2OnBnRpAVrng27nphRk9TY4FoPZsSOK0CB7+OODkLBwN+nU+0jbc2UvB0g4eqMikK9Mdk2o65V2xDFt9hEGLAEXOreq7u1REXwwssitgyD4tyElGq3v3BNgOwbGRF1MatdzYmZXCygO5W7rzRskiaDmxrlcgIFEMM2UUp50L5JuoE6qHLTHEEX492KyLShUliLzUUo+btYHILGMwPxN8i5QDdlmQSv19/Z0Q4a3XMqsZI6ve3kzsnslSNG6o= MIME-Version: 1.0 X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6b9f3b83-22b0-449c-a2c1-08d6f8b62998 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Jun 2019 15:10:58.9262 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 83e2e134-991c-4ede-8ced-34d47e38e6b1 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: irusski@aquantia.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1614 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org set_features should update flags and reinit hardware if vlan offload settings were changed. Signed-off-by: Igor Russkikh Tested-by: Nikita Danilov --- .../net/ethernet/aquantia/atlantic/aq_main.c | 34 +++++++++++++++---- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_main.c b/drivers/net/ethernet/aquantia/atlantic/aq_main.c index 5315df5ff6f8..100722ad5c2d 100644 --- a/drivers/net/ethernet/aquantia/atlantic/aq_main.c +++ b/drivers/net/ethernet/aquantia/atlantic/aq_main.c @@ -108,11 +108,16 @@ static int aq_ndev_change_mtu(struct net_device *ndev, int new_mtu) static int aq_ndev_set_features(struct net_device *ndev, netdev_features_t features) { + bool is_vlan_rx_strip = !!(features & NETIF_F_HW_VLAN_CTAG_RX); + bool is_vlan_tx_insert = !!(features & NETIF_F_HW_VLAN_CTAG_TX); struct aq_nic_s *aq_nic = netdev_priv(ndev); - struct aq_nic_cfg_s *aq_cfg = aq_nic_get_cfg(aq_nic); + bool need_ndev_restart = false; + struct aq_nic_cfg_s *aq_cfg; bool is_lro = false; int err = 0; + aq_cfg = aq_nic_get_cfg(aq_nic); + if (!(features & NETIF_F_NTUPLE)) { if (aq_nic->ndev->features & NETIF_F_NTUPLE) { err = aq_clear_rxnfc_all_rules(aq_nic); @@ -135,17 +140,32 @@ static int aq_ndev_set_features(struct net_device *ndev, if (aq_cfg->is_lro != is_lro) { aq_cfg->is_lro = is_lro; - - if (netif_running(ndev)) { - aq_ndev_close(ndev); - aq_ndev_open(ndev); - } + need_ndev_restart = true; } } - if ((aq_nic->ndev->features ^ features) & NETIF_F_RXCSUM) + + if ((aq_nic->ndev->features ^ features) & NETIF_F_RXCSUM) { err = aq_nic->aq_hw_ops->hw_set_offload(aq_nic->aq_hw, aq_cfg); + if (unlikely(err)) + goto err_exit; + } + + if (aq_cfg->is_vlan_rx_strip != is_vlan_rx_strip) { + aq_cfg->is_vlan_rx_strip = is_vlan_rx_strip; + need_ndev_restart = true; + } + if (aq_cfg->is_vlan_tx_insert != is_vlan_tx_insert) { + aq_cfg->is_vlan_tx_insert = is_vlan_tx_insert; + need_ndev_restart = true; + } + + if (need_ndev_restart && netif_running(ndev)) { + aq_ndev_close(ndev); + aq_ndev_open(ndev); + } + err_exit: return err; }