DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] Why doesn`t test-acl work when IP filed is RTE_ACL_FIELD_TYPE_RANGE?
@ 2015-06-17  2:41 Gyumin
  2015-06-17  9:29 ` Gyumin
  0 siblings, 1 reply; 2+ messages in thread
From: Gyumin @ 2015-06-17  2:41 UTC (permalink / raw)
  To: 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?

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-06-17  9:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-17  2:41 [dpdk-dev] Why doesn`t test-acl work when IP filed is RTE_ACL_FIELD_TYPE_RANGE? Gyumin
2015-06-17  9:29 ` Gyumin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).