From: Yossi Goldberg <Yossi@cgstowernetworks.com>
To: "users@dpdk.org" <users@dpdk.org>
Subject: [dpdk-users] Trying to use ACL with uint64
Date: Wed, 13 Feb 2019 10:29:33 +0000 [thread overview]
Message-ID: <AM6PR09MB2373F72D790C73C746A845E7CB660@AM6PR09MB2373.eurprd09.prod.outlook.com> (raw)
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
reply other threads:[~2019-02-13 10:29 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=AM6PR09MB2373F72D790C73C746A845E7CB660@AM6PR09MB2373.eurprd09.prod.outlook.com \
--to=yossi@cgstowernetworks.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).