Commit Graph

255 Commits

Author SHA1 Message Date
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
Jingjing Wu
1a572499be app/testpmd: setup DCB forwarding based on traffic class
This patch changes the testpmd DCB forwarding stream to make it
based on traffic class.
It also fixes some coding style issues.

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
Jingjing Wu
cb60ede6e3 ethdev: rename DCB field in config structs
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:44:31 +01:00
Adrien Mazarguil
f2f954a838 app/testpmd: fix missing init in RSS hash show command
The "show port X rss-hash" command sometimes displays garbage instead of the
expected RSS hash key because the maximum key length is undefined. When the
requested key is too large to fit in the buffer,
rte_eth_dev_rss_hash_conf_get() does not update it.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2015-11-01 11:23:30 +01:00
Nelio Laranjeiro
8205e241b2 app/testpmd: add missing type to RSS hash commands
DPDK uses a structure to get or set a new hash key (see
eth_rte_rss_hash_conf).  rss_hf field from this structure is used in
rss_hash_get_conf to retrieve the hash key and in rss_hash_update uses
it to verify the key exists before trying to update it.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2015-10-31 00:21:58 +01:00
Michael Qiu
10f4620f02 app/testpmd: modify mac in csum forwarding
For some ethnet-switch like intel RRC, all the packet forwarded
out by DPDK will be dropped in switch side, so the packet
generator will never receive the packet.

Signed-off-by: Michael Qiu <michael.qiu@intel.com>
Acked-by: Jijiang Liu <jijiang.liu@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2015-10-29 23:52:24 +01:00
Wenzhuo Lu
53b2bb9b7e app/testpmd: new flow director commands
The different fdir mode needs different parameters, so, the parameter *mode*
is introduced to the CLI flow_director_filter and flow_director_mask. This
parameter can pormpt the user to input the appropriate parameters for different
mode.
Please be aware, as we should set the fdir mode, the value of the parameter
pkt-filter-mode, when we start testpmd. We cannot set a different mode for
mask or filter.

The new CLIs are added for the mac vlan and tunnel modes, like this,
flow_director_mask X mode MAC-VLAN vlan XXXX mac XX,
flow_director_mask X mode Tunnel vlan XXXX mac XX tunnel-type X tunnel-id XXXX,
flow_director_filter X mode MAC-VLAN add/del/update mac XX:XX:XX:XX:XX:XX
vlan XXXX flexbytes (X,X) fwd/drop queue X fd_id X,
flow_director_filter X mode Tunnel add/del/update mac XX:XX:XX:XX:XX:XX
vlan XXXX tunnel NVGRE/VxLAN tunnel-id XXXX flexbytes (X,X) fwd/drop queue X
fd_id X.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2015-10-29 00:03:13 +01:00
Wenzhuo Lu
bf2e60bda6 app/testpmd: show new flow director modes
There're fdir mask and supported flow type in the output of the CLI,
show port fdir. But not every parameter has meaning for all the fdir
modes, and the supported flow type is meaningless for mac vlan and
tunnel modes. So, we output different thing for different mode.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2015-10-29 00:02:24 +01:00
Wenzhuo Lu
9276b982ae app/testpmd: add parameters for new flow director modes
For testpmd CLI's parameter pkt-filter-mode, there're new values supported for
fdir new modes, perfect-mac-vlan, perfect-tunnel.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2015-10-29 00:02:17 +01:00
Wenzhuo Lu
47b3ac6b45 app/testpmd: initialize new flow director masks
When a port is enabled, there're default values for the parameters of
fdir mask. For the new parameters, the default values also need to be
set.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2015-10-29 00:02:16 +01:00
Stephen Hurd
7acf894d07 app/testpmd: detect numa socket count
Currently, there is a MAX_SOCKET macro which artificially limits the
number of NUMA sockets testpmd can use.  Anything on a higher socket
ends up using socket zero.  This patch replaces this with a variable
set during set_default_fwd_lcores_config() and uses RTE_MAX_NUMA_NODES
where a hard-coded max number of sockets is required.

Signed-off-by: Stephen Hurd <shurd@broadcom.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2015-10-24 21:41:17 +02:00
Thomas Monjalon
51c764c1d7 ethdev: remove SCTP flow entries switch
The extended SCTP flow entries are now part of the standard API.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
2015-09-03 19:22:48 +02:00
Thomas Monjalon
ab351fe1c9 mbuf: remove packet type from offload flags
The extended unified packet type is now part of the standard ABI.
As mbuf struct is changed, the mbuf library version is incremented.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
2015-09-03 19:22:48 +02:00
Michael Qiu
d4e8ad64fa app/testpmd: fix error message when closing port twice
When close one port twice, testpmd will give out wrong messagse.

testpmd> port stop  0
Stopping ports...
Checking link statuses...
Port 0 Link Up - speed 0 Mbps - full-duplex
Port 1 Link Up - speed 0 Mbps - full-duplex
Done
testpmd> port close 0
Closing ports...
Done
testpmd> port close 0
Closing ports...
Port 0 is now not stopped
Done
testpmd>

Signed-off-by: Michael Qiu <michael.qiu@intel.com>
2015-07-30 02:15:32 +02:00
Michael Qiu
78ef434ae2 app/testpmd: fix crash when port id out of bound
In testpmd, when using "rx_vlan add 1 77", it will be a segment fault
Because the port ID should be less than 32.

Fixes: edab33b1c0 ("app/testpmd: support port hotplug")

Signed-off-by: Michael Qiu <michael.qiu@intel.com>
2015-07-30 02:15:32 +02:00
Bernard Iremonger
41b05095c4 app/testpmd: fix bonding start
When the bonded port is started it also starts the slave port,
but the slave port status is not set. A slave_flag has been
added to struct rte_port to resolve this issue.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
2015-07-27 19:20:45 +02:00
David Marchand
2b9fb6319d eal: remove useless PCI id header inclusions
Signed-off-by: David Marchand <david.marchand@6wind.com>
[Thomas: move inclusion used by ixgbe bypass]
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2015-07-27 00:56:08 +02:00
Thomas Monjalon
707cc8275d mbuf: fix tunnel flags check
A packet is tunnelled if the tunnel type is identified or if it has
an inner part.

Fix also some typos in RTE_PTYPE_INNER_L3_MASK and IP comments.

Fixes: f295a00a2b ("mbuf: add definitions of unified packet types")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2015-07-26 22:54:31 +02:00
Pablo de Lara
878a0e99ce app/testpmd: fix ieee1588 32-bit timestamp log
In ieee1588fwd.c, timestamp.tv_sec is a time_t variable,
which is a long int, but it was being printed with PRIu64,
causing an issue on 32 bits.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2015-07-22 12:00:05 +02:00
Jingjing Wu
b90f64b51b ethdev: add ports to SCTP flow director
Add sport and dport into the input set of sctp flow.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2015-07-20 01:13:08 +02:00
Bernard Iremonger
20718201c8 app/testpmd: fix port detaching with virtio
At this point the stop() and close() functions have already been called.
The rte_eth_promiscuous_disable() function does not return on the VM.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2015-07-19 22:24:42 +02:00
Helin Zhang
9e972be2b7 app: replace some offload flags with packet type
To unify packet types among all PMDs, bit masks of packet type for
'ol_flags' are replaced by unified packet type.
To avoid breaking ABI compatibility, all the changes would be
enabled by RTE_NEXT_ABI.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2015-07-16 00:57:47 +02:00
John McNamara
c4bcc342c8 app/testpmd: refactor ieee1588 forwarding
Refactor the ieee1588_fwd mode in testpmd to use the new ethdev
APIs to enable and read IEEE1588 PTP timestamps.

Signed-off-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2015-07-10 02:43:37 +02:00