DPDK usage discussions
 help / color / mirror / Atom feed
* DPDK 20.11 compilation and testing with clang 5.0.0 compiler - reg.
@ 2023-04-13 11:32 Sundararaman Rajagopalan
  2023-04-17 15:10 ` Stephen Hemminger
  0 siblings, 1 reply; 2+ messages in thread
From: Sundararaman Rajagopalan @ 2023-04-13 11:32 UTC (permalink / raw)
  To: users

[-- Attachment #1: Type: text/plain, Size: 2305 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 7297 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-04-17 15:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-13 11:32 DPDK 20.11 compilation and testing with clang 5.0.0 compiler - reg Sundararaman Rajagopalan
2023-04-17 15:10 ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).