[1/5] examples/l3fwd: fix port group mask generation
Checks
Commit Message
From: Pavan Nikhilesh <pbhagavatula@marvell.com>
Fix port group mask generation in altivec, vec_any_eq returns
0 or 1 while port_groupx4 expects comparison mask result.
Fixes: 2193b7467f7a ("examples/l3fwd: optimize packet processing on powerpc")
Cc: stable@dpdk.org
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
examples/common/altivec/port_group.h | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
@@ -26,12 +26,19 @@ port_groupx4(uint16_t pn[FWDSTEP + 1], uint16_t *lp,
uint16_t u16[FWDSTEP + 1];
uint64_t u64;
} *pnum = (void *)pn;
+ union u_vec {
+ __vector unsigned short v_us;
+ unsigned short s[8];
+ };
+ union u_vec res;
int32_t v;
- v = vec_any_eq(dp1, dp2);
-
+ dp1 = vec_cmpeq(dp1, dp2);
+ res.v_us = dp1;
+ v = (res.s[0] & 0x1) | (res.s[1] & 0x2) | (res.s[2] & 0x4) |
+ (res.s[3] & 0x8);
/* update last port counter. */
lp[0] += gptbl[v].lpv;