From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 4C6577E70 for ; Tue, 14 Oct 2014 17:13:02 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 14 Oct 2014 08:08:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,717,1406617200"; d="scan'208";a="605178691" Received: from irsmsx103.ger.corp.intel.com ([163.33.3.157]) by fmsmga001.fm.intel.com with ESMTP; 14 Oct 2014 08:18:37 -0700 Received: from irsmsx110.ger.corp.intel.com (163.33.3.25) by IRSMSX103.ger.corp.intel.com (163.33.3.157) with Microsoft SMTP Server (TLS) id 14.3.195.1; Tue, 14 Oct 2014 16:17:37 +0100 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.174]) by IRSMSX110.ger.corp.intel.com ([169.254.15.199]) with mapi id 14.03.0195.001; Tue, 14 Oct 2014 16:17:37 +0100 From: "Ananyev, Konstantin" To: Karmarkar Suyash , "dev@dpdk.org" Thread-Topic: Bug in IPACL library of DPDK-1.6.0 Thread-Index: Ac/nlN/T4HWZL3EbQoWoKK2IGfS6ZQABrq6AAAOG40AAAopFUAADEcfwAABIZhA= Date: Tue, 14 Oct 2014 15:17:35 +0000 Message-ID: <2601191342CEEE43887BDE71AB9772582139386C@IRSMSX105.ger.corp.intel.com> References: <2601191342CEEE43887BDE71AB9772582139376B@IRSMSX105.ger.corp.intel.com> <2601191342CEEE43887BDE71AB97725821393825@IRSMSX105.ger.corp.intel.com> In-Reply-To: Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "Dey, Souvik" , "Patil, PraveenKumar" Subject: Re: [dpdk-dev] Bug in IPACL library of DPDK-1.6.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Oct 2014 15:13:04 -0000 > -----Original Message----- > From: Karmarkar Suyash [mailto:skarmarkar@sonusnet.com] > Sent: Tuesday, October 14, 2014 4:07 PM > To: Ananyev, Konstantin; dev@dpdk.org > Cc: Dey, Souvik; Patil, PraveenKumar > Subject: RE: Bug in IPACL library of DPDK-1.6.0 >=20 > Hi Konstantin, >=20 > We did even tried with DPDK-1.7.0 version still we faced the same issue. Then I suppose, I need more information to reproduce it... See below the code I used, based on your description.=20 Does it replicate your problem? enum { NEXT_HDR_FIELD_IPV6, //8 IPSRC_FIELD0_IPV6, IPSRC_FIELD1_IPV6, IPSRC_FIELD2_IPV6, IPSRC_FIELD3_IPV6, IPDST_FIELD0_IPV6, IPDST_FIELD1_IPV6, IPDST_FIELD2_IPV6, IPDST_FIELD3_IPV6, PORTS_FIELD_IPV6, // src port (16) + dest port (16) =3D> 32 LIF_GRP_INFO_FIELD_IPV6, //lif group (16) + lif Id (16) =3D> 32 ADDR_CTX_FIELD_IPV6, //addr context (32) NUM_FIELDS_IPV6 }; static const struct rte_acl_field_def ipv6_defs[NUM_FIELDS_IPV6] =3D { { .type =3D RTE_ACL_FIELD_TYPE_BITMASK, .size =3D sizeof (uint8_t), .field_index =3D NEXT_HDR_FIELD_IPV6, .input_index =3D NEXT_HDR_FIELD_IPV6, .offset =3D offsetof(struct ipv6_hdr, proto), }, ///source ip { .type =3D RTE_ACL_FIELD_TYPE_BITMASK, .size =3D sizeof (uint32_t), .field_index =3D IPSRC_FIELD0_IPV6, .input_index =3D IPSRC_FIELD0_IPV6, .offset =3D offsetof(struct ipv6_hdr, src_addr), }, { .type =3D RTE_ACL_FIELD_TYPE_BITMASK, .size =3D sizeof (uint32_t), .field_index =3D IPSRC_FIELD1_IPV6, .input_index =3D IPSRC_FIELD1_IPV6, .offset =3D offsetof(struct ipv6_hdr, src_addr) + 1*sizeof (uint32_t)= , }, { .type =3D RTE_ACL_FIELD_TYPE_BITMASK, .size =3D sizeof (uint32_t), .field_index =3D IPSRC_FIELD2_IPV6, .input_index =3D IPSRC_FIELD2_IPV6, .offset =3D offsetof(struct ipv6_hdr, src_addr) + 2*sizeof (uint32_t)= , }, { .type =3D RTE_ACL_FIELD_TYPE_BITMASK, .size =3D sizeof (uint32_t), .field_index =3D IPSRC_FIELD3_IPV6, .input_index =3D IPSRC_FIELD3_IPV6, .offset =3D offsetof(struct ipv6_hdr, src_addr) + 3*sizeof (uint32_t)= , }, ///destination ip { .type =3D RTE_ACL_FIELD_TYPE_BITMASK, .size =3D sizeof (uint32_t), .field_index =3D IPDST_FIELD0_IPV6, .input_index =3D IPDST_FIELD0_IPV6, .offset =3D offsetof(struct ipv6_hdr, dst_addr), }, { .type =3D RTE_ACL_FIELD_TYPE_BITMASK, .size =3D sizeof (uint32_t), .field_index =3D IPDST_FIELD1_IPV6, .input_index =3D IPDST_FIELD1_IPV6, .offset =3D offsetof(struct ipv6_hdr, dst_addr) + 1*sizeof (uint32_t)= , }, { .type =3D RTE_ACL_FIELD_TYPE_BITMASK, .size =3D sizeof (uint32_t), .field_index =3D IPDST_FIELD2_IPV6, .input_index =3D IPDST_FIELD2_IPV6, .offset =3D offsetof(struct ipv6_hdr, dst_addr) + 2*sizeof (uint32_t)= , }, { .type =3D RTE_ACL_FIELD_TYPE_BITMASK, .size =3D sizeof (uint32_t), .field_index =3D IPDST_FIELD3_IPV6, .input_index =3D IPDST_FIELD3_IPV6, .offset =3D offsetof(struct ipv6_hdr, dst_addr) + 3*sizeof (uint32_t)= , }, ///ports { .type =3D RTE_ACL_FIELD_TYPE_BITMASK, .size =3D sizeof (uint32_t), .field_index =3D PORTS_FIELD_IPV6, .input_index =3D PORTS_FIELD_IPV6, .offset =3D sizeof(struct ipv6_hdr) , }, //LIF grp and addr ctx { .type =3D RTE_ACL_FIELD_TYPE_BITMASK, .size =3D sizeof (uint32_t), .field_index =3D LIF_GRP_INFO_FIELD_IPV6, .input_index =3D LIF_GRP_INFO_FIELD_IPV6, .offset =3D sizeof(struct ipv6_hdr) + sizeof (uint32_t), }, { .type =3D RTE_ACL_FIELD_TYPE_BITMASK, .size =3D sizeof (uint32_t), .field_index =3D ADDR_CTX_FIELD_IPV6, .input_index =3D ADDR_CTX_FIELD_IPV6, .offset =3D sizeof(struct ipv6_hdr) + 2*sizeof (uint32_t), } }; RTE_ACL_RULE_DEF(rule, NUM_FIELDS_IPV6); static const struct rule rules[] =3D { { .data.userdata =3D 1, .data.priority =3D 1, .data.category_mask =3D 1, .field[NEXT_HDR_FIELD_IPV6].value.u8 =3D IPPROTO_ICMPV6, .field[NEXT_HDR_FIELD_IPV6].mask_range.u8 =3D UINT8_MAX, }, { .data.userdata =3D 2, .data.priority =3D 2, .data.category_mask =3D 1, .field[NEXT_HDR_FIELD_IPV6].value.u8 =3D IPPROTO_ICMPV6, .field[NEXT_HDR_FIELD_IPV6].mask_range.u8 =3D UINT8_MAX, }, }; static const struct { struct ipv6_hdr hdr; uint32_t ports; uint32_t lif_grp; uint32_t addr_ctx; } data =3D { .hdr =3D {.proto =3D IPPROTO_ICMPV6,}, }; static const struct rte_acl_param prm =3D { .name =3D "xz1", .socket_id =3D SOCKET_ID_ANY, .rule_size =3D RTE_ACL_RULE_SZ(NUM_FIELDS_IPV6), .max_rule_num =3D 256, }; static void acl_test1(void) { int32_t rc; uint32_t res; struct rte_acl_ctx *ctx; struct rte_acl_config cfg; const uint8_t *dp; dp =3D (const uint8_t *)&data; cfg.num_categories =3D 1; cfg.num_fields =3D RTE_DIM(ipv6_defs); memcpy(&cfg.defs, ipv6_defs, sizeof(ipv6_defs)); ctx =3D rte_acl_create(&prm); assert(ctx !=3D NULL); rte_acl_add_rules(ctx, (const struct rte_acl_rule *)&rules[0], 1); rte_acl_add_rules(ctx, (const struct rte_acl_rule *)&rules[1], 1); rc =3D rte_acl_build(ctx, &cfg); rte_acl_dump(ctx); assert(rc =3D=3D 0); rc =3D rte_acl_classify(ctx, &dp, &res, 1, 1); assert(rc =3D=3D 0); assert(res =3D=3D 2); printf("rte_acl_classify() returns %d, res=3D%u\n", rc, res); rte_acl_reset(ctx); rte_acl_add_rules(ctx, (const struct rte_acl_rule *)&rules[1], 1); rte_acl_add_rules(ctx, (const struct rte_acl_rule *)&rules[0], 1); rc =3D rte_acl_build(ctx, &cfg); rte_acl_dump(ctx); assert(rc =3D=3D 0); rc =3D rte_acl_classify(ctx, &dp, &res, 1, 1); assert(rc =3D=3D 0); assert(res =3D=3D 2); printf("rte_acl_classify() returns %d, res=3D%u\n", rc, res); }