Commit Graph

12333 Commits

Author SHA1 Message Date
Jasvinder Singh
7e11393e40 examples/ip_pipeline: add meter profile commands
Add commands to configure the traffic meter profile.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
2018-04-05 19:00:19 +02:00
Jasvinder Singh
c64b9121a9 examples/ip_pipeline: add table entry stats command
Add command to read the pipeline table entry stats.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
2018-04-05 19:00:19 +02:00
Jasvinder Singh
3186282f8e examples/ip_pipeline: add table bulk add command
Add cli for adding bulk entries to pipeline table.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
2018-04-05 19:00:19 +02:00
Jasvinder Singh
f634e4c569 examples/ip_pipeline: add table entry delete command
Add command to delete the pipeline table entry.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
2018-04-05 19:00:19 +02:00
Jasvinder Singh
a3a95b7d58 examples/ip_pipeline: add table entry commands
Add commands to add pipeline table entries which contains match and
action part.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
2018-04-05 19:00:18 +02:00
Jasvinder Singh
50e73d0518 examples/ip_pipeline: add stats read commands
Add commands to read the pipeline  port in, port out
and table stats.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
2018-04-05 19:00:18 +02:00
Jasvinder Singh
6b1b3c3c9d examples/ip_pipeline: add port enable and disable commands
Add commands to enable and disable the pipeline ports.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
2018-04-05 19:00:18 +02:00
Jasvinder Singh
32e5d9b154 examples/ip_pipeline: add enable and disable commands
Add commands to enable and disable the pipeline on the thread.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
2018-04-05 19:00:17 +02:00
Jasvinder Singh
a8bd581de3 examples/ip_pipeline: add thread runtime
Add runtime thread functions for the pipeline.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
2018-04-05 19:00:17 +02:00
Jasvinder Singh
c0b668e0c6 examples/ip_pipeline: add threads
Add threads data structure and initialisation functions to run
the pipeline.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
2018-04-05 19:00:17 +02:00
Jasvinder Singh
d75c371e9b examples/ip_pipeline: add pipeline object
Add pipeline object implementation to the application.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
2018-04-05 19:00:08 +02:00
Jasvinder Singh
719374345c examples/ip_pipeline: add action profile objects
Add action profile object implementation to the application.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
2018-04-05 19:00:08 +02:00
Jasvinder Singh
9a408cc8ac examples/ip_pipeline: add KNI object
Add kni object implementation to the application.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
2018-04-05 19:00:00 +02:00
Jasvinder Singh
2f74ae28e2 examples/ip_pipeline: add tap object
Add tap object implementation to the application

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
2018-04-05 18:23:51 +02:00
Jasvinder Singh
25961ff3bc examples/ip_pipeline: add traffic manager object
Add traffic manager object implementation to the application.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
2018-04-05 18:23:51 +02:00
Jasvinder Singh
8245472c58 examples/ip_pipeline: add sw queue object
Add swq object implementation to the application.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
2018-04-05 18:23:50 +02:00
Jasvinder Singh
133c2c6565 examples/ip_pipeline: add link object
Add link object implementation to the application.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
2018-04-05 18:23:50 +02:00
Jasvinder Singh
6bfe74f8c9 examples/ip_pipeline: add mempool object
Add mempool object implementation to the application.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
2018-04-05 18:23:49 +02:00
Jasvinder Singh
4bbf8e30aa examples/ip_pipeline: add CLI interface
CLI interface allowing connectivity with external agent (e.g. telnet,
netcat, Python script, etc) is added to the application.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
2018-04-05 18:23:49 +02:00
Jasvinder Singh
fbc74e6633 examples/ip_pipeline: remove infra code
All the actions associated with application pipelines
tables and ports are now implemented using the new action
APIs. Therefore, thousands of lines of code are eliminated
from the application. The reduced code size is easier to
maintain and extend.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
2018-04-05 18:23:41 +02:00
Jasvinder Singh
f97f23a0c9 examples/ip_pipeline: remove config
Remove application configuration and script files.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
2018-04-04 12:26:22 +02:00
Jasvinder Singh
b5e408acd1 examples/ip_pipeline: remove master pipeline
remove master pipeline.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
2018-04-04 12:26:22 +02:00
Jasvinder Singh
998eab3001 examples/ip_pipeline: remove firewall pipeline
Remove firewall pipeline.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
2018-04-04 12:26:22 +02:00
Jasvinder Singh
f3e51ca4fa examples/ip_pipeline: remove flow actions pipeline
Remove flow actions pipeline.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
2018-04-04 12:26:21 +02:00
Jasvinder Singh
71fd20a96b examples/ip_pipeline: remove flow classification pipeline
Remove flow classification pipeline.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
2018-04-04 12:26:21 +02:00
Jasvinder Singh
ab3cd2be78 examples/ip_pipeline: remove routing pipeline
Remove routing pipeline.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
2018-04-04 12:26:21 +02:00
Jasvinder Singh
411a5df91d examples/ip_pipeline: remove passthrough pipeline
remove passthrough pipeline.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
2018-04-04 12:26:20 +02:00
Jasvinder Singh
8173863865 table: remove incorrect check for ACL
Remove wrong check for table entry pointer.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
2018-04-04 12:26:20 +02:00
Jasvinder Singh
f0e352ddb0 pipeline: add port in action APIs
This API provides a common set of actions for pipeline input ports to speed
up application development.

Each pipeline input port can be assigned an action handler to be executed
on every input packet during the pipeline execution.

The pipeline library allows the user to define his own input port actions
by providing customized input port action handler. While the user can
still follow this process, this API is intended to provide a quicker
development alternative for a set of predefined actions.

The typical steps to use this API are:
* Define an input port action profile.
* Instantiate the input port action profile to create input port action
  objects.
* Use the input port action to generate the input port action handler
  invoked by the pipeline.
* Use the input port action object to generate the internal data structures
  used by the input port action handler based on given action parameters.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2018-04-04 12:26:07 +02:00
Jasvinder Singh
934db41a31 pipeline: add load balance action
Add implementation of the load balance action.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2018-04-04 12:21:26 +02:00
Jasvinder Singh
2c3558c6bf pipeline: add timestamp action
Add implementation of timestamp action.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2018-04-04 12:21:26 +02:00
Jasvinder Singh
394a0739c8 pipeline: add statistics read action
Add implementation of stats read action

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2018-04-04 12:21:25 +02:00
Jasvinder Singh
625f4d4040 pipeline: add TTL update action
Add implementation of ttl update action.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2018-04-04 12:21:25 +02:00
Jasvinder Singh
a19dc6cd01 pipeline: add NAT action
Add implementation of Network Address Translation(NAT) action.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2018-04-04 12:21:25 +02:00
Jasvinder Singh
871f44164e pipeline: add packet encapsulation action
Add implementation of different type of packet encap
such as vlan, qinq, mpls, pppoe, etc.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2018-04-04 12:21:24 +02:00
Jasvinder Singh
c8ae949197 pipeline: add traffic manager action
Add implementation of traffic manager action.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2018-04-04 12:21:24 +02:00
Jasvinder Singh
7c9e5b9a12 pipeline: add traffic metering action
Add traffic metering action implementation.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2018-04-04 12:21:23 +02:00
Jasvinder Singh
406a2bc0c6 pipeline: get table action params
Add API to specify action related parameters such as action
handler, table entry data size, etc. for the pipeline table.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2018-04-04 12:21:23 +02:00
Jasvinder Singh
654dd41112 pipeline: add table action APIs
This API provides a common set of actions for pipeline tables to speed up
application development.

Each match-action rule added to a pipeline table has associated data
that stores the action context. This data is input to the table
action handler called for every input packet that hits the rule as
part of the table lookup during the pipeline execution.

The pipeline library allows the user to define his own table
actions by providing customized table action handlers (table
lookup) and complete freedom of setting the rules and their data
(table rule add/delete). While the user can still follow this
process, this API is intended to provide a quicker development
alternative for a set of predefined actions.

The typical steps to use this API are:
* Define a table action profile.
* Instantiate the table action profile to create table action objects.
* Use the table action object to generate the pipeline table action
  handlers (invoked by the pipeline table lookup operation).
* Use the table action object to generate the rule data (for the
  pipeline table rule add operation) based on given action parameters.
* Use the table action object to read action data (e.g. stats counters)
  for any given rule.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2018-04-04 12:21:11 +02:00
Gaetan Rivet
78f5a2e93d bus/fslmc: fix find device start condition
If start is set and a device before it matches the data,
this device is returned.

Fixes: c7fe1eea8a ("bus: simplify finding starting point")
Cc: stable@dpdk.org

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2018-04-05 00:45:21 +02:00
Anatoly Burakov
952b207772 eal: provide API for querying valid socket ids
During lcore scan, find all socket ID's and store them, and
provide public API to query valid socket id's. This will break
the ABI, so bump ABI version.

Also, remove deprecation notice corresponding to this change.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
2018-04-05 00:27:13 +02:00
Anatoly Burakov
f05e26051c eal: add IPC asynchronous request
This API is similar to the blocking API that is already present,
but reply will be received in a separate callback by the caller
(callback specified at the time of request, rather than registering
for it in advance).

Under the hood, we create a separate thread to deal with replies to
asynchronous requests, that will just wait to be notified by the
main thread, or woken up on a timer.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Jianfeng Tan <jianfeng.tan@intel.com>
2018-04-04 23:47:59 +02:00
Anatoly Burakov
ce3a731235 eal: rename IPC request as synchronous one
Rename rte_mp_request to rte_mp_request_sync to indicate
that this request will be done synchronously (as opposed to
asynchronous request, which comes in next patch).

Also, fix alphabetical ordering for .map file.

Suggested-by: Thomas Monjalon <thomas@monjalon.net>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Jianfeng Tan <jianfeng.tan@intel.com>
2018-04-04 23:32:21 +02:00
Anatoly Burakov
0891faf5d8 eal: rename IPC sync request to pending request
Originally, there was only one type of request which was used
for multiprocess synchronization (hence the name - sync request).

However, now that we are going to have two types of requests,
synchronous and asynchronous, having it named "sync request" is
very confusing, so we will rename it to "pending request". This
is internal-only, so no externally visible API changes.

Suggested-by: Jianfeng Tan <jianfeng.tan@intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Jianfeng Tan <jianfeng.tan@intel.com>
2018-04-04 23:30:32 +02:00
Pavan Nikhilesh
d8dd31652c common/octeontx: move mbox to common folder
Move commonly used functions across mempool, event and net devices to a
common folder in drivers.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
2018-04-04 23:14:52 +02:00
Pavan Nikhilesh
9c169bad7c drivers: add common folder
Add driver/common folder and skeleton makefile for adding commonly used
functions across mempool, event and net devices.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
2018-04-04 17:40:03 +02:00
Stephen Hemminger
8ea081f381 mbuf: fix truncated strncpy
Gcc-8 discovers issue with platform_mempool_ops.
rte_mbuf_pool_ops.c:26:3: error: ‘strncpy’ output truncated before
  terminating nul copying as many bytes from a string as its length
  [-Werror=stringop-truncation]
  strncpy(mz->addr, ops_name,  strlen(ops_name));

Since the ops_name is already checked for size, using strncpy
here is unnecessary; just use strcpy.

Fixes: a3acc3144a ("mbuf: add pool ops selection functions")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2018-04-04 17:34:20 +02:00
Remy Horton
255d42d5b6 metrics: fix potential missing string termination
Fixes a potential memory overrun detected by Coverity.
This overrun cannot currently happen in practice because
rte_metrics_reg_names() explicitly forces the last name
character to be a NULL terminator.

This patches uses strlcpy instead of strncpy to copy name strings.

Coverity issue: 143434
Fixes: 349950ddb9 ("metrics: add information metrics library")
Fixes: 710cab6f67 ("metrics: fix out of bound access")

Signed-off-by: Remy Horton <remy.horton@intel.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2018-04-04 17:33:08 +02:00
Bruce Richardson
c022cb400e convert snprintf to strlcpy
Since we have support for the strlcpy function in DPDK, replace all
instances where a string is copied using snprintf.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
2018-04-04 17:33:08 +02:00
Bruce Richardson
5364de644a eal: support strlcpy function
The strncpy function is error prone for doing "safe" string copies, so
we generally try to use "snprintf" instead in the code. The function
"strlcpy" is a better alternative, since it better conveys the
intention of the programmer, and doesn't suffer from the non-null
terminating behaviour of it's n'ed brethern.

The downside of this function is that it is not available by default
on linux, though standard in the BSD's. It is available on most
distros by installing "libbsd" package.

This patch therefore provides the following in rte_string_fns.h to ensure
that strlcpy is available there:
* for BSD, include string.h as normal
* if RTE_USE_LIBBSD is set, include <bsd/string.h>
* if not set, fallback to snprintf for strlcpy

Using make build system, the RTE_USE_LIBBSD is a hard-coded value to "n",
but when using meson, it's automatically set based on what is available
on the platform.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
2018-04-04 17:33:08 +02:00