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) \
> > +{
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 = &legacy_ops;
> > + hw->dev = dev;
> > +
> > + /*
> > +* Try if we can s
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 = &legacy_ops;
> > > + hw->dev = dev;
> > >
2016-01-19 16:12, Yuanhan Liu:
> int
> vtpci_init(struct rte_pci_device *dev, struct virtio_hw *hw)
> {
> - hw->vtpci_ops = &legacy_ops;
> + hw->dev = dev;
> +
> + /*
> +* Try if we can succeed reading virtio pci caps, which exists
> +* only on modern pci device
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; \
> +}
> +
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:
6 matches
Mail list logo