src/dpdk/lib/librte_acl/acl_run_neon.h
static inline int
search_neon_8(const struct rte_acl_ctx *ctx, const uint8_t **data,
	      uint32_t *results, uint32_t total_packets, uint32_t categories)
{
	int n;
	struct acl_flow_data flows;
	uint64_t index_array[8];
	struct completion cmplt[8];
	struct parms parms[8];
	int32x4_t input0, input1;

	acl_set_flow(&flows, cmplt, RTE_DIM(cmplt), data, results,
		     total_packets, categories, ctx->trans_table);

	for (n = 0; n < 8; n++) {
		cmplt[n].count = 0;
		index_array[n] = acl_start_next_trie(&flows, parms, n, ctx);
	}

	 /* Check for any matches. */
	acl_match_check_x4(0, ctx, parms, &flows, &index_array[0]);
	acl_match_check_x4(4, ctx, parms, &flows, &index_array[4]);

	while (flows.started > 0) {
		/* Gather 4 bytes of input data for each stream. */
		input0 = vdupq_n_s32(GET_NEXT_4BYTES(parms, 0));
		input1 = vdupq_n_s32(GET_NEXT_4BYTES(parms, 4));

		input0 = vsetq_lane_s32(GET_NEXT_4BYTES(parms, 1), input0, 1);
		input1 = vsetq_lane_s32(GET_NEXT_4BYTES(parms, 5), input1, 1);

		input0 = vsetq_lane_s32(GET_NEXT_4BYTES(parms, 2), input0, 2);
		input1 = vsetq_lane_s32(GET_NEXT_4BYTES(parms, 6), input1, 2);

		input0 = vsetq_lane_s32(GET_NEXT_4BYTES(parms, 3), input0, 3);
		input1 = vsetq_lane_s32(GET_NEXT_4BYTES(parms, 7), input1, 3);

		/* Process the 4 bytes of input on each stream. */

		input0 = transition4(input0, flows.trans, &index_array[0]);
		input1 = transition4(input1, flows.trans, &index_array[4]);

		input0 = transition4(input0, flows.trans, &index_array[0]);
		input1 = transition4(input1, flows.trans, &index_array[4]);

		input0 = transition4(input0, flows.trans, &index_array[0]);
		input1 = transition4(input1, flows.trans, &index_array[4]);

		input0 = transition4(input0, flows.trans, &index_array[0]);
		input1 = transition4(input1, flows.trans, &index_array[4]);

		 /* Check for any matches. */
		acl_match_check_x4(0, ctx, parms, &flows, &index_array[0]);
		acl_match_check_x4(4, ctx, parms, &flows, &index_array[4]);
	}

	return 0;
}
/*
 * Execute trie traversal with 8 traversals in parallel
 */
Execute trie traversal with 8 traversals in parallel
Execute trie traversal with 8 traversals in parallel
static inline int
search_neon_8(const struct rte_acl_ctx *ctx, const uint8_t **data,
	      uint32_t *results, uint32_t total_packets, uint32_t categories)
{
	int n;
	struct acl_flow_data flows;
	uint64_t index_array[8];
	struct completion cmplt[8];
	struct parms parms[8];
	int32x4_t input0, input1;
	acl_set_flow(&flows, cmplt, RTE_DIM(cmplt), data, results,
		     total_packets, categories, ctx->trans_table);
	for (n = 0; n < 8; n++) {
		cmplt[n].count = 0;
		index_array[n] = acl_start_next_trie(&flows, parms, n, ctx);
	}
	acl_match_check_x4(0, ctx, parms, &flows, &index_array[0]);
	acl_match_check_x4(4, ctx, parms, &flows, &index_array[4]);
	while (flows.started > 0) {
		input0 = vdupq_n_s32(GET_NEXT_4BYTES(parms, 0));
		input1 = vdupq_n_s32(GET_NEXT_4BYTES(parms, 4));
		input0 = vsetq_lane_s32(GET_NEXT_4BYTES(parms, 1), input0, 1);
		input1 = vsetq_lane_s32(GET_NEXT_4BYTES(parms, 5), input1, 1);
		input0 = vsetq_lane_s32(GET_NEXT_4BYTES(parms, 2), input0, 2);
		input1 = vsetq_lane_s32(GET_NEXT_4BYTES(parms, 6), input1, 2);
		input0 = vsetq_lane_s32(GET_NEXT_4BYTES(parms, 3), input0, 3);
		input1 = vsetq_lane_s32(GET_NEXT_4BYTES(parms, 7), input1, 3);
		input0 = transition4(input0, flows.trans, &index_array[0]);
		input1 = transition4(input1, flows.trans, &index_array[4]);
		input0 = transition4(input0, flows.trans, &index_array[0]);
		input1 = transition4(input1, flows.trans, &index_array[4]);
		input0 = transition4(input0, flows.trans, &index_array[0]);
		input1 = transition4(input1, flows.trans, &index_array[4]);
		input0 = transition4(input0, flows.trans, &index_array[0]);
		input1 = transition4(input1, flows.trans, &index_array[4]);
		acl_match_check_x4(0, ctx, parms, &flows, &index_array[0]);
		acl_match_check_x4(4, ctx, parms, &flows, &index_array[4]);
	}
	return 0;
}
static inline int search_neon_8 ( const struct rte_acl_ctx * ctx , const uint8_t * * data , uint32_t * results , uint32_t total_packets , uint32_t categories ) { int n ; struct acl_flow_data flows ; uint64_t index_array [ 8 ] ; struct completion cmplt [ 8 ] ; struct parms parms [ 8 ] ; int32x4_t input0 , input1 ; acl_set_flow ( & flows , cmplt , RTE_DIM ( cmplt ) , data , results , total_packets , categories , ctx -> trans_table ) ; for ( n = 0 ; n < 8 ; n ++ ) { cmplt [ n ] . count = 0 ; index_array [ n ] = acl_start_next_trie ( & flows , parms , n , ctx ) ; } acl_match_check_x4 ( 0 , ctx , parms , & flows , & index_array [ 0 ] ) ; acl_match_check_x4 ( 4 , ctx , parms , & flows , & index_array [ 4 ] ) ; while ( flows . started > 0 ) { input0 = vdupq_n_s32 ( GET_NEXT_4BYTES ( parms , 0 ) ) ; input1 = vdupq_n_s32 ( GET_NEXT_4BYTES ( parms , 4 ) ) ; input0 = vsetq_lane_s32 ( GET_NEXT_4BYTES ( parms , 1 ) , input0 , 1 ) ; input1 = vsetq_lane_s32 ( GET_NEXT_4BYTES ( parms , 5 ) , input1 , 1 ) ; input0 = vsetq_lane_s32 ( GET_NEXT_4BYTES ( parms , 2 ) , input0 , 2 ) ; input1 = vsetq_lane_s32 ( GET_NEXT_4BYTES ( parms , 6 ) , input1 , 2 ) ; input0 = vsetq_lane_s32 ( GET_NEXT_4BYTES ( parms , 3 ) , input0 , 3 ) ; input1 = vsetq_lane_s32 ( GET_NEXT_4BYTES ( parms , 7 ) , input1 , 3 ) ; input0 = transition4 ( input0 , flows . trans , & index_array [ 0 ] ) ; input1 = transition4 ( input1 , flows . trans , & index_array [ 4 ] ) ; input0 = transition4 ( input0 , flows . trans , & index_array [ 0 ] ) ; input1 = transition4 ( input1 , flows . trans , & index_array [ 4 ] ) ; input0 = transition4 ( input0 , flows . trans , & index_array [ 0 ] ) ; input1 = transition4 ( input1 , flows . trans , & index_array [ 4 ] ) ; input0 = transition4 ( input0 , flows . trans , & index_array [ 0 ] ) ; input1 = transition4 ( input1 , flows . trans , & index_array [ 4 ] ) ; acl_match_check_x4 ( 0 , ctx , parms , & flows , & index_array [ 0 ] ) ; acl_match_check_x4 ( 4 , ctx , parms , & flows , & index_array [ 4 ] ) ; } return 0 ; }
Execute trie traversal with 8 traversals in parallel
Execute trie traversal with 8 traversals in parallel
/* Check for any matches. */ /* Gather 4 bytes of input data for each stream. */ /* Process the 4 bytes of input on each stream. */ /* Check for any matches. */