From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt0-f170.google.com (mail-qt0-f170.google.com [209.85.216.170]) by dpdk.org (Postfix) with ESMTP id F23489E3 for ; Wed, 21 Jun 2017 07:11:35 +0200 (CEST) Received: by mail-qt0-f170.google.com with SMTP id u12so149283942qth.0 for ; Tue, 20 Jun 2017 22:11:35 -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=zoQnZiXBMg3wx5AxoKyoCvI9/tko47VB6Vbt8mbhoLU=; b=t69L7wYaId6fLMuffMGYtwxgsvY4Y6xVJouxbHCRN+sCvLceVIboWi9EI5P/56OeyP 90NBjxxnHzM6v1y9PrZ+gb1K6AlTx2QRkB2yIS1aJ0qDYne5j3KVqYUsGNdsFFev8rcm YvfcLuapz8/6hhNYW8itpVk1QN6W0QIc8CG1xMge7fh2dCpaAFL4ZqK2aMtwnx2xdsQh vT2y4bEeB+fA5NutPG3rNIGdR5ksUKH8ZWFGxkTI0Wx5EaLhQKaCRXXMsRT48zLDgD+e DVtCd0NFf4Yp+4x0+HW4xq4pwgfCykrqDSmsaFUjwq31JOcFS9itNz787S7ZFC8V9miO GShQ== 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=zoQnZiXBMg3wx5AxoKyoCvI9/tko47VB6Vbt8mbhoLU=; b=hGNKpB/mgEQSw6xAGnZ7zfcikLuoRUr1OprMgUyac6b3RhObdbLJrr5i+ADONdMX1K n6yksh368aSMaA+vPeNi1rwGkEhjZf2nfLx7uQ6ZVX7MlSrTgb497hjollMXjXs6sk5v 3GIP6G2CZ58uihNMXVmnHWtUjJPqyise0rDKtZdyrZTZJjgfqV+IsnKzGq6jS2KFeVkq /1UJHvA7DFs946vIgImbtIE4O2ZxxUiUYIuYtAa0EEbekV0oH1F430laU5jPhYIjqsRL db565tm1d0nKg1dnKN8fnKHurlWF8L9efkRTjrcHN5TRjLj0ItZgh+E1BgMj8qom7C2z J4SQ== X-Gm-Message-State: AKS2vOzLy1JBSk2nTuxjUY6UOxJjUubQavEhkfCfoPDI7x1M9Pa17mzC jvaV7n2vasCzocR3zG0n3C1zgIneOQ== X-Received: by 10.200.14.66 with SMTP id j2mr39957691qti.229.1498021895309; Tue, 20 Jun 2017 22:11:35 -0700 (PDT) MIME-Version: 1.0 Received: by 10.12.136.41 with HTTP; Tue, 20 Jun 2017 22:11:34 -0700 (PDT) In-Reply-To: References: From: Shyam Shrivastav Date: Wed, 21 Jun 2017 10:41:34 +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: Wed, 21 Jun 2017 05:11:36 -0000 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 rule 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 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 >>> 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 DPD= K >>> 16.04 >>> >>> Do you have any idea about this? >>> >>> Thank you. >>> >> >> >