[dpdk-dev] [PATCH v5 8/9] virtio: add 1.0 support

2016-01-27 Thread Yuanhan Liu
On Thu, Jan 21, 2016 at 12:37:42PM +0100, Thomas Monjalon wrote: > 2016-01-19 16:12, Yuanhan Liu: > > +#define IO_READ_DEF(nr_bits, type) \ > > +static inline type \ > > +io_read##nr_bits(type *addr) \ > > +{

[dpdk-dev] [PATCH v5 8/9] virtio: add 1.0 support

2016-01-27 Thread Yuanhan Liu
On Thu, Jan 21, 2016 at 12:49:10PM +0100, Thomas Monjalon wrote: > 2016-01-19 16:12, Yuanhan Liu: > > int > > vtpci_init(struct rte_pci_device *dev, struct virtio_hw *hw) > > { > > - hw->vtpci_ops = _ops; > > + hw->dev = dev; > > + > > + /* > > +* Try if we can succeed

[dpdk-dev] [PATCH v5 8/9] virtio: add 1.0 support

2016-01-27 Thread Thomas Monjalon
2016-01-27 11:46, Yuanhan Liu: > On Thu, Jan 21, 2016 at 12:49:10PM +0100, Thomas Monjalon wrote: > > 2016-01-19 16:12, Yuanhan Liu: > > > int > > > vtpci_init(struct rte_pci_device *dev, struct virtio_hw *hw) > > > { > > > - hw->vtpci_ops = _ops; > > > + hw->dev = dev; > > > + > >

[dpdk-dev] [PATCH v5 8/9] virtio: add 1.0 support

2016-01-21 Thread Thomas Monjalon
2016-01-19 16:12, Yuanhan Liu: > int > vtpci_init(struct rte_pci_device *dev, struct virtio_hw *hw) > { > - hw->vtpci_ops = _ops; > + hw->dev = dev; > + > + /* > +* Try if we can succeed reading virtio pci caps, which exists > +* only on modern pci device. If

[dpdk-dev] [PATCH v5 8/9] virtio: add 1.0 support

2016-01-21 Thread Thomas Monjalon
2016-01-19 16:12, Yuanhan Liu: > +#define IO_READ_DEF(nr_bits, type) \ > +static inline type \ > +io_read##nr_bits(type *addr) \ > +{ \ > + return *(volatile type *)addr; \ > +} >

[dpdk-dev] [PATCH v5 8/9] virtio: add 1.0 support

2016-01-19 Thread Yuanhan Liu
Modern (v1.0) virtio pci device defines several pci capabilities. Each cap has a configure structure corresponding to it, and the cap.bar and cap.offset fields tell us where to find it. Firstly, we map the pci resources by rte_eal_pci_map_device(). We then could easily locate a cfg structure by: