DPDK usage discussions
 help / color / mirror / Atom feed
* [dpdk-users] Trying to use ACL with uint64
@ 2019-02-13 10:29 Yossi Goldberg
  0 siblings, 0 replies; only message in thread
From: Yossi Goldberg @ 2019-02-13 10:29 UTC (permalink / raw)
  To: users

Hi,

I'm trying to use rte_acl to match range of uint64_t  numbers, but it seems that uint64_t is not working well.
it looks as if it match only 32 bits instead of full 64 bits value as it should.
I didn't find any example that using uint64_t, but according to the code comment it should work:
uint8_t  size;        /**< size of field 1,2,4, or 8. */

Does anyone know if it should work? Is there any specific configuration for 64bits?

Thanks

I'm running on Ubuntu 14.04 LTS using dpdk 17.11

This is filed definitions:

struct rte_acl_field_def acl_fields[] = {
        {
                .type = RTE_ACL_FIELD_TYPE_BITMASK,
                .size = sizeof(uint8_t),
                .field_index = 0,
                .input_index = 0,
                .offset = 0,
        },
        {
                .type = RTE_ACL_FIELD_TYPE_RANGE,
                .size = sizeof(uint64_t),
                .field_index = 1,
                .input_index = 1,
                .offset = offsetof(struct gtp_data, num),
        },
};

struct acl_data {
        uint64_t num;
};

For testing I tried to add number 0:

                rules[0].field[1].value.u64 = 0;
                rules[0].field[1].mask_range.u64 = 0;

                rules[0].data.userdata = 1
                rules[0].data.priority = 1;
                rules[0].data.category_mask = 1;

when I check with uint64_t(0) I get match. However, If I do the following:

        acl_data.num= 0;
        uint64_t tmp = htonl(0x12345678);
        acl_data.num |= ( tmp << 32);

and calling rte_acl_classify with acl_data I'm still getting a match.
Only if I change the first 32 bits I will get no-match

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-02-13 10:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-13 10:29 [dpdk-users] Trying to use ACL with uint64 Yossi Goldberg

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).