mbox series

[net-next,0/8] Hisilicon Network Subsystem 3 VF Ethernet Driver

Message ID 20171203123307.19820-1-salil.mehta@huawei.com
Headers show
Series Hisilicon Network Subsystem 3 VF Ethernet Driver | expand

Message

Salil Mehta Dec. 3, 2017, 12:32 p.m. UTC
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

Comments

Or Gerlitz Dec. 3, 2017, 1:22 p.m. UTC | #1
On Sun, Dec 3, 2017 at 2:32 PM, Salil Mehta <salil.mehta@huawei.com> wrote:
> 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.


Hi,

I wasn't sure if/what PF side control plane user space APIs are
supported by this series,
can you elaborate on that?  Please note that since 4.8, the kernel
supports switchdev
mode for SRIOV drivers and it's highly desirable for new drivers to
support that. The old
mode (called legacy) is inferior in functionality and design. We
didn't do a clear statement
asking new drivers not to support the legacy mode, but still, it would
be good to support
the new mode from day one.

Or.
Salil Mehta Dec. 4, 2017, 10:48 a.m. UTC | #2
Hi Or, 
> 

> ---------- Forwarded message ----------

> From: Or Gerlitz <gerlitz.or@gmail.com>

> Date: Sun, Dec 3, 2017 at 1:22 PM

> Subject: Re: [PATCH net-next 0/8] Hisilicon Network Subsystem 3 VF

> Ethernet Driver

> To: Salil Mehta <salil.mehta@huawei.com>

> Cc: David Miller <davem@davemloft.net>, yisen.zhuang@huawei.com,

> lipeng321@huawei.com, mehta.salil.lnk@gmail.com, Linux Netdev List

> <netdev@vger.kernel.org>, Andy Gospodarek <andy@greyhouse.net>, Simon

> Horman <simon.horman@netronome.com>, Jiri Pirko <jiri@mellanox.com>

> 

> 

> On Sun, Dec 3, 2017 at 2:32 PM, Salil Mehta <salil.mehta@huawei.com>

> wrote:

> > 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.

> 

> Hi,

> 

> I wasn't sure if/what PF side control plane user space APIs are

> supported by this series,

> can you elaborate on that? 

Current VF driver just supports very basic functionality. Idea was to
push basic RX/TX/RSS/TSO support along with this version.


> Please note that since 4.8, the kernel

> supports switchdev

> mode for SRIOV drivers and it's highly desirable for new drivers to

> support that. The old

> mode (called legacy) is inferior in functionality and design. We

> didn't do a clear statement

> asking new drivers not to support the legacy mode, but still, it would

> be good to support

> the new mode from day one.

We will support switchdev and other lined-up features after basic
version of the driver has gone through. We are in analysis phase right
now for all of these features.

Thanks
Salil
> 

> Or.
Or Gerlitz Dec. 4, 2017, 2:07 p.m. UTC | #3
On Mon, Dec 4, 2017 at 12:48 PM, Salil Mehta <salil.mehta@huawei.com> wrote:
>> From: Or Gerlitz <gerlitz.or@gmail.com>

>> I wasn't sure if/what PF side control plane user space APIs are
>> supported by this series, can you elaborate on that?

> Current VF driver just supports very basic functionality. Idea was to
> push basic RX/TX/RSS/TSO support along with this version.

I was referring to PF driver knobs to manage the e-switch, not to the VF driver.

> We will support switchdev and other lined-up features after basic
> version of the driver has gone through. We are in analysis phase right
> now for all of these features.

sounds good. You might want to consider supporting 1st or only the
switchdev mode, this will make your PF driver a community leader..

Or.
Salil Mehta Dec. 4, 2017, 2:28 p.m. UTC | #4
> -----Original Message-----

> From: Or Gerlitz [mailto:gerlitz.or@gmail.com]

> Sent: Monday, December 04, 2017 2:08 PM

> To: Salil Mehta <salil.mehta@huawei.com>

> Cc: davem@davemloft.net; Zhuangyuzeng (Yisen)

> <yisen.zhuang@huawei.com>; lipeng (Y) <lipeng321@huawei.com>;

> mehta.salil.lnk@gmail.com; netdev@vger.kernel.org; andy@greyhouse.net;

> simon.horman@netronome.com; jiri@mellanox.com

> Subject: Re: [PATCH net-next 0/8] Hisilicon Network Subsystem 3 VF

> Ethernet Driver

> 

> On Mon, Dec 4, 2017 at 12:48 PM, Salil Mehta <salil.mehta@huawei.com>

> wrote:

> >> From: Or Gerlitz <gerlitz.or@gmail.com>

> 

> >> I wasn't sure if/what PF side control plane user space APIs are

> >> supported by this series, can you elaborate on that?

> 

> > Current VF driver just supports very basic functionality. Idea was to

> > push basic RX/TX/RSS/TSO support along with this version.

> 

> I was referring to PF driver knobs to manage the e-switch, not to the

> VF driver.

Right. We have unified the Enet driver for VF and PF now which will have
all those hooks related to the switchdev once we decide to get down that
path. And since these are more related to PF they have to be taken care of
in separate patches.

> 

> > We will support switchdev and other lined-up features after basic

> > version of the driver has gone through. We are in analysis phase

> right

> > now for all of these features.

> 

> sounds good. You might want to consider supporting 1st or only the

> switchdev mode, this will make your PF driver a community leader..

Yes, we will consider it as part of our analysis.

Thanks
Salil

> 

> Or.