[dpdk-dev] [PATCH] examples/eventdev_pipeline: add Tx adapter support

Pavan Nikhilesh pbhagavatula at caviumnetworks.com
Wed Sep 19 12:42:10 CEST 2018


On Wed, Sep 19, 2018 at 08:24:01AM +0530, Rao, Nikhil wrote:
> On 9/5/2018 7:15 PM, Pavan Nikhilesh wrote:
> > Signed-off-by: Pavan Nikhilesh <pbhagavatula at caviumnetworks.com>
> > ---
> >   This patch depends on the following series:
> >   http://patches.dpdk.org/project/dpdk/list/?series=1121
> >
> >   examples/eventdev_pipeline/main.c             |  62 ++--
> >   examples/eventdev_pipeline/pipeline_common.h  |  31 +-
> >   .../pipeline_worker_generic.c                 | 273 +++++-------------
> >   .../eventdev_pipeline/pipeline_worker_tx.c    | 130 +++++----
> >   4 files changed, 186 insertions(+), 310 deletions(-)
> >
> > diff --git a/examples/eventdev_pipeline/main.c b/examples/eventdev_pipeline/main.c
> > index 700bc696f..95531150b 100644
> > --- a/examples/eventdev_pipeline/main.c
> > +++ b/examples/eventdev_pipeline/main.c
> >
> >
> </snip>
>
> >   static void
> >   do_capability_setup(uint8_t eventdev_id)
> >   {
> > +     int ret;
> >       uint16_t i;
> > -     uint8_t mt_unsafe = 0;
> > +     uint8_t generic_pipeline = 0;
> >       uint8_t burst = 0;
> >
> >       RTE_ETH_FOREACH_DEV(i) {
> > -             struct rte_eth_dev_info dev_info;
> > -             memset(&dev_info, 0, sizeof(struct rte_eth_dev_info));
> > -
> > -             rte_eth_dev_info_get(i, &dev_info);
> > -             /* Check if it is safe ask worker to tx. */
> > -             mt_unsafe |= !(dev_info.tx_offload_capa &
> > -                             DEV_TX_OFFLOAD_MT_LOCKFREE);
> > +             uint32_t caps = 0;
> > +
> > +             ret = rte_event_eth_tx_adapter_caps_get(eventdev_id, i, &caps);
> > +             if (ret)
> > +                     rte_exit(EXIT_FAILURE,
> > +                             "Invalid capability for Tx adptr port %d\n", i);
> > +             generic_pipeline |= !(caps &
> > +                             RTE_EVENT_ETH_TX_ADAPTER_CAP_INTERNAL_PORT);
> >       }
> >
> >       struct rte_event_dev_info eventdev_info;
> > @@ -406,10 +386,10 @@ do_capability_setup(uint8_t eventdev_id)
> >       burst = eventdev_info.event_dev_cap & RTE_EVENT_DEV_CAP_BURST_MODE ? 1 :
> >               0;
> >
> > -     if (mt_unsafe)
> > +     if (generic_pipeline)
> >               set_worker_generic_setup_data(&fdata->cap, burst);
> >       else
> > -             set_worker_tx_setup_data(&fdata->cap, burst);
> > +             set_worker_tx_enq_setup_data(&fdata->cap, burst);
> >   }
>
> The generic_pipeline flag is set here and therefore, aren't the
> subsequent checks in generic_opt_check() and worker_tx_enq_opt_check()
> redundant ?

The checks inside generic_opt_check, worker_tx_enq_opt_check are still required
as different eventdevs opdl, DSW, dpaa, sw, octeontx might have different
capabilities.

The generic_pipeline flag is just used to decide the pipeline to use based on
the ethdev connected to eventdev.

The original idea was to have support to add different pipelines based on
combination of capability between eventdev and ethdev.

>
> Thanks,
> Nikhil

Regards,
Pavan.


More information about the dev mailing list