Compare commits

...

71 Commits

Author SHA1 Message Date
Dave Wallace
540b31ac8f Release 18.01.2: update jvpp version
Change-Id: I46229d50de4f8892551041be7fee2bba5581da63
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2018-05-17 14:47:21 -04:00
Ed Kern
7ea3975d1f Makefile: 1801 only change to revert its clang version
Base build image now uses clang 5 as default but this new version
throws errors that the older 3.8 did not.

Change-Id: I938ffc4464bf45dd52bc3ca4270db52e21865fc6
Signed-off-by: Ed Kern <ejk@cisco.com>
2018-05-17 17:34:03 +00:00
Dave Wallace
e6b21b1127 18.01.2 Release Notes
Change-Id: I7f5704d023009a5226ca2b08a0be975ae0cf4884
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2018-05-16 13:17:24 -04:00
Steven
ca33d08caf tapv2: Sporadic SIGABRT in ethernet_input [VPP-1183]
virtio_free_rx_buffers uses the wrong slot in the vring to get
the buffer index. It uses desc_next. It should be last_used_idx
which is the slot number for the first valid descriptor.

Change-Id: I6b62b794f06869fbffffce45430b8b2e37b1266c
Signed-off-by: Steven <sluong@cisco.com>
(cherry picked from commit 074f698be5c2e6afc9df776b56a366bc3f404d95)
2018-03-31 14:38:12 +00:00
Marco Varlese
213831192d glibc 2.27 fix
With glibc 2.27 the memfd_create has been added to the devel libraries.
That's causing the internally defined static function to clash with the
system wide one. This patch addresses that issue on systems with latest
glibc libraries.

Change-Id: I788bf49b23d5b5f1cb1c0374e243d8a429178a71
Signed-off-by: Marco Varlese <marco.varlese@suse.com>
(cherry picked from commit 3f6ede3ab3df9624ba3682d5bc82c4f2aa2e0506)
2018-03-28 08:20:29 +00:00
Matus Fabian
ae33579bef NAT44: fix nat44_user_session_dump and nat44_del_session crash with one worker (VPP-1213)
Change-Id: I8e0c7ed2ff462b9ab59c233f56be262ec03c29ff
Signed-off-by: Matus Fabian <matfabia@cisco.com>
2018-03-28 07:05:12 +00:00
Matus Fabian
dd2f9865c1 NAT44: interface output feature and dst NAT (VPP-1200)
Do not translate packet which go out via nat44-in2out-output and was tranlated
in nat44-out2in before. On way back forward packet to nat44-in2out node.

Change-Id: I934d69856f0178c86ff879bc691c9e074b8485c8
Signed-off-by: Matus Fabian <matfabia@cisco.com>
(cherry picked from commit 4d023c8c930b2a4220998d4c211d751e33324faa)
2018-03-26 22:27:54 -07:00
Matus Fabian
ef25e1d0da NAT44: interface output feature and service host direct access (VPP-1176)
forwarding mode:
session initiaded from service host - translate
session initiaded from remote host - do not translate

Change-Id: I0e3733361de4b85068b9be02f953154a478ce8cc
Signed-off-by: Matus Fabian <matfabia@cisco.com>
2018-03-26 04:53:47 -07:00
Lee Roberts
828244c44f Assign correct NUMA node for DPDK crypto QAT devices (VPP-1210)
DPDK rte_cryptodev_socket_id() is returning zero for QAT devices.
Apply DPDK patch where correct NUMA node can be obtained with pci_dev->device.numa_node.

Change-Id: Ifaf35c7ac292627ea7cfb44a35b1e1c617811e80
Signed-off-by: Lee Roberts <lee.roberts@hpe.com>
2018-03-26 11:23:58 +00:00
Lee Roberts
1b8e8252b0 Correct address calculation for VPP-1168
Use (u64) cast to ensure proper address calculations.

Change-Id: Ifbbe66072eb94bfe33ac04eaa4416abceeb7245e
Signed-off-by: Lee Roberts <lee.roberts@hpe.com>
2018-03-26 11:23:26 +00:00
Matthew Smith
487f5474fe User session counters stay <= per-user limit
When a user session is allocated/reused, only increase
one of the session counters for that user if the counters
are below the per-user limit.

THis addresses a SEGV that arises after the following
sequence of events:

- an outside interface IP address is put in a pool
- a user exceeds the number of per-user translations by
an amount greater than the number of per-user translations
(nsessions + nstaticsessions > 100 + 100)
- the outside interface IP address is deleted and then added
again (observed when using DHCP client, likely happens if
address changed via CLI, API also)
- the user sends more packets that should be translated

When nsessions is > the per-user limit,
nat_session_alloc_or_recycle() reclaims the oldest existing
user session. When an outside address is deleted, the
corresponding user sessions are deleted. If the counters were
far above the per-user limit, the deletions wouldn't result
in the counters dropping back below the limit. So no session
could be reclaimed -> SEGV.

Change-Id: I940bafba0fd5385a563e2ce87534688eb9469f12
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2018-03-26 11:22:57 +00:00
Marco Varlese
e545457796 IPSEC_AH: broken initialization (VPP-1208)
The init-path for IPSEC_AH where the CTX gets initialized is broken
since the for-loop never executes due to the wrong usage of
tm->n_vlib_mains which being subtracted by 1.

Change-Id: I4d967f52cd3ca061aa60d824d65f446e06162403
Signed-off-by: Marco Varlese <marco.varlese@suse.com>
(cherry picked from commit 4631610a20e6ae3181cb517db27a93b2a3e07eff)
2018-03-26 06:04:56 +00:00
Matus Fabian
ae389bc4a1 NAT44: fix ICMP checksum update crash (VPP-1205)
Change-Id: I3e4bbfe205c86cb0839dd5c542f083dbe6bea881
Signed-off-by: Matus Fabian <matfabia@cisco.com>
(cherry picked from commit 3f2dd30b0bf7cf3d82c720d5065178c1fa628c6b)
2018-03-23 12:36:45 +00:00
Matus Fabian
cddbcdb666 NAT44: fix nat_not_translate_output_feature in dual loop (VPP-1194)
Change-Id: Icb858414145db0e5fef495e155903b3b935e50ba
Signed-off-by: Matus Fabian <matfabia@cisco.com>
(cherry picked from commit 3c2a416c42a0481698735a0b1e355bfb7a702882)
2018-03-23 11:32:58 +00:00
Matus Fabian
265640ce76 NAT44: fix removal of LB static mappings with same local address and port pair (VPP-1199)
Change-Id: Iad8c626e83bbc58d5c85b6736f5a3dd5bc9ceafb
Signed-off-by: Matus Fabian <matfabia@cisco.com>
(cherry picked from commit e877d68407d316adb64baa855985b746dcb2e102)
2018-03-23 10:49:54 +00:00
Dave Barach
f8fda2a98a VPP-1123: cherrypick to 18.01.02
Change-Id: Iaf959d7636907cec54d83b3f14244153fbf19fa2
Signed-off-by: Dave Barach <dbarach@cisco.com>
2018-03-21 17:10:36 +00:00
Matus Fabian
add7cb0ca7 Revert "NAT44: interface output feature and service host direct access (VPP-1176)"
This reverts commit d30c94afe4e67298b3da6fd839e0210844cf45a5.

Change-Id: Ic076f6c116e1d816c492eb8e03e50cf95cedae77
Signed-off-by: Matus Fabian <matfabia@cisco.com>
2018-03-21 09:09:03 -07:00
Matthew Smith
fb5148b4df NAT44 - unknown protocols work with forwarding
If forwarding is enabled, inbound packets on an outside
interface should not be dropped and instead pass on to
the FIB lookup. This works for TCP and UDP but not other
IP protocols. Enable it for unknown protocols.

Change-Id: I1da84b5633a36b3e5e64079754db2fcc50f29819
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
(cherry picked from commit 03f942a1cc4de3963507fc7075d91aff0cae7d58)
2018-03-14 18:47:11 +00:00
Matus Fabian
d30c94afe4 NAT44: interface output feature and service host direct access (VPP-1176)
forwarding mode:
session initiaded from service host - translate
session initiaded from remote host - do not translate

Change-Id: I48170ee8e4ad14d3d3083ee31a40ef8d10d6ff32
Signed-off-by: Matus Fabian <matfabia@cisco.com>
(cherry picked from commit 204591d1bd754f6086edcf8b27a95beab929a78f)
2018-03-14 18:46:45 +00:00
Matus Fabian
341b469c4d NAT44: fix nat_not_translate_output_feature for ICMP (VPP-1191)
Change-Id: I1552e1418b704fdf1f1fa2c0174313b9b82a37a3
Signed-off-by: Matus Fabian <matfabia@cisco.com>
2018-03-14 18:45:50 +00:00
ahdj007
dadcc84913 when lb tcp in2out flow,
in2out and out2in protocol are not same

Change-Id: I4ce680ad1f088cb079e1f2aeb15ca59225fca0d1
Signed-off-by: ahdj007 <dong.juan1@zte.com.cn>
(cherry picked from commit 9691cf2d082727fb2f88e85050068dc6fd761bcd)
2018-03-14 18:44:55 +00:00
ahdj007
648ae391b6 when exceed max reass,
frag packet can't get reass.

adding bihash,it can rewrite new hash value.
so need to delete hash after compare hash value.

Change-Id: I83b5c47890110e9a598b78cfbe8fcd27bbe291bb
Signed-off-by: ahdj007 <dong.juan1@zte.com.cn>
(cherry picked from commit 5e85c54d229e443d30dabe9bca39625587add8a5)
2018-03-14 18:44:27 +00:00
Chaoyu Jin
651dc0c5eb At AF_PACKET socket create, do intf bind before rx ring cfg to avoid receiving pkts from other interfaces
Change-Id: Ie40ee9129edaac717e716b469f4d10f3c29a4932
Signed-off-by: Chaoyu Jin <chjin@cisco.com>
2018-03-14 10:42:44 -07:00
Matus Fabian
9449a8acba NAT44: allow to configure one interface only as output or input feature (VPP-1192)
following is not possible:
set interface nat44 out GigabitEthernet0/3/0 output-feature
set interface nat44 out GigabitEthernet0/3/0

Change-Id: I1592cc18390881fda66f98316700886b8f5295f0
Signed-off-by: Matus Fabian <matfabia@cisco.com>
(cherry picked from commit e4e34c23fe7050c26967997fdb8f555c51fd3961)
2018-03-14 16:41:24 +00:00
ahdj007
308ed5c9e3 reass frag_n should to be inited to 0
Change-Id: I8a4a7a85e86acbfe411e6dfa22e3976d7d4c903b
Signed-off-by: ahdj007 <dong.juan1@zte.com.cn>
(cherry picked from commit 9f06d0eccf06b82b42cc55f02c37cbed9e1aab83)
2018-03-09 13:14:17 +00:00
Chun Li
f70cd9bdc6 memif: fix crash caused by zero pkt len in memif and clear dirty cache while interface reconnect.
Change-Id: Ifc7eb2494a22c334d8899422545fca1a4bba4d05
Signed-off-by: Chun Li <chunl2@cisco.com>
2018-03-08 09:21:03 +00:00
Chaoyu Jin
156084b325 at af_packet input, drop partial packets to prevent l4 checksum deadloop at ouptut
Change-Id: I6f75b7328fd0aa71d00a701e36c8b4ad06bff3c4
Signed-off-by: Chaoyu Jin <chjin@cisco.com>
2018-03-08 07:53:52 +00:00
Chun Li
91fa7d3387 ip4_forward: set pkt error in case potential memory corrupt
Change-Id: Ib9eb65d2ba166f5883a8ce8d37298c696113f2be
Signed-off-by: Chun Li <chunl2@cisco.com>
2018-03-08 07:53:41 +00:00
Chun Li
4298ab41db libmemif: cleanup queue info while memif connecting
Change-Id: I4265fd0606f87f80f43f7f59ced1c3a73de82776
Signed-off-by: Chun Li <chunl2@cisco.com>
2018-03-07 22:13:15 +01:00
Steven
a3daf77e4c tapv2: abort in tap_create_if (VPP-1179)
The following command sequences cause the crash:

create tap id 0 rx-ring-size 1024 tx-ring-size 1024
create tap id 1 rx-ring-size 1024 tx-ring-size 1024
set interface state tap0 up
set interface state tap1 up
delete tap tap0
delete tap tap1
create tap id 0 rx-ring-size 1024 tx-ring-size 1024

0: /home/sluong/vpp2/vpp/build-data/../src/vnet/interface_funcs.h:46
 (vnet_get_hw_interface) assertion `! pool_is_free (vnm->interface_main.hw_interfaces, _e)' fails

The reason for the crash is because when the tap interface is deleted,
the code does not remove the entry from the device queue. But the interface
is deleted anyway from vnet_main.interface_main.hw_interfaces.
When an interface is created again, it may encounter
the deleted entry in the device queue and crash. Notice create and delete a
single entry does not cause a crash. Need to create and delete 2 interfaces
to create a "hole" in the device queue.

Change-Id: I42ce0b7943d73b3eab32a16751a0a3183de62d9f
Signed-off-by: Steven <sluong@cisco.com>
(cherry picked from commit 0b8567331c3edf8b6aee51c849b8391a2922d9ab)
2018-02-28 21:45:05 +00:00
Matus Fabian
ebbb56fad6 NAT: replace format_vnet_sw_interface_name with format_vnet_sw_if_index_name (VPP-1149)
Change-Id: I860468bdc21c6ee07f63c8854592c46ca631ebc2
Signed-off-by: Matus Fabian <matfabia@cisco.com>
2018-02-27 06:09:49 +00:00
Matus Fabian
4f4964fab4 NAT44: in2out output feature skip translation for already translated packets (VPP-1156)
Change-Id: I5395245c9e49f741a949ada1f725c34f9379c249
Signed-off-by: Matus Fabian <matfabia@cisco.com>
(cherry picked from commit f7ad5cbe819533523169e8a88876b94b9f38789c)
2018-02-27 06:09:20 +00:00
Matus Fabian
e57f4480fb NAT44: fix ICMP error translation for endpoint dependent sessions (VPP-1150)
Change-Id: Iae15d15b470bdde759d08201de9d6dc5afef0ee9
Signed-off-by: Matus Fabian <matfabia@cisco.com>
2018-02-27 06:08:35 +00:00
Matus Fabian
38c16f87d9 NAT44: run NAT nodes after ACL (VPP-1160)
NAT input features run after acl-plugin-in-ip4-fa
NAT output features run after acl-plugin-out-ip4-fa

Change-Id: I1e4487a0d6fdb99a90b8db640d9ad0e0eb7347a5
Signed-off-by: Matus Fabian <matfabia@cisco.com>
(cherry picked from commit 16f0546cadb1248f9dce99788ecc50cc2668c7e4)
2018-02-26 05:42:01 +00:00
Damjan Marion
eed6a2b22f virtio: add missing tx lock when running multithreaded
Change-Id: I373f429c53c6f66ad38322addcfaccddb7761392
Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-02-25 11:56:46 +00:00
Damjan Marion
c17f55d31f virtio: reset vnet header on tx
Change-Id: Ib04a8787038fb536470a04d99fdc165102edfb5a
Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-02-24 18:59:38 +01:00
Matthew Smith
fdb47ad887 Fix DHCP client crash with worker threads
Crash occurring With a worker thread configured and dhcp
client active on an interface. When a DHCP reply packet
is received, call to ethernet_get_main() from
dhcp_proxy_to_client_input() was causing a crash.
Replaced with a call to vnet_get_ethernet_main().

Once that was resolved, calling dhcp_client_acquire_address()
from a worker thread also caused a crash. Changed so the main
thread will do the address/route configuration.

Change-Id: Ib23984787102dea8cf6cfcde86188a751f15c1e1
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2018-02-22 04:36:00 -08:00
Dave Barach
b704f49bb6 VPP-1169: reenable dhcp client detect when lease expires
We disable the client detect feature when we bind a DHCP address. Turn
it back on again when the lease expires.  Otherwise, if the DHCP
server replies after an outage, we'll never see the reply.

Add dhcp packet tx counters, by packet type

Change-Id: Id54b05647d5d7bd8d3ab99e6584ee86d9e4ff7f9
Signed-off-by: Dave Barach <dave@barachs.net>
(cherry picked from commit 4941fcc23ab01f5ca918e56489d404b92d8bde90)
2018-02-15 11:59:07 +00:00
Jan Gelety
f13bac295d Use CSIT release branch rls1801 in vpp stable/1801 branch
Change-Id: I6b00e7cd172709c1de4c700dbec29875bdc67fdb
Signed-off-by: Jan Gelety <jgelety@cisco.com>
2018-02-08 01:15:56 +00:00
Igor Mikhailov (imichail)
67d7825149 Provide page-aligned length to ftruncate.
For some files such as hugepages files, ftruncate() fails with the error
"Invalid argument" if the 'length' parameter is not on a page boundary.

Change-Id: I42a9cde98707da15e3c5d1653046e2277fc7a424
Signed-off-by: Igor Mikhailov (imichail) <imichail@cisco.com>
(cherry picked from commit 7d25415a9384d4c3d786d0c1ae5c0fcff3112acd)
2018-02-08 01:04:18 +00:00
Dave Wallace
0eacf49ffa Release 18.01.1 jvpp version update.
Change-Id: I000d842e969b838ad5fbcd18186ac7e1b39b4c46
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2018-02-06 21:00:15 -05:00
Dave Wallace
1247ece8d2 18.01.1 Release Notes
Change-Id: I2a6826a388cdd4c6b38f53f0e9bcb8b199714d29
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2018-02-05 17:32:27 -05:00
Matus Fabian
1c986cb3b8 NAT64: Run nat64-expire-worker-walk only when NAT64 is configured (VPP-1162)
Change-Id: Ic5e8d74bf5ac84cce5661de44778c89541c67636
Signed-off-by: Matus Fabian <matfabia@cisco.com>
(cherry picked from commit e71eb5922a293eca36dbd323970741daaca3c5c7)
2018-02-05 16:22:29 +00:00
John Lo
5e150a06a8 Improve tunnel interface creation performance
Modify interface creation to allow creation of tunnel interfaces
without dedicated per tunnel output and tx nodes which are not
used for most tunnel types. Also changed interface-output node
function vnet_per_buffer_interface_output() so it does not rely
on hw_if_index as the next node index which is not flexible nor
efficient for large scale tunnel interfaces.

The improvenemts are done for VXLAN, VXLAN-GPE, GENEVE and GTPU
tunnels. GRE tunnel is still using per tunnel output nodes which
will be changed in a separate patch with other GRE enhencements.

Change-Id: I4123c01c0d2ead814417a867adb8c8a407e4df55
Signed-off-by: John Lo <loj@cisco.com>
(cherry picked from commit e5453d0fa29f39a7f78a7e22815566a7f4c9e5ef)
2018-02-02 17:34:00 +00:00
Florin Coras
cba3675fab lisp-cp: fix handling of ndp without source link addr VPP-1159
Change-Id: Idddb60bbc7fcc701d39212f6422a6b2f6dc75221
Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-01-30 23:53:02 -08:00
Steven
a7effa1b07 vlib: allocating buffers on thread-x and freeing them on thread-y causes
a crash on debug image (VPP-1151)

In debug image, there is extra code to validate the buffer when it is
freed. It uses the hash table to lookup the buffer index with spinlock
to prevent contention. However, there is one spinlock for each worker
thread. So allocating the buffer on thread-x and freeing the same buffer
on thread-y causes the validation to fail on thread-y. The fix is to
have only one spinlock, stored in vlib_global_main.

Change-Id: Ic383846cefe84a3e262255afcf82276742f0f62e
Signed-off-by: Steven <sluong@cisco.com>
2018-01-29 20:20:47 -08:00
Dave Wallace
92b15bcea4 Add link to 18.01 test framework documentation.
Change-Id: I030602391ea3b612ac9a6780399cc30b427cc3a5
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2018-01-25 14:27:54 -05:00
Dave Wallace
a1a382bb2b Update 18.01 Release Notes
Change-Id: Id2f13c59c6f4e7bc79f6e77d6dab752bf6dfb06a
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2018-01-24 09:37:59 -05:00
Dave Wallace
9d21268d0a 18.01 Release Notes
Change-Id: I2493a6135aecb4e2eead20a71dcb9ca16834cd63
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2018-01-24 06:22:24 +00:00
Dave Wallace
7722efe8cd Script to list patches that changed api files.
- Add Ole Troan's script from vpp-dev email:
  https://lists.fd.io/pipermail/vpp-dev/2017-October/007037.html

Change-Id: I0cbf5118169dc25f0edd659a5a9f5cde8619f780
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2018-01-24 06:08:57 +00:00
Dave Wallace
1eb970d160 docs: Clean up TOC
Change-Id: I5415c002a431d84372f56d4a77dc2aabd6ef55f7
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2018-01-23 17:47:02 -05:00
Jan Gelety
1539400f14 Update CSIT tests 180110 -> 180122
- update of CSIT operational branch to be used for VPP-patch test

Change-Id: I3c81303dc7959da3593240a6da1309843aff8369
Signed-off-by: Jan Gelety <jgelety@cisco.com>
2018-01-22 08:31:43 +01:00
John Lo
7f5bec647c Sub-Interface deletion not cleanup hash's properly (VPP-1136)
On deleting sub-interfaces, functions vnet_delete_sub_interface()
and vnet_delete_hw_interface() are not cleaning up sub-interface
related hash tables and memory properly.

Change-Id: I17c7c4b2078c062c77bfe48889beb677610035ca
Signed-off-by: John Lo <loj@cisco.com>
2018-01-18 18:52:46 -05:00
Radu Nicolau
ec941ecb86 VPP-1122 dpdk/ipsec: fix transport mode pkt len
Change-Id: I6eef2ca258ff5b4aa9b21b98543d814633e295af
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
2018-01-17 17:17:38 +00:00
Steven
d8a998e74b tapv2: deleting tap interface may leak buffers (VPP-1124)
Buffers may be allocated for indirect descriptors by tx thread and
they are freed when tx thread is invoked in the next invocation.
This is to allow the recipient (kernel) to have a chance to process
them. But if the tap interface is deleted, the tx thread may not yet
be called to clean up the indirect descriptors' buffers. In that case,
we need to remove them without waiting for the tx thread to be called.
Failure to do so may cause buffers leak when the tap interface is deleted.

For the RX ring, leakage also exists for vring->buffers when the interface
is removed.

Change-Id: I3df313a0e60334776b19daf51a9f5bf20dfdc489
Signed-off-by: Steven <sluong@cisco.com>
2018-01-11 19:51:07 +00:00
Jan Gelety
977b0a5bd7 Use csit rls1801 operational branch in vpp stable/1801
Change-Id: Ie5824b4efe7930816a4312d7d3f541a86db5a2f0
Signed-off-by: Jan Gelety <jgelety@cisco.com>
2018-01-11 08:55:19 +01:00
Billy McFall
bbdfeaebf2 VPP-1131: doxygen: Documentation for Debug CLI stops at src/plugin/l2e
Change-Id: I3ce014da7b514aa766a90cacddd76cd2247406a8
Signed-off-by: Billy McFall <bmcfall@redhat.com>
2018-01-10 17:00:51 -05:00
Neale Ranns
9a5e61d775 makefile set CXXFLAGS so they are propageted to sub-builds
Change-Id: I55d9953851062f7106c66701d46bcd9073cf1ee4
Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
(cherry picked from commit 5ee623e789261552eb9460be10f34793d40b6575)
2018-01-10 18:42:43 +00:00
Pablo Camarillo
fd66de0f31 VPP-1120 SRv6 bug with SID list containing only one SID and no srh
Packets with a SR policy of one SID list create a malformed packet.
Outer IPv6 header points to a routing extension header that does not
exist since the SID list contains only one SID.

Change-Id: I1effee0457453bab95706a8a24fdabfbd843d5b7
Signed-off-by: Pablo Camarillo <pcamaril@cisco.com>
2018-01-10 08:40:37 +01:00
Pablo Camarillo
d01f4e76bd VPP-1113 SR MPLS path.frp_label_stack
provide one label stack per fib_table_entry_path_add2 call. otherwise multiple mheap releases take place.

Change-Id: I475ca1b801fc85dddda0b540c69ad628a274df7f
Signed-off-by: Pablo Camarillo <pcamaril@cisco.com>
2018-01-09 21:37:11 +00:00
Hongjun Ni
c287cd550b VPP-1119: PPPoE's destination MAC was overwritten
Change-Id: I6ae99c00e76058654f2c5e71377e9fd1bd13b47b
Signed-off-by: Hongjun Ni <hongjun.ni@intel.com>
2018-01-09 17:13:00 +00:00
Neale Ranns
f453a10cd4 BIER: missing endian swap for imposition object in API return
Change-Id: Iddd754d00ace3d042336e5c2c40431566275051a
Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
(cherry picked from commit eea537a288721b867d65b736363ab3f71ba6116c)
2018-01-09 17:02:17 +00:00
Neale Ranns
2b97ac55ed test: consolidate the multiple versions of send_and_*
Change-Id: I7fa7d0ebf73dab8264a2e5ddbd412600d78ead05
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit 52fae862646e25bac6d1cd11b9fc7ac77299bc25)
2018-01-09 17:01:21 +00:00
Neale Ranns
12bf52bae2 BIER: crash in show command when no tables are present
Change-Id: Ie291468ea9d05c47cefe39c4ff7fea3e016bacf2
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit 0e8cb6c475b616a3296b08d25bcaa1eed3ab0084)
2018-01-09 17:00:39 +00:00
John Lo
eeafbef61d GRE tunnel key should use fib_index instead of fib_id (VPP-1118)
Follow up fix - vl_api_gre_add_del_tunnel_t_handler should pass
outer_fib_id from API message to vnet_gre_add_del_tunnel() and
not convert it to fib_index, since vnet_gre_add_del_tunnel()
already perform the lookup to get fib_index from fib_id.

Change-Id: I24967a97f82ce018ddef596e556bd3eb1706cb63
Signed-off-by: John Lo <loj@cisco.com>
2018-01-08 23:19:18 -05:00
Matus Fabian
43ad007a0c NAT: fixed get_worker_out2in bug (VPP-1116)
Change-Id: I5e080d69f28661cc0b1846885d5001526b54fbd9
Signed-off-by: Matus Fabian <matfabia@cisco.com>
2018-01-08 09:20:24 +00:00
zhaoqingling
37aa1ffae6 VPP-1110 BVI reply ARP that doesn't request BVI loacl IP.
Change-Id: I66ae618edaa12c2b4e4afe276da689673b02c9cd
Signed-off-by: zhaoqingling <zhao.qingling@zte.com.cn>
(cherry picked from commit b4c42cdc6bbbf464f3f0034b2b39d4e20fd23a25)
2018-01-07 19:39:49 +00:00
John Lo
848b47c70e Unify/cleanup usage of hash_set/unset_mem by tunnels (VPP-1117)
Move the functions hash_set_key_copy() and hash_unset_key_free()
which are dupilicated in various tunnel support code modules to
hash.h as hash_set_mem_alloc() and hash_unset_mem_free() to be
used by all.

Change-Id: I40723cabe29072ab7feb1804c221f28606d8e4fe
Signed-off-by: John Lo <loj@cisco.com>
(cherry picked from commit e6bfeab1c352ae73a19361c038e2a06a58c035db)
2018-01-06 17:34:04 +00:00
John Lo
72247c8032 GRE tunnel key should use fib_index instead of fib_id (VPP-1118)
The code path in src/vnet/gre/interface.c uses fib_id as a
component to generate hash key for GRE tunnel. This should be
fib_index as the GRE rx/decap data path will be using fib_index
to generate the hash key to lookup the GRE tunnel.

Change-Id: Ia7f0892d84f9dac79223a6e016775892b61eb5fb
Signed-off-by: John Lo <loj@cisco.com>
2018-01-06 00:22:54 -05:00
Neale Ranns
1f720c3b19 VOM: NAT coverity found bugs
Change-Id: Ic55ad2e0a1435f552ce84ed1a9b1981191bc178b
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit 842eb22e5d5a7e11114fe093eeccafb080e9aa8b)
2018-01-04 11:56:46 +00:00
Dave Wallace
8c2bacde4f Initial changes for stable/1801 branch
This patch adds an entry for the defaultbranch
in .gitreview

Change-Id: I280cc0fb36a913cc5b26d2815d8429e18b8edde1
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2018-01-03 15:23:14 -05:00
90 changed files with 2169 additions and 760 deletions

View File

@ -2,3 +2,4 @@
host=gerrit.fd.io
port=29418
project=vpp
defaultbranch=stable/1801

View File

@ -522,7 +522,7 @@ ifeq ($(OS_ID)-$(OS_VERSION_ID),ubuntu-16.04)
@sudo -E apt-get update
@sudo -E apt-get $(CONFIRM) $(FORCE) install clang
$(call banner,"Building for PLATFORM=vpp using clang")
@make -C build-root CC=clang PLATFORM=vpp TAG=vpp_clang wipe-all install-packages
@make -C build-root CC=clang-3.8 PLATFORM=vpp TAG=vpp_clang wipe-all install-packages
endif
$(call banner,"Building sample-plugin")
@make -C build-root PLATFORM=vpp TAG=vpp sample-plugin-install

File diff suppressed because it is too large Load Diff

View File

@ -48,10 +48,13 @@ endif
vpp_debug_TAG_CFLAGS = -g -O0 -DCLIB_DEBUG -DFORTIFY_SOURCE=2 \
-fstack-protector-all -fPIC -Werror
vpp_debug_TAG_CXXFLAGS = -g -O0 -DCLIB_DEBUG -DFORTIFY_SOURCE=2 \
-fstack-protector-all -fPIC -Werror
vpp_debug_TAG_LDFLAGS = -g -O0 -DCLIB_DEBUG -DFORTIFY_SOURCE=2 \
-fstack-protector-all -fPIC -Werror
vpp_TAG_CFLAGS = -g -O2 -DFORTIFY_SOURCE=2 -fstack-protector -fPIC -Werror
vpp_TAG_CXXFLAGS = -g -O2 -DFORTIFY_SOURCE=2 -fstack-protector -fPIC -Werror
vpp_TAG_LDFLAGS = -g -O2 -DFORTIFY_SOURCE=2 -fstack-protector -fPIC -Werror
vpp_clang_TAG_CFLAGS = -g -O2 -DFORTIFY_SOURCE=2 -fstack-protector -fPIC -Werror

View File

@ -245,6 +245,8 @@ tag_var_with_added_space_fn = $(if $($(TAG)_TAG_$(1)),$($(TAG)_TAG_$(1)) )
# TAG=debug for debugging
debug_TAG_CFLAGS = -g -O0 -DCLIB_DEBUG -DFORTIFY_SOURCE=2 -march=$(MARCH) \
-fstack-protector-all -fPIC
debug_TAG_CXXFLAGS = -g -O0 -DCLIB_DEBUG -DFORTIFY_SOURCE=2 -march=$(MARCH) \
-fstack-protector-all -fPIC
debug_TAG_LDFLAGS = -g -O0 -DCLIB_DEBUG -DFORTIFY_SOURCE=2 -march=$(MARCH) \
-fstack-protector-all -fPIC
@ -537,6 +539,8 @@ configure_ldflags_fn = \
CONFIGURE_ENV = \
$(if $(call configure_var_fn,CPPFLAGS), \
CPPFLAGS="$(CPPFLAGS) $(call configure_var_fn,CPPFLAGS)") \
$(if $(call configure_var_fn,CXXFLAGS), \
CXXFLAGS="$(CXXFLAGS) $(call configure_var_fn,CXXFLAGS)") \
$(if $(call configure_var_fn,CFLAGS), \
CFLAGS="$(CFLAGS) $(call configure_var_fn,CFLAGS)") \
$(if $(call configure_var_fn,CCASFLAGS), \

View File

@ -1,2 +1,2 @@
#!/bin/sh
echo oper-171218
echo rls1801

View File

@ -3,6 +3,7 @@ Test Framework Documentation {#test_framework_doc}
PyDoc generated documentation for the "make test" framework is available for the following releases
- [Test framework documentation for VPP 18.01](https://docs.fd.io/vpp/18.01/vpp_make_test/html)
- [Test framework documentation for VPP 17.10](https://docs.fd.io/vpp/17.10/vpp_make_test/html)
- [Test framework documentation for VPP 17.04](https://docs.fd.io/vpp/17.04/vpp_make_test/html)
- [Test framework documentation for VPP 17.01](https://docs.fd.io/vpp/17.01/vpp_make_test/html)

View File

@ -17,3 +17,5 @@ Several modules provide operational, dataplane-user focused documentation.
- @subpage srv6_doc
- @subpage srmpls_doc
- @subpage nat64_doc
- @subpage vcl_ldpreload_doc
- @subpage kp_plugin_doc

View File

@ -0,0 +1,29 @@
From 6ca86563a48da5ffcc50a0f1ce7ac1b1af94ad88 Mon Sep 17 00:00:00 2001
From: Lee Roberts <lee.roberts@hpe.com>
Date: Fri, 23 Mar 2018 09:54:33 -0600
Subject: [PATCH] assign QAT cryptodev to correct NUMA node
rte_cryptodev_pmd_init_params should use NUMA node of the QAT device
for its socket_id rather than the socket_id of the initializing process.
Signed-off-by: Lee Roberts <lee.roberts@hpe.com>
---
drivers/crypto/qat/rte_qat_cryptodev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/crypto/qat/rte_qat_cryptodev.c b/drivers/crypto/qat/rte_qat_cryptodev.c
index 4f8e4bf..6197820 100644
--- a/drivers/crypto/qat/rte_qat_cryptodev.c
+++ b/drivers/crypto/qat/rte_qat_cryptodev.c
@@ -159,7 +159,7 @@ static int crypto_qat_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
{
struct rte_cryptodev_pmd_init_params init_params = {
.name = "",
- .socket_id = rte_socket_id(),
+ .socket_id = pci_dev->device.numa_node,
.private_data_size = sizeof(struct qat_pmd_private),
.max_nb_sessions = RTE_QAT_PMD_MAX_NB_SESSIONS
};
--
1.9.1

View File

@ -15,7 +15,9 @@
*------------------------------------------------------------------
*/
/** @file */
/** @file
* @defgroup libmemif
*/
#ifndef _LIBMEMIF_H_
#define _LIBMEMIF_H_
@ -78,7 +80,7 @@ typedef enum
/**
* @defgroup MEMIF_FD_EVENT Types of events that need to be watched for specific fd.
*
* @ingroup libmemif
* @{
*/
@ -99,6 +101,7 @@ typedef enum
typedef void *memif_conn_handle_t;
/**
* @defgroup CALLBACKS Callback functions definitions
* @ingroup libmemif
*
* @{
*/
@ -135,6 +138,7 @@ typedef int (memif_interrupt_t) (memif_conn_handle_t conn, void *private_ctx,
/**
* @defgroup ARGS_N_BUFS Connection arguments and buffers
* @ingroup libmemif
*
* @{
*/
@ -193,6 +197,7 @@ typedef struct
/**
* @defgroup MEMIF_DETAILS Memif details structs
* @ingroup libmemif
*
* @{
*/
@ -256,6 +261,7 @@ typedef struct
/**
* @defgroup API_CALLS Api calls
* @ingroup libmemif
*
* @{
*/

View File

@ -1398,11 +1398,13 @@ memif_buffer_alloc (memif_conn_handle_t conn, uint16_t qid,
uint16_t mask = (1 << mq->log2_ring_size) - 1;
uint16_t head = ring->head;
uint16_t tail = ring->tail;
uint16_t ring_size;
uint16_t s0, s1, ns;
*count_out = 0;
int i, err = MEMIF_ERR_SUCCESS; /* 0 */
ns = (1 << mq->log2_ring_size) - head + tail;
ring_size = (1 << mq->log2_ring_size);
ns = ring_size - head + tail;
/* calculate number of chain buffers */
if (size > ring->desc[0].buffer_length)

View File

@ -519,6 +519,7 @@ memif_msg_receive_add_ring (memif_connection_t * c, memif_msg_t * msg, int fd)
mq =
(memif_queue_t *) realloc (c->rx_queues,
sizeof (memif_queue_t) * (ar->index + 1));
memset(mq, 0, sizeof (memif_queue_t) * (ar->index + 1));
if (mq == NULL)
return memif_syscall_error_handler (errno);
c->rx_queues = mq;
@ -538,6 +539,7 @@ memif_msg_receive_add_ring (memif_connection_t * c, memif_msg_t * msg, int fd)
mq =
(memif_queue_t *) realloc (c->tx_queues,
sizeof (memif_queue_t) * (ar->index + 1));
memset(mq, 0, sizeof (memif_queue_t) * (ar->index + 1));
if (mq == NULL)
return memif_syscall_error_handler (errno);
c->tx_queues = mq;

View File

@ -0,0 +1,15 @@
#!/usr/bin/env python
import os, fnmatch, subprocess
starttag = 'v18.01-rc0'
endtag = 'v18.01-rc2'
apifiles = []
for root, dirnames, filenames in os.walk('.'):
for filename in fnmatch.filter(filenames, '*.api'):
apifiles.append(os.path.join(root, filename))
for f in apifiles:
commits = subprocess.check_output(['git', 'log',
'--oneline', starttag + '..' + endtag,
f])
if commits:
print f
print commits

View File

@ -1,4 +1,4 @@
# vcl-ldpreload a LD_PRELOAD library that uses the VPP Communications Library (VCL).
# vcl-ldpreload: a LD_PRELOAD library that uses the VPP Communications Library (VCL). {#vcl_ldpreload_doc}
User can LD_PRELOAD any application that uses POSIX socket API.

View File

@ -1,4 +1,4 @@
AC_INIT([vpp], [18.01], [vpp-dev@fd.io])
AC_INIT([vpp], [18.01.2], [vpp-dev@fd.io])
LT_INIT
AC_CONFIG_AUX_DIR([.])
AM_INIT_AUTOMAKE([subdir-objects])
@ -227,6 +227,7 @@ PLUGIN_ENABLED(l2e)
###############################################################################
# Dependency checks
###############################################################################
AC_CHECK_FUNC([memfd_create], [AC_DEFINE([HAVE_MEMFD_CREATE], [1], [Define if memfd exists])])
AM_COND_IF([ENABLE_DPDK_SHARED],
[

View File

@ -158,6 +158,7 @@ dpdk_esp_encrypt_node_fn (vlib_main_t * vm,
u32 iv_size;
u16 orig_sz;
u8 trunc_size;
u16 rewrite_len;
struct rte_mbuf *mb0 = 0;
struct rte_crypto_op *op;
u16 res_idx;
@ -267,6 +268,7 @@ dpdk_esp_encrypt_node_fn (vlib_main_t * vm,
if (sa0->is_tunnel)
{
rewrite_len = 0;
if (!is_ipv6 && !sa0->is_tunnel_ip6) /* ip4inip4 */
{
/* in tunnel mode send it back to FIB */
@ -344,7 +346,7 @@ dpdk_esp_encrypt_node_fn (vlib_main_t * vm,
else /* transport mode */
{
priv->next = DPDK_CRYPTO_INPUT_NEXT_INTERFACE_OUTPUT;
u16 rewrite_len = vnet_buffer (b0)->ip.save_rewrite_length;
rewrite_len = vnet_buffer (b0)->ip.save_rewrite_length;
u16 adv = sizeof (esp_header_t) + iv_size;
vlib_buffer_advance (b0, -adv - rewrite_len);
u8 *src = ((u8 *) ih0) - rewrite_len;
@ -393,11 +395,13 @@ dpdk_esp_encrypt_node_fn (vlib_main_t * vm,
if (is_ipv6)
{
u16 len = b0->current_length - sizeof (ip6_header_t);
oh6_0->ip6.payload_length = clib_host_to_net_u16 (len);
oh6_0->ip6.payload_length =
clib_host_to_net_u16 (len - rewrite_len);
}
else
{
oh0->ip4.length = clib_host_to_net_u16 (b0->current_length);
oh0->ip4.length =
clib_host_to_net_u16 (b0->current_length - rewrite_len);
oh0->ip4.checksum = ip4_header_checksum (&oh0->ip4);
}

View File

@ -97,14 +97,6 @@ format_gtpu_name (u8 * s, va_list * args)
return format (s, "gtpu_tunnel%d", dev_instance);
}
static uword
dummy_interface_tx (vlib_main_t * vm,
vlib_node_runtime_t * node, vlib_frame_t * frame)
{
clib_warning ("you shouldn't be here, leaking buffers...");
return frame->n_vectors;
}
static clib_error_t *
gtpu_interface_admin_up_down (vnet_main_t * vnm, u32 hw_if_index, u32 flags)
{
@ -120,7 +112,6 @@ VNET_DEVICE_CLASS (gtpu_device_class,static) = {
.name = "GTPU",
.format_device_name = format_gtpu_name,
.format_tx_trace = format_gtpu_encap_trace,
.tx_function = dummy_interface_tx,
.admin_up_down_function = gtpu_interface_admin_up_down,
};
/* *INDENT-ON* */
@ -294,25 +285,6 @@ gtpu_decap_next_is_valid (gtpu_main_t * gtm, u32 is_ip6, u32 decap_next_index)
return decap_next_index < r->n_next_nodes;
}
static void
hash_set_key_copy (uword ** h, void *key, uword v)
{
size_t ksz = hash_header (*h)->user;
void *copy = clib_mem_alloc (ksz);
clib_memcpy (copy, key, ksz);
hash_set_mem (*h, copy, v);
}
static void
hash_unset_key_free (uword ** h, void *key)
{
hash_pair_t *hp = hash_get_pair_mem (*h, key);
ASSERT (hp);
key = uword_to_pointer (hp->key, void *);
hash_unset_mem (*h, key);
clib_mem_free (key);
}
static uword
vtep_addr_ref (ip46_address_t * ip)
{
@ -323,7 +295,7 @@ vtep_addr_ref (ip46_address_t * ip)
return ++(*vtep);
ip46_address_is_ip4 (ip) ?
hash_set (gtpu_main.vtep4, ip->ip4.as_u32, 1) :
hash_set_key_copy (&gtpu_main.vtep6, &ip->ip6, 1);
hash_set_mem_alloc (&gtpu_main.vtep6, &ip->ip6, 1);
return 1;
}
@ -338,7 +310,7 @@ vtep_addr_unref (ip46_address_t * ip)
return *vtep;
ip46_address_is_ip4 (ip) ?
hash_unset (gtpu_main.vtep4, ip->ip4.as_u32) :
hash_unset_key_free (&gtpu_main.vtep6, &ip->ip6);
hash_unset_mem_free (&gtpu_main.vtep6, &ip->ip6);
return 0;
}
@ -370,7 +342,7 @@ mcast_shared_add (ip46_address_t * dst, fib_node_index_t mfei, adj_index_t ai)
.mfib_entry_index = mfei,
};
hash_set_key_copy (&gtpu_main.mcast_shared, dst, new_ep.as_u64);
hash_set_mem_alloc (&gtpu_main.mcast_shared, dst, new_ep.as_u64);
}
static inline void
@ -381,7 +353,7 @@ mcast_shared_remove (ip46_address_t * dst)
adj_unlock (ep.mcast_adj_index);
mfib_table_entry_delete_index (ep.mfib_entry_index, MFIB_SOURCE_GTPU);
hash_unset_key_free (&gtpu_main.mcast_shared, dst);
hash_unset_mem_free (&gtpu_main.mcast_shared, dst);
}
static inline fib_protocol_t
@ -442,8 +414,8 @@ int vnet_gtpu_add_del_tunnel
/* copy the key */
if (is_ip6)
hash_set_key_copy (&gtm->gtpu6_tunnel_by_key, &key6,
t - gtm->tunnels);
hash_set_mem_alloc (&gtm->gtpu6_tunnel_by_key, &key6,
t - gtm->tunnels);
else
hash_set (gtm->gtpu4_tunnel_by_key, key4.as_u64, t - gtm->tunnels);
@ -481,6 +453,11 @@ int vnet_gtpu_add_del_tunnel
hi = vnet_get_hw_interface (vnm, hw_if_index);
}
/* Set gtpu tunnel output node */
u32 encap_index = !is_ip6 ?
gtpu4_encap_node.index : gtpu6_encap_node.index;
vnet_set_interface_output_node (vnm, hw_if_index, encap_index);
t->hw_if_index = hw_if_index;
t->sw_if_index = sw_if_index = hi->sw_if_index;
@ -500,8 +477,6 @@ int vnet_gtpu_add_del_tunnel
fib_node_init (&t->node, gtm->fib_node_type);
fib_prefix_t tun_dst_pfx;
u32 encap_index = !is_ip6 ?
gtpu4_encap_node.index : gtpu6_encap_node.index;
vnet_flood_class_t flood_class = VNET_FLOOD_CLASS_TUNNEL_NORMAL;
fib_prefix_from_ip46_addr (&t->dst, &tun_dst_pfx);
@ -592,9 +567,6 @@ int vnet_gtpu_add_del_tunnel
flood_class = VNET_FLOOD_CLASS_TUNNEL_MASTER;
}
/* Set gtpu tunnel output node */
hi->output_node_index = encap_index;
vnet_get_sw_interface (vnet_get_main (), sw_if_index)->flood_class =
flood_class;
}
@ -621,7 +593,7 @@ int vnet_gtpu_add_del_tunnel
if (!is_ip6)
hash_unset (gtm->gtpu4_tunnel_by_key, key4.as_u64);
else
hash_unset_key_free (&gtm->gtpu6_tunnel_by_key, &key6);
hash_unset_mem_free (&gtm->gtpu6_tunnel_by_key, &key6);
if (!ip46_address_is_multicast (&t->dst))
{

View File

@ -1462,14 +1462,10 @@ ixge_rx_queue_no_wrap (ixge_main_t * xm,
to_add -= 2;
#if 0
ASSERT (VLIB_BUFFER_KNOWN_ALLOCATED ==
vlib_buffer_is_known (vm, bi0));
ASSERT (VLIB_BUFFER_KNOWN_ALLOCATED ==
vlib_buffer_is_known (vm, bi1));
ASSERT (VLIB_BUFFER_KNOWN_ALLOCATED ==
vlib_buffer_is_known (vm, fi0));
ASSERT (VLIB_BUFFER_KNOWN_ALLOCATED ==
vlib_buffer_is_known (vm, fi1));
ASSERT (VLIB_BUFFER_KNOWN_ALLOCATED == vlib_buffer_is_known (bi0));
ASSERT (VLIB_BUFFER_KNOWN_ALLOCATED == vlib_buffer_is_known (bi1));
ASSERT (VLIB_BUFFER_KNOWN_ALLOCATED == vlib_buffer_is_known (fi0));
ASSERT (VLIB_BUFFER_KNOWN_ALLOCATED == vlib_buffer_is_known (fi1));
#endif
b0 = vlib_get_buffer (vm, bi0);
@ -1680,10 +1676,8 @@ ixge_rx_queue_no_wrap (ixge_main_t * xm,
to_add -= 1;
#if 0
ASSERT (VLIB_BUFFER_KNOWN_ALLOCATED ==
vlib_buffer_is_known (vm, bi0));
ASSERT (VLIB_BUFFER_KNOWN_ALLOCATED ==
vlib_buffer_is_known (vm, fi0));
ASSERT (VLIB_BUFFER_KNOWN_ALLOCATED == vlib_buffer_is_known (bi0));
ASSERT (VLIB_BUFFER_KNOWN_ALLOCATED == vlib_buffer_is_known (fi0));
#endif
b0 = vlib_get_buffer (vm, bi0);

View File

@ -1,4 +1,4 @@
# Kube-proxy plugin for VPP
# Kube-proxy plugin for VPP {#kp_plugin_doc}
## Overview

View File

@ -136,12 +136,12 @@ l2_emulation_cli (vlib_main_t * vm,
}
/*?
* Configure l2 emualtion.
* Configure l2 emulation.
* When the interface is in L2 mode, configure the extraction of L3
* packets out of the L2 path and into the L3 path.
*
* @cliexpar
* @cliexstart{set interface l2 input l2-emulation <interface-name> [disable]
* @cliexstart{set interface l2 input l2-emulation <interface-name> [disable]}
* @cliexend
?*/
/* *INDENT-OFF* */
@ -179,7 +179,7 @@ l2_emulation_show (vlib_main_t * vm,
* packets out of the L2 path and into the L3 path.
*
* @cliexpar
* @cliexstart{show interface l2 l2-emulation
* @cliexstart{show interface l2 l2-emulation}
* @cliexend
?*/
/* *INDENT-OFF* */

View File

@ -194,14 +194,13 @@ format_memif_if_mode (u8 * s, va_list * args)
static u8 *
format_memif_queue (u8 * s, va_list * args)
{
memif_if_t *mif = va_arg (*args, memif_if_t *);
memif_queue_t *mq = va_arg (*args, memif_queue_t *);
uword i = va_arg (*args, uword);
u32 indent = format_get_indent (s);
s = format (s, "%U%s ring %u:\n",
format_white_space, indent,
(mif->flags & MEMIF_IF_FLAG_IS_SLAVE) ?
(mq->type == MEMIF_RING_S2M) ?
"slave-to-master" : "master-to-slave", i);
s = format (s, "%Uregion %u offset %u ring-size %u int-fd %d\n",
format_white_space, indent + 4,
@ -327,14 +326,14 @@ memif_show_command_fn (vlib_main_t * vm, unformat_input_t * input,
vec_foreach_index (i, mif->tx_queues)
{
mq = vec_elt_at_index (mif->tx_queues, i);
vlib_cli_output (vm, " %U", format_memif_queue, mif, mq, i);
vlib_cli_output (vm, " %U", format_memif_queue, mq, i);
if (show_descr)
vlib_cli_output (vm, " %U", format_memif_descriptor, mif, mq);
}
vec_foreach_index (i, mif->rx_queues)
{
mq = vec_elt_at_index (mif->rx_queues, i);
vlib_cli_output (vm, " %U", format_memif_queue, mif, mq, i);
vlib_cli_output (vm, " %U", format_memif_queue, mq, i);
if (show_descr)
vlib_cli_output (vm, " %U", format_memif_descriptor, mif, mq);
}

View File

@ -338,6 +338,7 @@ memif_init_regions_and_queues (memif_if_t * mif)
mq->region = 0;
mq->offset = (void *) mq->ring - (void *) mif->regions[mq->region].shm;
mq->last_head = 0;
mq->type = MEMIF_RING_S2M;
}
ASSERT (mif->rx_queues == 0);
@ -354,6 +355,7 @@ memif_init_regions_and_queues (memif_if_t * mif)
mq->region = 0;
mq->offset = (void *) mq->ring - (void *) mif->regions[mq->region].shm;
mq->last_head = 0;
mq->type = MEMIF_RING_M2S;
}
return 0;
@ -483,12 +485,15 @@ memif_delete_if (vlib_main_t * vm, memif_if_t * mif)
memif_disconnect (mif, err);
clib_error_free (err);
/* remove the interface */
if (mif->mode == MEMIF_INTERFACE_MODE_IP)
vnet_delete_hw_interface (vnm, mif->hw_if_index);
else
ethernet_delete_interface (vnm, mif->hw_if_index);
mif->hw_if_index = ~0;
if (mif->hw_if_index != ~0)
{
/* remove the interface */
if (mif->mode == MEMIF_INTERFACE_MODE_IP)
vnet_delete_hw_interface (vnm, mif->hw_if_index);
else
ethernet_delete_interface (vnm, mif->hw_if_index);
mif->hw_if_index = ~0;
}
/* free interface data structures */
clib_spinlock_free (&mif->lockp);

View File

@ -140,6 +140,9 @@ memif_copy_buffer_from_rx_ring (vlib_main_t * vm, memif_if_t * mif,
prev_bi = *bi;
*bi = nm->rx_buffers[thread_index][last_buf];
b = vlib_get_buffer (vm, *bi);
/* Clear the error first to ensure following node forget setting it */
/* It will cause null-node error counter increasement instead of potential crash */
b->error = 0x0;
_vec_len (nm->rx_buffers[thread_index]) = last_buf;
(*n_free_bufs)--;
if (PREDICT_FALSE (*n_free_bufs == 0))
@ -266,6 +269,7 @@ memif_device_input_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
}
head = ring->head;
mq->last_head = ring->tail;
if (head == mq->last_head)
return 0;
@ -309,6 +313,10 @@ memif_device_input_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
&first_bi1, &bi1,
&num_slots);
if (PREDICT_FALSE (!first_bi0 || !first_bi1))
{
goto _invalid_pkt01;
}
/* enqueue buffer */
to_next[0] = first_bi0;
to_next[1] = first_bi1;
@ -376,6 +384,66 @@ memif_device_input_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
/* next packet */
n_rx_packets += 2;
n_rx_bytes += b0_total + b1_total;
continue;
_invalid_pkt01:
if (!first_bi0 && !first_bi1)
{
continue;
}
if (first_bi1)
{
first_bi0 = first_bi1;
first_b0 = first_b1;
bi0 = bi1;
b0_total = b1_total;
}
if (mode == MEMIF_INTERFACE_MODE_IP)
{
next0 = memif_next_from_ip_hdr (node, first_b0);
}
else if (mode == MEMIF_INTERFACE_MODE_ETHERNET)
{
if (PREDICT_FALSE (mif->per_interface_next_index != ~0))
next0 = mif->per_interface_next_index;
else
/* redirect if feature path
* enabled */
vnet_feature_start_device_input_x1 (mif->sw_if_index, &next0,
first_b0);
}
/* trace */
VLIB_BUFFER_TRACE_TRAJECTORY_INIT (first_b0);
if (PREDICT_FALSE (n_trace > 0))
{
if (PREDICT_TRUE (first_b0 != 0))
{
memif_input_trace_t *tr;
vlib_trace_buffer (vm, node, next0, first_b0,
/* follow_chain */ 0);
vlib_set_trace_count (vm, node, --n_trace);
tr = vlib_add_trace (vm, node, first_b0, sizeof (*tr));
tr->next_index = next0;
tr->hw_if_index = mif->hw_if_index;
tr->ring = qid;
}
}
/* enqueue buffer */
to_next[0] = first_bi0;
to_next += 1;
n_left_to_next--;
/* enqueue */
vlib_validate_buffer_enqueue_x1 (vm, node, next_index, to_next,
n_left_to_next, first_bi0, next0);
/* next packet */
n_rx_packets++;
n_rx_bytes += b0_total;
}
while (num_slots && n_left_to_next)
{
@ -387,6 +455,10 @@ memif_device_input_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
&n_free_bufs, &first_b0,
&first_bi0, &bi0,
&num_slots);
if (PREDICT_FALSE (!first_bi0))
{
goto _invalid_pkt0;
}
if (mode == MEMIF_INTERFACE_MODE_IP)
{
@ -433,11 +505,17 @@ memif_device_input_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
/* next packet */
n_rx_packets++;
n_rx_bytes += b0_total;
continue;
_invalid_pkt0:
;
}
if (PREDICT_TRUE (n_rx_packets != 0))
{
vlib_put_next_frame (vm, node, next_index, n_left_to_next);
}
vlib_put_next_frame (vm, node, next_index, n_left_to_next);
}
CLIB_MEMORY_STORE_BARRIER ();
ring->tail = head;
ring->tail = mq->last_head;
vlib_increment_combined_counter (vnm->interface_main.combined_sw_if_counters
+ VNET_INTERFACE_COUNTER_RX, thread_index,

View File

@ -105,6 +105,9 @@ typedef struct
int int_fd;
uword int_clib_file_index;
u64 int_count;
/* queue type */
memif_ring_type_t type;
} memif_queue_t;
#define foreach_memif_if_flag \

View File

@ -351,11 +351,16 @@ memif_msg_receive_add_ring (memif_if_t * mif, memif_msg_t * msg, int fd)
mif->run.num_m2s_rings = vec_len (mif->tx_queues);
}
// clear previous cache data if interface reconncected
memset (mq, 0, sizeof (memif_queue_t));
mq->int_fd = fd;
mq->int_clib_file_index = ~0;
mq->log2_ring_size = ar->log2_ring_size;
mq->region = ar->region;
mq->offset = ar->offset;
mq->type =
(ar->flags & MEMIF_MSG_ADD_RING_FLAG_S2M) ? MEMIF_RING_S2M :
MEMIF_RING_M2S;
return 0;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -641,4 +641,16 @@ nat_send_all_to_node(vlib_main_t *vm, u32 *bi_vector,
}
}
always_inline void
user_session_increment(snat_main_t *sm, snat_user_t *u, u8 is_static)
{
if (u->nsessions + u->nstaticsessions < sm->max_translations_per_user)
{
if (is_static)
u->nstaticsessions++;
else
u->nsessions++;
}
}
#endif /* __included_snat_h__ */

View File

@ -202,7 +202,7 @@ nat64_get_worker_out2in (ip4_header_t * ip)
/* worker by outside port (TCP/UDP) */
port = clib_net_to_host_u16 (port);
if (port > 1024)
return (u32) ((port - 1024) / sm->port_per_thread);
return nm->sm->first_worker_index + ((port - 1024) / sm->port_per_thread);
return vlib_get_thread_index ();
}
@ -232,6 +232,8 @@ nat64_init (vlib_main_t * vm)
nm->tcp_est_timeout = SNAT_TCP_ESTABLISHED_TIMEOUT;
nm->tcp_incoming_syn_timeout = SNAT_TCP_INCOMING_SYN;
nm->total_enabled_count = 0;
/* Set up the interface address add/del callback */
cb4.function = nat64_ip4_add_del_interface_address_cb;
cb4.function_opaque = 0;
@ -430,6 +432,12 @@ nat64_add_del_interface (u32 sw_if_index, u8 is_inside, u8 is_add)
interface->flags |= NAT_INTERFACE_FLAG_IS_INSIDE;
else
interface->flags |= NAT_INTERFACE_FLAG_IS_OUTSIDE;
nm->total_enabled_count++;
vlib_process_signal_event (nm->sm->vlib_main,
nm->nat64_expire_walk_node_index,
NAT64_CLEANER_RESCHEDULE, 0);
}
else
{
@ -443,6 +451,8 @@ nat64_add_del_interface (u32 sw_if_index, u8 is_inside, u8 is_add)
~NAT_INTERFACE_FLAG_IS_OUTSIDE;
else
pool_put (nm->interfaces, interface);
nm->total_enabled_count--;
}
if (!is_inside)
@ -497,13 +507,17 @@ nat64_alloc_out_addr_and_port (u32 fib_index, snat_protocol_t proto,
snat_main_t *sm = nm->sm;
snat_session_key_t k;
u32 ai;
u32 worker_index = 0;
int rv;
k.protocol = proto;
if (sm->num_workers > 1)
worker_index = thread_index - sm->first_worker_index;
rv =
sm->alloc_addr_and_port (nm->addr_pool, fib_index, thread_index, &k, &ai,
sm->port_per_thread, thread_index);
sm->port_per_thread, worker_index);
if (!rv)
{
@ -1160,6 +1174,8 @@ VLIB_REGISTER_NODE (nat64_expire_worker_walk_node, static) = {
};
/* *INDENT-ON* */
static vlib_node_registration_t nat64_expire_walk_node;
/**
* @brief Centralized process to drive per worker expire walk.
*/
@ -1167,8 +1183,12 @@ static uword
nat64_expire_walk_fn (vlib_main_t * vm, vlib_node_runtime_t * rt,
vlib_frame_t * f)
{
nat64_main_t *nm = &nat64_main;
vlib_main_t **worker_vms = 0, *worker_vm;
int i;
uword event_type, *event_data = 0;
nm->nat64_expire_walk_node_index = nat64_expire_walk_node.index;
if (vec_len (vlib_mains) == 0)
vec_add1 (worker_vms, vm);
@ -1184,8 +1204,28 @@ nat64_expire_walk_fn (vlib_main_t * vm, vlib_node_runtime_t * rt,
while (1)
{
vlib_process_wait_for_event_or_clock (vm, 10.0);
vlib_process_get_events (vm, NULL);
if (nm->total_enabled_count)
{
vlib_process_wait_for_event_or_clock (vm, 10.0);
event_type = vlib_process_get_events (vm, &event_data);
}
else
{
vlib_process_wait_for_event (vm);
event_type = vlib_process_get_events (vm, &event_data);
}
switch (event_type)
{
case ~0:
break;
case NAT64_CLEANER_RESCHEDULE:
break;
default:
clib_warning ("unknown event %u", event_type);
break;
}
for (i = 0; i < vec_len (worker_vms); i++)
{
worker_vm = worker_vms[i];
@ -1197,8 +1237,6 @@ nat64_expire_walk_fn (vlib_main_t * vm, vlib_node_runtime_t * rt,
return 0;
}
static vlib_node_registration_t nat64_expire_walk_node;
/* *INDENT-OFF* */
VLIB_REGISTER_NODE (nat64_expire_walk_node, static) = {
.function = nat64_expire_walk_fn,

View File

@ -39,6 +39,11 @@ typedef enum
#undef _
} nat64_tcp_ses_state_t;
enum
{
NAT64_CLEANER_RESCHEDULE = 1,
} nat64_cleaner_process_event_e;
typedef struct
{
ip6_address_t prefix;
@ -99,6 +104,11 @@ typedef struct
u32 tcp_est_timeout;
u32 tcp_incoming_syn_timeout;
/* Total count of interfaces enabled */
u32 total_enabled_count;
/* The process node which orcherstrates the cleanup */
u32 nat64_expire_walk_node_index;
ip4_main_t *ip4_main;
snat_main_t *sm;
} nat64_main_t;

Some files were not shown because too many files have changed in this diff Show More