In icc 14.0, compilation was broken:
examples/ipsec-secgw/sa.c(212): error: a designator for an anonymous
union member can only appear within braces corresponding to that anonymous union
.cipher = { RTE_CRYPTO_CIPHER_OP_ENCRYPT, RTE_CRYPTO_CIPHER_AES_CBC,
^
The member in anonymous union initialization should be inside '{}',
otherwise it will report an error.
Fixes: d299106e8e ("examples/ipsec-secgw: add IPsec sample application")
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
error log:
ip_pipeline/pipeline/pipeline_routing_be.c:1537:
integer constant is too large for 'long' type
Fixes: 0ae7275810 ("examples/ip_pipeline: add more functions to routing pipeline")
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
CID 120150:
Wrong size of the allocated memory. Passing argument as size of pointer
(8UL) instead of size of structure app_pipeline_firewall_rule.
Fixes: 67ebdbef0c ("examples/ip_pipeline: add bulk update of firewall rules")
Signed-off-by: Marcin Kerlin <marcinx.kerlin@intel.com>
In l3fwd-acl and l3fwd-power not all tx ports was included in tx_port_id
array, used to periodically drain only available ports. This caused that
some packets can remain in buffer when application stops to receiving
packets or when size of burst is small.
Fixes: e2366e74e0 ("examples: use buffered Tx")
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
When parsing crypto device type, the string was being copied
with strcpy(), which could overflow the destination buffer
(which is 32 byte long), so snprintf() should be used instead.
This fixes coverity issue 124575:
/examples/l2fwd-crypto/main.c: 1005 in l2fwd_crypto_parse_args_long_options()
>>> CID 124575: (STRING_OVERFLOW)
>>> You might overrun the 32 byte fixed-size string
"options->string_auth_algo" by copying "optarg" without checking the length.
1005 strcpy(options->string_auth_algo, optarg);
Fixes: 49f79e8648 ("examples/l2fwd-crypto: add missing string initialization")
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
It seems that with gcc >5.x and -O2/-O3 optimization breaks packet
grouping algorithm.
When last packet pointer "lp" and "pnum->u64" buffer points the same
memory buffer, high optimization can cause unpredictable results.
It seems that assignment of precalculated group sizes may interfere
with initialization of new group size when lp points value inside
current group and didn't should be changed.
With gcc >5.x and optimization we cannot be sure which assignment will
be done first, so the group size can be counted incorrectly.
This patch eliminates intersection of assignment of initial group size
(lp[0] = 1) and precalculated group sizes when gptbl[v].idx < 4.
Fixes: 94c54b4158 ("examples/l3fwd: rework exact-match")
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
error: loops in this subroutine are not good vectorization candidates
(try compiling with O3 and/or IPO).
this error occurs in icc 15.0.1
Solution to disable this diagnostic message
https://software.intel.com/en-us/forums/intel-c-compiler/topic/537688
Fixes: d299106e8e ("examples/ipsec-secgw: add IPsec sample application")
Fixes: 8cc72f2814 ("examples/vmdq_dcb: support X710")
Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Fix for compilation errors for icc:
error #188: enumerated type mixed with another type
Fixes: 00c58901f1 ("examples/l2fwd-crypto: use key-value list of supported algorithms")
Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
This patch fixes the pcap file parsing in ip_pipeline. Originally, the
parser recognizes the pcap related entries regardless of the RTE_PORT_PCAP
macro definition status.
Fixes: fe5d046213 ("examples/ip_pipeline: add pcap file dump")
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
This patch redesigns the API to set the link speed/s configuration
of an ethernet port. Specifically:
- it allows to define a set of advertised speeds for
auto-negociation.
- it allows to disable link auto-negociation (single fixed speed).
- default: auto-negociate all supported speeds.
A flag autoneg in struct rte_eth_link indicates if link speed was a
result of auto-negociation or was fixed by configuration.
Signed-off-by: Marc Sune <marcdevel@gmail.com>
Tested-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Tested-by: Beilei Xing <beilei.xing@intel.com>
Tested-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Define and use ETH_LINK_UP and ETH_LINK_DOWN where appropriate.
Signed-off-by: Marc Sune <marcdevel@gmail.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
This patch fixes the initialization error in flow classification
pipeline. Originally, when there is no key_mask specified in the
CFG file, all '0' mask is utilized.
Fixes: 1a33c5ea2f ("examples/ip_pipeline: clean config parser")
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
The branch was disabled because of a typo in the SSE4.2 flag.
Change also the x86_64 flag to use a DPDK one.
Fixes: 28377375c6 ("examples/ip_pipeline: fix build for x86_64 without SSE4.2")
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Originally l3fwd used 16-bit value to store dest_port value.
To accommodate 24-bit nexthop dest_port was increased to 32-bit,
though some further packet processing code remained unchanged and
still expects dest_port to be 16-bit.
That is not correct and can cause l3fwd invalid behaviour or even
process crash/hang on some input packet patterns.
For the fix, I choose the simplest approach and restored dest_port
as 16-bit value, plus necessary conversions from 32 to 16 bit values
after lpm_lookupx4.
Fixes: dc81ebbaca ("lpm: extend IPv4 next hop field")
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Not all tx ports was included in tx_port_id array, used to periodically
drain only available ports. This caused that some packets remain in buffer
when application stops to receiving packets.
Fixes: 52c97adc1f ("examples/l3fwd: fix exact match performance")
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
In FreeBSD, sys/types.h and netinet/in.h need to be included before
netinet/ip.h
There were missed typedef for u_char - <sys/types.h>
There were missed network definitions - <netinet/in.h>
Failure #13: http://dpdk.org/ml/archives/test-report/2016-March/001896.html
Fixes: d299106e8e ("examples/ipsec-secgw: add IPsec sample application")
Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Display extra crypto information (algorithms, keys/IV/AAD used, chain...),
so user can know exactly what operations are being carried out.
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Tested-by: Min Cao <min.cao@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
In order to ease the parsing and display of supported algorithms
in the application, two new arrays are created, which contains
the strings of the different cipher and authentication algorithms,
These lists are used to parse the algorithms from the command line,
and will be used to display crypto information to the user.
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Cipher/Auth keys, AAD and IV must be passed from command line
with ":" between bytes, but help was not clarifying that.
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Some crypto algorithms support more than one key size
(including cipher key, authentication key, IV and AAD),
but the app was using always the minimum size.
These changes allows the user to use an specific size,
either from the string provided with cipher_key, auth_key, iv and ADD
parameters, or from the values provided with cipher_key_random_size,
auth_key_random_size, iv_random_size and aad_random_size.
This also allows the user to specify the digest size.
Fixes: 1df9c0109f ("examples/l2fwd-crypto: parse key parameters")
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Tested-by: Min Cao <min.cao@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
App was generating a random IV/AAD of only 4 bytes,
instead of the actual length, since it was using sizeof(length).
Fixes: 27cf2d1b18 ("examples/l2fwd-crypto: discover capabilities")
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Tested-by: Min Cao <min.cao@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
When passing the preferred crypto device type in the command line
parameters, the string (HW/SW/ANY) was not being saved, which is used
for error information to the user.
Fixes: 27cf2d1b18 ("examples/l2fwd-crypto: discover capabilities")
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
L2fwd-crypto app is based on L2fwd app and it inherits
some of its parameters (such as portmask, queues per core...).
The parameter period (period of time between statistic updates)
is -T in L2fwd, but was -t in L2fwd-crypto, so for consistency,
it is changed back to -T
Fixes: 387259bd6c ("examples/l2fwd-crypto: add sample application")
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
When compiling dpdk_qat app with an i686 target on a x86_64 OS,
an error message was shown, saying that it can only be built
on a 32-bit OS, which should be i686 OS, as other 32-bit OS
are not supported.
Fixes: 3460012bcc ("examples/qat: update")
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
As a example to use ptype info, l3fwd needs firstly to use
rte_eth_dev_get_supported_ptypes() API to check if device and/or
its PMD driver will parse and fill the needed packet type; if not,
use the newly added option, --parse-ptype, to analyze it in the
callback softly.
As the mode of EXACT_MATCH uses the 5 tuples to caculate hash, so
we narrow down its scope to:
a. ip packets with no extensions, and
b. L4 payload should be either tcp or udp.
Note: this patch does not completely solve the issue, "cannot run
l3fwd on virtio or other devices", because hw_ip_checksum may be
not supported by the devices. Currently we can:
a. remove this requirements, or
b. wait for virtio front end (pmd) to support it.
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Added validation for queue id of config parameter tuple.
This validation enforces user to enter queue ids of a port
from 0 and in sequence.
This additional validation on queue ids avoids ixgbe crash caused
by null rxq pointer access inside ixgbe_dev_rx_init.
Reason for null rxq is, L3fwd application allocates memory only for
queues passed by user. But rte_eth_dev_start tries to initialize rx
queues in sequence from 0 to nb_rx_queues,
which is not true and coredump while accessing the unallocated queue .
Fixes: af75078fec ("first public release")
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
While the last arg of virtio_tx_route() asks a vlan tag, we currently
feed it with device_fh, which is wrong. Fix it.
Fixes: 4796ad63ba ("examples/vhost: import userspace vhost application")
Reported-by: Qian Xu <qian.q.xu@intel.com>
Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Comments for PKT_TX_TCP_SEG at rte_mbuf says that we should only set
PKT_TX_IP_CKSUM and reset ip hdr checksum for IPv4:
- if it's IPv4, set the PKT_TX_IP_CKSUM flag and write the IP checksum
to 0 in the packet
Fixes: 9fd72e3cbd ("examples/vhost: add virtio offload")
Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
For checksum offloading only case, the TCP/IP stack would
have calculated the pseudo checksum. Therefore, we don't
need to re-calculate it again here; remove it.
Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
NULL crypto operation is now supported, but l2fwd-crypto
was missing an update on the list of supported algorithms
that can be passed from command line.
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
AES GCM is an algorithm for both ciphering and authentication,
but the authentication algorithm was missing in the
list of supported algorithms that can be passed from command line.
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Since SNOW3G UEA2/UIA2 are supported now by both HW and SW,
l2fwd-crypto may use them, extending the list of algorithms
parsed from command line.
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Previous cdev parameter was changed to cdev_type,
to select a crypto device type preference (HW/SW/ANY),
instead of the device itself (QAT/AESNI...).
Also deleted cdev duplicated parameter from the help.
Fixes: 27cf2d1b18 ("examples/l2fwd-crypto: discover capabilities")
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
For GLIBC < 2.17 it is necessery to add -lrt for linker
from glibc > 2.17 The `clock_*' suite of functions (declared in <time.h>) is now
available directly in the main C library. This affect Ubuntu 12.04 in i686
and other older Linux Distros).
Fixes: 4758404a30 ("mk: fix eal shared library dependencies")
Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
The flag ENABLE_MULTI_BUFFER_OPTIMIZE has been removed so the
related comments are now useless.
Fixes: 268888b5b0 ("examples/l3fwd: modularize")
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
clang reports these errors:
error: too many arguments to function call, expected 2, have 3
examples/performance-thread/l3fwd-thread/main.c:1220:1: note:
'l3fwd_simple_forward' declared here
examples/l3fwd/main.c:550:1: error: unused function 'send_packetsx4'
The function is used only when ENABLE_MULTI_BUFFER_OPTIMIZE is 1.
Fixes: d48415e1fe ("examples/performance-thread: add l3fwd-thread app")
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
This patch implements PQoS as a sample application.
PQoS allows management of the CPUs last level cache,
which can be useful for DPDK to ensure quality of service.
The sample app links against the existing 01.org PQoS library
(https://github.com/01org/intel-cmt-cat).
White paper demonstrating example use case "Increasing Platform Determinism
with Platform Quality of Service for the Data Plane Development Kit"
(http://www.intel.com/content/www/us/en/communications/increasing-platform-determinism-pqos-dpdk-white-paper.html)
Signed-off-by: Wojciech Andralojc <wojciechx.andralojc@intel.com>
Signed-off-by: Tomasz Kantecki <tomasz.kantecki@intel.com>
Signed-off-by: Marcel D Cornu <marcel.d.cornu@intel.com>
It seems that for the most use cases, previous hash_multi_lookup provides
better performance, and more, sequential lookup can cause significant
performance drop.
This patch sets previously optional hash_multi_lookup method as default.
It also provides some minor optimizations such as queue drain only on used
tx ports.
Fixes: 94c54b4158 ("examples/l3fwd: rework exact-match")
Fixes: dc81ebbaca ("lpm: extend IPv4 next hop field")
Fixes: 64d3955de1 ("examples/l3fwd: fix ARM build")
Reported-by: Qian Xu <qian.q.xu@intel.com>
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
l3fwd does not compile with HASH_MULTI_LOOKUP.
2 issues:
* in 64d395 mask0 changed type from xmm_t to rte_xmm_t
-> use x field from rte_xmm_t
* in dc81eb dst_port parameter changed to uint32_t
-> change uint16_t dst_port to uin32_t dsp_port
Fixes: dc81ebbaca ("lpm: extend IPv4 next hop field")
Fixes: 64d3955de1 ("examples/l3fwd: fix ARM build")
Signed-off-by: Maciej Czekaj <maciej.czekaj@caviumnetworks.com>
Updated ip_pipeline app is using new changes from LPM library
(Increased number of next hops and added new config structure
for LPM IPv4).
Fixes: f1f7261838 ("lpm: add a new config structure for IPv4")
Signed-off-by: Michal Kobylinski <michalx.kobylinski@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Previous l3fwd-power only processes IP and IPv6 packets, other
packets' mbufs are not freed, and this causes a memory leak.
This patch fixes this issue.
Fixes: 3c0184cc0c ("examples: replace some offload flags with packet type")
Signed-off-by: Shaopeng He <shaopeng.he@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
Currently, the example vmdq_dcb only works on Intel(R) 82599 NICs.
This patch extends this sample to make it work both on Intel(R) 82599
and X710/XL710 NICs by making the following changes:
1. add VMDQ base queue checking to avoid forwarding on PF queues.
2. assign each VMDQ pool to a MAC address.
3. add more arguments (nb-tcs, enable-rss) to change the default
setting
4. extend the max number of queues from 128 to 1024.
This patch also reworks the user guide for the vmdq_dcb sample.
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tell the compiler to use unsigned constants for left shift ops,
otherwise building with gcc >= 6.0 fails due to multiple warnings like:
warning: left shift of negative value [-Wshift-negative-value]
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
The pass-through pipeline implementation is extended with load balancing
function. This function allows uniform distribution of the packets among
its output ports. For packets distribution, any application level logic
can be applied. For instance, in this implementation, hash value
computed over specific header fields of the incoming packets has been
used to spread traffic uniformly among the output ports.
The following pass-through configuration can be used for implementing
load balancing function over ipv4 traffic;
[PIPELINE0]
type = PASS-THROUGH
core = 0
pktq_in = RXQ0.0 RXQ1.0 RXQ2.0 RXQ3.0
pktq_out = TXQ0.0 TXQ1.0 TXQ2.0 TXQ3.0
dma_src_offset = 278; mbuf (128) + headroom (128) + 1st ethertype offset (14) + ttl offset within ip header = 278 (ipv4)
dma_dst_offset = 128; mbuf (128)
dma_size = 16
dma_src_mask = 00FF0000FFFFFFFFFFFFFFFFFFFFFFFF
dma_hash_offset = 144; (dma_dst_offset+dma_size)
lb = hash
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
This patch add packet dumping feature to ip_pipeline. Output port type
SINK now supports dumping packets to PCAP file before releasing mbuf back
to mempool. This feature can be applied by specifying parameters in
configuration file as shown below:
[PIPELINE1]
type = PASS-THROUGH
core = 1
pktq_in = SOURCE0 SOURCE1
pktq_out = SINK0 SINK1
pcap_file_wr = /path/to/eth1.pcap /path/to/eth2.pcap
pcap_n_pkt_wr = 80 0
The configuration section "pcap_file_wr" contains full path and name of
the PCAP file which the packets will be dumped to. If multiple SINKs
exists, each shall have its own PCAP file path listed in this section,
separated by spaces. Multiple SINK ports shall NOT share same PCAP file to
be dumped.
The configuration section "pcap_n_pkt_wr" contains integer value(s)
and indicates the maximum number of packets to be dumped to the PCAP file.
If this value is "0", the "infinite" dumping mode will be used. If this
value is N (N > 0), the dumping will be finished when the number of
packets dumped to the file reaches N.
To enable PCAP dumping support to IP pipeline, the compiler option
CONFIG_RTE_PORT_PCAP must be set to 'y'. It is possible to disable this
feature by removing "pcap_file_wr" and "pcap_n_pkt_wr" lines from the
configuration file.
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
This patch add PCAP file support to ip_pipeline. Input port type SOURCE
now supports loading specific PCAP file and sends the packets in it to
pipeline instance. The packets are then released by SINK output port. This
feature can be applied by specifying parameters in configuration file as
shown below;
[PIPELINE1]
type = PASS-THROUGH
core = 1
pktq_in = SOURCE0 SOURCE1
pktq_out = SINK0 SINK1
pcap_file_rd = /path/to/eth1.PCAP /path/to/eth2.PCAP
pcap_bytes_rd_per_pkt = 0 64
The configuration section "pcap_file_rd" contains full path and name of
the PCAP file to be loaded. If multiple SOURCEs exists, each shall have
its own PCAP file path listed in this section, separated by spaces.
Multiple SOURCE ports may share same PCAP file to be copied.
The configuration section "pcap_bytes_rd_per_pkt" contains integer value
and indicates the maximum number of bytes to be copied from each packet
in the PCAP file. If this value is "0", all packets in the file will be
copied fully; if the packet size is smaller than the assigned value, the
entire packet is copied. Same as "pcap_file_rd", every SOURCE shall have
its own maximum copy byte number.
To enable PCAP support to IP pipeline, the compiler option
CONFIG_RTE_PORT_PCAP must be set to 'y'. It is possible to disable PCAP
support by removing "pcap_file_rd" and "pcap_bytes_rd_per_pkt" lines
from the configuration file.
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Change the fields of outer_mac and inner_mac in struct
rte_eth_tunnel_filter_conf from pointer to struct in order to
keep the code's readability.
Signed-off-by: Xutao Sun <xutao.sun@intel.com>
Signed-off-by: Jijiang Liu <jijiang.liu@intel.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
The names of function for tunnel port configuration are not
accurate. They're tunnel_add/del, better change them to
tunnel_port_add/del.
The old functions are directly replaced because the API and ABI
compatibility of ethdev are already broken in 16.04.
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>