On Wed, 13 Nov 2024 17:22:57 +0800 (CST)
<[email protected]> wrote:
> Hi Stephen,
>
> >> +char zxdh_gdma_driver_name[] = "rawdev_zxdh_gdma";>> +char dev_name[] =
> >> "zxdh_gdma";>> +>> +uint32_t>> +zxdh_gdma_read_reg(struct rte_rawdev *dev,
> >> uint16_t queue_id, uint32_t offset)>> +{>> + struct zxdh_gdma_rawdev
> >> *gdmadev = zxdh_gdma_rawdev_get_priv(dev);>> + uint32_t addr = 0;>> +
> >> uint32_t val = 0;>> +>> + addr = offset + queue_id *
> >> ZXDH_GDMA_CHAN_SHIFT;>> + val = *(uint32_t *)(gdmadev->base_addr +
> >> addr);>> +>> + return val;>> +}>> +>> +void>>
> >> +zxdh_gdma_write_reg(struct rte_rawdev *dev, uint16_t queue_id, uint32_t
> >> offset, uint32_t val)>> +{>> + struct zxdh_gdma_rawdev *gdmadev =
> >> zxdh_gdma_rawdev_get_priv(dev);>> + uint32_t addr = 0;>> +>> + addr
> >> = offset + queue_id * ZXDH_GDMA_CHAN_SHIFT;>> + *(uint32_t
> >> *)(gdmadev->base_addr + addr) = val;>> +}>>This driver is made up one C
> >> file. Please make all these helper functions>and the names static. If
> >> static checkers and optimizers can work better.
>
> Thanks for your suggestion, I will check other functions. But these two
> functions will also
> be called by the test application(Not Submitted), so it is not appropriate to
> names static.
If you need the functions for a test app then they need to be in version.map and
in a user API header file. It is ok to have PMD specific hooks, but they need to
be treated as real API's.