Re: [vpp-dev] VPP and RCU?

2018-10-30 Thread Honnappa Nagarahalli


> > >
> > >> Hi Stephen,
> > >>
> > >> No, we don’t support RCU. Wouldn’t rw-locks be enough to support your
> usecases?
> > >>
> > >> Florin
> > >>
> > >>> On Oct 29, 2018, at 12:40 PM, Stephen Hemminger
>  wrote:
> > >>>
> > >>> Is it possible to do Read Copy Update with VPP? Either using
> > >>> Userspace RCU (https://librcu.org) or manually. RCU is very
> > >>> efficient way to handle read mostly tables and other dynamic cases such
> as plugins.
> > >>>
> > >>> The several things that are needed are non-preempt, atomic update
> > >>> of a pointer and a mechanism to be sure all active threads have
> > >>> gone through a quiescent period. I don't think VPP will preempt
> > >>> one node for another so that is done. The atomic update is
> > >>> relatively easy with basic barriers, either from FD.IO, DPDK, or native
> compiler operations. But is there an API to have a quiescent period marker in
> the main VPP vector scheduler?
> > >>>
> > >>> Something like the QSBR model of Userspace RCU library.
> > >>> (each thread calls rcu_queiscent_state() periodically) would be
> > >>> ideal.
> > >>>
> > >>> -=-=-=-=-=-=-=-=-=-=-=-
> > >>> Links: You receive all messages sent to this group.
> > >>>
> > >>> View/Reply Online (#11023):
> > >>> https://lists.fd.io/g/vpp-dev/message/11023
> > >>> Mute This Topic: https://lists.fd.io/mt/27785182/675152
> > >>> Group Owner: vpp-dev+ow...@lists.fd.io
> > >>> Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub
> [fcoras.li...@gmail.com]
> > >>> -=-=-=-=-=-=-=-=-=-=-=-
> > >>
> > >
> > > No reader-writer locks are 100's of times slower.  In fact reader
> > > write locks are slower than normal spin lock.
> > >
> >
> > I guess you meant that in general, and I can see how for scenarios with
> multiple writers and readers performance can be bad. But from your original
> message I assumed you’re mostly interested in concurrent read performance
> with few writes. For such scenarios I would expect our current, simple, spin
> and rw lock implementations to not be that bad. If that’s provably not the 
> case,
> we should definitely consider doing RCU.
> >
> > Also worth noting that a common pattern in vpp is to have per thread data
> structures and then entirely avoid locking. For lookups we typically use the
> bihash and that is thread safe.
When you say 'per thread data structures', does it mean the data structures 
will be duplicated for each data plane thread?

> >
> > Florin
> >
> >
> 
> https://www.researchgate.net/publication/247337469_RCU_vs_Locking_Perf
> ormance_on_Different_CPUs
> 
> https://lwn.net/Articles/263130/
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#11045): https://lists.fd.io/g/vpp-dev/message/11045
Mute This Topic: https://lists.fd.io/mt/27785182/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [vpp-dev] NAT44 && vxlan tunnel conflict

2018-10-30 Thread wangchuan...@163.com
I want to use the vpp as the data forwarding center through vxlan tunnel, and 
the server-PC VPP running on can be SSH-login at remote PC.
PC2 <-> PC1 disconnected after add NAT (tapSSH - TenGigabitEthernet8/0/0).
My current main doubts is that how can I limit the NAT44 only work at SSH(port 
22 tcp)?

The topology is show below: 
cmd config like:###
BASE:
set int state TenGigabitEthernet8/0/0 up
set int ip addr TenGigabitEthernet8/0/0 172.16.4.2/24

create bridge-domain  learn 1 forward 1 uu-flood 1 flood 1 arp-term 1
loopback create
set int l2 bridge loop0  bvi
set int ip address loop0 192.168.120.1/24
set int state loop0 up

tap connect tapSSH address 192.168.120.2/24
set int l2 bridge tapcli-0 
set int state tapcli-0 up

create vxlan tunnel src 172.16.4.2 dst 172.16.4.177 vni 100
set interface l2 bridge vxlan_tunnel0 
create vxlan tunnel src 172.16.4.2 dst 172.16.4.188 vni 100
set interface l2 bridge vxlan_tunnel1 

#NAT
nat44 add interface address TenGigabitEthernet8/0/0
set interface nat44 in loop0 out TenGigabitEthernet8/0/0
nat44 add static mapping local 192.168.120.2 22 external 
TenGigabitEthernet8/0/0 22 tcp


#and trace is show below###
BASE:
00:24:38:826034: dpdk-input
  TenGigabitEthernet8/0/0 rx queue 0
  buffer 0x18d92: current data 14, length 134, free-list 0, clone-count 0, 
totlen-nifb 0, trace 0x2
  ext-hdr-valid 
  l4-cksum-computed l4-cksum-correct l2-hdr-offset 0 
l3-hdr-offset 14 
  PKT MBUF: port 1, nb_segs 1, pkt_len 148
buf_len 2176, data_len 148, ol_flags 0x180, data_off 128, phys_addr 
0x6de36500
packet_type 0x211 l2_len 0 l3_len 0 outer_l2_len 0 outer_l3_len 0
Packet Offload Flags
  PKT_RX_IP_CKSUM_GOOD (0x0080) IP cksum of RX pkt. is valid
  PKT_RX_L4_CKSUM_GOOD (0x0100) L4 cksum of RX pkt. is valid
Packet Types
  RTE_PTYPE_L2_ETHER (0x0001) Ethernet packet
  RTE_PTYPE_L3_IPV4 (0x0010) IPv4 packet without extension headers
  RTE_PTYPE_L4_UDP (0x0200) UDP packet
  IP4: 00:25:7c:30:05:ec -> 00:a0:c9:00:00:02
  UDP: 172.16.4.177 -> 172.16.4.2
tos 0x00, ttl 64, length 134, checksum 0x12ba
fragment id 0x06da
  UDP: 4789 -> 4789
length 114, checksum 0x
00:24:38:826037: ip4-input-no-checksum
  UDP: 172.16.4.177 -> 172.16.4.2
tos 0x00, ttl 64, length 134, checksum 0x12ba
fragment id 0x06da
  UDP: 4789 -> 4789
length 114, checksum 0x
00:24:38:826040: ip4-lookup
  fib 0 dpo-idx 7 flow hash: 0x
  UDP: 172.16.4.177 -> 172.16.4.2
tos 0x00, ttl 64, length 134, checksum 0x12ba
fragment id 0x06da
  UDP: 4789 -> 4789
length 114, checksum 0x
00:24:38:826041: ip4-local
UDP: 172.16.4.177 -> 172.16.4.2
  tos 0x00, ttl 64, length 134, checksum 0x12ba
  fragment id 0x06da
UDP: 4789 -> 4789
  length 114, checksum 0x
00:24:38:826042: ip4-udp-lookup
  UDP: src-port 4789 dst-port 4789
00:24:38:826043: vxlan4-input
  VXLAN decap from vxlan_tunnel0 vni 100 next 1 error 0
00:24:38:826051: l2-input
  l2-input: sw_if_index 5 dst 00:25:7c:30:05:ef src 00:25:7c:30:05:eb
00:24:38:826053: l2-learn
  l2-learn: sw_if_index 5 dst 00:25:7c:30:05:ef src 00:25:7c:30:05:eb bd_index 1
00:24:38:826057: l2-fwd
  l2-fwd:   sw_if_index 5 dst 00:25:7c:30:05:ef src 00:25:7c:30:05:eb bd_index 1
00:24:38:826058: l2-output
  l2-output: sw_if_index 6 dst 00:25:7c:30:05:ef src 00:25:7c:30:05:eb data 08 
00 45 00 00 54 ac 4b 40 00 40 01
00:24:38:826058: vxlan4-encap
  VXLAN encap to vxlan_tunnel1 vni 100
00:24:38:826060: ip4-load-balance
  fib 6 dpo-idx 20 flow hash: 0x00010001
  UDP: 172.16.4.2 -> 172.16.4.188
tos 0x00, ttl 254, length 134, checksum 0x5b88
fragment id 0x
  UDP: 4789 -> 4789
length 114, checksum 0x
00:24:38:826061: ip4-rewrite
  tx_sw_if_index 2 dpo-idx 5 : ipv4 via 172.16.4.188 TenGigabitEthernet8/0/0: 
mtu:1500 00257c3005f000a0c9020800 flow hash: 0x00010001
  : 00257c3005f000a0c90208004586fd115c88ac100402ac10
  0020: 04bc12b512b50072080064257c3005ef00257c30
00:24:38:826062: TenGigabitEthernet8/0/0-output
  TenGigabitEthernet8/0/0
  IP4: 00:a0:c9:00:00:02 -> 00:25:7c:30:05:f0
  UDP: 172.16.4.2 -> 172.16.4.188
tos 0x00, ttl 253, length 134, checksum 0x5c88
fragment id 0x
  UDP: 4789 -> 4789
length 114, checksum 0x
00:24:38:826063: TenGigabitEthernet8/0/0-tx
  TenGigabitEthernet8/0/0 tx queue 2
  buffer 0x18d92: current data 0, length 148, free-list 0, clone-count 0, 
totlen-nifb 0, trace 0x2
  ext-hdr-valid 
  l4-cksum-computed l4-cksum-correct l2-hdr-offset 0 
l3-hdr-offset 14 
  PKT MBUF: port 1, nb_segs 1, pkt_len 148
buf_len 2176, data_len 148, ol_flags 0x180, data_off 128, phys_addr 
0x6de36500
packet_type 0x211 l2_len 0 l3_len 0 outer_l2_len 0 outer_l3_len 0
Packet Offload Flags
  PKT_RX_IP_CKSUM_GOOD (0x0080) IP cksum of RX pkt. is valid

Re: [vpp-dev] difference between tap device and veth

2018-10-30 Thread carlito nueno
Thank you!
On Tue, Oct 30, 2018 at 12:42 PM Damjan Marion  wrote:
>
>
>
> > On 30 Oct 2018, at 19:35, Carlito Nueno  wrote:
> >
> > Got it.
> > Just to clarify, does tapv2 use vhost-net backend?
>
> yes
>
> > Is is correct/sufficient way to use it?
> > create tap id 0 host-ip4-addr 10.20.2/24 host-if-name testtap
>
> yes
>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#11043): https://lists.fd.io/g/vpp-dev/message/11043
Mute This Topic: https://lists.fd.io/mt/27746126/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


[vpp-dev] 18.10 release artifacts

2018-10-30 Thread Michal Cmarada via Lists.Fd.Io
Hi vpp-devs,

I was preparing honeycomb release and while building it I found out that there 
are some artifacts missing in nexus repository for 18.10. 
https://nexus.fd.io/content/repositories/fd.io.release/io/fd/vpp/ . most of 
them were deployed ok, but some of them are missing e.g. jvpp-ioampot. I tried 
to build 18.10 release of vpp locally on Ubuntu and it seems that jvpp is built 
correctly. I then exported jvpp dependencies directly out of debian package and 
it contained jvpp-ioampot. I think that something might happen during upload to 
nexus.

Can someone please check it out? I am not familiar with the build process and 
upload to nexus.

Thanks,

Michal

[https://www.cisco.com/c/dam/m/en_us/signaturetool/images/banners/standard/06_standard_graphic.png]




Michal Cmarada
Engineer - Software
mcmar...@cisco.com
Tel:










Cisco Systems, Inc.



Slovakia
cisco.com



[http://www.cisco.com/assets/swa/img/thinkbeforeyouprint.gif]

Think before you print.

This email may contain confidential and privileged material for the sole use of 
the intended recipient. Any review, use, distribution or disclosure by others 
is strictly prohibited. If you are not the intended recipient (or authorized to 
receive for the recipient), please contact the sender by reply email and delete 
all copies of this message.
Please click 
here
 for Company Registration Information.







-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#11042): https://lists.fd.io/g/vpp-dev/message/11042
Mute This Topic: https://lists.fd.io/mt/27799255/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [vpp-dev] difference between tap device and veth

2018-10-30 Thread Damjan Marion via Lists.Fd.Io


> On 30 Oct 2018, at 19:35, Carlito Nueno  wrote:
> 
> Got it.
> Just to clarify, does tapv2 use vhost-net backend?

yes

> Is is correct/sufficient way to use it?
> create tap id 0 host-ip4-addr 10.20.2/24 host-if-name testtap

yes

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#11041): https://lists.fd.io/g/vpp-dev/message/11041
Mute This Topic: https://lists.fd.io/mt/27746126/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [vpp-dev] difference between tap device and veth

2018-10-30 Thread carlito nueno
Got it.
Just to clarify, does tapv2 use vhost-net backend?

Is is correct/sufficient way to use it?
create tap id 0 host-ip4-addr 10.20.2/24 host-if-name testtap

Thanks
On Sat, Oct 27, 2018 at 1:49 AM Damjan Marion  wrote:
>
>
> Tap (with vhost-net backend) is faster and it is real interface from linux 
> perspective...
>
> —
> Damjan
>
> > On 27 Oct 2018, at 03:48, carlito nueno  wrote:
> >
> > Hi all,
> >
> > Is there a performance difference between using tap device vs veth?
> > Use case: running a DNS server on the host.
> >
> > Thanks
> > -=-=-=-=-=-=-=-=-=-=-=-
> > Links: You receive all messages sent to this group.
> >
> > View/Reply Online (#11009): https://lists.fd.io/g/vpp-dev/message/11009
> > Mute This Topic: https://lists.fd.io/mt/27746126/675642
> > Group Owner: vpp-dev+ow...@lists.fd.io
> > Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [dmar...@me.com]
> > -=-=-=-=-=-=-=-=-=-=-=-
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#11040): https://lists.fd.io/g/vpp-dev/message/11040
Mute This Topic: https://lists.fd.io/mt/27746126/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


[vpp-dev] Sample plugin documentation out of date

2018-10-30 Thread Stephen Hemminger
I was playing around with sample plugin, it looks like the documentation is out 
of date
with current VPP especially autoconf etc.

Could someone walkthrough the documentation and make sure the example works.

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#11039): https://lists.fd.io/g/vpp-dev/message/11039
Mute This Topic: https://lists.fd.io/mt/27793263/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [vpp-dev] VPP and RCU?

2018-10-30 Thread Stephen Hemminger
On Mon, 29 Oct 2018 14:58:07 -0700
Florin Coras  wrote:

> > On Oct 29, 2018, at 1:42 PM, Stephen Hemminger  
> > wrote:
> > 
> > On Mon, 29 Oct 2018 13:20:27 -0700
> > Florin Coras  wrote:
> >   
> >> Hi Stephen, 
> >> 
> >> No, we don’t support RCU. Wouldn’t rw-locks be enough to support your 
> >> usecases?
> >> 
> >> Florin
> >>   
> >>> On Oct 29, 2018, at 12:40 PM, Stephen Hemminger 
> >>>  wrote:
> >>> 
> >>> Is it possible to do Read Copy Update with VPP? Either using Userspace 
> >>> RCU (https://librcu.org)
> >>> or manually. RCU is very efficient way to handle read mostly tables and 
> >>> other dynamic cases
> >>> such as plugins.
> >>> 
> >>> The several things that are needed are non-preempt, atomic update of a 
> >>> pointer and a mechanism to be sure
> >>> all active threads have gone through a quiescent period. I don't think 
> >>> VPP will preempt one node
> >>> for another so that is done. The atomic update is relatively
> >>> easy with basic barriers, either from FD.IO, DPDK, or native compiler 
> >>> operations. But
> >>> is there an API to have a quiescent period marker in the main VPP vector 
> >>> scheduler?
> >>> 
> >>> Something like the QSBR model of Userspace RCU library.
> >>> (each thread calls rcu_queiscent_state() periodically)
> >>> would be ideal.
> >>> 
> >>> -=-=-=-=-=-=-=-=-=-=-=-
> >>> Links: You receive all messages sent to this group.
> >>> 
> >>> View/Reply Online (#11023): https://lists.fd.io/g/vpp-dev/message/11023
> >>> Mute This Topic: https://lists.fd.io/mt/27785182/675152
> >>> Group Owner: vpp-dev+ow...@lists.fd.io
> >>> Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [fcoras.li...@gmail.com]
> >>> -=-=-=-=-=-=-=-=-=-=-=-
> >>   
> > 
> > No reader-writer locks are 100's of times slower.  In fact reader write 
> > locks
> > are slower than normal spin lock.
> >   
> 
> I guess you meant that in general, and I can see how for scenarios with 
> multiple writers and readers performance can be bad. But from your original 
> message I assumed you’re mostly interested in concurrent read performance 
> with few writes. For such scenarios I would expect our current, simple, spin 
> and rw lock implementations to not be that bad. If that’s provably not the 
> case, we should definitely consider doing RCU. 
> 
> Also worth noting that a common pattern in vpp is to have per thread data 
> structures and then entirely avoid locking. For lookups we typically use the 
> bihash and that is thread safe.  
> 
> Florin
> 
>

https://www.researchgate.net/publication/247337469_RCU_vs_Locking_Performance_on_Different_CPUs

https://lwn.net/Articles/263130/
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#11038): https://lists.fd.io/g/vpp-dev/message/11038
Mute This Topic: https://lists.fd.io/mt/27785182/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [vpp-dev] Snooping non-IP packets

2018-10-30 Thread Dave Barach via Lists.Fd.Io
When you register a feature node on the "device-input" arc, that node will 
receive EVERY packet on all interfaces which have the feature enabled... 

-Original Message-
From: vpp-dev@lists.fd.io  On Behalf Of Prashant Upadhyaya
Sent: Monday, October 29, 2018 10:11 PM
To: Damjan Marion 
Cc: vpp-dev@lists.fd.io
Subject: Re: [vpp-dev] Snooping non-IP packets

Thanks Damjan !
Just to be sure, when I use the device-input feature arc thus --

VNET_FEATURE_INIT (myfeature, static) =
{
  .arc_name = "device-input",
  .node_name = "mynode",
  .runs_before = VNET_FEATURES ("ethernet-input"),
};

I get to see only the non-IP packets inside mynode, is that correct ?
I do get your point about sub-interfacing and that is fine.

Do the IPv4 and IPv6 packets go directly from dpdk-input to ip4-input and 
ip6-input, just to be sure ?

I also see a wiki link
https://wiki.fd.io/view/VPP/Feature_Arcs

It is mentioned there how to setup the next0 in mynode. I suppose doing a call 
to vnet_feature_next is a shortcut. Perhaps the wiki can mention that I think.

Regards
-Prashant



Regards
-Prashant



On Mon, Oct 29, 2018 at 11:31 PM Damjan Marion  wrote:
>
>
> Yes, you can just use device-input feature arc instead.
>
> Please note that packets on that arc are not (optionally) assigned to 
> sub-interfaces yet.
> So if you have vlan subinterface, packets will show up as main 
> interface packets and with original l2 header.
>
> --
> Damjan
>
> On 29 Oct 2018, at 18:22, Prashant Upadhyaya  wrote:
>
> Hi,
>
> I am using DPDK Plugin
> I want to write a node which will get to observe all the  non-IP packets.
> By observe, I mean that I want my node to see the non-IP packets, but 
> when I return from my node, the packets should traverse the original 
> graph of VPP which they would have followed had my node not been 
> there.
>
> I am wondering what's the best way to achieve the above.
> I have done VNET_FEATURE_INIT before using which eg. I got to observe 
> all the IPv4 packets by making my feature node sit on the ip4-unicast 
> arc and running before ip4-lookup.
>
> Can I do something similar for my requirement of observing all the 
> non-IP packets in a similar way or some other way, any advice would be 
> helpful.
>
> Regards
> -Prashant
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
>
> View/Reply Online (#11021): 
> https://lists.fd.io/g/vpp-dev/message/11021
> Mute This Topic: https://lists.fd.io/mt/27783711/675642
> Group Owner: vpp-dev+ow...@lists.fd.io
> Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [dmar...@me.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#11037): https://lists.fd.io/g/vpp-dev/message/11037
Mute This Topic: https://lists.fd.io/mt/27783711/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


[vpp-dev] How to modify cache sizes in VPP to measure cache hit rates

2018-10-30 Thread Arijit Pramanik
Hi,

Could anyone provide some help on how to limit the cache sizes to check the
hit rate for benchmarking VPP's performance? And how do we refresh the
memory statistics on vpp while testing with packet generators for each run?

Thanks in advance.
Arijit.
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#11036): https://lists.fd.io/g/vpp-dev/message/11036
Mute This Topic: https://lists.fd.io/mt/27792597/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [vpp-dev] Snooping non-IP packets

2018-10-30 Thread Prashant Upadhyaya
Thanks Damjan !
Just to be sure, when I use the device-input feature arc thus --

VNET_FEATURE_INIT (myfeature, static) =
{
  .arc_name = "device-input",
  .node_name = "mynode",
  .runs_before = VNET_FEATURES ("ethernet-input"),
};

I get to see only the non-IP packets inside mynode, is that correct ?
I do get your point about sub-interfacing and that is fine.

Do the IPv4 and IPv6 packets go directly from dpdk-input to ip4-input
and ip6-input, just to be sure ?

I also see a wiki link
https://wiki.fd.io/view/VPP/Feature_Arcs

It is mentioned there how to setup the next0 in mynode. I suppose
doing a call to vnet_feature_next is a shortcut. Perhaps the wiki can
mention that I think.

Regards
-Prashant



Regards
-Prashant



On Mon, Oct 29, 2018 at 11:31 PM Damjan Marion  wrote:
>
>
> Yes, you can just use device-input feature arc instead.
>
> Please note that packets on that arc are not (optionally) assigned to 
> sub-interfaces yet.
> So if you have vlan subinterface, packets will show up as main interface 
> packets and with
> original l2 header.
>
> --
> Damjan
>
> On 29 Oct 2018, at 18:22, Prashant Upadhyaya  wrote:
>
> Hi,
>
> I am using DPDK Plugin
> I want to write a node which will get to observe all the  non-IP packets.
> By observe, I mean that I want my node to see the non-IP packets, but
> when I return from my node, the packets should traverse the original
> graph of VPP which they would have followed had my node not been
> there.
>
> I am wondering what's the best way to achieve the above.
> I have done VNET_FEATURE_INIT before using which eg. I got to observe
> all the IPv4 packets by making my feature node sit on the ip4-unicast
> arc and running before ip4-lookup.
>
> Can I do something similar for my requirement of observing all the
> non-IP packets in a similar way or some other way, any advice would be
> helpful.
>
> Regards
> -Prashant
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
>
> View/Reply Online (#11021): https://lists.fd.io/g/vpp-dev/message/11021
> Mute This Topic: https://lists.fd.io/mt/27783711/675642
> Group Owner: vpp-dev+ow...@lists.fd.io
> Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [dmar...@me.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#11035): https://lists.fd.io/g/vpp-dev/message/11035
Mute This Topic: https://lists.fd.io/mt/27783711/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [vpp-dev] AF_PACKET performance question

2018-10-30 Thread Damjan Marion via Lists.Fd.Io

nothing obvious on my mind...

-- 
Damjan

> On 30 Oct 2018, at 13:25, Xuekun  wrote:
> 
> Yes, I know. I’m also doing the performance comparison between tapv2 vs. 
> af_packet.
> I just found below strange problem, and would like to know why? 
>  
> Thanks. 
>  
>  <>From: Damjan Marion  
> Sent: Tuesday, October 30, 2018 8:18 PM
> To: Hu, Xuekun 
> Cc: vpp-dev@lists.fd.io
> Subject: Re: [vpp-dev] AF_PACKET performance question
>  
>  
> If you are interested in performance, i suggest using tap interface instead 
> of af_packet.
> With tap (by using vhost-net backend) there is no memcpy involved, kernel 
> puts buffer data straight into VPP buffers...
>  
> -- 
> Damjan
> 
> 
> On 30 Oct 2018, at 13:07, Xuekun  > wrote:
>  
> Hi, All
> 
> Recently I found a big performance difference (~5Gbps vs. ~300Mbps by iperf3) 
> between two settings, which AF_PACKET related. 
> 
> The testing topology: 
> Two servers are directly connected through 10G link; One is running VPP on 
> the 10G NIC and AF_PACKET interface. And the iperf client (TCP) is sending 
> packets to the AF_PACKET interface. The other is running iperf server. 
> 
> The startup.conf settings: 
> ...
> cpu {
>  main-core 18
>  corelist-workers 19,20,21,22
> }
> dev :af:00.1 {
>  workers 0
> #   workers 1
> }
>  
> 
> The only difference of two testing is the "workers" setting, one (test1) is 
> setting workers to 0, the other (test2) is setting workers to 1. And I found 
> the iperf3 perf is ~5Gbps for test1, while only ~300Mbps for test2. 
> 
> So I run "show run" to see what's happening and what's the difference. 
> 
> Below is the output of "show run" that I only paste the working core. 
> 
> Test1 (workers to 0) 
> Thread 1 vpp_wk_0 (lcore 19)
> Time 1.2, average vectors/node 32.01, last 128 main loops .05 per node 1.00
>  vector rates in 4.7033e5, out 4.7033e5, drop 0.e0, punt 0.e0
> Name State   
> Calls  VectorsSuspends Clocks   Vectors/Call
> TenGigabitEthernetaf/0/1-outpu  active   8134  528460 
>   0  1.32e1   64.97
> TenGigabitEthernetaf/0/1-tx active   8134  
> 528460   0  1.32e2   64.97
> af-packet-input interrupt wa   184542 
>  528460   0  8.31e22.86
> dpdk-inputpolling
> 038663   40390   0  5.87e3 .02
> ethernet-input   active   
> 8134  528460   0  2.91e1   64.97
> host-vpp0-output  active  11729   
> 40390   0  8.22e13.44
> host-vpp0-tx   active  
> 11729   40390   0  4.37e43.44
> ip4-input active  
>  8134  528460   0  3.89e1   64.97
> ip4-input-no-checksumactive  11729
>40390   0  2.03e23.44
> ip4-lookup  active  
> 19863  568850   0  3.68e1   28.64
> ip4-rewrite active  
> 19863  568850   0  3.62e1   28.64
> 
> Test2 (workers to 1) 
> Thread 1 vpp_wk_0 (lcore 19)
> Time 1.3, average vectors/node 256.00, last 128 main loops 0.00 per node 0.00
>  vector rates in 2.4971e4, out 2.4971e4, drop 0.e0, punt 0.e0
> Name State Calls  
> VectorsSuspends Clocks   Vectors/Call
> TenGigabitEthernetaf/0/1-outpu   active130   33280
>0  9.40e0  256.00
> TenGigabitEthernetaf/0/1-tx  active130   
> 33280   0  1.17e2  256.00
> af-packet-inputinterrupt wa8146   
> 33280   0  6.34e24.09
> ethernet-input   active130
>33280   0  2.84e1  256.00
> ip4-input active
> 130   33280   0  3.56e1  256.00
> ip4-lookup  active130 
>   33280   0  3.13e1  256.00
> ip4-rewrite active130 
>   33280

Re: [vpp-dev] AF_PACKET performance question

2018-10-30 Thread Xuekun
Yes, I know. I’m also doing the performance comparison between tapv2 vs. 
af_packet.
I just found below strange problem, and would like to know why? 

Thanks.

From: Damjan Marion 
Sent: Tuesday, October 30, 2018 8:18 PM
To: Hu, Xuekun 
Cc: vpp-dev@lists.fd.io
Subject: Re: [vpp-dev] AF_PACKET performance question


If you are interested in performance, i suggest using tap interface instead of 
af_packet.
With tap (by using vhost-net backend) there is no memcpy involved, kernel puts 
buffer data straight into VPP buffers...

--
Damjan


On 30 Oct 2018, at 13:07, Xuekun 
mailto:xuekun...@intel.com>> wrote:

Hi, All

Recently I found a big performance difference (~5Gbps vs. ~300Mbps by iperf3) 
between two settings, which AF_PACKET related.

The testing topology:
Two servers are directly connected through 10G link; One is running VPP on the 
10G NIC and AF_PACKET interface. And the iperf client (TCP) is sending packets 
to the AF_PACKET interface. The other is running iperf server.

The startup.conf settings:
...
cpu {
 main-core 18
 corelist-workers 19,20,21,22
}
dev :af:00.1 {
 workers 0
#   workers 1
}


The only difference of two testing is the "workers" setting, one (test1) is 
setting workers to 0, the other (test2) is setting workers to 1. And I found 
the iperf3 perf is ~5Gbps for test1, while only ~300Mbps for test2.

So I run "show run" to see what's happening and what's the difference.

Below is the output of "show run" that I only paste the working core.

Test1 (workers to 0)
Thread 1 vpp_wk_0 (lcore 19)
Time 1.2, average vectors/node 32.01, last 128 main loops .05 per node 1.00
 vector rates in 4.7033e5, out 4.7033e5, drop 0.e0, punt 0.e0
Name State   
Calls  VectorsSuspends Clocks   Vectors/Call
TenGigabitEthernetaf/0/1-outpu  active   8134  528460   
0  1.32e1   64.97
TenGigabitEthernetaf/0/1-tx active   8134  
528460   0  1.32e2   64.97
af-packet-input interrupt wa   184542  
528460   0  8.31e22.86
dpdk-inputpolling038663 
  40390   0  5.87e3 .02
ethernet-input   active   8134  
528460   0  2.91e1   64.97
host-vpp0-output  active  11729 
  40390   0  8.22e13.44
host-vpp0-tx   active  
11729   40390   0  4.37e43.44
ip4-input active   
8134  528460   0  3.89e1   64.97
ip4-input-no-checksumactive  11729  
 40390   0  2.03e23.44
ip4-lookup  active  
19863  568850   0  3.68e1   28.64
ip4-rewrite active  
19863  568850   0  3.62e1   28.64

Test2 (workers to 1)
Thread 1 vpp_wk_0 (lcore 19)
Time 1.3, average vectors/node 256.00, last 128 main loops 0.00 per node 0.00
 vector rates in 2.4971e4, out 2.4971e4, drop 0.e0, punt 0.e0
Name State Calls
  VectorsSuspends Clocks   Vectors/Call
TenGigabitEthernetaf/0/1-outpu   active130   33280  
 0  9.40e0  256.00
TenGigabitEthernetaf/0/1-tx  active130   33280  
 0  1.17e2  256.00
af-packet-inputinterrupt wa8146   
33280   0  6.34e24.09
ethernet-input   active130  
 33280   0  2.84e1  256.00
ip4-input active130 
  33280   0  3.56e1  256.00
ip4-lookup  active130   
33280   0  3.13e1  256.00
ip4-rewrite active130   
33280   0  2.97e1  256.00
unix-epoll-input   polling  9317
   0   0  4.62e50.00
---
Thread 2 vpp_wk_1 (lcore 20)
Time 1.3, average vectors/node 1.44, last 128 main loops 0.00 per node 0.00
 vector rates in 5.3198e2, out 5.3198e2, 

Re: [vpp-dev] NAT44 && vxlan tunnel conflict

2018-10-30 Thread Dave Barach via Lists.Fd.Io
Please send the exact config you used, and the relevant packet tracer output.

From: wangchuan...@163.com 
Sent: Tuesday, October 30, 2018 1:13 AM
To: Dave Barach (dbarach) ; vpp-dev 
Subject: Re: RE: [vpp-dev] NAT44 && vxlan tunnel conflict

The attempt failed!  Adding static mapping to bvi or tap-in-OS both does not 
work.
Is there any cmd that can remove the NAT logic of udp-4789 from NAT44?

Help
please!


wangchuan...@163.com

From: Dave Barach (dbarach)
Date: 2018-10-29 22:25
To: wangchuan...@163.com; 
vpp-dev@lists.fd.io
Subject: RE: [vpp-dev] NAT44 && vxlan tunnel conflict
The NAT plugin is tossing vxlan out-to-in packets. You’ll get different results 
if you add a static mapping for (UDP, 4789) packets – maybe not the desired 
result, but at least a different result...

D.

From: vpp-dev@lists.fd.io 
mailto:vpp-dev@lists.fd.io>> On Behalf Of 
wangchuan...@163.com
Sent: Monday, October 29, 2018 4:13 AM
To: vpp-dev mailto:vpp-dev@lists.fd.io>>
Subject: [vpp-dev] NAT44 && vxlan tunnel conflict

Hi all,
I want to login PC1 through SSH2 where vpp is running, and the VPP is used 
as the VXLAN translate center(only 1 ip).
However, I found some error!
Data from vxlan tunnel 1 were dropped, which should be decaped at one 
vxlan-tunnel-1 and transmited out from vxlan-tunnel-2.

How can I achieve my goal?
Help please!



#REMARK##



SSH:172.16.4.3  (SSH2)  172.16.4.2 (NAT44)---  192.168.120.2
VXLAN:172.16.4.177   (vxlan)  172.16.4.2  (NAT44)   --  
  drop

  ( desired: vxlan-decap -> br -> vxlan-encap -> 
TenGigabitEthernet6/0/0-tx )

trace:
00:31:35:400543: dpdk-input
  TenGigabitEthernet6/0/0 rx queue 0
  buffer 0x12c31: current data 14, length 164, free-list 0, clone-count 0, 
totlen-nifb 0, trace 0x0
  ext-hdr-valid
  l4-cksum-computed l4-cksum-correct l2-hdr-offset 0 
l3-hdr-offset 14
  PKT MBUF: port 0, nb_segs 1, pkt_len 178
buf_len 2176, data_len 178, ol_flags 0x180, data_off 128, phys_addr 
0x708b0cc0
packet_type 0x211 l2_len 0 l3_len 0 outer_l2_len 0 outer_l3_len 0
Packet Offload Flags
  PKT_RX_IP_CKSUM_GOOD (0x0080) IP cksum of RX pkt. is valid
  PKT_RX_L4_CKSUM_GOOD (0x0100) L4 cksum of RX pkt. is valid
Packet Types
  RTE_PTYPE_L2_ETHER (0x0001) Ethernet packet
  RTE_PTYPE_L3_IPV4 (0x0010) IPv4 packet without extension headers
  RTE_PTYPE_L4_UDP (0x0200) UDP packet
  IP4: 00:25:7c:30:05:ec -> 00:a0:c9:00:00:00
  UDP: 172.16.4.177 -> 172.16.4.2
tos 0x00, ttl 64, length 164, checksum 0x4902
fragment id 0x1743, flags DONT_FRAGMENT
  UDP: 4789 -> 4789
length 144, checksum 0x5ceb
00:31:35:400565: ip4-input-no-checksum
  UDP: 172.16.4.177 -> 172.16.4.2
tos 0x00, ttl 64, length 164, checksum 0x4902
fragment id 0x1743, flags DONT_FRAGMENT
  UDP: 4789 -> 4789
length 144, checksum 0x5ceb


00:31:35:400581: nat44-out2in
  NAT44_OUT2IN: sw_if_index 1, next index 0, session index -1
00:31:35:400596: error-drop
  nat44-out2in: No translation





configure cmd line*
set int state TenGigabitEthernet6/0/0 up
set int ip addr TenGigabitEthernet6/0/0 172.16.4.2/24

create bridge-domain  learn 1 forward 1 uu-flood 1 flood 1 arp-term 1
loopback create
set int l2 bridge loop0  bvi
set int ip address loop0 192.168.120.1/24
set int state loop0 up
tap connect tapOS address 192.168.120.2/24
set int l2 bridge tapcli-0 
set int state tapcli-0 up

create vxlan tunnel src 172.16.4.2 dst 172.16.4.177 vni 100
set interface l2 bridge vxlan_tunnel0 
create vxlan tunnel src 172.16.4.2 dst 172.16.4.188 vni 100
set interface l2 bridge vxlan_tunnel0 

nat44 add interface address TenGigabitEthernet6/0/0
set interface nat44 in loop0 out TenGigabitEthernet6/0/0
nat44 add static mapping local 192.168.120.2 22 external 
TenGigabitEthernet6/0/0 22 tcp


wangchuan...@163.com
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#11032): https://lists.fd.io/g/vpp-dev/message/11032
Mute This Topic: https://lists.fd.io/mt/27779539/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [vpp-dev] AF_PACKET performance question

2018-10-30 Thread Damjan Marion via Lists.Fd.Io

If you are interested in performance, i suggest using tap interface instead of 
af_packet.
With tap (by using vhost-net backend) there is no memcpy involved, kernel puts 
buffer data straight into VPP buffers...

-- 
Damjan

> On 30 Oct 2018, at 13:07, Xuekun  wrote:
> 
> Hi, All
> 
> Recently I found a big performance difference (~5Gbps vs. ~300Mbps by iperf3) 
> between two settings, which AF_PACKET related. 
> 
> The testing topology: 
> Two servers are directly connected through 10G link; One is running VPP on 
> the 10G NIC and AF_PACKET interface. And the iperf client (TCP) is sending 
> packets to the AF_PACKET interface. The other is running iperf server. 
> 
> The startup.conf settings: 
> ...
> cpu {
>  main-core 18
>  corelist-workers 19,20,21,22 
> }
> dev :af:00.1 {
>  workers 0
> #   workers 1
> }
>  
> 
> The only difference of two testing is the "workers" setting, one (test1) is 
> setting workers to 0, the other (test2) is setting workers to 1. And I found 
> the iperf3 perf is ~5Gbps for test1, while only ~300Mbps for test2. 
> 
> So I run "show run" to see what's happening and what's the difference. 
> 
> Below is the output of "show run" that I only paste the working core. 
> 
> Test1 (workers to 0) 
> Thread 1 vpp_wk_0 (lcore 19)
> Time 1.2, average vectors/node 32.01, last 128 main loops .05 per node 1.00
>  vector rates in 4.7033e5, out 4.7033e5, drop 0.e0, punt 0.e0
> Name State   
> Calls  VectorsSuspends Clocks   Vectors/Call
> TenGigabitEthernetaf/0/1-outpu  active   8134  528460 
>   0  1.32e1   64.97
> TenGigabitEthernetaf/0/1-tx active   8134  
> 528460   0  1.32e2   64.97
> af-packet-input interrupt wa   184542 
>  528460   0  8.31e22.86
> dpdk-inputpolling
> 038663   40390   0  5.87e3 .02
> ethernet-input   active   
> 8134  528460   0  2.91e1   64.97
> host-vpp0-output  active  11729   
> 40390   0  8.22e13.44
> host-vpp0-tx   active  
> 11729   40390   0  4.37e43.44
> ip4-input active  
>  8134  528460   0  3.89e1   64.97
> ip4-input-no-checksumactive  11729
>40390   0  2.03e23.44
> ip4-lookup  active  
> 19863  568850   0  3.68e1   28.64
> ip4-rewrite active  
> 19863  568850   0  3.62e1   28.64
> 
> Test2 (workers to 1) 
> Thread 1 vpp_wk_0 (lcore 19)
> Time 1.3, average vectors/node 256.00, last 128 main loops 0.00 per node 0.00
>  vector rates in 2.4971e4, out 2.4971e4, drop 0.e0, punt 0.e0
> Name State Calls  
> VectorsSuspends Clocks   Vectors/Call
> TenGigabitEthernetaf/0/1-outpu   active130   33280
>0  9.40e0  256.00
> TenGigabitEthernetaf/0/1-tx  active130   
> 33280   0  1.17e2  256.00
> af-packet-inputinterrupt wa8146   
> 33280   0  6.34e24.09
> ethernet-input   active130
>33280   0  2.84e1  256.00
> ip4-input active
> 130   33280   0  3.56e1  256.00
> ip4-lookup  active130 
>   33280   0  3.13e1  256.00
> ip4-rewrite active130 
>   33280   0  2.97e1  256.00
> unix-epoll-input   polling  9317  
>  0   0  4.62e50.00
> ---
> Thread 2 vpp_wk_1 (lcore 20)
> Time 1.3, average vectors/node 1.44, last 128 main loops 0.00 per node 0.00
>  vector rates in 5.3198e2, out 5.3198e2, drop 0.e0, punt 0.e0
> Name   State Calls
>   VectorsSuspends Clocks   

[vpp-dev] AF_PACKET performance question

2018-10-30 Thread Xuekun
Hi, All

Recently I found a big performance difference (~5Gbps vs. ~300Mbps by iperf3) 
between two settings, which AF_PACKET related. 

The testing topology: 
Two servers are directly connected through 10G link; One is running VPP on the 
10G NIC and AF_PACKET interface. And the iperf client (TCP) is sending packets 
to the AF_PACKET interface. The other is running iperf server. 

The startup.conf settings: 
...
cpu {
  main-core 18
  corelist-workers 19,20,21,22  
}
dev :af:00.1 {
  workers 0
#   workers 1
 }
 
 
The only difference of two testing is the "workers" setting, one (test1) is 
setting workers to 0, the other (test2) is setting workers to 1. And I found 
the iperf3 perf is ~5Gbps for test1, while only ~300Mbps for test2. 

So I run "show run" to see what's happening and what's the difference. 

Below is the output of "show run" that I only paste the working core. 

Test1 (workers to 0) 
Thread 1 vpp_wk_0 (lcore 19)
Time 1.2, average vectors/node 32.01, last 128 main loops .05 per node 1.00
  vector rates in 4.7033e5, out 4.7033e5, drop 0.e0, punt 0.e0
 Name State   
Calls  VectorsSuspends Clocks   Vectors/Call
TenGigabitEthernetaf/0/1-outpu  active   8134  528460   
0  1.32e1   64.97
TenGigabitEthernetaf/0/1-tx active   8134  
528460   0  1.32e2   64.97
af-packet-input interrupt wa   184542  
528460   0  8.31e22.86
dpdk-inputpolling038663 
  40390   0  5.87e3 .02
ethernet-input   active   8134  
528460   0  2.91e1   64.97
host-vpp0-output  active  11729 
  40390   0  8.22e13.44
host-vpp0-tx   active  
11729   40390   0  4.37e43.44
ip4-input active   
8134  528460   0  3.89e1   64.97
ip4-input-no-checksumactive  11729  
 40390   0  2.03e23.44
ip4-lookup  active  
19863  568850   0  3.68e1   28.64
ip4-rewrite active  
19863  568850   0  3.62e1   28.64

Test2 (workers to 1) 
Thread 1 vpp_wk_0 (lcore 19)
Time 1.3, average vectors/node 256.00, last 128 main loops 0.00 per node 0.00
  vector rates in 2.4971e4, out 2.4971e4, drop 0.e0, punt 0.e0
 Name State Calls   
   VectorsSuspends Clocks   Vectors/Call
TenGigabitEthernetaf/0/1-outpu   active130   33280  
 0  9.40e0  256.00
TenGigabitEthernetaf/0/1-tx  active130   33280  
 0  1.17e2  256.00
af-packet-inputinterrupt wa8146   
33280   0  6.34e24.09
ethernet-input   active130  
 33280   0  2.84e1  256.00
ip4-input active130 
  33280   0  3.56e1  256.00
ip4-lookup  active130   
33280   0  3.13e1  256.00
ip4-rewrite active130   
33280   0  2.97e1  256.00
unix-epoll-input   polling  9317
   0   0  4.62e50.00
---
Thread 2 vpp_wk_1 (lcore 20)
Time 1.3, average vectors/node 1.44, last 128 main loops 0.00 per node 0.00
  vector rates in 5.3198e2, out 5.3198e2, drop 0.e0, punt 0.e0
 Name   State Calls 
 VectorsSuspends Clocks   Vectors/Call
dpdk-input polling  18232975
 709   0  2.29e60.00
host-vpp0-outputactive492   
  709   0  1.91e21.44
host-vpp0-tx active492  
   709   0  1.51e51.44