[dpdk-dev] [PATCH v1 00/15] rte_driver/device infrastructure

2016-07-15 Thread Jan Viktorin
On Fri, 15 Jul 2016 15:19:14 +0200
Thomas Monjalon  wrote:

> 2016-07-08 21:09, Jan Viktorin:
> > Hello,
> > 
> > based on the discussions with Shreyansh, I propose a patchset with
> > the important EAL changes. It is incomplete and I suppose to extend
> > and change certain things in the foreseeable future.
> > 
> > Important notes:
> > 
> > * pmd_type is removed
> > * introduced rte_vdev_driver inheriting rte_driver
> > * PMD_REGISTER_DRIVER is replaced by RTE_EAL_VDRV_REGISTER
> > * rte_driver/device integrated into rte_pci_driver/device
> > * all drivers and devices are in 2 lists - general and bus-specific
> > 
> > Shreyansh, I hope I do not duplicate your work. I tried to avoid touching
> > pmd_type but it quite complicated... There is also an initial generalization
> > of rte_pci_resource. More such generalizations are to be done.
> > 
> > The init/uninit functions cannot be generalized easily, I think. Both PCI
> > and VDEV have different requirements.
> > 
> > No idea about hotplug...  
> 
> Please could you give a clear overview of how you split the work in
> your respective series?

Yes, it's a bit messy... My quick summary follows.

> 
> I take the opportunity to put my notes about some initial targets of
> this refactoring:
> 
> module/drivers
>   attached to 1 bus: pci_driver or vdev_driver

pci_driver is done by Shreyansh/David
vdev_driver is done by myself

>   rte_device = device resources / embedded in pci/vdev_driver

Extraction of rte_device is done by myself

>   attached to n device interfaces (ethdev, crypto)
>   1 device resource -> n device interfaces

I am not sure, what those two points means exactly.

>   hotplug resource -> lookup drivers list
>   per-bus lists or 1 list?

Not sure. At least partially done by Shreyansh/David.

>   devinit/devuninit generalized and moved to rte_driver
>   -> rename to probe/remove  

Some renames done by Shreyansh/David.

There will be no move. The vdev_driver has different kind of init/uninit
then PCI. So I cannot see a simple way how to generalize this.

I'll do the final init->probe, uninit->remove renames.

>   crypto.dev_type could be dropped

I am not sure about this.

>   drv_flags should be moved to rte_driver

I'll do.

>   intr_init can be moved earlier in init, before affinity set
> devices

Done by Shreyansh/David.

>   unique_device_name -> standard naming?

Done for PCI: rte_eal_pci_device_name by Shreyansh/David.

>   difference with port_id ? -> device id for ethdev

Not sure.

>   should be unique_resource_name -> 1 EAL resource may match 
> several devices

Not sure.

>   ethdev manage an interface, eal manage a hardware resource, device 
> object in between?

Not sure about the question.

>   need for bus object?

I don't think so at this stage.

>   no need of driver object, module object?

The current rte_driver will not exist. Same for any kind of module.

>   devargs, intr_handle, numa_node should be moved to rte_device

Yes, done by myself.

> hotplug notification to do
>   notify free-able ressource?
>   remove blacklist at EAL level and let application handle it
>   devargs still in hotplug function, must be moved in separate API
> devargs
>   new API
>   new command line parameters
> 



-- 
   Jan Viktorin  E-mail: Viktorin at RehiveTech.com
   System Architect  Web:www.RehiveTech.com
   RehiveTech
   Brno, Czech Republic


[dpdk-dev] [PATCH v1 00/15] rte_driver/device infrastructure

2016-07-15 Thread Thomas Monjalon
2016-07-08 21:09, Jan Viktorin:
> Hello,
> 
> based on the discussions with Shreyansh, I propose a patchset with
> the important EAL changes. It is incomplete and I suppose to extend
> and change certain things in the foreseeable future.
> 
> Important notes:
> 
> * pmd_type is removed
> * introduced rte_vdev_driver inheriting rte_driver
> * PMD_REGISTER_DRIVER is replaced by RTE_EAL_VDRV_REGISTER
> * rte_driver/device integrated into rte_pci_driver/device
> * all drivers and devices are in 2 lists - general and bus-specific
> 
> Shreyansh, I hope I do not duplicate your work. I tried to avoid touching
> pmd_type but it quite complicated... There is also an initial generalization
> of rte_pci_resource. More such generalizations are to be done.
> 
> The init/uninit functions cannot be generalized easily, I think. Both PCI
> and VDEV have different requirements.
> 
> No idea about hotplug...

Please could you give a clear overview of how you split the work in
your respective series?

I take the opportunity to put my notes about some initial targets of
this refactoring:

module/drivers
attached to 1 bus: pci_driver or vdev_driver
rte_device = device resources / embedded in pci/vdev_driver
attached to n device interfaces (ethdev, crypto)
1 device resource -> n device interfaces
hotplug resource -> lookup drivers list
per-bus lists or 1 list?
devinit/devuninit generalized and moved to rte_driver
-> rename to probe/remove
crypto.dev_type could be dropped
drv_flags should be moved to rte_driver
intr_init can be moved earlier in init, before affinity set
devices
unique_device_name -> standard naming?
difference with port_id ? -> device id for ethdev
should be unique_resource_name -> 1 EAL resource may match 
several devices
ethdev manage an interface, eal manage a hardware resource, device 
object in between?
need for bus object?
no need of driver object, module object?
devargs, intr_handle, numa_node should be moved to rte_device
hotplug notification to do
notify free-able ressource?
remove blacklist at EAL level and let application handle it
devargs still in hotplug function, must be moved in separate API
devargs
new API
new command line parameters



[dpdk-dev] [PATCH v1 00/15] rte_driver/device infrastructure

2016-07-11 Thread Shreyansh jain
Hi Jan,

On Saturday 09 July 2016 12:39 AM, Jan Viktorin wrote:
> Hello,
> 
> based on the discussions with Shreyansh, I propose a patchset with
> the important EAL changes. It is incomplete and I suppose to extend
> and change certain things in the foreseeable future.
> 
> Important notes:
> 
> * pmd_type is removed
> * introduced rte_vdev_driver inheriting rte_driver
> * PMD_REGISTER_DRIVER is replaced by RTE_EAL_VDRV_REGISTER
> * rte_driver/device integrated into rte_pci_driver/device
> * all drivers and devices are in 2 lists - general and bus-specific
> 
> Shreyansh, I hope I do not duplicate your work. I tried to avoid touching
> pmd_type but it quite complicated... There is also an initial generalization
> of rte_pci_resource. More such generalizations are to be done.

My mistake - I didn't even notice this email somehow. In fact, I noticed right 
when I was about to send the v6 - while searching for my old conversation.
I will look through these patches and remove any conflicting change (as much as 
possible) - I don't think it there would much conflicts except the VDEV area.
And, cursory look shows not much duplication - don't worry.

> 
> The init/uninit functions cannot be generalized easily, I think. Both PCI
> and VDEV have different requirements.
> 
> No idea about hotplug...
> 
> 
> The patchset is based on (all rebased on top of 34d279):
> 
>  [PATCH v5 00/17] Prepare for rte_device / rte_driver
> 
> 
> Thanks anybody for some quick review and notes.

Added to my list of todo. I will review and reply soon.

> 
> Regards
> Jan

-
Shreyansh

[...]


[dpdk-dev] [PATCH v1 00/15] rte_driver/device infrastructure

2016-07-08 Thread Jan Viktorin
Hello,

based on the discussions with Shreyansh, I propose a patchset with
the important EAL changes. It is incomplete and I suppose to extend
and change certain things in the foreseeable future.

Important notes:

* pmd_type is removed
* introduced rte_vdev_driver inheriting rte_driver
* PMD_REGISTER_DRIVER is replaced by RTE_EAL_VDRV_REGISTER
* rte_driver/device integrated into rte_pci_driver/device
* all drivers and devices are in 2 lists - general and bus-specific

Shreyansh, I hope I do not duplicate your work. I tried to avoid touching
pmd_type but it quite complicated... There is also an initial generalization
of rte_pci_resource. More such generalizations are to be done.

The init/uninit functions cannot be generalized easily, I think. Both PCI
and VDEV have different requirements.

No idea about hotplug...


The patchset is based on (all rebased on top of 34d279):

 [PATCH v5 00/17] Prepare for rte_device / rte_driver


Thanks anybody for some quick review and notes.

Regards
Jan

--

Jan Viktorin (15):
  eal: extract vdev infra
  eal: no need to test for PMD_VDEV anymore
  eal: do not call init for PMD_PDEV drivers
  drivers: convert PMD_VDEV drivers to use rte_vdev_driver
  eal: move init/uninit to rte_vdev_driver
  eal: remove PMD_REGISTER_DRIVER
  eal: get rid of pmd_type
  eal: define macro container_of
  eal: rte_pci.h includes rte_dev.h
  eal: rename and move rte_pci_resource
  eal/pci: inherit rte_driver by rte_pci_driver
  eal: call rte_eal_driver_register
  eal: introduce rte_device
  eal/pci: inherit rte_device by rte_pci_device
  eal/pci: insert rte_device on scan

 app/test/test_pci.c|  10 ++-
 app/test/virtual_pmd.c |   6 +-
 drivers/crypto/aesni_gcm/aesni_gcm_pmd.c   |  13 ++--
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c |  13 ++--
 drivers/crypto/kasumi/rte_kasumi_pmd.c |  13 ++--
 drivers/crypto/null/null_crypto_pmd.c  |  13 ++--
 drivers/crypto/qat/rte_qat_cryptodev.c |   4 +-
 drivers/crypto/snow3g/rte_snow3g_pmd.c |  13 ++--
 drivers/net/af_packet/rte_eth_af_packet.c  |  11 ++--
 drivers/net/bnx2x/bnx2x_ethdev.c   |   8 ++-
 drivers/net/bonding/rte_eth_bond_pmd.c |  11 ++--
 drivers/net/cxgbe/cxgbe_ethdev.c   |   4 +-
 drivers/net/cxgbe/sge.c|   6 +-
 drivers/net/e1000/em_ethdev.c  |   4 +-
 drivers/net/e1000/igb_ethdev.c |   8 ++-
 drivers/net/ena/ena_ethdev.c   |   4 +-
 drivers/net/enic/enic_ethdev.c |   4 +-
 drivers/net/fm10k/fm10k_ethdev.c   |  10 +--
 drivers/net/i40e/i40e_ethdev.c |   4 +-
 drivers/net/i40e/i40e_ethdev_vf.c  |   4 +-
 drivers/net/i40e/i40e_fdir.c   |   2 +-
 drivers/net/ixgbe/ixgbe_ethdev.c   |   8 ++-
 drivers/net/mlx4/mlx4.c|   4 +-
 drivers/net/mlx5/mlx5.c|   4 +-
 drivers/net/mpipe/mpipe_tilegx.c   |  20 +++---
 drivers/net/nfp/nfp_net.c  |   4 +-
 drivers/net/null/rte_eth_null.c|  11 ++--
 drivers/net/pcap/rte_eth_pcap.c|  11 ++--
 drivers/net/qede/qede_ethdev.c |   4 ++
 drivers/net/ring/rte_eth_ring.c|  11 ++--
 drivers/net/szedata2/rte_eth_szedata2.c|   8 ++-
 drivers/net/vhost/rte_eth_vhost.c  |  11 ++--
 drivers/net/virtio/virtio_ethdev.c |   6 +-
 drivers/net/virtio/virtio_pci.c|   2 +-
 drivers/net/vmxnet3/vmxnet3_ethdev.c   |   7 +-
 drivers/net/vmxnet3/vmxnet3_rxtx.c |   2 +-
 drivers/net/xenvirt/rte_eth_xenvirt.c  |  11 ++--
 lib/librte_cryptodev/rte_cryptodev.c   |   6 +-
 lib/librte_eal/bsdapp/eal/Makefile |   1 +
 lib/librte_eal/common/Makefile |   2 +-
 lib/librte_eal/common/eal_common_dev.c |  67 +++
 lib/librte_eal/common/eal_common_pci.c |  20 +++---
 lib/librte_eal/common/eal_common_vdev.c| 100 +
 lib/librte_eal/common/include/rte_common.h |  16 +
 lib/librte_eal/common/include/rte_dev.h|  54 +---
 lib/librte_eal/common/include/rte_pci.h|  20 ++
 lib/librte_eal/common/include/rte_vdev.h   |  96 +++
 lib/librte_eal/linuxapp/eal/Makefile   |   1 +
 lib/librte_eal/linuxapp/eal/eal_ivshmem.c  |   2 +-
 lib/librte_eal/linuxapp/eal/eal_pci.c  |   7 +-
 lib/librte_ether/rte_ethdev.c  |  16 +++--
 51 files changed, 468 insertions(+), 229 deletions(-)
 create mode 100644 lib/librte_eal/common/eal_common_vdev.c
 create mode 100644 lib/librte_eal/common/include/rte_vdev.h

-- 
2.9.0