On Sat, 27 Jun 2026 08:09:09 +0800
fengchengwen <[email protected]> wrote:
> >
> > +static int
> > +ae4dma_dev_configure(struct rte_dma_dev *dev __rte_unused,
> > + const struct rte_dma_conf *dev_conf,
> > + uint32_t conf_sz)
> > +{
> > + if (sizeof(struct rte_dma_conf) != conf_sz)
> > + return -EINVAL;
>
> This may break ABI compatible
Ignore that suggestion. This is a reasonable way to handle new configuration
functions. You need/want a minimal set of values. If rte_dma_conf grows in size
then the code can add compatability; by requiring a minimum set of values
and then setting the rest to zero.
Something like
static int
ae4dma_dev_configure(struct rte_dma_dev *dev __rte_unused,
const struct rte_dma_conf *dev_conf,
size_t conf_sz)
{
if (conf_sz < sizeof(struct orig_rte_dma_conf))
return -EINVAL;
struct rte_dma_conf conf;
memcpy(&conf, dev_conf, RTE_MIN(conf_sz, sizeof(conf)));
dev_conf = &conf;
Looking at rte_dma_conf the structure has holes and dmadev lib
doesn't validate undefined flags, so it already has future ABI problems.