Commit Graph

211 Commits

Author SHA1 Message Date
Jasvinder Singh
7959831b4d examples/ip_pipeline: replace strncpy with strlcpy
The destination string may not have a null termination if
the source string's length is equal to the sizeof.

Fix by replacing strncpy with strlcpy that guarantees NULL-termination.

[merged several commits]

Coverty issue: 272606
Fixes: d75c371e9b ("examples/ip_pipeline: add pipeline object")
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>

Coverty issue: 272594
Fixes: 133c2c6565 ("examples/ip_pipeline: add link object")
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>

Coverty issue: 272603
Fixes: 2f74ae28e2 ("examples/ip_pipeline: add tap object")
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>

Coverity issue: 272588
Fixes: 6bfe74f8c9 ("examples/ip_pipeline: add mempool object")
Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Reviewed-by: Jasvinder Singh <jasvinder.singh@intel.com>

Coverity issue: 272592
Fixes: 25961ff3bc ("examples/ip_pipeline: add traffic manager object")
Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Reviewed-by: Jasvinder Singh <jasvinder.singh@intel.com>

Coverity issue: 272562
Fixes: 9a408cc8ac ("examples/ip_pipeline: add KNI object")
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Reviewed-by: Jasvinder Singh <jasvinder.singh@intel.com>

Coverity issue: 272580
Fixes: 719374345c ("examples/ip_pipeline: add action profile objects")
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Reviewed-by: Jasvinder Singh <jasvinder.singh@intel.com>

Coverity issue: 272572
Fixes: 719374345c ("examples/ip_pipeline: add action profile objects")
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>

Coverity issue: 272563
Fixes: 8245472c58 ("examples/ip_pipeline: add sw queue object")
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2018-05-08 13:35:10 +02:00
Fan Zhang
61e41fb6e7 examples/ip_pipeline: remove dead code in table command
Coverity issue: 272567
Fixes: d75c371e9b ("examples/ip_pipeline: add pipeline object")

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Reviewed-by: Jasvinder Singh <jasvinder.singh@intel.com>
2018-05-08 13:16:10 +02:00
Reshma Pattan
1d27b0f2c2 examples/ip_pipeline: fix uninitialized KNI parameter
Using uninitialized value p.thread_id when calling kni_create.
Initialize the kni_params object to 0.

Coverity issue: 272569
Fixes: 9a408cc8ac ("examples/ip_pipeline: add KNI object")

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Reviewed-by: Jasvinder Singh <jasvinder.singh@intel.com>
2018-05-08 13:14:05 +02:00
Fan Zhang
84a27d8913 examples/ip_pipeline: fix uninitialized link parameter
Coverity issue: 272575
Fixes: 133c2c6565 ("examples/ip_pipeline: add link object")

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Reviewed-by: Jasvinder Singh <jasvinder.singh@intel.com>
2018-05-08 13:12:39 +02:00
Jasvinder Singh
9b60795143 examples/ip_pipeline: fix leak on DSCP parsing
Close the file stream before returning from the function to avoid
memory leak.

Coverity issue: 272605
Fixes: 2b82ef4861 ("examples/ip_pipeline: add DSCP table update command")

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
2018-05-08 13:10:41 +02:00
Reshma Pattan
0015ea2767 examples/ip_pipeline: fix leak on tap creation failure
Close tap device fd before returning upon failures.

Coverity issue: 272576
Fixes: 2f74ae28e2 ("examples/ip_pipeline: add tap object")

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Reviewed-by: Jasvinder Singh <jasvinder.singh@intel.com>
2018-05-08 13:09:20 +02:00
Kevin Laatz
89668b1c75 examples/ip_pipeline: fix leak on connection error
Closing the fd_server file descriptor on error to fix the resource leak.

Coverity issue: 272587
Fixes: 4bbf8e30aa ("examples/ip_pipeline: add CLI interface")

Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Reviewed-by: Jasvinder Singh <jasvinder.singh@intel.com>
2018-05-08 13:06:16 +02:00
Thomas Monjalon
a9dbe18022 fix ethdev port id validation
Some DPDK applications wrongly assume these requirements:
    - no hotplug, i.e. ports are never detached
    - all allocated ports are available to the application

Such application assume a valid port index is in the range [0..count[.

There are three consequences when using such wrong design:
    - new ports having an index higher than the port count won't be valid
    - old ports being detached (RTE_ETH_DEV_UNUSED) can be valid

Such mistake will be less common with growing hotplug awareness.
All applications and examples inside this repository - except testpmd -
must be fixed to use the function rte_eth_dev_is_valid_port.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2018-04-18 00:37:05 +02:00
Ferruh Yigit
cd8c7c7ce2 ethdev: replace bus specific struct with generic dev
Public struct rte_eth_dev_info has a "struct rte_pci_device" field in it
although it is common for all ethdev in all buses.

Replacing pci specific struct with generic device struct and updating
places that are using pci device in a way to get this information from
generic device.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: David Marchand <david.marchand@6wind.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2018-04-14 00:41:44 +02:00
Jasvinder Singh
d389f9a352 examples/ip_pipeline: skip in FreeBSD build
IP_Pipeline app is not supported in FreeBSD environment. Therefore,
skip it while building the sample apps on FreeBSD.

Fixes: 4bbf8e30aa ("examples/ip_pipeline: add CLI interface")
Fixes: 2f74ae28e2 ("examples/ip_pipeline: add tap object")

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2018-04-10 14:41:01 +02:00
Jasvinder Singh
86be4becc5 examples/ip_pipeline: add ECMP route example
Add example to build pipeline to demonstrate equal-cost multi-path
routing example.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
2018-04-05 19:00:23 +02:00
Jasvinder Singh
085c3d8c4d examples/ip_pipeline: fix load balance table action
Fix bug in load balance action for pipeline table.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
2018-04-05 19:00:22 +02:00
Jasvinder Singh
1286b7af1b examples/ip_pipeline: add flow classification example
Add example to build pipeline with hash table to classify the
ingress traffic.

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:22 +02:00
Jasvinder Singh
f2d324ef75 examples/ip_pipeline: add firewall example
Add example to built pipeline with ACL table to demonstrate
the firewall operation.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
2018-04-05 19:00:22 +02:00
Jasvinder Singh
5f7de2559e examples/ip_pipeline: add route example
Add example to built pipeline with LPM table to demonstrate layer 3
routing.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
2018-04-05 19:00:22 +02:00
Jasvinder Singh
cf69b99171 examples/ip_pipeline: add TAP port example
Add example to illustrate the pipeline functioning with TAP
interface.

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:21 +02:00
Jasvinder Singh
ada399857a examples/ip_pipeline: add KNI port example
Add example to illustrate the pipeline functioning with KNI
interface.

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:21 +02:00
Jasvinder Singh
2df8535bc4 examples/ip_pipeline: add l2fwd example
This patch add the configuration file for l2fwd example. It
includes commands to build the packet processing stage (pipeline),
defining action, add rules to its table, etc.

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:21 +02:00
Jasvinder Singh
802755dca3 examples/ip_pipeline: add load balance action command
Add command for load balance action.

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

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
2018-04-05 19:00:20 +02:00
Jasvinder Singh
2b82ef4861 examples/ip_pipeline: add DSCP table update command
Add command to update the dscp table for traffic meter and traffic
manager.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
2018-04-05 19:00:20 +02:00
Jasvinder Singh
e92058d604 examples/ip_pipeline: add meter stats command
Add command to read traffic meter stats.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
2018-04-05 19:00:20 +02:00
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
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