Re: [PATCH 00/15] Adding GAUDI NIC code to habanalabs driver

Jakub Kicinski
2020-09-10T20:46:31Z

On Thu, 10 Sep 2020 23:16:22 +0300 Oded Gabbay wrote:
> On Thu, Sep 10, 2020 at 11:01 PM Jakub Kicinski <kuba@kernel.org> wrote:
> > On Thu, 10 Sep 2020 19:11:11 +0300 Oded Gabbay wrote:
> > > create mode 100644 drivers/misc/habanalabs/gaudi/gaudi_nic.c
> > > create mode 100644 drivers/misc/habanalabs/gaudi/gaudi_nic.h
> > > create mode 100644 drivers/misc/habanalabs/gaudi/gaudi_nic_dcbnl.c
> > > create mode 100644 drivers/misc/habanalabs/gaudi/gaudi_nic_debugfs.c
> > > create mode 100644 drivers/misc/habanalabs/gaudi/gaudi_nic_ethtool.c
> > > create mode 100644 drivers/misc/habanalabs/gaudi/gaudi_phy.c
> > > create mode 100644 drivers/misc/habanalabs/include/gaudi/asic_reg/nic0_qm0_masks.h
> > > create mode 100644 drivers/misc/habanalabs/include/gaudi/asic_reg/nic0_qm0_regs.h
> > > create mode 100644 drivers/misc/habanalabs/include/gaudi/asic_reg/nic0_qm1_regs.h
> > > create mode 100644 drivers/misc/habanalabs/include/gaudi/asic_reg/nic0_qpc0_masks.h
> > > create mode 100644 drivers/misc/habanalabs/include/gaudi/asic_reg/nic0_qpc0_regs.h
> > > create mode 100644 drivers/misc/habanalabs/include/gaudi/asic_reg/nic0_qpc1_regs.h
> > > create mode 100644 drivers/misc/habanalabs/include/gaudi/asic_reg/nic0_rxb_regs.h
> > > create mode 100644 drivers/misc/habanalabs/include/gaudi/asic_reg/nic0_rxe0_masks.h
> > > create mode 100644 drivers/misc/habanalabs/include/gaudi/asic_reg/nic0_rxe0_regs.h
> > > create mode 100644 drivers/misc/habanalabs/include/gaudi/asic_reg/nic0_rxe1_regs.h
> > > create mode 100644 drivers/misc/habanalabs/include/gaudi/asic_reg/nic0_stat_regs.h
> > > create mode 100644 drivers/misc/habanalabs/include/gaudi/asic_reg/nic0_tmr_regs.h
> > > create mode 100644 drivers/misc/habanalabs/include/gaudi/asic_reg/nic0_txe0_masks.h
> > > create mode 100644 drivers/misc/habanalabs/include/gaudi/asic_reg/nic0_txe0_regs.h
> > > create mode 100644 drivers/misc/habanalabs/include/gaudi/asic_reg/nic0_txe1_regs.h
> > > create mode 100644 drivers/misc/habanalabs/include/gaudi/asic_reg/nic0_txs0_masks.h
> > > create mode 100644 drivers/misc/habanalabs/include/gaudi/asic_reg/nic0_txs0_regs.h
> > > create mode 100644 drivers/misc/habanalabs/include/gaudi/asic_reg/nic0_txs1_regs.h
> > > create mode 100644 drivers/misc/habanalabs/include/gaudi/asic_reg/nic1_qm0_regs.h
> > > create mode 100644 drivers/misc/habanalabs/include/gaudi/asic_reg/nic1_qm1_regs.h
> > > create mode 100644 drivers/misc/habanalabs/include/gaudi/asic_reg/nic2_qm0_regs.h
> > > create mode 100644 drivers/misc/habanalabs/include/gaudi/asic_reg/nic2_qm1_regs.h
> > > create mode 100644 drivers/misc/habanalabs/include/gaudi/asic_reg/nic3_qm0_regs.h
> > > create mode 100644 drivers/misc/habanalabs/include/gaudi/asic_reg/nic3_qm1_regs.h
> > > create mode 100644 drivers/misc/habanalabs/include/gaudi/asic_reg/nic4_qm0_regs.h
> > > create mode 100644 drivers/misc/habanalabs/include/gaudi/asic_reg/nic4_qm1_regs.h
> > > create mode 100644 drivers/misc/habanalabs/include/hw_ip/nic/nic_general.h
> >
> > The relevant code needs to live under drivers/net/(ethernet/).
> > For one thing our automation won't trigger for drivers in random
> > (/misc) part of the tree.
>
> Can you please elaborate on how to do this with a single driver that
> is already in misc ?
> As I mentioned in the cover letter, we are not developing a
> stand-alone NIC. We have a deep-learning accelerator with a NIC
> interface.
> Therefore, we don't have a separate PCI physical function for the NIC
> and I can't have a second driver registering to it.

Is it not possible to move the files and still build them into a single
module?

> We did this design based on existing examples in the kernel
> (registering to netdev), such as (just a few examples):
> 1. sgi-xp driver in drivers/misc/sgi-xp (see file xpnet.c)
> 2. bnx2fc in drivers/scsi/bnx2fc
>
> Thanks,
> Oded