DPDK patches and discussions
 help / color / mirror / Atom feed
From: Doohwan Lee <letsme@gmail.com>
To: dev@dpdk.org
Subject: [dpdk-dev] Question about range type of DPDK ACL
Date: Mon, 3 Jul 2017 17:28:17 +0900	[thread overview]
Message-ID: <CAG5unGwct61ykO=6JS92TUAhk+=mU8OaP6YJSBnpGD17PUZG2Q@mail.gmail.com> (raw)

Hello everyone.

I want to implement some feature like ACL using DPDK ACL library.
so, I defined rule like below.


struct acl_match_component
{
    uint8_t protocol;
    uint32_t sip;
    uint32_t dip;
    uint16_t sport;
    uint16_t dport;
    uint16_t in_if;
    uint16_t out_if;
}


struct rte_acl_field_def ipv4_defs[7] = {
    {
        .type = RTE_ACL_FIELD_TYPE_RANGE,
        .size = sizeof(uint8_t),
        .field_index = 0,
        .input_index = 0,
        .offset = 0
    },
    {
        .type = RTE_ACL_FIELD_TYPE_RANGE,
        .size = sizeof(uint32_t),
        .field_index = 1,
        .input_index = 1,
        .offset = offsetof(struct acl_match_component, sip)
    },
    {
        .type = RTE_ACL_FIELD_TYPE_RANGE,
        .size = sizeof(uint32_t),
        .field_index = 2,
        .input_index = 2,
        .offset = offsetof(struct acl_match_component, dip)
    },
    {
        .type = RTE_ACL_FIELD_TYPE_RANGE,
        .size = sizeof(uint16_t),
        .field_index = 3,
        .input_index = 3,
        .offset = offsetof(struct acl_match_component, sport)
    },
    {
        .type = RTE_ACL_FIELD_TYPE_RANGE,
        .size = sizeof(uint16_t),
        .field_index = 4,
        .input_index = 3,
        .offset = offsetof(struct acl_match_component, dport)
    },
    {
        .type = RTE_ACL_FIELD_TYPE_RANGE,
        .size = sizeof(uint16_t),
        .field_index = 5,
        .input_index = 4,
        .offset = offsetof(struct acl_match_component, in_if)
    },
    {
        .type = RTE_ACL_FIELD_TYPE_RANGE,
        .size = sizeof(uint16_t),
        .field_index = 6,
        .input_index = 4,
        .offset = offsetof(struct acl_match_component, out_if)
    },
};

I defined 32bit IPv4 address filed as RTE_ACL_FIELD_TYPE_RANGE type.
and I set rte_acl_field for IP field like below.

value.u32 = IPv4(10,10,10,10);
mask_range.u32 = IPv4(20,20,20,20);

In this case, I think IP 10.10.10.15 and 10.10.10.30 should be matched.
but result was IP 10.10.10.15 was matched and 10.10.10.30 was not matched.

I am using DPDK 16.04 and there was no example in the DPDK source using
32bit field as range type.
Range type with 16bit field (ex. port number) works well.

Do you have any idea about this?


I already posted same question to users@dpdk.org.

https://www.mail-archive.com/users@dpdk.org/msg02071.html


Thank you.

                 reply	other threads:[~2017-07-03  8:28 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='CAG5unGwct61ykO=6JS92TUAhk+=mU8OaP6YJSBnpGD17PUZG2Q@mail.gmail.com' \
    --to=letsme@gmail.com \
    --cc=dev@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).