Hi Neale,

Its done.

I checked for [add|del] [count <n>] as well.
I believe it works fine now.

Please find the output below.

vpp# sh ip6 fib
ipv6-VRF:0, fib_index 0, flow hash:
::/0
  unicast-ip6-chain
  [@0]: dpo-load-balance: [index:5 buckets:1 uRPF:5 to:[0:0]]
    [0] [@0]: dpo-drop ip6
fe80::/10
  unicast-ip6-chain
  [@0]: dpo-load-balance: [index:6 buckets:1 uRPF:6 to:[0:0]]
    [0] [@2]: dpo-receive

vpp# ip route addd::12/128 via 9001::1

vpp# sh ip6 fib
ipv6-VRF:0, fib_index 0, flow hash:
::/0
  unicast-ip6-chain
  [@0]: dpo-load-balance: [index:5 buckets:1 uRPF:5 to:[0:0]]
    [0] [@0]: dpo-drop ip6
9001::1/128
  unicast-ip6-chain
  [@0]: dpo-load-balance: [index:8 buckets:1 uRPF:5 to:[0:0]]
    [0] [@0]: dpo-drop ip6
addd::12/128
  unicast-ip6-chain
  [@0]: dpo-load-balance: [index:9 buckets:1 uRPF:7 to:[0:0]]
      load-balance-map: index:0 buckets:1
         index:    0
           map:    0
    [0] [@6]: dpo-load-balance: [index:8 buckets:1 uRPF:5 to:[0:0]]
          [0] [@0]: dpo-drop ip6
fe80::/10
  unicast-ip6-chain
  [@0]: dpo-load-balance: [index:6 buckets:1 uRPF:6 to:[0:0]]
    [0] [@2]: dpo-receive

vpp# ip route add addd::11/128 via 9001::1

vpp# sh ip6 fib
ipv6-VRF:0, fib_index 0, flow hash:
::/0
  unicast-ip6-chain
  [@0]: dpo-load-balance: [index:5 buckets:1 uRPF:5 to:[0:0]]
    [0] [@0]: dpo-drop ip6
9001::1/128
  unicast-ip6-chain
  [@0]: dpo-load-balance: [index:8 buckets:1 uRPF:5 to:[0:0]]
    [0] [@0]: dpo-drop ip6
addd::11/128
  unicast-ip6-chain
  [@0]: dpo-load-balance: [index:10 buckets:1 uRPF:7 to:[0:0]]
      load-balance-map: index:0 buckets:1
         index:    0
           map:    0
    [0] [@6]: dpo-load-balance: [index:8 buckets:1 uRPF:5 to:[0:0]]
          [0] [@0]: dpo-drop ip6
addd::12/128
  unicast-ip6-chain
  [@0]: dpo-load-balance: [index:9 buckets:1 uRPF:7 to:[0:0]]
      load-balance-map: index:0 buckets:1
         index:    0
           map:    0
    [0] [@6]: dpo-load-balance: [index:8 buckets:1 uRPF:5 to:[0:0]]
          [0] [@0]: dpo-drop ip6
fe80::/10
  unicast-ip6-chain
  [@0]: dpo-load-balance: [index:6 buckets:1 uRPF:6 to:[0:0]]
    [0] [@2]: dpo-receive

vpp# ip route del addd::11/128 via 9001::1

vpp# sh ip6 fib
ipv6-VRF:0, fib_index 0, flow hash:
::/0
  unicast-ip6-chain
  [@0]: dpo-load-balance: [index:5 buckets:1 uRPF:5 to:[0:0]]
    [0] [@0]: dpo-drop ip6
9001::1/128
  unicast-ip6-chain
  [@0]: dpo-load-balance: [index:8 buckets:1 uRPF:5 to:[0:0]]
    [0] [@0]: dpo-drop ip6
addd::12/128
  unicast-ip6-chain
  [@0]: dpo-load-balance: [index:9 buckets:1 uRPF:7 to:[0:0]]
      load-balance-map: index:0 buckets:1
         index:    0
           map:    0
    [0] [@6]: dpo-load-balance: [index:8 buckets:1 uRPF:5 to:[0:0]]
          [0] [@0]: dpo-drop ip6
fe80::/10
  unicast-ip6-chain
  [@0]: dpo-load-balance: [index:6 buckets:1 uRPF:6 to:[0:0]]
    [0] [@2]: dpo-receive

vpp# ip route del addd::12/128

vpp# sh ip6 fib
ipv6-VRF:0, fib_index 0, flow hash:
::/0
  unicast-ip6-chain
  [@0]: dpo-load-balance: [index:5 buckets:1 uRPF:5 to:[0:0]]
    [0] [@0]: dpo-drop ip6
fe80::/10
  unicast-ip6-chain
  [@0]: dpo-load-balance: [index:6 buckets:1 uRPF:6 to:[0:0]]
    [0] [@2]: dpo-receive

vpp# ip route count 2 addd::12/128 via 9001::1
5.680738e4 routes/sec

vpp# sh ip6 fib
ipv6-VRF:0, fib_index 0, flow hash:
::/0
  unicast-ip6-chain
  [@0]: dpo-load-balance: [index:5 buckets:1 uRPF:5 to:[0:0]]
    [0] [@0]: dpo-drop ip6
9001::1/128
  unicast-ip6-chain
  [@0]: dpo-load-balance: [index:9 buckets:1 uRPF:5 to:[0:0]]
    [0] [@0]: dpo-drop ip6
addd::12/128
  unicast-ip6-chain
  [@0]: dpo-load-balance: [index:8 buckets:1 uRPF:7 to:[0:0]]
      load-balance-map: index:0 buckets:1
         index:    0
           map:    0
    [0] [@6]: dpo-load-balance: [index:9 buckets:1 uRPF:5 to:[0:0]]
          [0] [@0]: dpo-drop ip6
addd:0:0:1::12/128
  unicast-ip6-chain
  [@0]: dpo-load-balance: [index:10 buckets:1 uRPF:7 to:[0:0]]
      load-balance-map: index:0 buckets:1
         index:    0
           map:    0
    [0] [@6]: dpo-load-balance: [index:9 buckets:1 uRPF:5 to:[0:0]]
          [0] [@0]: dpo-drop ip6
fe80::/10
  unicast-ip6-chain
  [@0]: dpo-load-balance: [index:6 buckets:1 uRPF:6 to:[0:0]]
    [0] [@2]: dpo-receive

vpp# ip route del count 2 addd::12/128 via 9001::1
1.061138e5 routes/sec

vpp# sh ip6 fib
ipv6-VRF:0, fib_index 0, flow hash:
::/0
  unicast-ip6-chain
  [@0]: dpo-load-balance: [index:5 buckets:1 uRPF:5 to:[0:0]]
    [0] [@0]: dpo-drop ip6
fe80::/10
  unicast-ip6-chain
  [@0]: dpo-load-balance: [index:6 buckets:1 uRPF:6 to:[0:0]]
    [0] [@2]: dpo-receive





Thanks,

Pragash Vijayaragavan
Grad Student at Rochester Institute of Technology
email : pxv3...@rit.edu
ph : 585 764 4662


On Fri, Aug 11, 2017 at 1:48 PM, Neale Ranns (nranns) <nra...@cisco.com>
wrote:

> Hi Pragash,
>
>
>
> It’s in vnet_ip_route_cmd() from ip/lookup.c.
>
>
>
> It is a loop over a series of text matching rules. After each rule
> (unformat) the matched text is consumed and the next iteration occurs
> further into the string, which as you say, occurs left to right. So the
> order the matching rules are applied is important.
>
>
>
> Regards,
>
> neale
>
>
>
>
>
> *From: *Pragash Vijayaragavan <pxv3...@rit.edu>
> *Reply-To: *"pxv3...@rit.edu" <pxv3...@rit.edu>
> *Date: *Friday, 11 August 2017 at 10:12
> *To: *"Neale Ranns (nranns)" <nra...@cisco.com>
> *Cc: *"vpp-dev@lists.fd.io" <vpp-dev@lists.fd.io>, "John Marshall (jwm)" <
> j...@cisco.com>, Minseok Kwon <mxk...@rit.edu>
> *Subject: *Re: ip6 route add bug
>
>
>
> Hi Neale,
>
>
>
> I took a look at the code.
>
>
>
> What i believe is being done is the parsing is going from left to right,
> for say  "ip route add add::123/128 via 9001::3",
>
> then when the parser encounters a "add", it sets the is_add = 1, flag, so
> the is_add flag is set two times in this case
>
> and hence the ip is not parsed properly.
>
>
>
> We can just have a check, if the is_add flag is set or not, thus
> preventing it being set 2 times.
>
>
>
> I tried to find where i should do this change in the code, but could not
> get where the cli is being used and called.
>
>
>
> I tried to modify the vat/api_format.c, which has the
> "api_ip_add_del_route (vat_main_t * vam)" function
>
> but it didnt work.
>
>
>
> Could you please hint me on how this function was generated.
>
>
>
> I checked all the format files and api files. I could not find any file
> where the input string is parsed.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> Thanks,
>
>
>
> Pragash Vijayaragavan
>
> Grad Student at Rochester Institute of Technology
>
> email : pxv3...@rit.edu
>
> ph : 585 764 4662 <(585)%20764-4662>
>
>
>
>
>
> On Thu, Aug 10, 2017 at 9:56 AM, Neale Ranns (nranns) <nra...@cisco.com>
> wrote:
>
> Hi Pragash,
>
>
>
> Yes that’s a bug.
>
> Could you submit a patch for it – we need to flip the order the ‘add’
> string is parsed from the options so that it comes after parsing the IPv6
> address.
>
>
>
> Thanks,
>
> neale
>
>
>
> *From: *Pragash Vijayaragavan <pxv3...@rit.edu>
> *Reply-To: *"pxv3...@rit.edu" <pxv3...@rit.edu>
> *Date: *Thursday, 10 August 2017 at 14:47
> *To: *"vpp-dev@lists.fd.io" <vpp-dev@lists.fd.io>
> *Cc: *"Neale Ranns (nranns)" <nra...@cisco.com>, "John Marshall (jwm)" <
> j...@cisco.com>, Minseok Kwon <mxk...@rit.edu>
> *Subject: *ip6 route add bug
>
>
>
> Hi,
>
>
>
> When i add the following ip6 route, which starts with "add", the "add" is
> ignored and the rest of the ip is added.
>
>
>
> Is this a bug?
>
>
>
> You can check the outputs below.
>
>
>
> This is in 17.07-rc0.
>
>
>
>
>
> *vpp# ip route add add:9538:44f8::/45 via 9000::1*
>
>
>
> vpp# sh ip6 fib
>
> ipv6-VRF:0, fib_index 0, flow hash:
>
> ::/0
>
>   unicast-ip6-chain
>
>   [@0]: dpo-load-balance: [index:5 buckets:1 uRPF:5 to:[0:0]]
>
>     [0] [@0]: dpo-drop ip6
>
> 9000::1/128
>
>   unicast-ip6-chain
>
>   [@0]: dpo-load-balance: [index:8 buckets:1 uRPF:5 to:[0:0]]
>
>     [0] [@0]: dpo-drop ip6
>
> *9538:44f8::/45*
>
>   unicast-ip6-chain
>
>   [@0]: dpo-load-balance: [index:9 buckets:1 uRPF:7 to:[0:0]]
>
>       load-balance-map: index:0 buckets:1
>
>          index:    0
>
>            map:    0
>
>     [0] [@6]: dpo-load-balance: [index:8 buckets:1 uRPF:5 to:[0:0]]
>
>           [0] [@0]: dpo-drop ip6
>
> fe80::/10
>
>   unicast-ip6-chain
>
>   [@0]: dpo-load-balance: [index:6 buckets:1 uRPF:6 to:[0:0]]
>
>     [0] [@2]: dpo-receive
>
>
>
>
>
> Is this fixed in 17.10.
>
>
>
>
>
>
> Thanks,
>
>
>
> Pragash Vijayaragavan
>
> Grad Student at Rochester Institute of Technology
>
> email : pxv3...@rit.edu
>
> ph : 585 764 4662 <(585)%20764-4662>
>
>
>
>
>
>
_______________________________________________
vpp-dev mailing list
vpp-dev@lists.fd.io
https://lists.fd.io/mailman/listinfo/vpp-dev

Reply via email to