[dpdk-dev] L3fwd mode in testpmd

Ananyev, Konstantin konstantin.ananyev at intel.com
Thu Apr 29 13:47:30 CEST 2021



> 
> On Thu, Apr 29, 2021 at 08:31:03AM +0000, Ananyev, Konstantin wrote:
> > Hi Stanislaw,
> >
> > >
> > > On Wed, Apr 28, 2021 at 09:44:54PM +0000, Honnappa Nagarahalli wrote:
> > > <snip>
> > > > [Honnappa] Sorry, I do not understand this. I see that vector code is under compile time flag as below
> > > >
> > > > #if defined RTE_ARCH_X86 || defined __ARM_NEON
> > > >                         l3fwd_em_send_packets(nb_rx, pkts_burst,
> > > >                                                         portid, qconf);
> > > > #else
> > > >                        l3fwd_em_no_opt_send_packets(nb_rx, pkts_burst,
> > > >                                                         portid, qconf);
> > > > #endif
> > > Take a look at the ifdef tree at the top of l3fwd_em.c, here:
> > > http://git.dpdk.org/dpdk/tree/examples/l3fwd/l3fwd_em.c#n218
> > >
> > > #if defined(__SSE2__)
> > > ...
> > > #else
> > > #error No vector engine (SSE, NEON, ALTIVEC) available, check your toolchain
> > > #endif
> > >
> >
> > I think it is just a flaw and needs to be fixed.
> > Patch would help here 😊
> > Konstantin
> 
> It looks as if implementing em_mask_key() is enough to get l3fwd
> working. However to me this ifdef seems tricky. How should a scalar
> implementation handle the xmm_t type? rte_xmm_t looks like an API
> type/union, but both are not mentioned in documentation and are in
> platform dependent rte_vect.h only.
> So either I add another case for RISC-V or (what seems more proper) add
> an else clause implementation. However then should I change this function
> to take rte_xmm_t? If not is casting xmm_t to i.e. int32_t[] always
> valid? Even if I change to rte_xmm_t, it's not a stable API type, is it?
> So what guarantee do I have that it maps to int32_t bit-wise on every
> platform?
> 
> I think the semantic requirements of xmm_t typedef are a bit undefined as
> well as the vector handling across the architectures (being something
> rather arch specific). I don't have a clear idea on how to solve this
> yet and I would not like to hijack this discussion with vector stuff.
> 
> Though I may be missing some obvious solution here. Any idea is welcome.
> :)

I think it should be possible to replace xmm_t with rte_xmm_t in ipv(4|6)_5tuple_host
and make em_mask_key to take 'rte_xmm_t *' as a parameter/return value instead of xmm_t.
With that in place scalar version seems straightforward.
Of course perf regression test would be needed after such changes,
but I think with '-O3' it should be no difference.




More information about the dev mailing list