[dpdk-dev] [PATCH v2 08/16] ethdev: add callback support fortelemetry

Morten Brørup mb at smartsharesystems.com
Fri Apr 10 11:57:55 CEST 2020


> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Bruce Richardson
> Sent: Thursday, April 9, 2020 10:21 AM
> 
> On Wed, Apr 08, 2020 at 07:16:10PM +0100, Wiles, Keith wrote:
> >
> >
> > > On Apr 8, 2020, at 11:49 AM, Power, Ciara <ciara.power at intel.com>
> wrote:
> > >
> > > From: Bruce Richardson <bruce.richardson at intel.com>
> > >
> > > The ethdev library now registers commands with telemetry, and
> > > implements the callback functions. These commands allow the list of
> > > ethdev ports and the stats and link status for a port to be
> queried.
> > >
> > > Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
> > > Signed-off-by: Ciara Power <ciara.power at intel.com>
> > >
> > > ---
> > > v2:
> > >  - Renamed stats to xstats for device specific stats.
> > >  - Added link status command for ethdev ports.
> > > ---
> > > lib/librte_ethdev/Makefile     |   4 ++
> > > lib/librte_ethdev/meson.build  |   4 ++
> > > lib/librte_ethdev/rte_ethdev.c | 106
> +++++++++++++++++++++++++++++++++
> > > 3 files changed, 114 insertions(+)
> > >
> <snip>
> > +
> > > +if (link.link_status)
> > > +ret = snprintf(buffer, buf_len,
> > > +"{\"status\":\"%s\", \"speed\":%u, \"duplex\":"
> > > +"\"%s\"}", link.link_status ? "UP" : "DOWN:",

Also remove the colon after DOWN.

> > > +link.link_speed,
> > > +(link.link_duplex == ETH_LINK_FULL_DUPLEX) ?
> > > +("full-duplex") : ("half-duplex"));
> >
> > Adding link status nice. Please remove the spaces in the output
> string.
> >
> Good catch, thanks.



More information about the dev mailing list