From: hem...@mnkcg.com <hem...@mnkcg.com>
Date: Monday, 19 April 2021 at 17:23
To: hem...@mnkcg.com <hem...@mnkcg.com>, Neale Ranns <ne...@graphiant.com>, 
vpp-dev@lists.fd.io <vpp-dev@lists.fd.io>
Subject: RE: [vpp-dev] dst mac-address look up?
I do see a correct adj in the output from “sh adj” for the pg1 interface.

[@16] ipv6 via 2002::2 pg1: mtu:9000 next:4 flags:[] 
002590ebe8ed02fee2df6d1386dd

So the issue is how I get adj_index in the VPP plugin code is clearly not 
working.

    u32 adj_index = vnet_buffer (b)->ip.adj_index[VLIB_TX];
    ip_adjacency_t *adj = adj_get(adj_index);

the adjacency is written into the packet metadata as a result of a forwarding 
decision. Usually this is ip[46]-lookup. As you said your plugin bypasses that, 
so you need to do your own lookup to get the adj – hence the table I was 
suggesting.

/neale

    vnet_rewrite_header_t rwh = adj->rewrite_header;
    char *str = "UPF6";
    print_n_bytes(str, &rwh.data[0], rwh.data_bytes);

The output in vpp /tmp logs is below

vpp-unittest-TestIP6GTPTOGTP-fsn4sjum/vpp_stderr.txt:UPF6 size 14 
000000020000006068083D001100
vpp-unittest-TestIP6GTPTOGTP-fsn4sjum/vpp_stderr.txt:UPF6 IP = 2002::2, mac = 
00:25:90:eb:e8:ed, sw_index = 2, eg_int mac 02:fe:09:b8:84:53

Hemant

From: vpp-dev@lists.fd.io <vpp-dev@lists.fd.io> On Behalf Of hemant via 
lists.fd.io
Sent: Monday, April 19, 2021 10:57 AM
To: ne...@graphiant.com; vpp-dev@lists.fd.io
Subject: Re: [vpp-dev] dst mac-address look up?

I am using a test_plugin.py with VPP Python API.  The ip6 address found in 
ip-neighbor is 2002::2.


10:43:38,382 CLI: show ip6 neighbors
10:43:38,382 Calling cli_inband('cmd':'show ip6 
neighbors\n','context':67,'_vl_msg_id':614,'client_index':2147483649)
10:43:38,383 Return value: cli_inband_reply(_0=616, context=67, retval=0, 
reply='    Time    ...
10:43:38,384     Time                       IP                    Flags      
Ethernet              Interface
      1.6860                fd01:1::2                  D    02:01:00:00:ff:02 
pg0
      1.7778                 2002::2                   S    00:25:90:eb:e8:ed 
pg1
      1.7141                fd01:2::2                  D    02:02:00:00:ff:02 
pg1
      1.7417                fd01:3::2                  D    02:03:00:00:ff:02 
pg2
      1.7682                fd01:4::2                  D    02:04:00:00:ff:02 
pg3

10:43:38,384 CLI: show adj
10:43:38,384 Calling cli_inband('cmd':'show 
adj\n','context':68,'_vl_msg_id':614,'client_index':2147483649)
10:43:38,385 Return value: cli_inband_reply(_0=616, context=68, retval=0, 
reply='[@0] ipv6-gl...
10:43:38,385 [@0] ipv6-glean: [src:0.0.0.0/0] pg0: mtu:9000 next:2 flags:[] 
ffffffffffff02fe2fab1beb86dd
[@1] ipv6-mcast: pg0: mtu:9000 next:3 flags:[] 33330000000002fe2fab1beb86dd
[@2] ipv6-glean: [src:fd01:1::/64] pg0: mtu:9000 next:2 flags:[] 
ffffffffffff02fe2fab1beb86dd
[@3] ipv6 via fd01:1::2 pg0: mtu:9000 next:3 flags:[] 
02010000ff0202fe2fab1beb86dd
[@4] ipv6-glean: [src:0.0.0.0/0] pg1: mtu:9000 next:3 flags:[] 
ffffffffffff02fee2df6d1386dd
[@5] ipv6-mcast: pg1: mtu:9000 next:4 flags:[] 33330000000002fee2df6d1386dd
[@6] ipv6-glean: [src:fd01:2::/64] pg1: mtu:9000 next:3 flags:[] 
ffffffffffff02fee2df6d1386dd
[@7] ipv6 via fd01:2::2 pg1: mtu:9000 next:4 flags:[] 
02020000ff0202fee2df6d1386dd
[@8] ipv6-glean: [src:0.0.0.0/0] pg2: mtu:9000 next:4 flags:[] 
ffffffffffff02fe8c8070f186dd
[@9] ipv6-mcast: pg2: mtu:9000 next:5 flags:[] 33330000000002fe8c8070f186dd
[@10] ipv6-glean: [src:fd01:3::/64] pg2: mtu:9000 next:4 flags:[] 
ffffffffffff02fe8c8070f186dd
[@11] ipv6 via fd01:3::2 pg2: mtu:9000 next:5 flags:[] 
02030000ff0202fe8c8070f186dd
[@12] ipv6-glean: [src:0.0.0.0/0] pg3: mtu:9000 next:5 flags:[] 
ffffffffffff02fe16735ff286dd
[@13] ipv6-mcast: pg3: mtu:9000 next:6 flags:[] 33330000000002fe16735ff286dd
[@14] ipv6-glean: [src:fd01:4::/64] pg3: mtu:9000 next:5 flags:[] 
ffffffffffff02fe16735ff286dd
[@15] ipv6 via fd01:4::2 pg3: mtu:9000 next:6 flags:[] 
02040000ff0202fe16735ff286dd
[@16] ipv6 via 2002::2 pg1: mtu:9000 next:4 flags:[] 
002590ebe8ed02fee2df6d1386dd

Hemant

From: Neale Ranns <ne...@graphiant.com<mailto:ne...@graphiant.com>>
Sent: Monday, April 19, 2021 10:14 AM
To: hem...@mnkcg.com<mailto:hem...@mnkcg.com>; 
vpp-dev@lists.fd.io<mailto:vpp-dev@lists.fd.io>
Subject: Re: [vpp-dev] dst mac-address look up?



From: hem...@mnkcg.com<mailto:hem...@mnkcg.com> 
<hem...@mnkcg.com<mailto:hem...@mnkcg.com>>
Date: Monday, 19 April 2021 at 16:03
To: Neale Ranns <ne...@graphiant.com<mailto:ne...@graphiant.com>>, 
vpp-dev@lists.fd.io<mailto:vpp-dev@lists.fd.io> 
<vpp-dev@lists.fd.io<mailto:vpp-dev@lists.fd.io>>
Subject: RE: [vpp-dev] dst mac-address look up?


From: Neale Ranns <ne...@graphiant.com<mailto:ne...@graphiant.com>>
Sent: Monday, April 19, 2021 3:34 AM
To: hem...@mnkcg.com<mailto:hem...@mnkcg.com>; 
vpp-dev@lists.fd.io<mailto:vpp-dev@lists.fd.io>
Subject: Re: [vpp-dev] dst mac-address look up?



From: hem...@mnkcg.com<mailto:hem...@mnkcg.com> 
<hem...@mnkcg.com<mailto:hem...@mnkcg.com>>
Date: Sunday, 18 April 2021 at 19:25
To: Neale Ranns <ne...@graphiant.com<mailto:ne...@graphiant.com>>, 
vpp-dev@lists.fd.io<mailto:vpp-dev@lists.fd.io> 
<vpp-dev@lists.fd.io<mailto:vpp-dev@lists.fd.io>>
Subject: RE: [vpp-dev] dst mac-address look up?

The adjacency is incomplete for the egress interface, i.e., interface rewrite 
string is not setup yet.   However, the ARP cache does have a complete 
adjacency  and this is why the arp cache is looked up and ipn-> 
pn_fib_entry_index is correct.

then something is broken. If there is an ARP entry then the adj should be 
complete.
Can you show me:
  Sh ip neighbor
  Sh adj
Out point out which neighbor it is.

/neale


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#19254): https://lists.fd.io/g/vpp-dev/message/19254
Mute This Topic: https://lists.fd.io/mt/82127329/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to