Hi Neale,

I've patched the router plugin a bit to make it work with several VRF
tables. For every VRF table it will create a netns inside the host. And for
every interface it will create a corresponding tap device. But I need to
get TX sw_if_index somehow to properly choose the tx fd of tap interface.

I've tried to use VLIB_RX sw_if_index, but it doesn't fit in case with
several VRF tables (because RX sw_if_index always will be the interface in
the global table).
Seems like there should be a way to extract sw_if_index, because there is
information about interface in FIB:

1.1.1.1/32
  unicast-ip4-chain
  [@0]: dpo-load-balance: [proto:ip4 index:28 buckets:1 uRPF:29
to:[1339:144612]]
    [0] [@2]: dpo-receive: 1.1.1.1 on *loop0*

But I can't find the right way. Any suggestions are appreciated.

BTW your Linux Control Plane Mirror plugin seems very interesting to me.
Maybe I'll find my answer there.

On Fri, 22 Jan 2021 at 18:52, Neale Ranns <ne...@graphiant.com> wrote:

>
>
> Hi Stanislav,
>
>
>
> There is no TX interface information if the packet is for-us. There is
> only valid TX interface information if the routing decision was to TX on an
> interface. How do you choose the egress Tap?
>
>
>
> /neale
>
>
>
>
>
> *From: *vpp-dev@lists.fd.io <vpp-dev@lists.fd.io> on behalf of Stanislav
> Zaikin via lists.fd.io <zstaseg=gmail....@lists.fd.io>
> *Date: *Friday, 22 January 2021 at 16:29
> *To: *vpp-dev <vpp-dev@lists.fd.io>
> *Subject: *[vpp-dev] local lookup and tx sw_if_index
>
> Hello,
>
>
>
> I have a custom node which registered certain protocols (it's basically an
> old good "router" plugin).
>
> After "ip4-local" node VPP sends the packet to this node. But there is no
> information about TX interface, and I need TX sw_if_index to push my packet
> to the corresponding tap device.
>
>
>
> If I've understood correctly vnet_buffer(b0)->sw_if_index[VLIB_TX] is set
> to fib index.
>
> How can I get TX sw_if_index of the destination address after the lookup?
>
>
>
> 00:00:39:579495: memif-input
>
>   memif: hw_if_index 1 next-index 4
>
>     slot: ring 0
>
> 00:00:39:587518: ethernet-input
>
>   frame: flags 0x1, hw-if-index 1, sw-if-index 1
>
>   MPLS: 02:fe:13:14:0e:36 -> 02:fe:4c:84:cc:01
>
> 00:00:39:587526: mpls-input
>
>   MPLS: next mpls-lookup[1]  label 1111 ttl 64 exp 0
>
> 00:00:39:587530: mpls-lookup
>
>   MPLS: next [6], lookup fib index 0, LB index 33 hash 0 label 1111 eos 1
>
> 00:00:39:587534: ip4-mpls-label-disposition-pipe
>
>   rpf-id:-1 ip4, pipe
>
> 00:00:39:587539: lookup-ip4-dst
>
>      fib-index:1 addr:1.1.1.1 load-balance:28
>
> 00:00:39:587543: ip4-local
>
>     TCP: 100.0.0.2 -> 1.1.1.1
>
>       tos 0x00, ttl 63, length 60, checksum 0x1f25 dscp CS0 ecn NON_ECN
>
>       fragment id 0xb693, flags DONT_FRAGMENT
>
>     TCP: 40740 -> 169
>
>       seq. 0x66669613 ack 0x00000000
>
>       flags 0x02 SYN, tcp header: 40 bytes
>
>       window 64240, checksum 0x0939
>
> 00:00:39:587552: tap-inject-tx
>
>   tap_inject_tx rx_sw_if 1 tx_sw_if 1 tap fd 23
>
>
> --
>
> Best regards
> Stanislav Zaikin
>


-- 
Best regards
Stanislav Zaikin
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#18584): https://lists.fd.io/g/vpp-dev/message/18584
Mute This Topic: https://lists.fd.io/mt/80032473/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