Thomas Monjalon [Thu, 15 Dec 2016 21:47:44 +0000 (22:47 +0100)]
scripts: move to devtools
The remaining scripts in the scripts/ directory are only useful
to developers. That's why devtools/ is a better name.
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
Thomas Monjalon [Thu, 15 Dec 2016 21:46:47 +0000 (22:46 +0100)]
scripts: move to buildtools
There is already a directory buildtools for pmdinfogen used by
the build system. The scripts used in makefiles are moved here.
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
John McNamara [Wed, 21 Dec 2016 15:03:49 +0000 (15:03 +0000)]
doc: add required python versions
Add a requirement to support both Python 2 and 3 to the
DPDK Python Coding Standards and Getting started Guide.
Signed-off-by: John McNamara <john.mcnamara@intel.com>
John McNamara [Wed, 21 Dec 2016 15:03:48 +0000 (15:03 +0000)]
make python scripts python2/3 compliant
Make all the DPDK Python apps work with Python 2 or 3 to
allow them to work with whatever is the system default.
Signed-off-by: John McNamara <john.mcnamara@intel.com>
John McNamara [Wed, 21 Dec 2016 15:03:47 +0000 (15:03 +0000)]
make python scripts PEP8 compliant
Make all DPDK python application compliant with the PEP8 standard
to allow for consistency checking of patches and to allow further
refactoring.
Signed-off-by: John McNamara <john.mcnamara@intel.com>
Ferruh Yigit [Tue, 3 Jan 2017 16:15:42 +0000 (16:15 +0000)]
mk: disable icc warning 188
error #188: enumerated type mixed with another type
This is get when an integer assigned to an enum variable.
Since this usage is common and causing many ICC compilation errors, and
other compilers accept this usage. Disabling the warning.
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Tomasz Kulasek [Fri, 23 Dec 2016 18:40:54 +0000 (19:40 +0100)]
app/testpmd: use Tx preparation in checksum engine
Since all current drivers supports Tx preparation API, it is used
in csum forwarding engine by default for all drivers.
Adding additional step to the csum engine costs about 3-4% of performance
drop, on my setup with ixgbe driver. It's caused mostly by the need
of reaccessing and modification of packet data.
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Konstantin Ananyev [Fri, 23 Dec 2016 18:40:53 +0000 (19:40 +0100)]
net/ena: add Tx preparation
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Konstantin Ananyev [Fri, 23 Dec 2016 18:40:52 +0000 (19:40 +0100)]
net/vmxnet3: add Tx preparation
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Yong Wang <yongwang@vmware.com>
Tomasz Kulasek [Fri, 23 Dec 2016 18:40:49 +0000 (19:40 +0100)]
net/fm10k: add Tx preparation
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Tomasz Kulasek [Fri, 23 Dec 2016 18:40:50 +0000 (19:40 +0100)]
net/i40e: add Tx preparation
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Tomasz Kulasek [Fri, 23 Dec 2016 18:40:51 +0000 (19:40 +0100)]
net/ixgbe: add Tx preparation
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Tomasz Kulasek [Fri, 23 Dec 2016 18:40:48 +0000 (19:40 +0100)]
net/e1000: add Tx preparation
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Tomasz Kulasek [Fri, 23 Dec 2016 18:40:47 +0000 (19:40 +0100)]
ethdev: add Tx preparation
Added API for `rte_eth_tx_prepare`
uint16_t rte_eth_tx_prepare(uint8_t port_id, uint16_t queue_id,
struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
Added fields to the `struct rte_eth_desc_lim`:
uint16_t nb_seg_max;
/**< Max number of segments per whole packet. */
uint16_t nb_mtu_seg_max;
/**< Max number of segments per one MTU */
These fields can be used to create valid packets according to the
following rules:
* For non-TSO packet, a single transmit packet may span up to
"nb_mtu_seg_max" buffers.
* For TSO packet the total number of data descriptors is "nb_seg_max",
and each segment within the TSO may span up to "nb_mtu_seg_max".
Added functions:
int
rte_validate_tx_offload(struct rte_mbuf *m)
to validate general requirements for tx offload set in mbuf of packet
such a flag completness. In current implementation this function is
called optionaly when RTE_LIBRTE_ETHDEV_DEBUG is enabled.
int rte_net_intel_cksum_prepare(struct rte_mbuf *m)
to prepare pseudo header checksum for TSO and non-TSO tcp/udp packets
before hardware tx checksum offload.
- for non-TSO tcp/udp packets full pseudo-header checksum is
counted and set.
- for TSO the IP payload length is not included.
int
rte_net_intel_cksum_flags_prepare(struct rte_mbuf *m, uint64_t ol_flags)
this function uses same logic as rte_net_intel_cksum_prepare, but
allows application to choose which offloads should be taken into
account, if full preparation is not required.
PERFORMANCE TESTS
-----------------
This feature was tested with modified csum engine from test-pmd.
The packet checksum preparation was moved from application to Tx
preparation step placed before burst.
We may expect some overhead costs caused by:
1) using additional callback before burst,
2) rescanning burst,
3) additional condition checking (packet validation),
4) worse optimization (e.g. packet data access, etc.)
We tested it using ixgbe Tx preparation implementation with some parts
disabled to have comparable information about the impact of different
parts of implementation.
IMPACT:
1) For unimplemented Tx preparation callback the performance impact is
negligible,
2) For packet condition check without checksum modifications (nb_segs,
available offloads, etc.) is
14626628/
14252168 (~2.62% drop),
3) Full support in ixgbe driver (point 2 + packet checksum
initialization) is
14060924/
13588094 (~3.48% drop)
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Olivier Matz [Fri, 23 Dec 2016 20:35:48 +0000 (21:35 +0100)]
ethdev: clarify extended statistics documentation
Reword the API documentation of ethdev xstats.
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Remy Horton <remy.horton@intel.com>
Olivier Matz [Fri, 16 Dec 2016 09:44:13 +0000 (10:44 +0100)]
ethdev: fix extended statistics name index
The function rte_eth_xstats_get() return an array of tuples (id,
value). The value is the statistic counter, while the id references a
name in the array returned by rte_eth_xstats_get_name().
Today, each 'id' returned by rte_eth_xstats_get() is equal to the index
in the returned array, making this value useless. It also prevents a
driver from having different indexes for names and value, like in the
example below:
rte_eth_xstats_get_name() returns:
0: "rx0_stat"
1: "rx1_stat"
2: ...
7: "rx7_stat"
8: "tx0_stat"
9: "tx1_stat"
...
15: "tx7_stat"
rte_eth_xstats_get() returns:
0: id=0, val=<stat> ("rx0_stat")
1: id=1, val=<stat> ("rx1_stat")
2: id=8, val=<stat> ("tx0_stat")
3: id=9, val=<stat> ("tx1_stat")
This patch fixes the drivers to set the 'id' in their ethdev->xstats_get()
(except e1000 which was already doing it), and fixes ethdev by not setting
the 'id' field to the index of the table for pmd-specific stats: instead,
they should just be shifted by the max number of generic statistics.
Fixes:
bd6aa172cf35 ("ethdev: fetch extended statistics with integer ids")
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Remy Horton <remy.horton@intel.com>
Jan Blunck [Fri, 23 Dec 2016 15:58:11 +0000 (16:58 +0100)]
ethdev: decouple from PCI device
This makes struct rte_eth_dev independent of struct rte_pci_device by
replacing it with a pointer to the generic struct rte_device.
Signed-off-by: Jan Blunck <jblunck@infradead.org>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Jan Blunck [Fri, 23 Dec 2016 15:58:10 +0000 (16:58 +0100)]
ethdev: move info filling of PCI into drivers
Only the drivers itself can decide if it could fill PCI information fields
of dev_info.
Signed-off-by: Jan Blunck <jblunck@infradead.org>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Jan Blunck [Fri, 23 Dec 2016 15:58:09 +0000 (16:58 +0100)]
ethdev: decouple interrupt handling from PCI device
The struct rte_intr_handle is an abstraction layer for different types of
interrupt mechanisms. It is embedded in the low-level device (e.g. PCI).
On allocation of a struct rte_eth_dev a reference to the intr_handle
should be stored for devices supporting interrupts.
Signed-off-by: Jan Blunck <jblunck@infradead.org>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Jan Blunck [Fri, 23 Dec 2016 15:58:08 +0000 (16:58 +0100)]
net/vmxnet3: use driver name from ethdev
Signed-off-by: Jan Blunck <jblunck@infradead.org>
Jan Blunck [Fri, 23 Dec 2016 15:58:06 +0000 (16:58 +0100)]
net/szedata2: localize handling of PCI resources
This changes the driver to handle the PCI resource directly instead
of repeatedly going through eth_dev.
Signed-off-by: Jan Blunck <jblunck@infradead.org>
Jan Blunck [Fri, 23 Dec 2016 15:58:07 +0000 (16:58 +0100)]
net/nfp: localize mapping of ethdev to PCI device
This simplifies later changes to ethdev.
Signed-off-by: Jan Blunck <jblunck@infradead.org>
Jan Blunck [Fri, 23 Dec 2016 15:58:05 +0000 (16:58 +0100)]
net/qede: localize mapping of ethdev to PCI device
This simplifies later changes to ethdev.
Signed-off-by: Jan Blunck <jblunck@infradead.org>
Acked-by: Harish Patil <harish.patil@qlogic.com>
Jan Blunck [Fri, 23 Dec 2016 15:58:03 +0000 (16:58 +0100)]
net/bnx2x: localize mapping of ethdev to PCI device
Use device private information to minimize the places that assume eth_dev
contains pci_dev.
Signed-off-by: Jan Blunck <jblunck@infradead.org>
Acked-by: Harish Patil <harish.patil@qlogic.com>
Jan Blunck [Fri, 23 Dec 2016 15:58:04 +0000 (16:58 +0100)]
net/fm10k: localize mapping of ethdev to PCI device
This simplifies later changes to ethdev.
Signed-off-by: Jan Blunck <jblunck@infradead.org>
Jan Blunck [Fri, 23 Dec 2016 15:58:02 +0000 (16:58 +0100)]
net/virtio: do not depend on PCI device of ethdev
We don't need to depend on rte_eth_dev->pci_dev to differentiate between
the virtio_user and the virtio_pci case. Instead we can use the private
virtio_hw struct to get that information.
Signed-off-by: Jan Blunck <jblunck@infradead.org>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Jan Blunck [Fri, 23 Dec 2016 15:58:01 +0000 (16:58 +0100)]
net/virtio: add helper to get interrrupt handle
This adds a helper to get the rte_intr_handle from the virtio_hw. This is
safe to do since the usage of the helper is guarded by RTE_ETH_DEV_INTR_LSC
which is only set if we found a PCI device during initialization.
Signed-off-by: Jan Blunck <jblunck@infradead.org>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Jan Blunck [Fri, 23 Dec 2016 15:58:00 +0000 (16:58 +0100)]
net/virtio: remove useless driver name copy
This is overwritten in rte_eth_dev_info_get().
Signed-off-by: Jan Blunck <jblunck@infradead.org>
Reviewed-by: David Marchand <david.marchand@6wind.com>
Stephen Hemminger [Fri, 23 Dec 2016 15:57:59 +0000 (16:57 +0100)]
net/bnxt: localize mapping of ethdev to PCI device
Use existing information about pci and interrupt handle to minimize
the number of places that assume eth_dev contains pci_device
information.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Jan Blunck <jblunck@infradead.org>
Stephen Hemminger [Fri, 23 Dec 2016 15:57:58 +0000 (16:57 +0100)]
net/i40e: localize mapping of ethdev to PCI device
Simplify later changes to eth_dev.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Jan Blunck <jblunck@infradead.org>
Stephen Hemminger [Fri, 23 Dec 2016 15:57:57 +0000 (16:57 +0100)]
net/ixgbe: localize mapping of ethdev to PCI device
Since later changes will change where PCI information is,
localize mapping in one macro.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Jan Blunck <jblunck@infradead.org>
Stephen Hemminger [Fri, 23 Dec 2016 15:57:56 +0000 (16:57 +0100)]
net/e1000: localize mapping of ethdev to PCI device
Create one macro for where PCI device information is extracted
from ethernet device. Makes later changes easier to review, and test.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Jan Blunck <jblunck@infradead.org>
Stephen Hemminger [Fri, 23 Dec 2016 15:57:55 +0000 (16:57 +0100)]
drivers: remove useless reset of PCI device pointer
Since rte_eth_dev_info_get does memset() on dev_info before
calling device specific code, the explicit assignment of NULL
in all these virtual drivers has no effect.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Jan Blunck <jblunck@infradead.org>
Stephen Hemminger [Fri, 23 Dec 2016 15:57:54 +0000 (16:57 +0100)]
eal: make driver pointer const in device struct
The info in rte_device about driver is immutable and
shouldn't change.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Jan Blunck <jblunck@infradead.org>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Jan Blunck [Fri, 23 Dec 2016 15:57:53 +0000 (16:57 +0100)]
eal: allow passing const interrupt handle
Both register/unregister and enable/disable don't necessarily require the
rte_intr_handle to be modifiable. Therefore lets constify it.
Signed-off-by: Jan Blunck <jblunck@infradead.org>
Jan Blunck [Fri, 23 Dec 2016 15:57:52 +0000 (16:57 +0100)]
eal: define container_of macro
This macro is based on Jan Viktorin's original patch but also checks the
type of the passed pointer against the type of the member.
Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
[jblunck@infradead.org: add type checking and __extension__]
Signed-off-by: Jan Blunck <jblunck@infradead.org>
Adrien Mazarguil [Fri, 23 Dec 2016 15:52:56 +0000 (16:52 +0100)]
app/testpmd: fix flow command build on FreeBSD
A missing include causes the following compilation errors:
error: use of undeclared identifier 'AF_INET'
error: use of undeclared identifier 'AF_INET6'
Fixes:
ef6e38550f07 ("app/testpmd: add items ipv4/ipv6 to flow command")
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Adrien Mazarguil [Fri, 23 Dec 2016 14:00:05 +0000 (15:00 +0100)]
doc: update release notes for flow API
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Adrien Mazarguil [Wed, 21 Dec 2016 14:51:42 +0000 (15:51 +0100)]
app/testpmd: add protocol fields to flow command
This commit exposes the following item fields through the flow command:
- VLAN priority code point, drop eligible indicator and VLAN identifier
(all part of TCI).
- IPv4 type of service, time to live and protocol.
- IPv6 traffic class, flow label, next header and hop limit.
- SCTP tag and checksum.
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Adrien Mazarguil [Wed, 21 Dec 2016 14:51:41 +0000 (15:51 +0100)]
doc: describe testpmd flow command
Document syntax, interaction with rte_flow and provide usage examples.
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Olga Shern <olgas@mellanox.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Adrien Mazarguil [Wed, 21 Dec 2016 14:51:40 +0000 (15:51 +0100)]
app/testpmd: add queue actions to flow command
- QUEUE: assign packets to a given queue index.
- DUP: duplicate packets to a given queue index.
- RSS: spread packets among several queues.
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Olga Shern <olgas@mellanox.com>
Adrien Mazarguil [Wed, 21 Dec 2016 14:51:39 +0000 (15:51 +0100)]
app/testpmd: add various actions to flow command
- MARK: attach 32 bit value to packets.
- FLAG: flag packets.
- DROP: drop packets.
- COUNT: enable counters for a rule.
- PF: redirect packets to physical device function.
- VF: redirect packets to virtual device function.
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Olga Shern <olgas@mellanox.com>
Adrien Mazarguil [Wed, 21 Dec 2016 14:51:38 +0000 (15:51 +0100)]
app/testpmd: add L4 items to flow command
Add the ability to match a few properties of common L4[.5] protocol
headers:
- ICMP: type and code.
- UDP: source and destination ports.
- TCP: source and destination ports.
- SCTP: source and destination ports.
- VXLAN: network identifier.
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Olga Shern <olgas@mellanox.com>
Adrien Mazarguil [Wed, 21 Dec 2016 14:51:37 +0000 (15:51 +0100)]
app/testpmd: add items ipv4/ipv6 to flow command
Add the ability to match basic fields from IPv4 and IPv6 headers (source
and destination addresses only).
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Olga Shern <olgas@mellanox.com>
Adrien Mazarguil [Wed, 21 Dec 2016 14:51:36 +0000 (15:51 +0100)]
app/testpmd: add items eth/vlan to flow command
These pattern items match basic Ethernet headers (source, destination and
type) and related 802.1Q/ad VLAN headers.
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Olga Shern <olgas@mellanox.com>
Adrien Mazarguil [Wed, 21 Dec 2016 14:51:35 +0000 (15:51 +0100)]
app/testpmd: add item raw to flow command
Matches arbitrary byte strings with properties:
- relative: look for pattern after the previous item.
- search: search pattern from offset (see also limit).
- offset: absolute or relative offset for pattern.
- limit: search area limit for start of pattern.
- length: pattern length.
- pattern: byte string to look for.
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Olga Shern <olgas@mellanox.com>
Adrien Mazarguil [Wed, 21 Dec 2016 14:51:34 +0000 (15:51 +0100)]
app/testpmd: add various items to flow command
- PF: match packets addressed to the physical function.
- VF: match packets addressed to a virtual function ID.
- PORT: device-specific physical port index to use.
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Olga Shern <olgas@mellanox.com>
Adrien Mazarguil [Wed, 21 Dec 2016 14:51:33 +0000 (15:51 +0100)]
app/testpmd: add item any to flow command
This pattern item matches any protocol in place of the current layer and
has two properties:
- min: minimum number of layers covered (0 or more).
- max: maximum number of layers covered (0 means infinity).
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Olga Shern <olgas@mellanox.com>
Adrien Mazarguil [Wed, 21 Dec 2016 14:51:32 +0000 (15:51 +0100)]
app/testpmd: support flow bit-field
Several rte_flow structures expose bit-fields that cannot be set in a
generic fashion at byte level. Add bit-mask support to handle them.
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Olga Shern <olgas@mellanox.com>
Adrien Mazarguil [Wed, 21 Dec 2016 14:51:31 +0000 (15:51 +0100)]
app/testpmd: add flow item spec prefix length
Generating bit-masks from prefix lengths is often more convenient than
providing them entirely (e.g. to define IPv4 and IPv6 subnets).
This commit adds the "prefix" operator that assigns generated bit-masks to
any pattern item specification field.
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Olga Shern <olgas@mellanox.com>
Adrien Mazarguil [Wed, 21 Dec 2016 14:51:30 +0000 (15:51 +0100)]
app/testpmd: add flow item spec handler
Add parser code to fully set individual fields of pattern item
specification structures, using the following operators:
- fix: sets field and applies full bit-mask for perfect matching.
- spec: sets field without modifying its bit-mask.
- last: sets upper value of the spec => last range.
- mask: sets bit-mask affecting both spec and last from arbitrary value.
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Olga Shern <olgas@mellanox.com>
Adrien Mazarguil [Wed, 21 Dec 2016 14:51:29 +0000 (15:51 +0100)]
app/testpmd: add flow query command
Syntax:
flow query {port_id} {rule_id} {action}
Query a specific action of an existing flow rule.
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Olga Shern <olgas@mellanox.com>
Adrien Mazarguil [Wed, 21 Dec 2016 14:51:28 +0000 (15:51 +0100)]
app/testpmd: add flow validate/create commands
Syntax:
flow (validate|create) {port_id}
[group {group_id}] [priority {level}] [ingress] [egress]
pattern {item} [/ {item} [...]] / end
actions {action} [/ {action} [...]] / end
Either check the validity of a flow rule or create it. Any number of
pattern items and actions can be provided in any order. Completion is
available for convenience.
This commit only adds support for the most basic item and action types,
namely:
- END: terminates pattern items and actions lists.
- VOID: item/action filler, no operation.
- INVERT: inverted pattern matching, process packets that do not match.
- PASSTHRU: action that leaves packets up for additional processing by
subsequent flow rules.
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Olga Shern <olgas@mellanox.com>
Adrien Mazarguil [Wed, 21 Dec 2016 14:51:27 +0000 (15:51 +0100)]
app/testpmd: add flow destroy command
Syntax:
flow destroy {port_id} rule {rule_id} [...]
Destroy a given set of flow rules associated with a port.
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Olga Shern <olgas@mellanox.com>
Adrien Mazarguil [Wed, 21 Dec 2016 14:51:26 +0000 (15:51 +0100)]
app/testpmd: add flow flush command
Syntax:
flow flush {port_id}
Destroy all flow rules on a port.
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Olga Shern <olgas@mellanox.com>
Adrien Mazarguil [Wed, 21 Dec 2016 14:51:25 +0000 (15:51 +0100)]
app/testpmd: add flow list command
Syntax:
flow list {port_id} [group {group_id}] [...]
List configured flow rules on a port. Output can optionally be limited to a
given set of group identifiers.
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Olga Shern <olgas@mellanox.com>
Adrien Mazarguil [Wed, 21 Dec 2016 14:51:24 +0000 (15:51 +0100)]
app/testpmd: support flow integer
Parse all integer types and handle conversion to network byte order in a
single function.
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Olga Shern <olgas@mellanox.com>
Adrien Mazarguil [Wed, 21 Dec 2016 14:51:23 +0000 (15:51 +0100)]
app/testpmd: add flow command
Managing generic flow API functions from command line requires the use of
dynamic tokens for convenience as flow rules are not fixed and cannot be
defined statically.
This commit adds specific flexible parser code and object for a new "flow"
command in separate file.
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Olga Shern <olgas@mellanox.com>
Adrien Mazarguil [Wed, 21 Dec 2016 14:51:22 +0000 (15:51 +0100)]
app/testpmd: implement basic support for flow API
Add basic management functions for the generic flow API (validate, create,
destroy, flush, query and list). Flow rule objects and properties are
arranged in lists associated with each port.
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Olga Shern <olgas@mellanox.com>
Adrien Mazarguil [Wed, 21 Dec 2016 14:51:21 +0000 (15:51 +0100)]
cmdline: add alignment constraint
This prevents sigbus errors on architectures that cannot handle unexpected
unaligned accesses to the output buffer.
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Olga Shern <olgas@mellanox.com>
Adrien Mazarguil [Wed, 21 Dec 2016 14:51:20 +0000 (15:51 +0100)]
cmdline: support dynamic tokens
Considering tokens must be hard-coded in a list part of the instruction
structure, context-dependent tokens cannot be expressed.
This commit adds support for building dynamic token lists through a
user-provided function, which is called when the static token list is empty
(a single NULL entry).
Because no structures are modified (existing fields are reused), this
commit has no impact on the current ABI.
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Olga Shern <olgas@mellanox.com>
Adrien Mazarguil [Wed, 21 Dec 2016 14:51:19 +0000 (15:51 +0100)]
doc: announce deprecation of legacy filter types
They are superseded by the generic flow API (rte_flow). Target release is
not defined yet.
Suggested-by: Kevin Traynor <ktraynor@redhat.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Olga Shern <olgas@mellanox.com>
Adrien Mazarguil [Wed, 21 Dec 2016 14:51:18 +0000 (15:51 +0100)]
doc: add generic flow API guide
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Olga Shern <olgas@mellanox.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Adrien Mazarguil [Wed, 21 Dec 2016 14:51:17 +0000 (15:51 +0100)]
ethdev: introduce generic flow API
This new API supersedes all the legacy filter types described in
rte_eth_ctrl.h. It is slightly higher level and as a result relies more on
PMDs to process and validate flow rules.
Benefits:
- A unified API is easier to program for, applications do not have to be
written for a specific filter type which may or may not be supported by
the underlying device.
- The behavior of a flow rule is the same regardless of the underlying
device, applications do not need to be aware of hardware quirks.
- Extensible by design, API/ABI breakage should rarely occur if at all.
- Documentation is self-standing, no need to look up elsewhere.
Existing filter types will be deprecated and removed in the near future.
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Olga Shern <olgas@mellanox.com>
Ferruh Yigit [Thu, 22 Dec 2016 13:10:13 +0000 (13:10 +0000)]
ethdev: cleanup device ops struct whitespace
- Grouped related items using empty lines
- Aligned arguments to same column
- All item comments that doesn't fit same line are placed blow the item
itself
- Moved some comments to same line if overall line < 100 chars
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Ferruh Yigit [Thu, 22 Dec 2016 12:00:16 +0000 (12:00 +0000)]
ethdev: remove invalid function from version map
Fixes:
9d41beed24b0 ("lib: provide initial versioning")
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Ilya Maximets [Thu, 24 Nov 2016 11:26:49 +0000 (12:26 +0100)]
net/bonding: reconfigure all slave queues every time
This reverts commit
5b7bb2bda5519b7800f814df64d4e015282140e5.
It is necessary to reconfigure all queues every time because configuration
can be changed.
For example, if we're reconfiguring bonding device with new memory pool,
already configured queues will still use the old one. And if the old
mempool be freed, application likely will panic in attempt to use
freed mempool.
This happens when we use the bonding device with OVS 2.6 while MTU
reconfiguration:
PANIC in rte_mempool_get_ops():
assert "(ops_index >= 0) && (ops_index < RTE_MEMPOOL_MAX_OPS_IDX)" failed
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Jan Blunck <jblunck@infradead.org>
Jan Blunck [Thu, 24 Nov 2016 11:26:48 +0000 (12:26 +0100)]
net/bonding: force reconfiguration of removed slaves
After a slave interface is removed from a bond group it still has the
configuration of the bond interface. Lets enforce that the slave interface
is reconfigured after removal by resetting it.
Signed-off-by: Jan Blunck <jblunck@infradead.org>
Jan Blunck [Thu, 24 Nov 2016 11:26:47 +0000 (12:26 +0100)]
ethdev: add internal reset function
This is a helper for DPDK internal users to force a reconfiguration of a
device.
Signed-off-by: Jan Blunck <jblunck@infradead.org>
Jan Blunck [Thu, 24 Nov 2016 11:26:46 +0000 (12:26 +0100)]
ethdev: free queue array after releasing all queues
If all queues are released lets also free up the dev->data->rx/tx_queues
to be able to properly reinitialize.
Signed-off-by: Jan Blunck <jblunck@infradead.org>
Jan Blunck [Thu, 24 Nov 2016 11:26:45 +0000 (12:26 +0100)]
ethdev: release queue before setting up
If a queue has been setup before lets release it before we setup.
Otherwise we might leak resources.
Signed-off-by: Jan Blunck <jblunck@infradead.org>
Jan Blunck [Thu, 17 Nov 2016 17:16:12 +0000 (18:16 +0100)]
ethdev: initialize more fields on allocation
This moves the non-PCI related initialization of the link state interrupt
callback list and the setting of the default MTU to rte_eth_dev_allocate()
so that drivers only need to set non-default values.
Signed-off-by: Jan Blunck <jblunck@infradead.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Jan Blunck [Thu, 17 Nov 2016 17:16:11 +0000 (18:16 +0100)]
ethdev: clear data when allocating device
Lets clear the eth_dev->data when allocating a new rte_eth_dev so that
drivers only need to set non-zero values.
Signed-off-by: Jan Blunck <jblunck@infradead.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Stephen Hemminger [Wed, 7 Dec 2016 18:04:36 +0000 (10:04 -0800)]
pci: remove unused unbind support
No device driver sets the unbind flag in current public code base.
Therefore it is good time to remove the unused dead code.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Jerin Jacob [Sun, 20 Nov 2016 08:00:50 +0000 (13:30 +0530)]
eal: postpone vdev initialization
Some platform like octeontx may use pci and
vdev based combined device to represent a logical
dpdk functional device.In such case, postponing the
vdev initialization after pci device
initialization will provide the better view of
the pci device resources in the system in
vdev's probe function, and it allows better
functional subsystem registration in vdev probe
function.
As a bonus, This patch fixes a bond device
initialization use case.
example command to reproduce the issue:
./testpmd -c 0x2 --vdev 'eth_bond0,mode=0,
slave=0000:02:00.0,slave=0000:03:00.0' --
--port-topology=chained
root cause:
In existing case(vdev initialization and then pci
initialization), creates three Ethernet ports with
following port ids
0 - Bond device
1 - PCI device 0
2 - PCI devive 1
Since testpmd, calls the configure/start on all the ports on
start up,it will translate to following illegal setup sequence
1)bond device configure/start
1.1) pci device0 stop/configure/start
1.2) pci device1 stop/configure/start
2)pci device 0 configure(illegal setup case,
as device in start state)
The fix changes the initialization sequence and
allow initialization in following valid setup order
1) pcie device 0 configure/start
2) pcie device 1 configure/start
3) bond device 2 configure/start
3.1) pcie device 0/stop/configure/start
3.2) pcie device 1/stop/configure/start
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Jianfeng Tan [Fri, 2 Dec 2016 17:48:56 +0000 (17:48 +0000)]
eal: restrict cores auto detection
This patch uses pthread_getaffinity_np() to narrow down used
cores when none of below options is specified:
* coremask (-c)
* corelist (-l)
* and coremap (--lcores)
The purpose of this patch is to leave out these core related options
when DPDK applications are deployed under container env, so that
users do not need decide the core related parameters when developing
applications. Instead, when applications are deployed in containers,
use cpu-set to constrain which cores can be used inside this container
instance. And DPDK application inside containers just rely on this
auto detect mechanism to start polling threads.
Note: previously, some users are using isolated CPUs, which could
be excluded by default. Please add commands like taskset to use
those cores.
Test example:
$ taskset 0xc0000 ./examples/helloworld/build/helloworld -m 1024
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Aaron Conole [Thu, 8 Dec 2016 15:56:45 +0000 (10:56 -0500)]
eal: clarify the argc and argv documentation
It's been a source of confusion in the past, and even with this update
may continue to be a source of confusion. However, the original
language seems to imply that the DPDK EAL will take ownership of the
array passed in. Loosening the language up a bit might give a better
understanding for what is actually happening.
Signed-off-by: Aaron Conole <aconole@redhat.com>
Olivier Matz [Thu, 15 Dec 2016 13:46:39 +0000 (14:46 +0100)]
drivers: advertise kmod dependencies in pmdinfo
Add a new macro RTE_PMD_REGISTER_KMOD_DEP() that allows a driver to
declare the list of kernel modules required to run properly.
Today, most PCI drivers require uio/vfio.
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Qiming Yang [Tue, 22 Nov 2016 01:41:24 +0000 (09:41 +0800)]
examples/ethtool: fix driver information
Function pcmd_drvinfo_callback uses struct info to get
the ethtool information of each port. Struct info will
store the information of previous port until this
information be updated. This patch fixes this issue.
Fixes:
bda68ab9d1e7 ("examples/ethtool: add user-space ethtool sample application")
Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
Remy Horton [Wed, 30 Nov 2016 02:47:29 +0000 (10:47 +0800)]
examples/ethtool: fix querying non-PCI devices
Doing a device information query on a non-PCI device such as
vhost was resulting in the dereferencing of a NULL pointer
(the absent PCI data), causing a segmentation fault.
Fixes:
bda68ab9d1e7 ("examples/ethtool: add user-space ethtool sample application")
Signed-off-by: Remy Horton <remy.horton@intel.com>
Rami Rosen [Thu, 15 Dec 2016 21:03:20 +0000 (23:03 +0200)]
doc: fix typo in testpmd guide
This patch fixes a trivial typo in testpmd application user guide.
Signed-off-by: Rami Rosen <rami.rosen@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Baruch Siach [Tue, 13 Dec 2016 13:40:26 +0000 (15:40 +0200)]
doc: fix typo in sample app guide
Fixes:
bda68ab9d1e7 ("examples/ethtool: add user-space ethtool sample application")
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Acked-by: Remy Horton <remy.horton@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Baruch Siach [Tue, 13 Dec 2016 11:18:55 +0000 (13:18 +0200)]
doc: fix source extract command in Linux guide
DPDK source archives are .tar.xz or .tar.gz, not .zip. Use .tar.xz in the
instructions, since that is what the main download page links to.
Also, correct the archive file and directory name capitalization.
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Acked-by: John McNamara <john.mcnamara@intel.com>
Baruch Siach [Mon, 19 Dec 2016 19:28:40 +0000 (21:28 +0200)]
doc: fix required tools list layout in Linux guide
The Python requirement should appear in the bullet list.
Also, indent the x32 note, since it is related to the previous bullet.
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Acked-by: John McNamara <john.mcnamara@intel.com>
Yong Wang [Fri, 9 Dec 2016 11:52:29 +0000 (06:52 -0500)]
doc: fix mistakes in contribution guide
Signed-off-by: Yong Wang <wang.yong19@zte.com.cn>
Acked-by: John McNamara <john.mcnamara@intel.com>
John McNamara [Fri, 16 Dec 2016 17:50:34 +0000 (17:50 +0000)]
doc: add details of sub-trees and maintainers
Add a new section to the Code Contributors Guide to outline
the roles of tree and component maintainers and how they
can be added and removed.
Signed-off-by: John McNamara <john.mcnamara@intel.com>
Maxime Coquelin [Tue, 6 Dec 2016 12:24:40 +0000 (13:24 +0100)]
doc: introduce PVP reference benchmark
Having reference benchmarks is important in order to obtain
reproducible performance figures.
This patch describes required steps to configure a PVP setup
using testpmd in both host and guest.
Not relying on external vSwitch ease integration in a CI loop by
not being impacted by DPDK API changes.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Rasesh Mody [Wed, 7 Dec 2016 19:22:19 +0000 (11:22 -0800)]
maintainers: update for qede PMD and bnx2x PMD
Following Cavium's acquisition of QLogic we need to update all the
qlogic PMD maintainer's entries to point to our new e-mail addresses.
Update driver's maintainers as they are no longer working for Cavium.
Thanks to Sony Chacko for his support and development of our various
dpdk drivers.
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
Anatoly Burakov [Fri, 18 Nov 2016 16:32:49 +0000 (16:32 +0000)]
vdev: fix detaching with alias
Fixes:
d63eed6b2dca ("eal: add driver name alias")
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Anatoly Burakov [Sat, 19 Nov 2016 13:10:11 +0000 (13:10 +0000)]
ethdev: fix port lookup if none
Aside from avoiding doing useless work, this also fixes a segfault
when calling rte_eth_dev_get_port_by_name() whenever no devices
were found yet, and therefore rte_eth_dev_data wasn't yet allocated.
Fixes:
9c5b8d8b9feb ("ethdev: clean port id retrieval when attaching")
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Robin Jarry [Fri, 25 Nov 2016 12:22:17 +0000 (13:22 +0100)]
kni: avoid using lsb_release script
The lsb_release script is part of an optional package which is not
always installed. On the other hand, /etc/lsb-release is always present
even on minimal Ubuntu installations.
root@ubuntu1604:~# dpkg -S /etc/lsb-release
base-files: /etc/lsb-release
Read the file if present and use the variables defined in it.
Signed-off-by: Robin Jarry <robin.jarry@6wind.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Thomas Monjalon [Sun, 4 Dec 2016 22:08:45 +0000 (23:08 +0100)]
config: remove insecure warnings
There was an option CONFIG_RTE_INSECURE_FUNCTION_WARNING (disabled by
default), which prevents from using some libc functions:
sprintf, snprintf, vsnprintf, strcpy, strncpy, strcat, strncat, sscanf,
strtok, strsep and strlen.
It's all about using them at the right place with the right precautions.
However, it is neither really possible nor a good advice to disable them.
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Baruch Siach [Tue, 6 Dec 2016 08:25:25 +0000 (10:25 +0200)]
doc: fix description of attach to indirect mbuf
Since commit
4a96e8b652181 ("mbuf: allow to clone an indirect mbuf")
attaching to an indirect mbuf creates a clone of that mbuf. Update the mbuf
documentation to match.
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Acked-by: John McNamara <john.mcnamara@intel.com>
Baruch Siach [Tue, 29 Nov 2016 09:25:43 +0000 (11:25 +0200)]
doc: fix mistakes in prog guide
- Remove wrong document description:
The Programmer’s Guide intro is not the Release Notes.
- Fix heading of section which only deals with Tx queues configuration.
- Fix wrong verbatim text paragraphs:
Reduce the indentation of these paragraphs since they are not part of the
verbatim block.
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Acked-by: John McNamara <john.mcnamara@intel.com>
John McNamara [Sun, 4 Dec 2016 16:47:37 +0000 (16:47 +0000)]
doc: fix relative path of NIC table input file
Fix relative path between sphinx conf.py file and Nic table file
to allow automatic build on ReadTheDocs.
Fixes:
9db3f52126fb ("doc: generate NIC overview table from ini files")
Signed-off-by: John McNamara <john.mcnamara@intel.com>
Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Reshma Pattan [Thu, 1 Dec 2016 11:02:10 +0000 (11:02 +0000)]
doc: add pdump library to API doxygen
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Yong Wang [Tue, 6 Dec 2016 12:30:49 +0000 (07:30 -0500)]
doc: remove repeated words in contribution guide
Signed-off-by: Yong Wang <wang.yong19@zte.com.cn>
Acked-by: John McNamara <john.mcnamara@intel.com>
Yong Wang [Tue, 29 Nov 2016 22:23:39 +0000 (17:23 -0500)]
doc: fix typos in code comments
Signed-off-by: Yong Wang <wang.yong19@zte.com.cn>
Acked-by: John McNamara <john.mcnamara@intel.com>
Olivier Matz [Tue, 22 Nov 2016 10:04:58 +0000 (11:04 +0100)]
mempool: fix API documentation
A previous commit changed the local_cache table into a
pointer, reducing the size of the rte_mempool structure.
Fix the API comment of rte_mempool_create() related to
this modification.
Fixes:
213af31e0960 ("mempool: reduce structure size if no cache needed")
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Wei Zhao [Mon, 5 Dec 2016 03:40:00 +0000 (11:40 +0800)]
mempool: remove a redundant word in comment
There is a redundant repetition word "for" in comment line of the
file rte_mempool.h after the definition of RTE_MEMPOOL_OPS_NAMESIZE.
The word "for" appears twice in line 359 and 360. One of them is
redundant, so delete it.
Fixes:
449c49b93a6b ("mempool: support handler operations")
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>