[dpdk-users] Trying to use ACL with uint64

Yossi Goldberg Yossi at cgstowernetworks.com
Wed Feb 13 11:29:33 CET 2019


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



More information about the users mailing list