DPDK 20.11 compilation and testing with clang 5.0.0 compiler - reg.
Sundararaman Rajagopalan
Sundararaman.Rajagopalan at tatacommunications.com
Thu Apr 13 13:32:25 CEST 2023
Hi Team,
We are trying to compile and run dpdk 20.11 pipeline using clang (LLVM 5.0) compiler. We are able to compile and run the pipeline. However, we observed a lot of pkts not executing the acl lookup properly. While debugging, we found that a lot of pkts were missed in packets out mask. This aspect was checked with the rte_table_acl_lookup function in lib/librte_table/rte_table_acl.c file.
Here is the function:
static int
rte_table_acl_lookup(
void *table,
struct rte_mbuf **pkts,
uint64_t pkts_mask,
uint64_t *lookup_hit_mask,
void **entries)
{
struct rte_table_acl *acl = (struct rte_table_acl *) table;
const uint8_t *pkts_data[RTE_PORT_IN_BURST_SIZE_MAX];
uint32_t results[RTE_PORT_IN_BURST_SIZE_MAX];
uint64_t pkts_out_mask;
uint32_t n_pkts, i, j;
__rte_unused uint32_t n_pkts_in = __builtin_popcountll(pkts_mask);
RTE_TABLE_ACL_STATS_PKTS_IN_ADD(acl, n_pkts_in);
/* Input conversion */
for (i = 0, j = 0; i < (uint32_t)(RTE_PORT_IN_BURST_SIZE_MAX -
__builtin_clzll(pkts_mask)); i++) {
uint64_t pkt_mask = 1LLU << i;
if (pkt_mask & pkts_mask) {
pkts_data[j] = rte_pktmbuf_mtod(pkts[i], uint8_t *);
j++;
}
}
n_pkts = j;
/* Low-level ACL table lookup */
if (acl->ctx != NULL)
rte_acl_classify(acl->ctx, pkts_data, results, n_pkts, 1);
else
n_pkts = 0;
/* Output conversion */
pkts_out_mask = 0;
for (i = 0; i < n_pkts; i++) {
uint32_t action_table_pos = results[i];
uint32_t pkt_pos = __builtin_ctzll(pkts_mask);
uint64_t pkt_mask = 1LLU << pkt_pos;
pkts_mask &= ~pkt_mask;
if (action_table_pos != 0) {
pkts_out_mask |= pkt_mask;
entries[pkt_pos] = (void *)
&acl->memory[action_table_pos *
acl->entry_size];
rte_prefetch0(entries[pkt_pos]);
}
}
*lookup_hit_mask = pkts_out_mask;
RTE_TABLE_ACL_STATS_PKTS_LOOKUP_MISS(acl, n_pkts_in - __builtin_popcountll(pkts_out_mask));
return 0;
}
Can you provide some suggestions to avoid this issue and enable acl to run without functionality loss?
Thanks and regards,
R. Sundararaman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mails.dpdk.org/archives/users/attachments/20230413/cc924ca0/attachment-0001.htm>
More information about the users
mailing list