From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk0-f178.google.com (mail-qk0-f178.google.com [209.85.220.178]) by dpdk.org (Postfix) with ESMTP id 370589E3 for ; Tue, 20 Jun 2017 10:58:52 +0200 (CEST) Received: by mail-qk0-f178.google.com with SMTP id g83so52251385qkb.3 for ; Tue, 20 Jun 2017 01:58:52 -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=OSNk6mEejqEozQGpk1rx+QX710f68ayZTaFy7k6Sivs=; b=faYIgVbVIgCFlkZokfXVvbchwpyS3uD70NZ2dehglNBKQ4Wft0YIwhKCBiyoqv18VB UOQWJ/Uyiz88S49BInVRI8j1NPQejAU2Wjf+3u0rYoOY/dM00y6KIxx+qliPB/KTrPSG 6R4K/zToKtNqY14dZCovTNfPP93mxG9xNFd3pnT45dOvhMCyvNELZe5J3gH5C1HDF6by oiNAcyUmi33DHiZwWoM0fN3CRd0ru1hYibjxj1LMAS8lHWQOk6/f2T1ABV/eIQpZ7g98 gopf77xW0hE0lQxLGAV6RiU0mQ2ZY3zIKUtZxemOFu13Vv5f5HDBK/vPH2nwQ/Yd6u1R b+wA== 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=OSNk6mEejqEozQGpk1rx+QX710f68ayZTaFy7k6Sivs=; b=j9xmg/xrCwer+c23uwvhUT9JgaCvP2m+wvict6nGaKPsoSoRZwFRa2UDBIhVZMJifV RnTll84GPDBTdrLPBGeic9jXYjIIYN/oubHFt7Yx6OkIamBoBOO2Dx1WhjiaS0lmFM4N mhUp0Wb7Z+29dBAj2C8boEY3bFxOq/dOTQh6bawJtarvZCj0660RdCk3yl1gVOTgoJXs 08NXsrB9nZuZhhk3aK2fQEQ1301za4mZAt7SdYoJOr7UXJldwl7XDwpJ3VsvLAFL45xt wKXQuttcox7JzKqYrKpuPQtfzBSpsEEwVHWjq/UKIZpm7MIap2XhbFINSVr9e9CbLPbH we9Q== X-Gm-Message-State: AKS2vOxWaZEijvwbw9VYTkY4pNTIdqHD87aWmn7+BOSYp4uU8OA8ofwx 3tyTMPtlBfc93GrD7wU34to9BFiOqfV+ X-Received: by 10.55.136.1 with SMTP id k1mr34037870qkd.104.1497949132298; Tue, 20 Jun 2017 01:58:52 -0700 (PDT) MIME-Version: 1.0 Received: by 10.12.136.41 with HTTP; Tue, 20 Jun 2017 01:58:51 -0700 (PDT) In-Reply-To: References: From: Shyam Shrivastav Date: Tue, 20 Jun 2017 14:28:51 +0530 Message-ID: To: =?UTF-8?B?7J2065GQ7ZmY?= 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: Tue, 20 Jun 2017 08:58:53 -0000 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 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. >