Commit Graph

277 Commits

Author SHA1 Message Date
Thomas Monjalon
a3f34a98b7 log: deprecate history dump
The log history uses rte_mempool. In order to remove the mempool
dependency in EAL (and improve the build), this feature is deprecated.
The ABI is kept but the behaviour is now voided because it seems this
function was not used. The history can be read from syslog.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: David Marchand <david.marchand@6wind.com>
2016-06-10 15:08:57 +02:00
Pablo de Lara
b38bb262a4 app/testpmd: fix typo when closing port
Fixes: ce8d561418 ("app/testpmd: add port configuration settings")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-06-08 22:38:53 +02:00
Jerin Jacob
7fdb263bbb app/testpmd: prefetch data in the forwarding loop
prefetch the next packet data address in advance in forwarding loop
for performance improvement.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-06-08 22:38:53 +02:00
Olivier Matz
d1eb542e05 app/testpmd: log mbuf pool creation
Enhance the logs related to mbuf pool creation. Display an info level
log when creating the mbuf, and display the error as a string on failure.

After the patch, we have:

  [...]
  EAL:   probe driver: 8086:10fb rte_ixgbe_pmd
  USER1: create a new mbuf pool <mbuf_pool_socket_0>: n=331456, \
      size=2176, socket=0
  EAL: Error - exiting with code: 1
    Cause: Creation of mbuf pool for socket 0 failed: Cannot allocate \
      memory

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-06-08 22:38:53 +02:00
Maciej Czekaj
faac4bff87 app/testpmd: add Tx flags in config command
"port config all txqflags <value>" allows for
specifying txq_flags value in command line.

Signed-off-by: Maciej Czekaj <maciej.czekaj@caviumnetworks.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-06-08 22:38:53 +02:00
Maciej Czekaj
7903072cac app/testpmd: add scatter enabling in config command
"port config all scatter on|off" allows for
controlling rxmode.enable_scatter in command line.

Signed-off-by: Maciej Czekaj <maciej.czekaj@caviumnetworks.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-06-08 22:38:52 +02:00
Maciej Czekaj
0499793854 app/testpmd: add scatter enabling option
This parameter allows for controlling rxmode.enable_scatter
which in turn allow for multi-segment packet receive tests.

Signed-off-by: Maciej Czekaj <maciej.czekaj@caviumnetworks.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-06-08 22:38:52 +02:00
Olivier Matz
b19a0c75a0 app/testpmd: remove anonymous mempool code
Now that mempool library provide functions to populate with anonymous
mmap'd memory, we can remove this specific code from test-pmd.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2016-05-19 14:40:14 +02:00
Olivier Matz
f49e858580 mempool: rename object constructor typedef
This commit renames mempool_obj_ctor_t as mempool_obj_cb_t.

In next commits, we will add the ability to populate the
mempool and iterate through objects using the same function.
We will use the same callback type for that. As the callback is
not a constructor anymore, rename it into rte_mempool_obj_cb_t.

The rte_mempool_obj_iter_t that was used to iterate over objects
will be removed in next commits.

No functional change.
In this commit, the API is preserved through a compat typedef.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2016-05-19 14:40:12 +02:00
Olivier Matz
fbfd99551c mbuf: add raw allocation function
Many drivers provide their own implementation of rte_mbuf_raw_alloc(),
duplicating the code. Introduce a new public function in rte_mbuf to
allocate a raw mbuf (uninitialized).

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2016-05-17 08:31:33 +02:00
Tomasz Kulasek
331c617bfb app/testpmd: fix string overrun in engines listing
CID 13307 (#1 of 1): Copy into fixed size buffer (STRING_OVERFLOW)
fixed_size_dest: You might overrun the 128 byte fixed-size string fwd_modes
by copying fwd_eng->fwd_mode_name without checking the length.

Fixes: 769ce6b178 ("app/testpmd: list forwarding engines")

Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
2016-04-27 17:41:47 +02:00
Christian Ehrhardt
bece7b6cf6 app/testpmd: fix running without Xen whereas enabled
With LIBRTE_PMD_XENVIRT enabled testpmd is built in a way to ONLY work
in XEN environments.
It will surface as:
   PMD: gntalloc: ioctl error
   EAL: Error - exiting with code: 1
     Cause: Creation of mbuf pool for socket 0 failed

With LIBRTE_PMD_XENVIRT enabled this now tries the xen style grant
table allocation, but falls back gracefully for the normal allocation.

The only thing left in the log will be the
   PMD: gntalloc: ioctl error

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
2016-04-11 16:44:15 +02:00
Thomas Monjalon
b2feed01d6 ethdev: add 100G link speed
The link speed configuration is now done with bitmaps so 100G speed
requires only a new bit flag.
The actual link speed is a number so its size must be increased from
16-bit to 32-bit.

Signed-off-by: Marc Sune <marcdevel@gmail.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Tested-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Tested-by: Matej Vido <vido@cesnet.cz>
2016-04-01 21:38:34 +02:00
Marc Sune
82113036e4 ethdev: redesign link speed config
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>
2016-04-01 21:38:34 +02:00
Marc Sune
39fd068a27 ethdev: rename link speed constants
The speed numbers ETH_LINK_SPEED_ are renamed ETH_SPEED_NUM_.
The prefix ETH_LINK_SPEED_ is kept for AUTONEG and will be used
for bit flags in next patch.

Signed-off-by: Marc Sune <marcdevel@gmail.com>
2016-04-01 21:38:34 +02:00
Marc Sune
88fbedcd5e app/testpmd: move speed and duplex parsing in a function
The code for checking and parsing speed/duplex was duplicated.
The new function is also checking the speed/duplex combination.

Signed-off-by: Marc Sune <marcdevel@gmail.com>
2016-04-01 21:38:34 +02:00
Thomas Monjalon
09419f235e ethdev: use constants for link state
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>
2016-04-01 21:38:34 +02:00
Marvin Liu
edc845bd53 app/testpmd: fix build on FreeBSD
Build log:
/root/dpdk/app/test-pmd/cmdline.c:6687:45: error: no member named
's6_addr32' in 'struct in6_addr'
    rte_be_to_cpu_32(res->ip_value.addr.ipv6.s6_addr32[i]);

This is caused by macro "s6_addr32" not defined on FreeBSD and testpmd
swap big endian parameter to host endian. Move the swap action to i40e
ethdev will fix this issue.

Fixes: 7b1312891b ("ethdev: add IP in GRE tunnel")

Signed-off-by: Marvin Liu <yong.liu@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Tested-by: Bruce Richardson <bruce.richardson@intel.com>
2016-03-25 19:52:59 +01:00
Jingjing Wu
01c5e0044f app/testpmd: add VLAN in flow director input set
This patch extends the commands for changing flow director filter's input
set. It adds vlan as a possible filter input field.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2016-03-25 19:01:38 +01:00
Jingjing Wu
28d62131a1 app/testpmd: extend flow director input set commands
This patch extends commands for changing a flow director filter's input
set. It adds tos, protocol and ttl as filter's input fields, and removes
the words selection from flex payloads.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2016-03-25 19:01:38 +01:00
Tomasz Kulasek
a85ad367ac app/testpmd: fix build with icc
This patch fixes error #188: enumerated type mixed with another type,
when uint32_t is casted on enum type in icc.

Fixes: 05f1b9c82e ("app/testpmd: add commands for L2 tunnel config")

Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
2016-03-22 18:12:33 +01:00
Igor Ryzhov
86057c9992 ethdev: remove missed packets from error counter
Comment for "ierrors" counter says that it counts erroneous received
packets. But for some reason "imissed" counter is added to "ierrors"
counter in most drivers.
It is a mistake, because missed packets are obviously not received.
This patch fixes it.

Fixes: 70bdb18657 ("ethdev: add Rx error counters for missed, badcrc and badlen packets")
Fixes: 6bfe648406 ("i40e: add Rx error statistics")
Fixes: 856505d303 ("cxgbe: add port statistics")

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2016-03-22 11:07:28 +01:00
Reshma Pattan
5a8fb55c48 app/testpmd: support unidirectional configuration
Added testpmd support to validate zero nb_rxq/nb_txq
changes of ethdev (d505ba8).

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-03-13 16:22:55 +01:00
Xutao Sun
7b1312891b ethdev: add IP in GRE tunnel
Signed-off-by: Xutao Sun <xutao.sun@intel.com>
Signed-off-by: Jijiang Liu <jijiang.liu@intel.com>
2016-03-13 15:27:20 +01:00
Xutao Sun
dd76f93c2d ethdev: rework tunnel filtering structure
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>
2016-03-13 15:26:55 +01:00
Wenzhuo Lu
1cbe755fef ethdev: rename UDP tunnel port functions
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>
2016-03-13 11:44:33 +01:00
Wenzhuo Lu
0eec728ec9 app/testpmd: add commands for E-tag operation
Add the CLIs to support the E-tag operation.
1, Offloading of E-tag insertion and stripping.
2, Forwarding the E-tag packets to pools based on the GRP and E-CID_base.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Shaopeng He <shaopeng.he@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Tested-by: Yong Liu <yong.liu@intel.com>
2016-03-11 23:25:58 +01:00
Wenzhuo Lu
05f1b9c82e app/testpmd: add commands for L2 tunnel config
Add CLIs to config ether type of l2 tunnel, and to enable/disable
a type of l2 tunnel.
Now only e-tag tunnel is supported.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Shaopeng He <shaopeng.he@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Tested-by: Yong Liu <yong.liu@intel.com>
2016-03-11 23:25:58 +01:00
Helin Zhang
19b16e2f64 ethdev: add vlan type when setting ether type
In order to set ether type of VLAN for single VLAN, inner
and outer VLAN, the VLAN type as an input parameter is added
to 'rte_eth_dev_set_vlan_ether_type()'.
In addition, corresponding changes in e1000, ixgbe and i40e
are also added.

It is an ABI break but ethdev library is already bumped for 16.04.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-03-11 22:21:06 +01:00
Stephen Hurd
f54fe5ee31 app/testpmd: fix numa socket detection
Previously, max_socket was set to the highest numbered socket with
an enabled lcore.  The intent is to set it to the highest socket
regardless of it being enabled.

Fixes: 7acf894d07 ("app/testpmd: detect numa socket count")

Signed-off-by: Stephen Hurd <shurd@broadcom.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-03-05 20:09:31 +01:00
Wang Xiao W
6a34f91690 app/testpmd: fix error message when setting Tx VLAN
When using testpmd, sometimes we forget the right order of port_id and
vid in "tx_vlan set (port_id) vlan_id[, vlan_id_outer]\n" command, and
input "tx_vlan set 51 0", we'll get a strange prompt saying "Error, as
QinQ has been enabled.".

In cmd_tx_vlan_set_parsed function, the first thing we do is checking
the port's vlan_offload capability, rather than checking validity of the
port_id, therefore if it's an invalid port_id we'll get the above wrong
message. We should always make sure that we get a valid port_id before
we do other things.

It's the similar issue for cmd_tx_vlan_set_qinq_parsed function.

Fixes: 92ebda07ee ("app/testpmd: add qinq stripping and insertion")

Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-03-05 19:57:29 +01:00
Jingjing Wu
1409f127d7 ethdev: fix byte order consistency of flow director
Fixed issue of byte order in ethdev library that the structure
for setting fdir's mask and flow entry is inconsist and made
inputs of mask be in big endian.

Fixes: 2d4c1a9ea2 ("ethdev: add new flow director masks")
Fixes: 76c6f89e80 ("ixgbe: support new flow director masks")

Reported-by: Yaacov Hazan <yaacovh@mellanox.com>
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Zhe Tao <zhe.tao@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-03-04 16:50:58 +01:00
Nelio Laranjeiro
a9963a86b2 ethdev: increase RETA entry size
Several NICs can handle 512 entries/queues in their RETA table,
an 8 bit field is not large enough for them.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2016-03-03 20:39:47 +01:00
Huawei Xie
693f715da4 remove extra parentheses in return statement
fix the error reported by checkpatch:
  "ERROR: return is not a function, parentheses are not required"

remove parentheses in return like:
  "return (logical expressions)"

remove parentheses in return a function like:
  "return (rte_mempool_lookup(...))"

Fixes: 6307b909b8 ("lib: remove extra parenthesis after return")

Signed-off-by: Huawei Xie <huawei.xie@intel.com>
2016-02-10 15:47:50 +01:00
Zhihong Wang
d3a274ce9d app/testpmd: handle SIGINT and SIGTERM
Handle SIGINT and SIGTERM in testpmd.

Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
2016-01-27 17:06:51 +01:00
Jingjing Wu
d536ac17d8 app/testpmd: fix dead code
Coverity issue (CID 119254): Control flow issues (DEADCODE).

Fixes: 1a572499be ("app/testpmd: setup DCB forwarding based on traffic class")

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
2015-12-15 18:06:58 +01:00
Pablo de Lara
2704ad28ad app/testpmd: swap MAC in IEEE1588 forwarding
IEEE1588 forwarding mode uses same port to receive and transmit packets.
In this mode, the MAC address in the packets are not touched,
and therefore, packets could be sent with the same destination
MAC address as the MAC address of the port that is transmitting,
which causes the packet to be dropped in some NICs.

In order to avoid this scenario, MAC addresses are swapped
before packet is sent out.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
2015-12-10 22:20:08 +01:00
Stephen Hemminger
6c76533ccf replace bzero with memset
The standard for DPDK is to use memset() not bzero which
is a leftover BSD-ism.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2015-12-07 04:57:16 +01:00
Konstantin Ananyev
57ccb27808 app/testpmd: add description of queue info command
Fixes: ab3257e13d ("app/testpmd: add command to display queue info")

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2015-12-07 04:14:59 +01:00
Pablo de Lara
8a45731c02 app/testpmd: add nanosecond output for ieee1588
Testpmd was only printing out second values when printing
RX/TX timestamp value, instead of both second and nanoseconds.
Since resolution of time counters is in nanoseconds,
testpmd should print out both.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Reviewed-by: John McNamara <john.mcnamara@intel.com>
2015-11-13 17:44:43 +01:00
Stephen Hemminger
f72a0fa627 app/testpmd: remove references to deprecated statistics
Some of the statistics are deprecated, so don't test them.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2015-11-12 23:05:20 +01:00
Konstantin Ananyev
79bec05b32 app/testpmd: add ability to split outgoing packets
For CSUM forwarding mode add ability to copy & split outgoing packet
into the new mbuf that consists of multiple segments.
For TXONLY and CSUM forwarding modes add ability to make number of
segments in the outgoing packet to vary on a per packet basis.
Number of segments and size of each segment is controlled by
'set txpkts' command.
Split policy is controlled by 'set txsplit' command.
Possible values are: on | off | rand.
Tha allows to increase test coverage for TX PMD codepaths.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2015-11-12 00:22:26 +01:00
Helin Zhang
64ee9e4815 app/testpmd: fix build with icc 13
It fixes compile issue on ICC 13.0.0.

Error logs:
app/test-pmd/cmdline.c(8160): error #188: enumerated type mixed
with another type
    entry.input.flow.tunnel_flow.tunnel_type =
        str2fdir_tunneltype(res->tunnel_type);

Fixes: 53b2bb9b7e ("app/testpmd: new flow director commands")

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2015-11-11 19:38:11 +01:00
David Marchand
695ae2788e app/testpmd: fix icmp echo Tx queues
icmp echo forward engine relies on the core rank rather than the number of
queues available.
This fix is still wrong, because if we set a nb-rxq > nb-txq, then we will
use an invalid txq, but with this, we are aligned on other fwd engines.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2015-11-10 17:22:07 +01:00
Wenzhuo Lu
2892fcc14e app/testpmd: fix flow director help and doc
After implementing the fdir new modes for x550, the CLIs are modified.
Forgot to update the related help info and doc.

Fixes: 53b2bb9b7e ("app/testpmd: new flow director commands")

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2015-11-10 17:06:53 +01:00
Jingjing Wu
e6a68c0133 app/testpmd: extend commands for flow director in VF
This patch extends commands to support filtering in VFs of flow director.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2015-11-04 13:41:00 +01:00
Helin Zhang
34a068db14 app/testpmd: add command to select filtering GRE key size
Test commands are added to support selecting different length of GRE key.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Signed-off-by: Andrey Chilikin <andrey.chilikin@intel.com>
2015-11-04 00:45:54 +01:00
Helin Zhang
c5fcdd0489 app/testpmd: add commands for input fields of RSS and flow director
Test commands are added to support selecting input set, or adding
new input set per different pctype.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Signed-off-by: Andrey Chilikin <andrey.chilikin@intel.com>
2015-11-04 00:23:35 +01:00
Konstantin Ananyev
ab3257e13d app/testpmd: add command to display queue info
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
2015-11-02 00:14:52 +01:00
Jingjing Wu
cd80f411a7 app/testpmd: add command to display DCB info
This patch adds a command to display DCB info in ports.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Jijiang Liu <jijiang.liu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-11-01 14:52:06 +01:00