From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot0-f181.google.com (mail-ot0-f181.google.com [74.125.82.181]) by dpdk.org (Postfix) with ESMTP id 7F21D292D for ; Wed, 21 Jun 2017 08:06:19 +0200 (CEST) Received: by mail-ot0-f181.google.com with SMTP id r67so105098781ota.1 for ; Tue, 20 Jun 2017 23:06:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=sQ/o8w7O5SEoRyZ3jN3rJ7bEmifaP1YRTpYCMlmmYag=; b=li14xradA6DBaDJ2IuoyDT76I3r51KR9un6nuCKbX6Q8YM85bI8dT67bGsNzj2IBvl wwhL1uU8BJ+q3zSRMLtQuHHmyYGo/kbA1dZ3XLbnlbIuhf2KixhXVW+dTnZYcwEd2Osw bnqCVChujBWsmQ340a1PjJOCGZhGL1u3CM+WvoNLZQQU6Cfzt4M/tH6t+i0g+V5Yigu3 K9Z28Bk3Hq17HcasSdWwL6E+ynjq7mb1drNjpZEUuPifxAY+bwfF0C7A2dTjaiWWmKaX wHQ64KPnR9Pyi6NT2SLvF0idfVQY5J+lEM45w4pmplhV0ozrmnpiG7i33xl9yjixt0nS zhbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=sQ/o8w7O5SEoRyZ3jN3rJ7bEmifaP1YRTpYCMlmmYag=; b=JvKi/9U9OWhVNhEW9Rx+JWpJIXoaGf5OAdQRwnoUEwd1gS2ODADMfCxevWIrCfSDNa dgmDqR6jFIi+oe0a20HTwG6p71yGS1Kt4LGl1QHt+XtaxPwKu2AzunmeZIsZ99yROHGW asprbdyp66B0soYeZw9kdbMOpG/rTGTBVaMYaAM4wNqNz5mdEHcZ9AwDMtFg8oQ+4/5N 8zkn/WB3VCGkI+QEQSPaEZPSb2WLP7VB0Lqva6eqHvWvGXHcv9BZiRDGl8qNcuwTpBVi T9B4nZtvdfp8VJqdNKv/g15KrTWFvXk2BKJB3LPZyF+YeACHKQANPLQyNsr+Qv6yIJmX Mb4Q== X-Gm-Message-State: AKS2vOx36m7ro2xVYLfLCs5VYupDRzogZ0pnHnYu2RSbmae76QnbxJrA W+eYjUjxN52k41vmXD9Z4Nc1stoutw== X-Received: by 10.157.46.65 with SMTP id c1mr9964207otd.190.1498025178627; Tue, 20 Jun 2017 23:06:18 -0700 (PDT) MIME-Version: 1.0 Received: by 10.74.137.44 with HTTP; Tue, 20 Jun 2017 23:06:18 -0700 (PDT) In-Reply-To: References: From: Doohwan Lee Date: Wed, 21 Jun 2017 15:06:18 +0900 Message-ID: To: Shyam Shrivastav Cc: users@dpdk.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-users] Question about range type of DPDK ACL X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jun 2017 06:06:20 -0000 Thank you for your opinion. But I already checked byte ordering. It is used correctly like you mentioned. And, ACL library works good except 32bit matching with range type. DPDK ACL library uses multi-bit trie with 8-bit stride. I guess that implementation of the trie doesn't support 32bit range matching. On Wed, Jun 21, 2017 at 2:11 PM, Shyam Shrivastav < shrivastav.shyam@gmail.com> wrote: > Yes it can be but generally not used. Check dotted decimal IP address to > integer conversion, ACL library expects host byte order while adding acl > rules and network byte order while matching .. > > FROM ADD > > rules : Array of rules to add to the ACL context. Note that all fields > in rte_acl_rule structures are expected to be in host byte order. Each ru= le > expected to be in the same format and not exceed size specified at ACL > context creation time. > > FROM CLASSIFY > > data : Array of pointers to input data buffers to perform search. > Note that all fields in input data buffers supposed to be in network byte > order (MSB). > > > On Wed, Jun 21, 2017 at 6:20 AM, =EC=9D=B4=EB=91=90=ED=99=98 wrote: > >> IPv4 address can be just 4byte integer value. >> 10.10.10.10 means 0x0a0a0a0a and 20.20.20.20 means 0x14141414 >> 10.10.10.30 is 0x0a0a0a1e and it is greater than 0x0a0a0a0a and less the= n >> 0x14141414. >> So, I think it should be matched but the result was not. >> Did I miss something? >> >> On Tue, Jun 20, 2017 at 5:58 PM, Shyam Shrivastav < >> shrivastav.shyam@gmail.com> wrote: >> >>> RTE_ACL_FIELD_TYPE_RANGE is for linear integer range like port numbers >>> For ip addresses RTE_ACL_FIELD_TYPE_MASK should be used. >>> >>> On Tue, Jun 20, 2017 at 1:57 PM, =EC=9D=B4=EB=91=90=ED=99=98 wrote: >>> >>>> 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] =3D { >>>> { >>>> .type =3D RTE_ACL_FIELD_TYPE_RANGE, >>>> .size =3D sizeof(uint8_t), >>>> .field_index =3D 0, >>>> .input_index =3D 0, >>>> .offset =3D 0 >>>> }, >>>> { >>>> .type =3D RTE_ACL_FIELD_TYPE_RANGE, >>>> .size =3D sizeof(uint32_t), >>>> .field_index =3D 1, >>>> .input_index =3D 1, >>>> .offset =3D offsetof(struct acl_match_component, sip) >>>> }, >>>> { >>>> .type =3D RTE_ACL_FIELD_TYPE_RANGE, >>>> .size =3D sizeof(uint32_t), >>>> .field_index =3D 2, >>>> .input_index =3D 2, >>>> .offset =3D offsetof(struct acl_match_component, dip) >>>> }, >>>> { >>>> .type =3D RTE_ACL_FIELD_TYPE_RANGE, >>>> .size =3D sizeof(uint16_t), >>>> .field_index =3D 3, >>>> .input_index =3D 3, >>>> .offset =3D offsetof(struct acl_match_component, sport) >>>> }, >>>> { >>>> .type =3D RTE_ACL_FIELD_TYPE_RANGE, >>>> .size =3D sizeof(uint16_t), >>>> .field_index =3D 4, >>>> .input_index =3D 3, >>>> .offset =3D offsetof(struct acl_match_component, dport) >>>> }, >>>> { >>>> .type =3D RTE_ACL_FIELD_TYPE_RANGE, >>>> .size =3D sizeof(uint16_t), >>>> .field_index =3D 5, >>>> .input_index =3D 4, >>>> .offset =3D offsetof(struct acl_match_component, in_if) >>>> }, >>>> { >>>> .type =3D RTE_ACL_FIELD_TYPE_RANGE, >>>> .size =3D sizeof(uint16_t), >>>> .field_index =3D 6, >>>> .input_index =3D 4, >>>> .offset =3D 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 =3D IPv4(10,10,10,10); >>>> mask_range.u32 =3D 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 usin= g >>>> 32bit field as range type. >>>> Range type with 16bit field (ex. port number) works well. >>>> And, DPDK 17.05 has no meaningful changes on ACL library compare to DP= DK >>>> 16.04 >>>> >>>> Do you have any idea about this? >>>> >>>> Thank you. >>>> >>> >>> >> >