9346 Commits

Author SHA1 Message Date
Damjan Marion
ddd8c0fe59 crypto-native: fix issues detected by coiverity
Type: fix
Change-Id: Id61aa407eeeb4d44cf47ed39283a0c79ed3abbee
Signed-off-by: Damjan Marion <damarion@cisco.com>
(cherry picked from commit 139a6ae0dd460a6b8a5884e65cfd96f0c409f69e)
2020-09-15 11:25:25 +00:00
Yichen Wang
748bf82a50 build: fix the the build on centos/rhel 8
1. Remove uncessary runtime dependency;
2. Add missing build dependency;
3. Fix runtime dependency for api-python3 RPM;

Type: make

Change-Id: I2700f1a15112effba8d1527aca6467158f81f486
Signed-off-by: Yichen Wang <yicwang@cisco.com>
(cherry picked from commit 466872f0896139b34ef8ccf12f7fcc0093d7cb19)
2020-09-15 10:08:53 +00:00
Filip Tehlar
57b16c694c ikev2: fix copy-paste error when freeing memory
Type: fix

Change-Id: If44c807d188b3e88d819f4132d73e6a34402a525
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
(cherry picked from commit 999395cd6644a297c01dd6de033cf1ffb4e9951b)
2020-09-15 10:07:50 +00:00
Benoît Ganne
047eebfa97 build: fix build for Debian 9 and Debian 10
Type: fix

Change-Id: Ic07d0ae313b32e420ba93693cb75960a86f752a9
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 3f0ae664faf33578515ffa1fd5287ad692f16c6f)
2020-09-15 08:40:06 +00:00
Florin Coras
89bdb836f9 vcl: always fill buffer or drain rx fifo
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ibbe438aa6f2fe6d9f55c56ca6d3aec1a29b32cad
(cherry picked from commit 4a2c794c431c72364e241fa14327f03e35b886b7)
2020-09-15 08:39:26 +00:00
Neale Ranns
ec8a577ed9 wireguard: coverity fixes
Type: fix

Signed-off-by: Neale Ranns <nranns@cisco.com>
Change-Id: Ib1eabbc87a573c660ac251602d631f167928259b
(cherry picked from commit 76770fd659420c23e43422d672a55e268f042129)
2020-09-15 08:39:03 +00:00
Benoît Ganne
a238082a8a vlib: fix call to vlib_get_node_by_name
Type: fix

Change-Id: I1b4f52e186165b04db5bd5f11058dc77b647bc94
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 268e3b647733807dbecf402fcebedceff4c85544)
2020-09-15 08:38:32 +00:00
Matthew Smith
649ba152cb l2: fix null deref in l2_to_bvi()
Type: fix

Static analysis identified a possible null pointer dereference. It
was introduced by a recent patch which expanded the DMAC comparison
on inbound packets on a BVI interface to include any secondary MAC
addresses which were added to an interface.

Check if the pointer is null before dereferencing.

Change-Id: Ic2afe2b062eda32977e05bf3f98d82c1fe64620c
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
(cherry picked from commit 78681def21b931309a779dfc6a5cbc6ff8b1f814)
2020-09-15 08:38:11 +00:00
Benoît Ganne
c13aab8ca1 ikev2: fix memory leaks
- make sure everything is freed on cleanup
 - reuse already allocated vectors where possible

Type: fix

Change-Id: Ibd8da1edb37126522dc2d525596521d32dceb73a
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 730cec8c0697627cc1fb6a34acd094c77ba07622)
2020-09-15 08:35:37 +00:00
Martin Millnert
cb94290d5f misc: selinux fixes (packet_socket r/w)
vpp-20.05 on up-to-date Centos 7.8 host with enforcing SELinux fails to
create a host-interface due to two missing SELinux-permissions:

vpp_t self:packet_socket { read write }

This simple patch adds these two permissions. Tested successfully on
local installation.

The steps to reproduce:

$ ip link add vpeer-host type veth peer name vpeer-vpp
vpp# create host-interface name vpeer-vpp
create host-interface: Permission denied (errno 13)
[...]
$ semodule -i vpp-packet-socket.pp
vpp# create host-interface name vpeer-vpp
host-vpeer-vpp

Type: fix
Ticket: VPP-1931
Change-Id: I2b3d92b27b9a9f26aa1c85af2946b15e83e27944
Signed-off-by: Martin Millnert <martin@millnert.se>
(cherry picked from commit 68849350c56b0258d21fc906b09df71a1951f694)
2020-09-15 08:35:15 +00:00
Aloys Augustin
6f1a86f187 quic: fix coverity warning
Change-Id: Ic31cde8564a0705710d91e0a7b90dcc6cf2f8db6
Type: fix
Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
2020-09-15 08:34:37 +00:00
Mohammed Hawari
758e6776a8 af_xdp: documents incompatibility with 1GB hugepages and high buffers-per-numa.
Type: docs
Change-Id: If8602d4b73cc1f04e42d19b8df60a05f67aa90c9
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
(cherry picked from commit 5d2091da2a96cb1092b0744cdee8bb481788a6dc)
2020-09-15 08:34:05 +00:00
Chenmin Sun
f1b7953449 dpdk: fix coverity defect #214232, #182930
Type: fix

Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>
Change-Id: Ie328834159687cdb4314c37d36697f2fb9081fbd
(cherry picked from commit 504bcb7c29da6ab45656f54cda394cccb0d97dae)
2020-09-12 21:54:43 +00:00
Andrew Yourtchenko
f96ce156b5 misc: edit the MAINTAINERS entries for crypto plugins for common style
Change-Id: Ic40bf11210cf1c36420578281f5a42668bad9801
Type: docs
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
(cherry picked from commit f8b319359cd2a24271dbe7cebfc8a4147ab89727)
2020-09-11 18:07:25 +00:00
Andrew Yourtchenko
fb6d768419 misc: Initial changes for stable/2009 branch
Change-Id: Ibb982c877427c8382a30ee561c23d878adc9c28d
Type: docs
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
v20.09-rc1
2020-09-09 21:54:44 +00:00
Nathan Skrzypczak
c4781a32df docs: Improve new plugin doc & add govpp API doc
Type: docs

Change-Id: I5f20ac0232c5cdc3cf64015185b0d0fc5c4a3100
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2020-09-09 20:44:08 +00:00
Nathan Skrzypczak
f681e9f736 docs: Update and improve indent install
Type: docs

Change-Id: I1a37450261e0bcedf90685243b14027f3cf23704
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2020-09-09 20:44:00 +00:00
Matthew Smith
adf2fe0def l2: check secondary macs on BVI interface
Type: fix

VRRP cannot be used on a BVI interface currently because packets sent
to the virtual mac address of the VR fail the destination mac check in
l2_to_bvi().

Apparently people want to use VRRP on BVI interfaces, so update the
check in l2_to_bvi() so that it will check any secondary mac addresses
which have been added to the ethernet interface if the destination mac
address does not match the primary mac address for the interface.

An equivalent check is already done in ethernet_input_inline() for L3
interfaces which are in promiscuous mode.

Change-Id: I7c5bf624dafda8744fea236c704e8e17e5f53b35
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2020-09-09 19:45:26 +00:00
Nathan Skrzypczak
97158289bc docs: Fix create memif cli
Type: docs

Change-Id: I91a954abf77335e1ddcbd1468633d9d7980bbac2
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2020-09-09 16:56:28 +00:00
Benoît Ganne
da5b4efbab svm: fix non-null-terminated string
Type: fix

Change-Id: Ia9cd71ce12584cd8ef90bfe357cf762dd7653f71
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-09-09 14:49:59 +00:00
Andrew Yourtchenko
d78a5bc03e misc: Merge 20.05.1, 19.08.3 RELEASE.md sections
also, remove a duplicate 17.01.1 section and wrong page tag for 20.09

Change-Id: Ia2cc77faa75cccab38972ad46517762cb7456466
Type: docs
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2020-09-09 13:36:01 +00:00
Artem Glazychev
edca1325cf wireguard: initial implementation of wireguard protocol
Type: feature

The main information about plugin you can see in README.md

vpp# wireguard ?
  wireguard create                         wireguard create listen-port <port> private-key <key> src <IP> [generate-key]
  wireguard delete                         wireguard delete <interface>
  wireguard peer add                       wireguard peer add <wg_int> public-key <pub_key_other>endpoint <ip4_dst> allowed-ip <prefix>dst-port [port_dst] persistent-keepalive [keepalive_interval]
  wireguard peer remove                    wireguard peer remove <index>

Change-Id: I85eb0bfc033ccfb2045696398d8a108b1c64b8d9
Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>
Signed-off-by: Damjan Marion <damarion@cisco.com>
Signed-off-by: Jim Thompson <jim@netgate.com>
Signed-off-by: Neale Ranns <nranns@cisco.com>
Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-09-09 11:57:48 +00:00
Fan Zhang
ef80ad6bff crypto: change cryptodev with new cryptodev API
Type: feature

This patch updateds cryptodev engine uses new DPDK Cryptodev
API planned to be upstreamed in DPDK 20.11.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Signed-off-by: Piotr Bronowski <piotrX.bronowski@intel.com>
Change-Id: I8dd1a8ac643f1e952deb787e466b76ea7aa5f420
2020-09-09 10:19:21 +00:00
Chenmin Sun
c4665093cd interface: support configuring RSS steering queues
This patch adds the RSS steering queues set interface, and it's
implementation in DPDK device:

/* Interface to set rss queues of the interface */
typedef clib_error_t *(vnet_interface_rss_queues_set_t)
  (struct vnet_main_t * vnm, struct vnet_hw_interface_t * hi,
   clib_bitmap_t *bitmap);

This patch also introduces a command line to set the RSS queues:
  set interface rss queues <interface> <list <queue-list>>
To display the rss queues, use "show hardware-interfaces"

Below is the example to configure rss queues for interface Gig0:
vpp# set interface rss queues Gig0 list 0,2,4-7
vpp# show hardware-interfaces brief
              Name                Idx   Link  Hardware
VirtualFunctionEthernet18/1/0      1    down  VirtualFunctionEthernet18/1/0
  Link speed: unknown
  RSS queues: 0 2 4 5 6 7
local0                             0    down  local0
  Link speed: unknown
vpp#

Users can also configure the rss queues on a dpdk interface in
startup.conf:
dpdk {
    dev 0000:18:01.0 {
        rss-queues 0,2,5-7
    }
}

Type: feature

Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>
Change-Id: I1835595a1c54016a84eabee9fd62ce137935385d
2020-09-09 10:12:06 +00:00
Rajesh Goel
765008670b stats: Fix stat_segment to set timeout directly
Type: fix

Signed-off-by: Rajesh Goel <rajegoel@cisco.com>
Change-Id: Ib37802f4270fe894a31e871c7fbb12b5a1cdf058
2020-09-09 06:47:15 +00:00
Ryujiro Shibuya
ddfd56265e tcp: fix the tcp unittest to work
Type: fix

Signed-off-by: Ryujiro Shibuya <ryujiro.shibuya@owmobility.com>
Change-Id: If5a8313262da828616db8b1d9ef831d42b11d952
2020-09-09 04:14:11 +00:00
Christian Hopps
f6cb044604 dpdk-ipsec: don't leak buffers on crypto alloc failure
Type: fix
Signed-off-by: Christian Hopps <chopps@labn.net>
Change-Id: I4dee2ea723631e1bd95b33a74b9431d984565aef
2020-09-08 17:12:22 +00:00
Christian Hopps
cd64f73951 dpdk: fix extended stat strings
- These were displaying blank, apparently dpdk extended stat strings
must be within the heap so they are identified as vectors by
format_c_identifier even though they are not.

Type: fix
Change-Id: I2b153b100203b9856ce3af6d5ecb2daae410fb5b
Signed-off-by: Christian Hopps <chopps@labn.net>
2020-09-08 16:58:29 +00:00
Christian Hopps
527746ff06 dpdk: fix interface counters to never go backward
Was seeing imissed counter become negative. Reuse the RX_ERROR code for all
three error counters to avoid the problem.

Type: fix
Change-Id: I99a69c8816326682745785ecd30e18a131ac2969
Signed-off-by: Christian Hopps <chopps@labn.net>
2020-09-08 16:55:52 +00:00
Florin Coras
97d39e3e05 svm session: document unsupported fifo deq combinations
Type: fix

- Document that ooo dequeues with ooo lookups cannot be done in
combination with in order dequeues.
- Added assert to capture this scenario and de-initialized rbtrees for
cut-through tx fifo

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ic40d020b3f0391fcf022ea3c906b86121744144f
2020-09-08 16:14:08 +00:00
Christian Hopps
fb7e7ed2cd ipsec: fix padding/alignment for native IPsec encryption
Not all ESP crypto algorithms require padding/alignment to be the same
as AES block/IV size. CCM, CTR and GCM all have no padding/alignment
requirements, and the RFCs indicate that no padding (beyond ESPs 4 octet
alignment requirement) should be used unless TFC (traffic flow
confidentiality) has been requested.

  CTR: https://tools.ietf.org/html/rfc3686#section-3.2
  GCM: https://tools.ietf.org/html/rfc4106#section-3.2
  CCM: https://tools.ietf.org/html/rfc4309#section-3.2

- VPP is incorrectly using the IV/AES block size to pad CTR and GCM.
These modes do not require padding (beyond ESPs 4 octet requirement), as
a result packets will have unnecessary padding, which will waste
bandwidth at least and possibly fail certain network configurations that
have finely tuned MTU configurations at worst.

Fix this as well as changing the field names from ".*block_size" to
".*block_align" to better represent their actual (and only) use. Rename
"block_sz" in esp_encrypt to "esp_align" and set it correctly as well.

test: ipsec: Add unit-test to test for RFC correct padding/alignment

test: patch scapy to not incorrectly pad ccm, ctr, gcm modes as well

- Scapy is also incorrectly using the AES block size of 16 to pad CCM,
CTR, and GCM cipher modes. A bug report has been opened with the
and acknowledged with the upstream scapy project as well:

  https://github.com/secdev/scapy/issues/2322

Ticket: VPP-1928
Type: fix
Signed-off-by: Christian Hopps <chopps@labn.net>
Change-Id: Iaa4d6a325a2e99fdcb2c375a3395bcfe7947770e
2020-09-07 09:43:27 +00:00
Christian E. Hopps
dce44e4e23
marvell: add cli options to configure rxq and txq sizes
Add the ability to configure the pp2 rx and tx queue sizes in the CLI.

Type: improvement
Signed-off-by: Christian E. Hopps <chopps@chopps.org>
Change-Id: I6a824f92e22fa47fec3d84525cc2d82524ddf639
2020-09-06 08:50:38 -04:00
Nathan Skrzypczak
4b2946a884 vlib: vlib_get_node_by_name fails via API
Type: fix

Calling vlib_get_node_by_name via the VPE api
doesn't work due to hash weirdness. Haven't
gotten around the real cause of this. But this
fixes it.

Change-Id: I89f95dba2bcd9573b8f1f435e063e9dd57f9ca93
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2020-09-05 08:43:44 +00:00
Nathan Skrzypczak
24179ee1a4 docs: Improve & link cnat doc
Type: docs

Change-Id: Ib985ed6a644ae3f4c330bf6a27dc69c49a489a2f
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2020-09-05 08:37:51 +00:00
Dave Barach
e697caf9f8 cnat: fix cnat_set_snat() debug CLI
Otherwise, the debug CLI command is unusable in a script because it
will eat (and complain about) subsequent lines in the script. Missing
this guitar lick, etc:

/* Get a line of input. */
 if (!unformat_user (input, unformat_line_input, line_input))
   return 0;

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: Id328e6f1cc4d2e1672c3946db3865ab5a1a3af8d
2020-09-04 16:33:25 -04:00
MathiasRaoul
5c721baeb1 cnat: fix snat ip v6 tests
Type: fix

Change-Id: I9e102e0028274cc084e59c106d1cd4be174b1205
Signed-off-by: MathiasRaoul <mathias.raoul@gmail.com>
2020-09-04 16:57:22 +00:00
Mohsin Kazmi
a7a2281732 virtio: remove kernel virtio header dependencies
Type: refactor

tap, virtio and vhost use virtio/vhost header files from linux
kernel. Different features are supported on different kernel
versions, making it difficult to use those in VPP. This patch
removes virtio/vhost based header dependencies to local header
files.

Change-Id: I064a8adb5cd9753c986b6f224bb075200b3856af
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-09-04 13:34:20 +00:00
Matthew Smith
f1cd3da20f vrrp: improve RFC compliance for ARP/ND
Type: fix

The ARP/ND feature nodes reply to requests for a VR virtual IP address
when a VR is in the master state. If the VR is in the backup state, the
request is passed to the next node on the feature arc.

This can cause an incorrect response to be sent. If some other feature
(e.g. NAT) causes a virtual IP address to be configured as a "local"
address on the system, a later node on the feature arc may respond to
an ARP/ND request with the real MAC address of the interface.

RFC 5798 says that a router must respond to ARP/ND requests for VR
virtual IP addresses with the VR virtual MAC address. And it says a
router must not respond to ARP/ND requests for VR virtual IP addresses
when the VR is in the backup state. Ensure that ARP/ND requests for
VR virtual IP addresses are dropped when in the backup state rather
than allowing them to continue on the feature arc where another node
may end up responding.

In order to do this, enable/disable the feature nodes when leaving
or entering the init state instead of the master state.

Change-Id: I416f83e125cbf91deb90c3b6eb00ba3207de24ad
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2020-09-04 12:55:42 +00:00
Damjan Marion
0be1b764a3 buffers: improve cache occupancy
Adjust buffer allocation so it always have odd number of cache lines.
That should result in better distribution of cachelines among cache sets.

Type: improvement
Change-Id: I0d39d4cf01cff36ad6f70a700730823a96448c22
Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-09-04 12:45:46 +00:00
Christian Hopps
93a7f63943 dpdk-ipsec: use init function instead of one-time process
Use VLIB_MAIN_LOOP_ENTER_FUNCTION to do post init initialization for
dpdk crypto rather than create a one-time process to do the same.

Type: fix
Signed-off-by: Christian Hopps <chopps@labn.net>
Change-Id: I06e480b028c8e1fc1b0024a66b2338eb21a797ca
2020-09-04 12:40:54 +00:00
Nathan Skrzypczak
5cd626eb1e vpp: Fix node APIs
Type: fix

Change-Id: Ic6e2b7e05b50945a8e2222019c2942a6ee52e465
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2020-09-04 12:14:51 +00:00
Christian Hopps
942b9803f8 dpdk-ipsec: fix show output
Fix the shown crypto inflight counts which were reversed. Also improve a
couple error descriptions to tell them apart when viewed.

Type: fix
Signed-off-by: Christian Hopps <chopps@labn.net>
Change-Id: I6d4054c64aa842658cfcde8969c7aa48f6d21207
2020-09-04 12:12:57 +00:00
Christian Hopps
d570e53c74 ipsec: fix trace of GRE_teb packets
The issue is not easily hit. When GRE_teb packets are received the post
crypto processing adjusts the l2.l2_len value in the vnet_buffer opaque
data. This is overwriting the ipsec opaque data. Later the trace code
fetches the sa_index from the ipsec opaque data. It's just an accident
that this currently works, if the ipsec data is changed so that the
sa_index moves around it will be overwritten by the l2_len modification.
Indeed, this was found b/c local development changes had moved the
sa_index so it was over-lapping with the l2_len memory space, and the UT
failed.

Type: fix
Change-Id: Iaecfa750cf0b36653fd9e75b4d799f323a14d932
Signed-off-by: Christian Hopps <chopps@labn.net>
2020-09-04 11:56:06 +00:00
Christian Hopps
99975388a2 ipsec: cli: add missing flags for SA add
Add missing cli options for setting IPsec SA flags, inbound,
use-anti-replay, and use-esn.

Type: fix
Change-Id: Ia7a91b4b0a12be9e4dd0e684be3e04d8ccafb9d4
Signed-off-by: Christian Hopps <chopps@labn.net>
2020-09-04 11:40:45 +00:00
Zhiyong Yang
5e52417a2a ip: enhance vtep4_check of tunnel by vector way
This patch aims to improve decap performance by reducing expensive
hash_get callings as less as possible using AVX512 on XEON.
e.g. vxlan, vxlan_gpe, geneve, gtpu.

For the existing code, if vtep4 of the current packet match the last
vtep4_key_t well, expensive hash computation can be avoided and the
code returns directly.

This patch improves tunnel decap multiple flows case greatly by
leveraging 512bit vector register on XEON accommodating 8 vtep4_keys.
It enhances the possiblity of avoiding unnecessary hash computing
once hash key of the current packet hits any one of 8 in the 512bit
cache.

The oldest element in vtep4_cache_t is updated in round-robin order.

vlib_get_buffers is also leveraged in the meanwhile.

Type: improvement

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Signed-off-by: Junfeng Wang <drenfong.wang@intel.com>
Change-Id: I313103202bd76f2dd638cd942554721b37ddad60
2020-09-04 02:34:03 +00:00
Christian Hopps
4a433f4608 api: fix ipsec custom_dump function
The protocol value was changed to 50 and 51 (rather than 0 and 1), but
the custom_dump function wasn't updated to reflect this. Also the is_add
value wasn't being shown. Fix both these issues.

Type: fix
Change-Id: I429b4616d6c7937f73308b644154370fab32eaae
Signed-off-by: Christian Hopps <chopps@labn.net>
2020-09-03 22:53:34 +00:00
Christian Hopps
4d56b18ce5 misc: l2tp: cli: fix overly generic CLI commands
"clear counters" is not appropriate for a protocol to own. Change
to "clear l2tp counters" (and "test l2tp counter").

Type: fix
Signed-off-by: Christian Hopps <chopps@labn.net>
Change-Id: I3faac3907c4697c1c95df34ac7d31e48063869a8
2020-09-03 22:51:24 +00:00
Christian Hopps
1da08197eb vlib: exit 0 (nocore) on SIGHUP
Scenarios where SIGHUP is sent would include the user closing an xterm
while in interactive/nodaemon mode, or similarly when running vpp in the
same mode during testing (e.g., using ssh to run VPP on a DUT). VPP
should exit in these cases; however, generating a core is unwanted.

Type: fix
Signed-off-by: Christian Hopps <chopps@labn.net>
Change-Id: Ibccfe5e676547e913c8a205ff16ab56d9abb1c82
2020-09-03 22:50:13 +00:00
Nathan Skrzypczak
0c936b147f crypto: Add async crypto APIs
Type: feature

This adds api calls for the following CLIs:
* set sw_scheuduler worker <N> crypto on|off
* set crypto async dispatch polling|interrupt
* set crypto handler
* set crypto async handler

Change-Id: Ic701d149c440e42ea4575da42b9f69e4c8759602
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2020-09-03 16:49:19 +02:00
PiotrX Kleski
2284817eae crypto: SW scheduler async crypto engine
Type: feature

This patch adds new sw_scheduler async crypto engine.
The engine transforms async frames info sync crypto ops and
delegates them to active sync engines. With the patch it
is possible to increase the single worker crypto throughput
by offloading the crypto workload to multiple workers.

By default all workers in the system will attend the crypto
workload processing. However a worker's available cycles
are limited. To avail more cycles to one worker to process
other workload (e.g. the worker core that handles the RX/TX
and IPSec stack processing), a useful cli command is added
to remove itself (or add it back later) from the heavy
crypto workload but only let other workers to process the
crypto. The command is:

 - set sw_scheduler worker <idx> crypto <on|off>

It also adds new interrupt mode to async crypto dispatch node.
This mode signals the node when new frames are enqueued
as opposed to polling mode that continuously calls dispatch node.

New cli commands:
 - set crypto async dispatch [polling|interrupt]
 - show crypto async status (displays mode and nodes' states)

Signed-off-by: PiotrX Kleski <piotrx.kleski@intel.com>
Signed-off-by: DariuszX Kazimierski <dariuszx.kazimierski@intel.com>
Reviewed-by: Fan Zhang <roy.fan.zhang@intel.com>
Change-Id: I332655f347bb9e3bc9c64166e86e393e911bdb39
2020-09-03 14:23:51 +00:00