[dpdk-dev] [PATCH 26/28] net/virtio: use eal I/O device memory read/write API

Yuanhan Liu yuanhan.liu at linux.intel.com
Fri Dec 16 03:12:56 CET 2016


On Wed, Dec 14, 2016 at 09:45:34PM -0800, Santosh Shukla wrote:
> On Wed, Dec 14, 2016 at 11:02:23AM +0800, Yuanhan Liu wrote:
> > On Wed, Dec 14, 2016 at 07:25:56AM +0530, Jerin Jacob wrote:
> > >   * Following macros are derived from linux/pci_regs.h, however,
> > >   * we can't simply include that header here, as there is no such
> > > @@ -320,37 +322,37 @@ static const struct virtio_pci_ops legacy_ops = {
> > >  static inline uint8_t
> > >  io_read8(uint8_t *addr)
> > >  {
> > > -	return *(volatile uint8_t *)addr;
> > > +	return rte_readb(addr);
> > >  }
> > 
> > Oh, one more comments: why not replacing io_read8 with rte_readb(),
> > and do similar for others? Then we don't have to define those wrappers.
> > 
> > I think you can also do something similar for other patches?
> 
> Make sense for the virtio-pci case where API name io_read/write as good as
> rte_read/write.

Yes, and I think there are few others like this in your example.

> However, IMO for other drivers for example ADF_CSR_RD/WR
> improves code readability compared to plain rte_read/write.

Sure, for such case, we should not replace the macro.

	--yliu


More information about the dev mailing list