From patchwork Fri Dec 8 21:16:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 121247 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp1081qgn; Fri, 8 Dec 2017 13:20:27 -0800 (PST) X-Google-Smtp-Source: AGs4zMY8+3Ugwnypg2UXuaSxPbC5uI9/UfWf8hlner9OJPs9ctoqKLdF5ZDWrjMchS1FoxvQcIXy X-Received: by 10.99.175.14 with SMTP id w14mr3365043pge.11.1512768027754; Fri, 08 Dec 2017 13:20:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512768027; cv=none; d=google.com; s=arc-20160816; b=mFCGQkiyXkvUXoVNHhKqS1FUu2arKZ1l50uQfaw2cbmhKcaWvKD199h9R0kdc4FZrX bAeOWsXW+ahHfdksf5MXBAcrCYuOrI4Vy7nJvMNVBDhufVpkx9llSp+6/P3j1l8gWwBd hG2WH8LJPgKK5uBXCFH5yGarT4jYiulMeWxOlotqwoFP6IEsk+UZ4lPhgpCdoi/5F2CF sED+TLa7Q/AR4IYqMArVK5Ym9A9ur1wVsTetgk+2aiIc5Lt4FhKuQdu9kEKp5VemdLRi Iv1OFTF0T0fnZHvz5vz9aPz2fPOZ4kn57XenPTGqZplhbUEtdr2PO/U9LkJl7llXraQF yUKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:arc-authentication-results; bh=maRHgrPHajOCFKve+toTOQ8oCbdMsdtwvJieefIBTcE=; b=W5OvF5MjKkjoiV2zoX3btdjnzdBKxBItUH8m3K84kwkq+u9UOfC+qsRLWhA0m27GuP +7iI9kfRZF4OR52EOCBQONUVN+jX4UbM0llvMCxpbF4I0RtjzSdL12xyZYuFG0X7J6Wv lMwGLmi99pw86pXGS9cqYoufls8VQY2u8WkI13glZrkV3uXdxFv/RuI/mBKmUTDeKeka M8BEwqkoblb84J6IjF7VO4kKwBkNrYJoLMcqmvskgUasTwDKscAjaecDmx5lDyfoDIMQ IIaEbgUXMmCyeEG9JTt22KYNmpysR9kxEbXMkIoGqugcoZXInRH0DdTmmHnvx7mrsdhw q84A== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 92si6007067pli.326.2017.12.08.13.20.27; Fri, 08 Dec 2017 13:20:27 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753527AbdLHVUZ (ORCPT + 19 others); Fri, 8 Dec 2017 16:20:25 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:37146 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752572AbdLHVRx (ORCPT ); Fri, 8 Dec 2017 16:17:53 -0500 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 305C91F90F785; Sat, 9 Dec 2017 05:17:39 +0800 (CST) Received: from S00293818-DELL1.china.huawei.com (10.202.226.117) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.361.1; Sat, 9 Dec 2017 05:17:33 +0800 From: Salil Mehta To: CC: , , , , , , , Subject: [PATCH V2 net-next 0/8] Hisilicon Network Subsystem 3 VF Ethernet Driver Date: Fri, 8 Dec 2017 21:16:54 +0000 Message-ID: <20171208211702.20104-1-salil.mehta@huawei.com> X-Mailer: git-send-email 2.8.3 MIME-Version: 1.0 X-Originating-IP: [10.202.226.117] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch-set contains the support of the HNS3 (Hisilicon Network Subsystem 3) Virtual Function Ethernet driver for hip08 family of SoCs. The Physical Function driver is already part of the Linux mainline. This VF driver has its Hardware Compatibility Layer and has commom/unified ENET layer/client/ethtool code with the PF driver. It also has support of mailbox to communicate with the HNS3 PF driver. The basic architecture of VF driver is derivative of the PF driver. Just like PF driver, this driver is also PCI Express based. This driver is the ongoing development work and HNS3 VF Ethernet driver would be incrementally enhanced with more new features. High Level Architecture: [ Ethtool ] | [ Ethernet Client ] ... [ RoCE Client ] | | [ HNAE Device ] |________ | | | --------------------------------------------- | | [ HNAE3 Framework (Register/unregister) ] | | --------------------------------------------- | | | [ VF HCLGE Layer ] | | | | | | | | | | | [ VF Mailbox (To PF via IMP) ] | | | | [ IMP command Interface ] [ IMP command Interface ] | | | | (A B O V E R U N S O N G U E S T S Y S T E M) ------------------------------------------------------------- Q E M U / V F I O / K V M (on Host System) ------------------------------------------------------------- HIP08 H A R D W A R E (limited to VF by SMMU) [ IMP/Mgmt Processor (hardware common to system/cmd based) ] Fig 1. HNS3 Virtual Function Driver [ dcbnl ] [ Ethtool ] | | [ Ethernet Client ] [ ODP/UIO Client ] . . .[ RoCE Client ] |_____________________| | | _________| [ HNAE Device ] | | | | | --------------------------------------------- | | [ HNAE3 Framework (Register/unregister) ] | | --------------------------------------------- | | | [ HCLGE Layer ] | ________________|_________________ | | | | | [ DCB ] | | | | | | | [ Scheduler/Shaper ] [ MDIO ] [ PF Mailbox ] | | | | | |________________|_________________| | | | [ IMP command Interface ] [ IMP command Interface ] ---------------------------------------------------------------- HIP08 H A R D W A R E [ IMP/Mgmt Processor (hardware common to system/cmd based) ] Fig 2. Existing HNS3 PF Driver (added with mailbox) Change Log Summary: Patch V2: 1. Addressed some comments by David Miller. 2. Addressed some internal comments on various patches Patch V1: Initial Submit NOTE: This patch depends upon https://lkml.org/lkml/2017/11/30/1079 Salil Mehta (8): net: hns3: Add HNS3 VF IMP(Integrated Management Proc) cmd interface net: hns3: Add mailbox support to VF driver net: hns3: Add HNS3 VF HCL(Hardware Compatibility Layer) Support net: hns3: Add HNS3 VF driver to kernel build framework net: hns3: Unified HNS3 {VF|PF} Ethernet Driver for hip08 SoC net: hns3: Add mailbox support to PF driver net: hns3: Change PF to add ring-vect binding & resetQ to mailbox net: hns3: Add mailbox interrupt handling to PF driver drivers/net/ethernet/hisilicon/Kconfig | 28 +- drivers/net/ethernet/hisilicon/hns3/Makefile | 7 +- drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h | 94 ++ drivers/net/ethernet/hisilicon/hns3/hnae3.c | 14 +- drivers/net/ethernet/hisilicon/hns3/hnae3.h | 7 +- .../hisilicon/hns3/{hns3pf => }/hns3_dcbnl.c | 2 +- .../hisilicon/hns3/{hns3pf => }/hns3_enet.c | 2 + .../hisilicon/hns3/{hns3pf => }/hns3_enet.h | 0 .../hisilicon/hns3/{hns3pf => }/hns3_ethtool.c | 22 +- .../net/ethernet/hisilicon/hns3/hns3pf/Makefile | 7 +- .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 207 +-- .../ethernet/hisilicon/hns3/hns3pf/hclge_main.h | 17 +- .../net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c | 416 ++++++ .../net/ethernet/hisilicon/hns3/hns3vf/Makefile | 8 + .../ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c | 348 +++++ .../ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.h | 262 ++++ .../ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 1495 ++++++++++++++++++++ .../ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h | 170 +++ .../ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c | 188 +++ 19 files changed, 3171 insertions(+), 123 deletions(-) create mode 100644 drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h rename drivers/net/ethernet/hisilicon/hns3/{hns3pf => }/hns3_dcbnl.c (97%) rename drivers/net/ethernet/hisilicon/hns3/{hns3pf => }/hns3_enet.c (99%) rename drivers/net/ethernet/hisilicon/hns3/{hns3pf => }/hns3_enet.h (100%) rename drivers/net/ethernet/hisilicon/hns3/{hns3pf => }/hns3_ethtool.c (97%) create mode 100644 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c create mode 100644 drivers/net/ethernet/hisilicon/hns3/hns3vf/Makefile create mode 100644 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c create mode 100644 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.h create mode 100644 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c create mode 100644 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h create mode 100644 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c -- 2.7.4