From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi0-f51.google.com (mail-oi0-f51.google.com [209.85.218.51]) by dpdk.org (Postfix) with ESMTP id 219522C72 for ; Wed, 21 Jun 2017 02:50:56 +0200 (CEST) Received: by mail-oi0-f51.google.com with SMTP id c189so59104943oia.2 for ; Tue, 20 Jun 2017 17:50:56 -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=D5S1EpafrCNs8jjDUH866zT+Zolmg4Kay2ZHdNAyzoE=; b=SytUkUijMLeEPL86E+O0sLvoIrYr9eyQ2qKaLwVnvkJ6kpI8n05ExGaspXuwUXf1NF 0rz9EUMVRU3ZwAdYiaRvIEWgMik/Tcde8m0O59EcGBuo5kw6MxvzVXmL6+KDYy33K7Vj XXGVVGvPO6Ik+0BkQ9XJsWX5DSJUEGKKVJf+qdKor4em0UOEKUWJ2Ei3UJ0niZE49HId 2vadbYEjtTzVm+XajZbKGpeuITndN8krZXI05YAfoAvoiDOKANjTB8+T35vI5Yem0Csp 3kU0ozeWZQe3edIRIj3+lOnUEutl1Zzr3nXDzDS1N+FWGI4AWSLLPJNULeU1SgkmpQaS 2JSw== 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=D5S1EpafrCNs8jjDUH866zT+Zolmg4Kay2ZHdNAyzoE=; b=HMCWZ40Xr8GuX6xEg/kwsiRBz0gPwpilTLW5sKVdMcxnIeS5E52pFdGI2pL29is0tl zmb5/IcoDl8liCMsCjQy2Eo2Dd/I2Mx6tGtTW6mKHQRG612CJVv/NyY7BG9Z/iexxWZX tzgUCYsXAXsfP/Kue5iGwuPP7QjPlA4tXlPFzerjF8tAaBKB3+wdaGMwR1GOg1/qfq6v GUMwmOGd8KwClr/Tq99cAkQgnOFdvOR+cMGm++GtVbf5pBzE+qKG2P9gLtDe00RQa8JX IM21NoS//aPFavJMQa3Sl27CYtsM3vVZCuGBjyb2vIXkYYQ+0c3Q1tPNMjTbnhGLbN1f qDVA== X-Gm-Message-State: AKS2vOxR4/pLIUc5V656UlURyml39OPrLFO9qrPBY4JOoqQVDzRQk8Pv lHe6/zCW4h1NJ7wwUiW7BZCkQzAc4Q== X-Received: by 10.202.90.70 with SMTP id o67mr8162014oib.56.1498006255462; Tue, 20 Jun 2017 17:50:55 -0700 (PDT) MIME-Version: 1.0 Received: by 10.74.137.44 with HTTP; Tue, 20 Jun 2017 17:50:54 -0700 (PDT) In-Reply-To: References: From: =?UTF-8?B?7J2065GQ7ZmY?= Date: Wed, 21 Jun 2017 09:50:54 +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 00:50:56 -0000 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 then 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 matche= d. >> >> 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. >> And, DPDK 17.05 has no meaningful changes on ACL library compare to DPDK >> 16.04 >> >> Do you have any idea about this? >> >> Thank you. >> > >