DPDK usage discussions
 help / color / mirror / Atom feed
From: Sundararaman Rajagopalan <Sundararaman.Rajagopalan@tatacommunications.com>
To: "users@dpdk.org" <users@dpdk.org>
Subject: DPDK 20.11 compilation and testing with clang 5.0.0 compiler - reg.
Date: Thu, 13 Apr 2023 11:32:25 +0000	[thread overview]
Message-ID: <PSAPR04MB445427614FADF31ABDAF3144E5989@PSAPR04MB4454.apcprd04.prod.outlook.com> (raw)

[-- 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 --]

             reply	other threads:[~2023-04-17  8:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-13 11:32 Sundararaman Rajagopalan [this message]
2023-04-17 15:10 ` Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=PSAPR04MB445427614FADF31ABDAF3144E5989@PSAPR04MB4454.apcprd04.prod.outlook.com \
    --to=sundararaman.rajagopalan@tatacommunications.com \
    --cc=users@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).