> > > >
> > >
> > > How about *_str_* style ?
> >
> > _name kind of implies it the string. may be _mode is good as it is short.
> >
> > > int
> > > rte_eth_rx_burst_mode_str_get(uint16_t port_id, uint16_t queue_id,
> > >                                       char *buf, int buflen)
> >
>
> About the function, keep the same is better ? Then we need no whole
> replace, just update the parameters, and the parameters indicated that
> it is in string format.

In this case, we need additional PMD op to get the buflen as
the application will not know the buffer size in advance. It needs to come
from the driver and common code.


See below.

>
> > We don't need buflen as it is not known to the application. The
> > typical pattern, we followed,
> > in dpdk is, when function called buf as NULL then the function returns
> > the expected size so that
> > the application can alloc and get the buffer from ethdev layer on the
> > next iteration.
> >
> >
>
> A little complicated and too heavy for using ? where is the example code ?

See rte_eth_xstats_get_names() API as example for dynamic buffer allocation
and similar use case in DPDK.

Reply via email to