From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gyumin Subject: Why doesn`t test-acl work when IP filed is RTE_ACL_FIELD_TYPE_RANGE? Date: Wed, 17 Jun 2015 11:41:04 +0900 Message-ID: <5580DE40.3060704@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit To: dev@dpdk.org Return-path: Received: from mail-pd0-f176.google.com (mail-pd0-f176.google.com [209.85.192.176]) by dpdk.org (Postfix) with ESMTP id 97128C342 for ; Wed, 17 Jun 2015 04:45:17 +0200 (CEST) Received: by pdbki1 with SMTP id ki1so27521504pdb.1 for ; Tue, 16 Jun 2015 19:45:16 -0700 (PDT) Received: from [192.168.10.52] ([122.49.119.83]) by mx.google.com with ESMTPSA id pp6sm2745204pbb.79.2015.06.16.19.45.14 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Jun 2015 19:45:16 -0700 (PDT) List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" hi, I ran test-acl without any modification and it worked well, and I modified test-acl like below: { //.type = RTE_ACL_FIELD_TYPE_MASK, .type = RTE_ACL_FIELD_TYPE_RANGE, .size = sizeof(uint32_t), .field_index = SRC_FIELD_IPV4, .input_index = RTE_ACL_IPV4VLAN_SRC, .offset = offsetof(struct ipv4_5tuple, ip_src), }, { //.type = RTE_ACL_FIELD_TYPE_MASK, .type = RTE_ACL_FIELD_TYPE_RANGE, .size = sizeof(uint32_t), .field_index = DST_FIELD_IPV4, .input_index = RTE_ACL_IPV4VLAN_DST, .offset = offsetof(struct ipv4_5tuple, ip_dst), }, static int parse_ipv4_net(const char *in, uint32_t *addr, uint32_t *mask_len) { uint8_t a, b, c, d, m; GET_CB_FIELD(in, a, 0, UINT8_MAX, '.'); GET_CB_FIELD(in, b, 0, UINT8_MAX, '.'); GET_CB_FIELD(in, c, 0, UINT8_MAX, '.'); GET_CB_FIELD(in, d, 0, UINT8_MAX, '/'); //GET_CB_FIELD(in, m, 0, sizeof(uint32_t) * CHAR_BIT, 0); GET_CB_FIELD(in, m, 0, 4294967295, 0); addr[0] = IPv4(a, b, c, d); mask_len[0] = m; printf("m[%d]\n", m); return 0; } test-acl didn`t match any rules when I ran modified test-acl. Here are my rule and trace file: cat rule1.range @192.168.0.1/100 192.168.0.0/24 400 : 500 0 : 52 6/0xff cat trace1 0xc0a80005 0xc0a80009 450 53 0x06 Is there anything that I`m missing?