Commit Graph

1409 Commits

Author SHA1 Message Date
Tiwei Bie
e9436f54af pdump: remove deprecated APIs
We already changed to use generic IPC in pdump since below commit:

commit 660098d61f ("pdump: use generic multi-process channel")

The `rte_pdump_set_socket_dir()`, the `path` parameter of
`rte_pdump_init()` and the `enum rte_pdump_socktype` have been
deprecated since then. This commit removes these deprecated
APIs and also bumps the pdump ABI.

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
2018-12-19 01:25:56 +01:00
Dekel Peled
da4d923557 app/testpmd: fix MPLSoGRE encapsulation
In function cmd_set_mplsogre_encap_parsed(), MPLS label value was
set in mplsogre_encap_conf struct without the required offset.
As a result the value was copied incorrectly into
rte_flow_item_mpls struct.

This patch sets MPLS label value in appropriate location at
mplsogre_encap_conf struct, so it is correctly copied to
rte_flow_item_mpls struct.

Fixes: 3e77031be8 ("app/testpmd: add MPLSoGRE encapsulation")
Cc: stable@dpdk.org

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
2018-12-13 17:45:59 +00:00
Dekel Peled
0f79b515fe app/testpmd: fix MPLSoUDP encapsulation
In function cmd_set_mplsoudp_encap_parsed(), MPLS label value was
set in mplsoudp_encap_conf struct without the required offset.
As a result the value was copied incorrectly into
rte_flow_item_mpls struct.

This patch sets MPLS label value in appropriate location at
mplsoudp_encap_conf struct, so it is correctly copied to
rte_flow_item_mpls struct.

Fixes: a1191d39cb ("app/testpmd: add MPLSoUDP encapsulation")
Cc: stable@dpdk.org

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
2018-12-13 17:45:59 +00:00
Saleh Alsouqi
440dbc323e app/testpmd: fix MPLS BoS bit default value
The Bottom-of-Stack (bos) bit of MPLS indicates
whether its the last MPLS layer (1) or not (0).

Indicating that the encapsulating MPLS is the
last MPLS layer in the packet as the default
behavior is more appropriate since multiple
encapsulation actions is not supported.

Fixes: 3e77031be8 ("app/testpmd: add MPLSoGRE encapsulation")
Fixes: 3e77031be8 ("app/testpmd: add MPLSoGRE encapsulation")
Fixes: a1191d39cb ("app/testpmd: add MPLSoUDP encapsulation")
cc: stable@dpdk.org

Signed-off-by: Saleh Alsouqi <salehals@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
2018-12-13 16:31:06 +00:00
Thomas Monjalon
43d162bc16 fix dpdk.org URLs
The DPDK website has a new URL scheme since June 2018.

Cc: stable@dpdk.org

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: John McNamara <john.mcnamara@intel.com>
2018-11-26 20:19:24 +01:00
Thomas Monjalon
ff0633d2b1 app/eventdev: fix possible uninitialized variable
When compiling with -O1, this error can appear:
	app/test-eventdev/test_pipeline_common.c:332:6: error:
	‘ret’ may be used uninitialized in this function

If there is no device, then ret is returned without being initialized.
It is fixed by setting 0 as initial value.

Fixes: 032a965a8f ("app/eventdev: support Tx adapter")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2018-11-23 01:43:47 +01:00
Marko Kovacevic
e772cf1bd0 app/pdump: fix port id storage size
port_id size should be uint16_t,
fix where it is defined as uint8_t

Fixes: f8244c6399 ("ethdev: increase port id range")
Cc: stable@dpdk.org

Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
2018-11-18 22:32:47 +01:00
Jasvinder Singh
5fe5678de9 app/testpmd: fix memory leak for DSCP table
Fix memory leak for dscp table reported by coverity

Coverity issue: 326961
Fixes: 281eeb8afc ("app/testpmd: add commands for metering and policing")
Cc: stable@dpdk.org

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
2018-11-18 22:32:47 +01:00
Jeff Guo
cc1bf3077d app/testpmd: workaround deadlock in hot-unplug callback
Because the user's callback is invoked in eal interrupt callback, the
interrupt callback need to be finished before it can be unregistered
when detaching device. So finish callback soon and use a deferred
removal to detach device is need.

It is a workaround, once the device detaching be moved into the eal in
the future, the deferred removal could be deleted. This patch aim to
add this workaround and refine the function name and the description to
be more explicit and comment the limitation.

Fixes: 2049c5113f ("app/testpmd: use hotplug failure handler")

Signed-off-by: Jeff Guo <jia.guo@intel.com>
2018-11-18 17:17:07 +01:00
Jasvinder Singh
459463ae6c app/testpmd: fix memory allocation for DSCP table
The patch fixes the memory allocation for the meter DSCP table.

Fixes: e63b50162a ("app/testpmd: clean metering and policing commands")
Cc: stable@dpdk.org

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-11-12 17:45:32 +01:00
Jasvinder Singh
8bf02b320e app/testpmd: fix memory leak for TM object
Fixes memory leak for shared shaper object of the traffic manager.

Fixes: 5b590fbe09 ("app/testpmd: add traffic management forwarding mode")
Cc: stable@dpdk.org

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-11-12 17:45:31 +01:00
Ophir Munk
f3698c3d09 app/testpmd: revert setting default RSS
This reverts the patch that enables default RSS action by setting
key=NULL and key_len=0.
In current testpmd implementation a key pointer must exist if
key_len!=0. For example, the following flow rule will cause a
segmentation fault:
flow create 0 <pattern> actions rss queues 0 1 end key_len 40 / end

Fixes: a4391f8bae ("app/testpmd: set default RSS key as null")
Cc: stable@dpdk.org

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-11-14 00:35:53 +01:00
Raslan Darawsheh
2b5651c026 app/testpmd: fix L4 length for UDP checksum
testpmd only sets the L4 len in case of TCP packets.
some PMD's like tap rely on mbuf meta data to calculate csum

This will set the L4 len for UDP packets same as TCP

Fixes: 160c3dc945 ("app/testpmd: introduce IP parsing functions in csum fwd engine")
CC: stable@dpdk.org

Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-11-14 00:35:53 +01:00
Wei Zhao
054075ea90 app/testpmd: fix Rx offload search
There is an error in function search_rx_offload(),
it will break when get unexpected return value from function
rte_eth_dev_rx_offload_name(), but rte_eth_dev_rx_offload_name()
will return some unexpected value indeed.

Fixes: c73a907187 ("app/testpmd: add commands to test new offload API")
Cc: stable@dpdk.org

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Tested-by: Yuan Peng <yuan.peng@intel.com>
2018-11-14 00:35:53 +01:00
Ophir Munk
a4391f8bae app/testpmd: set default RSS key as null
When creating an RSS rule without specifying a key (see [1]) it is
expected that the device will use the default key.
A NULL key is used to indicate to a PMD it should use
its default key, however testpmd assigns a non-NULL dummy key
(see [2]) instead.
This does not enable testing any PMD behavior when the RSS key is not
specified. This commit fixes this limitation by setting key to NULL.

[1]
RSS rule example without specifying a key:
flow create 0 ingress <pattern> / end actions rss queues 0 1 end / end
[2]
Testpmd default key assignment:
.key= "testpmd's default RSS hash key, "
"override it for better balancing"

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-11-05 15:01:25 +01:00
Radu Nicolau
0ae8071784 app/testpmd: fix port status for new bonded devices
Set port status to stopped for newly added devices.

Fixes: 2950a76931 ("bond: testpmd support")
Cc: stable@dpdk.org

Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
2018-11-05 15:01:25 +01:00
Ferruh Yigit
2482a004d6 app/testpmd: fix Tx offload flags
ol_flags can be wrong if DEV_TX_OFFLOAD_VLAN_INSERT is not set in
tx_offloads

Fixes: 3eecba267c ("app/testpmd: cleanup internal Tx offloads flags field")
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
2018-11-05 15:01:25 +01:00
Leah Tekoa
930a030d2a app/testpmd: fix RED byte stats
Y stands for Yellow, R stands for Red.

Fixes: 30ffb4e67e ("app/testpmd: add commands traffic metering and policing")
Cc: stable@dpdk.org

Signed-off-by: Leah Tekoa <leah@ethernitynet.com>
2018-11-05 08:41:07 +01:00
Rosen Xu
c2c15f769a app/testpmd: fix shaper profile parameters
As struct rte_tm_shaper_params defined, the command line of
testpmd should include committed and peak parameters, but
right now the command line doesn't identify whether it's
committed or peak parameter. This patch identifies and
adds the clarify definition

Fixes: bddc2f40b5 ("app/testpmd: add commands for shaper and wred profiles")
Cc: stable@dpdk.org

Signed-off-by: Rosen Xu <rosen.xu@intel.com>
2018-11-05 08:41:03 +01:00
Ferruh Yigit
b74fd6b842 add missing static keyword to globals
Some global variables can indeed be static, add static keyword to them.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2018-10-29 02:01:08 +01:00
Kevin Laatz
57ae0ec626 build: add dependency on telemetry to apps with meson
This patch adds telemetry as a dependecy to all applications. Without these
changes, the --telemetry flag will not be recognised and applications will
fail to run if they want to enable telemetry.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
2018-10-27 15:21:33 +02:00
Jerin Jacob
a72a1ef34e app/testpmd: fix QinQ strip display option
Fix a typo on DEV_RX_OFFLOAD_QINQ_STRIP selection.

Fixes: 0074d02fca ("app/testpmd: convert to new Rx offloads API")
Cc: stable@dpdk.org

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-10-26 22:14:06 +02:00
Thomas Monjalon
4f1ed78ebd app/testpmd: setup attached ports on probe event
After probing is done, each new port must be setup.
The new ports are currently guessed by iterating on ports
matching the devargs string used for probing.

When probing a port, it is possible that one more port probing
get triggered (e.g. PF is automatically probed when probing
a VF representor). Such automatic probing will be caught only on event.

The iterator loop may be replaced by a call from the event callback.
In order to be able to test both modes, a command is added
to choose between iterator and event modes.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
2018-10-26 22:14:06 +02:00
Thomas Monjalon
97b5d8b545 app/testpmd: move ethdev events registration
The callback for ethdev events was registered on port start,
so it was missing some events.

It is now registered at the beginning of the main function.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
2018-10-26 22:14:06 +02:00
Thomas Monjalon
86fa5de1d8 app/testpmd: check not configuring port twice
It is possible to request probing of a device twice,
and possibly get new ports for this device.
However, the ports which were already probed and setup
must not be setup again. That's why it is checked whether
the port is already part of fwd_ports_ids array at the beginning
of the function setup_attached_port().

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
2018-10-26 22:14:06 +02:00
Thomas Monjalon
4f1de450c9 app/testpmd: merge ports list update functions
The arrays ports_ids and fwd_ports_ids require the same kind
of update when some ports are removed or added.

The functions update_fwd_ports() and remove_unused_fwd_ports()
are merged in the new function remove_invalid_ports().
The part for adding new port is moved into setup_attached_port().

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
2018-10-26 22:14:06 +02:00
Thomas Monjalon
f8e5baa266 app/testpmd: check not detaching device twice
The command "port detach" is removing the EAL rte_device
of the ethdev port specified as parameter.
The function name and some comments are updated to make clear
that we are detaching the whole device.

After detaching, the pointer, which maps a port to its device,
is reset. This way, it is possible to check whether a port
is still associated to a (not removed) device.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
2018-10-26 22:14:06 +02:00
Dekel Peled
1e45c908fe app/testpmd: fix metadata API and Tx insertion
Previous patch introduces the Tx metadata feature, with unnecessary
restrictions on data entry.
It also used the metadata in txonly fwd engine only.

This fix removes the data entry restrictions on metadata item.
It also implements callback function to add the metadata in every
Tx packet, sent by any fwd engine.

Fixes: c18feafa19 ("app/testpmd: support metadata as flow rule item")

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
2018-10-26 22:14:06 +02:00
Wei Zhao
3c90743dd3 app/testpmd: support more types for flow RSS
Some user and tester require flow RSS to support more types,
so add "all" and "none" to make configuration more easy for users.

Tested-by: Yuan Peng <yuan.peng@intel.com>
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
2018-10-26 22:14:05 +02:00
Thomas Monjalon
c9cce42876 ethdev: remove deprecated attach/detach functions
The hotplug attach/detach features are implemented in EAL layer.
There is a new ethdev iterator to retrieve ports from ethdev layer.

As announced earlier, the (buggy) ethdev functions are now removed.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-10-26 22:14:05 +02:00
Ori Kam
3e77031be8 app/testpmd: add MPLSoGRE encapsulation
Example for MPLSoGRE tunnel:
ETH / IPV4 / GRE / MPLS / IP / L4..L7

In order to encapsulate such a tunnel there is a need to remove L2 of
the inner packet and encap the remaining tunnel, this is done by
applying 2 rte flow commands l2_decap followed by mplsogre_encap.
Both commands must appear in the same flow, and from the point of the
packet it both actions are applied at the same time. (There is no part
where a packet doesn't have L2 header).

Decapsulating such a tunnel works the other way, first we need to decap
the outer tunnel header and then apply the new L2.
So the commands will be mplsogre_decap / l2_encap

Due to the complex encapsulation of MPLSoGRE flow action and
based on the fact testpmd does not allocate memory, this patch adds a
new command in testpmd to initialise a global structure containing the
necessary information to make the outer layer of the packet.  This same
global structures will then be used by the flow commands in testpmd when
the action mplsogre_encap, mplsogre_decap, will be parsed, at this
point, the conversion into such action becomes trivial.

Signed-off-by: Ori Kam <orika@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-10-26 22:14:05 +02:00
Ori Kam
a1191d39cb app/testpmd: add MPLSoUDP encapsulation
MPLSoUDP is an example for L3 tunnel encapsulation.

L3 tunnel type is a tunnel that is missing the layer 2 header of the
inner packet.

Example for MPLSoUDP tunnel:
ETH / IPV4 / UDP / MPLS / IP / L4..L7

In order to encapsulate such a tunnel there is a need to remove L2 of
the inner packet and encap the remaining tunnel, this is done by
applying 2 rte flow commands l2_decap followed by mplsoudp_encap.
Both commands must appear in the same flow, and from the point of the
packet it both actions are applied at the same time. (There is no part
where a packet doesn't have L2 header).

Decapsulating such a tunnel works the other way, first we need to decap
the outer tunnel header and then apply the new L2.
So the commands will be mplsoudp_decap / l2_encap

Due to the complex encapsulation of MPLSoUDP and L2  flow actions and
based on the fact testpmd does not allocate memory, this patch adds a
new command in testpmd to initialise a global structures containing the
necessary information to make the outer layer of the packet.  This same
global structures will then be used by the flow commands in testpmd when
the action mplsoudp_encap, mplsoudp_decap, l2_encap, l2_decap, will be
parsed, at this point, the conversion into such action becomes trivial.

The l2_encap and l2_decap actions can also be used for other L3 tunnel
types.

Signed-off-by: Ori Kam <orika@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-10-26 22:14:05 +02:00
Dekel Peled
c18feafa19 app/testpmd: support metadata as flow rule item
As described in [1], this series adds option to set metadata value
as match pattern when creating a new flow rule.

This patch introduces additional options in testpmd commands:
- New item type "meta" "data"
- New per-port offload flag "match_metadata".

It also adds commands to configure the tx_metadata value to use:
- New 'config' command takes a 32 bit value and stores it per port:
	port config <port_id> tx_metadata <value>
  testpmd will add to any Tx packet sent from this port the metadata
  value, and set ol_flags accordingly.
- A matching 'show' command is added to read the configured value:
	port config <port_id> tx_metadata <value>

[1] "ethdev: support metadata as flow rule criteria"

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-10-26 22:14:05 +02:00
Thomas Monjalon
23ea57a2a0 ethdev: complete closing of port
After closing a port, it cannot be restarted.
So there is no reason to not free all associated resources.

The last step was done with rte_eth_dev_detach() which is deprecated.
Instead of blindly removing the associated rte_device, the driver should
check if no more port (ethdev, cryptodev, etc) is open for the device.

The last ethdev freeing which were done by rte_eth_dev_detach(),
are now done at the end of rte_eth_dev_close() if the driver supports
the flag RTE_ETH_DEV_CLOSE_REMOVE.
There will be a transition period for PMDs to enable this new flag
and migrate to the new behaviour.
When enabling RTE_ETH_DEV_CLOSE_REMOVE, the PMD must free all its
private resources for the port, in its dev_close function.
It is advised to call the dev_close function in the remove function
in order to support removing a device without closing its ports.

Some drivers does not allocate MAC addresses dynamically or separately.
In those cases, the pointer is set to NULL, in order to avoid wrongly
freeing them in rte_eth_dev_release_port().

A closed port will have the state RTE_ETH_DEV_UNUSED which is
considered as invalid by rte_eth_dev_is_valid_port().
So validity is not checked anymore for closed ports in testpmd.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-10-26 22:14:05 +02:00
Thomas Monjalon
3f4a837047 app/testpmd: allow detaching a port not closed
The testpmd application aim is for testing;
so order of operations should not be enforced.

There was a test to forbid detaching before closing a port.
However, it may interesting to test what happens in such case.
It is possible for a PMD to automatically close the port when detaching.

in order to avoid a crash, it is checked that the port must be stopped
before detaching (as for closing).

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
2018-10-26 22:14:05 +02:00
Wisam Jaddo
ce6959bf79 app/testpmd: update port list for multiple removals
When detaching a port, the full rte_device is removed.
If the rte_device was hosting several ports,
the testpmd list of ports must be updated for multiple removals.

Signed-off-by: Wisam Jaddo <wisamm@mellanox.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
2018-10-26 22:14:05 +02:00
Phil Yang
a569af2481 app/testpmd: reserve NUMA node per port and per ring
If user explicitly requested memory to be allocated from a socket via
`port-numa-config` and `ring-numa-config`, and if that socket is
valid, add that socket into socket_ids[] so that mempool allocated for
that socket.

Fixes: dbfb8ec709 ("app/testpmd: optimize mbuf pool allocation")
Cc: stable@dpdk.org

Suggested-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-10-26 22:14:05 +02:00
Anatoly Burakov
5d7b673d5f mk: build with _GNU_SOURCE defined by default
We use _GNU_SOURCE all over the place, but often times we miss
defining it, resulting in broken builds on musl. Rather than
fixing every library's and driver's and application's makefile,
fix it by simply defining _GNU_SOURCE by default for all
builds.

Remove all usages of _GNU_SOURCE in source files and makefiles,
and also fixup a couple of instances of using __USE_GNU instead
of _GNU_SOURCE.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
2018-10-22 11:28:27 +02:00
Raslan Darawsheh
b5b38ed878 app/testpmd: set packet dump based on verbosity level
when changing verbosity level it will configure rx/tx callbacks to dump
packets based on the verbosity value as following:
    1- dump only received packets:
       testpmd> set verbose 1
    2- dump only sent packets:
       testpmd> set verbose 2
    3- dump sent and received packets:
       testpmd> set verbose (any number > 2)
    4- disable dump
       testpmd> set verbose 0

Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
2018-10-18 10:24:39 +02:00
Raslan Darawsheh
c77ad9de2a app/testpmd: add packet dump callbacks
add new rx/tx callback functions to be used for dumping the packets.

Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
2018-10-18 10:24:39 +02:00
Raslan Darawsheh
d862c45b59 app/testpmd: move dumping packets to a separate function
verbosity for the received/sent packets is needed in all of the
forwarding engines so moving it to be in a separate function

Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
2018-10-18 10:24:39 +02:00
Phil Yang
effdb8bbb0 app/testpmd: fix physical port socket initialization
Once the lcore list setting excluded the socket which physical device
attached, it will cause failure. Meanwhile, it will disable Testpmd
cross NUMA scenario.

Fixes: dbfb8ec709 ("app/testpmd: optimize mbuf pool allocation")
Cc: stable@dpdk.org

Signed-off-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2018-10-18 10:24:39 +02:00
Xiaoyu Min
4dff9e2976 app/testpmd: add commands to modify MAC address
add commands to support following actions:

- RTE_FLOW_ACTION_TYPE_SET_MAC_SRC
- RTE_FLOW_ACTION_TYPE_SET_MAC_DST

Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2018-10-18 10:24:39 +02:00
Xiaoyu Min
708d0bcb72 app/testpmd: add commands to modify TTL
add commands which supports following TTL actions:
- RTE_FLOW_ACTION_TYPE_DEC_TTL
- RTE_FLOW_ACTION_TYPE_SET_TTL

Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2018-10-18 10:24:39 +02:00
Phil Yang
2984133643 app/testpmd: fix vdev socket initialization
The cmdline settings of port-numa-config and rxring-numa-config have
been flushed by the following init_config. If we don't configure the
port-numa-config, the virtual device will allocate the device ports to
socket 0. It will cause failure when the socket 0 is unavailable.

eg:
testpmd -l <cores from socket 1> --vdev net_pcap0,iface=lo
--socket-mem=64 -- --numa --port-numa-config="(0,1)"
--ring-numa-config="(0,1,1),(0,2,1)" -i

...
Configuring Port 0 (socket 0)
Failed to setup RX queue:No mempool allocation on the socket 0
EAL: Error - exiting with code: 1
  Cause: Start ports failed

Fix by allocate the devices port to the first available socket or the
socket configured in port-numa-config.

Fixes: 487f9a592a ("app/testpmd: fix NUMA structures initialization")
Fixes: 20a0286fd2 ("app/testpmd: check socket id validity")
Cc: stable@dpdk.org

Signed-off-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-10-18 10:24:39 +02:00
Thomas Monjalon
5e046832f1 ethdev: rename memzones allocated for DMA
The helper rte_eth_dma_zone_reserve() is called by PMDs
when probing a new port.
It creates a new memzone with an unique name.
The name of this memzone was using the name of the driver
doing the probe.

In order to avoid assigning the driver before the end of the probing,
the driver name is removed from these memzone names.
The ethdev name (data->name) is not used because it may be too long
and may be not set at this stage of probing.

Syntax of old name: <driver>_<ring>_<port>_<queue>
Syntax of new name: eth_p<port>_q<queue>_<ring>

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Tested-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-10-17 10:26:59 +02:00
Jeff Guo
89ecd11052 eal: modify device event process function
This patch modify the device event callback process function name to be
more explicit, change the variable to be const. And more, because not only
eal device helper will use the callback, but also vfio bus will use the
callback to handle hot-unplug, so exposure the API out from private eal.
The bus drivers and eal device would directly use this API to process
device event callback.

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
2018-10-15 22:55:55 +02:00
Jeff Guo
2049c5113f app/testpmd: use hotplug failure handler
This patch use testpmd for example, to show how an app smoothly handle
failure when device be hot-unplug. Except that app should enabled the
device event monitor and register the hotplug event’s callback, it also
need enable hotplug handle mechanism before running. Once app detect the
removal event, the hot-unplug callback would be called. It will first stop
the packet forwarding, then stop the port, close the port, and finally
detach the port to clean the device and release the resources.

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
2018-10-15 22:19:00 +02:00
Krzysztof Kanas
6673fe0ce2 app/testpmd: add TM commands to mark packets
Add following testpmd run-time commands to support test of TM packet
marking:

set port tm mark ip_ecn   <port_id> <green> <yellow> <red>
set port tm mark ip_dscp  <port_id> <green> <yellow> <red>
set port tm mark vlan_dei <port_id> <green> <yellow> <red>

Signed-off-by: Krzysztof Kanas <krzysztof.kanas@caviumnetworks.com>
2018-10-08 17:53:03 +02:00
Jasvinder Singh
a0f367eb06 app/testpmd: fix metering and policing commands
Fixes bad arguments error for cli commands related to adding meter
profile for srtcm_rfc2697, trtcm_rfc2698 and trtcm_rfc4115.

error log:
testpmd> add port meter profile trtcm_rfc2698 2 0 3125000000
3125000000 2500000 2500000
Bad arguments

Fixes: 30ffb4e67e ("app/testpmd: add commands traffic metering and policing")
Cc: stable@dpdk.org

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
2018-10-08 17:52:48 +02:00