[dpdk-dev] [RFC 2/4] app/testpmd: new flow dump CLI
Jerin Jacob
jerinjacobk at gmail.com
Tue Jan 14 15:00:49 CET 2020
On Tue, Jan 14, 2020 at 3:45 PM Jack Min <jackmin at mellanox.com> wrote:
>
> On Tue, 20-01-14, 10:01, Jerin Jacob wrote:
> > On Tue, Jan 14, 2020 at 9:15 AM Xiaoyu Min <jackmin at mellanox.com> wrote:
> > >
> > > From: Xueming Li <xuemingl at mellanox.com>
> > >
> > > New flow dump CLI to dump MLX5 PMD specific flows into screen.
> > >
> > > Signed-off-by: Xueming Li <xuemingl at mellanox.com>
> > > Signed-off-by: Xiaoyu Min <jackmin at mellanox.com>
> > > ---
> > > app/test-pmd/Makefile | 4 ++
> > > app/test-pmd/cmdline_flow.c | 91 +++++++++++++++++++++++++++++++++++++
> > > app/test-pmd/config.c | 33 ++++++++++++++
> > > app/test-pmd/meson.build | 3 ++
> > > app/test-pmd/testpmd.h | 1 +
> > > 5 files changed, 132 insertions(+)
> > >
> >
> > >
> > > +/** Dump all flow rules. */
> > > +int
> > > +port_flow_dump(portid_t port_id __rte_unused,
> > > + const char *file_name __rte_unused)
> > > +{
> > > + int ret = 0;
> > > +#ifdef RTE_LIBRTE_MLX5_PMD
> >
> > IMO, It should be the last resort to add driver-specific symbols in testpmd.
> > Why not introduce rte_flow_dump() and hook the MLX driver underneath?
> >
> Hey Jerin,
Hi Jack.
>
> Thanks for you comments.
>
> What my understanding is this flow dump is very Mellanox specific, it will dump
> all flows in Mellanox HW using Mellanox format. They are hardware flows in
> short, which are different from rte flow.
We do have a similar API for other drivers to represent the internal info.
I think, similar API[1] would suffice for your case. We should not
standardize the output of dump, instead, it will provide a generic API
to dump the internal representation of flow HW to file/stdout.
Octeontx2 MACM HW (rte_flow) has similar internal information,
We could implement the driver API if it is a generic API.
[1]
See the below example for eventdev driver.
/**
* Dump internal information about *dev_id* to the FILE* provided in *f*.
*
* @param dev_id
* The identifier of the device.
*
* @param f
* A pointer to a file for output
*
* @return
* - 0: on success
* - <0: on failure.
*/
int
rte_event_dev_dump(uint8_t dev_id, FILE *f);
>
> I don't know whether other vendor has the similar functionality and needs
> so an rte flow level API could be helpful.
>
> And basically rte flow API is based on rte_flow, a dump function probabily means
> dump rte_flow itself (i.e flow->attr, pattern, actions).
>
> This is the reason a private API is choosen and driver-specific symbols added
> in testpmd as result.
>
> -Jack
More information about the dev
mailing list