From patchwork Sun Dec 3 12:32:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 843971 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@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=) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3yqSBC1ZYRz9s83 for ; Sun, 3 Dec 2017 23:34:27 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752194AbdLCMeD (ORCPT ); Sun, 3 Dec 2017 07:34:03 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:2245 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751156AbdLCMeB (ORCPT ); Sun, 3 Dec 2017 07:34:01 -0500 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id D74D398491A0A; Sun, 3 Dec 2017 20:33:54 +0800 (CST) Received: from S00293818-DELL1.china.huawei.com (10.47.82.162) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.361.1; Sun, 3 Dec 2017 20:33:47 +0800 From: Salil Mehta To: CC: , , , , , , , Subject: [PATCH net-next 0/8] Hisilicon Network Subsystem 3 VF Ethernet Driver Date: Sun, 3 Dec 2017 12:32:59 +0000 Message-ID: <20171203123307.19820-1-salil.mehta@huawei.com> X-Mailer: git-send-email 2.8.3 MIME-Version: 1.0 X-Originating-IP: [10.47.82.162] X-CFilter-Loop: Reflected Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@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. 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) 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 | 203 +-- .../ethernet/hisilicon/hns3/hns3pf/hclge_main.h | 17 +- .../net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c | 415 ++++++ .../net/ethernet/hisilicon/hns3/hns3vf/Makefile | 8 + .../ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c | 341 +++++ .../ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.h | 262 ++++ .../ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 1491 ++++++++++++++++++++ .../ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h | 170 +++ .../ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c | 187 +++ 19 files changed, 3157 insertions(+), 120 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