dpdk.git
9 years agoixgbe/base: use a semaphore to serialize X550 IOSF accesses
Wenzhuo Lu [Wed, 24 Jun 2015 03:26:06 +0000 (11:26 +0800)]
ixgbe/base: use a semaphore to serialize X550 IOSF accesses

Because each IOSF access requires the use of multiple registers,
use a semaphore to serialize those accesses.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agoixgbe/base: add wait helper for X550 IOSF accesses
Wenzhuo Lu [Wed, 24 Jun 2015 03:26:05 +0000 (11:26 +0800)]
ixgbe/base: add wait helper for X550 IOSF accesses

Add a helper function to wait for IOSF accesses to complete. Also
perform this wait before each access, as specified in the datasheet.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agoixgbe/base: add macros for X550em bus speed fuse
Wenzhuo Lu [Wed, 24 Jun 2015 03:26:01 +0000 (11:26 +0800)]
ixgbe/base: add macros for X550em bus speed fuse

x550em has two different bus speeds, 300 MHz and 400 MHz.
A bit in a fuse register tells which it is, with a 1 meaning
the bus is running at 300 MHz.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agoixgbe/base: fix X550em UniPHY link configuration
Wenzhuo Lu [Wed, 24 Jun 2015 03:26:00 +0000 (11:26 +0800)]
ixgbe/base: fix X550em UniPHY link configuration

In UniPHY we have 2 IOSF targets that are UniPHY related. We can
write to PHY and PCS. In earlier times I've been told that there
were 2 separate PCS targets for IOSF commands and that's why I
implemented it with 2 defines and adding hw->bus.lan_id, but lately
I confirmed with HW that FW takes care of which PCS "slice" we are
talking to and is directing writes to correct one, so KX4_PCS1
target is dead now and we cannot use it.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agoixgbe/base: power down the X550em PHY on overtemp event
Wenzhuo Lu [Wed, 24 Jun 2015 03:25:58 +0000 (11:25 +0800)]
ixgbe/base: power down the X550em PHY on overtemp event

This patch powers down the x550em PHY on over-temp events. The
PHY firmware is supposed to do this autonomously but that isn't
implemented. The short-term stop-gap solution is for SW to power
down the PHY when it reports an overtemp event.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agoixgbe/base: check X550em SFP support
Wenzhuo Lu [Wed, 24 Jun 2015 03:25:55 +0000 (11:25 +0800)]
ixgbe/base: check X550em SFP support

This patch adds identify SFP module support for x550em. x550em
support returns an error for SFP module types not supported by
x550em design.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agoixgbe/base: fix X550em link setup without SFP
Wenzhuo Lu [Wed, 24 Jun 2015 03:25:53 +0000 (11:25 +0800)]
ixgbe/base: fix X550em link setup without SFP

This patch updates the x550em SFP link setup by adding
ixgbe_sfp_type_unknown and ixgbe_sfp_type_not_present case expression
to the ixgbe_setup_mac_link_sfp_x550em SFP type switch statement. This
handles the case when no module is present.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agoixgbe/base: fix uninitialized variable
Wenzhuo Lu [Wed, 24 Jun 2015 03:25:56 +0000 (11:25 +0800)]
ixgbe/base: fix uninitialized variable

Fix the warning caused by an uninitialized variable which might have
been used.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agoixgbe/base: fix X550em SFP+ link stability
Wenzhuo Lu [Wed, 24 Jun 2015 03:25:52 +0000 (11:25 +0800)]
ixgbe/base: fix X550em SFP+ link stability

Configure the CS4227 correctly for both 1G and 10G operation,
by moving the code to ixgbe_setup_mac_link_sfp_x550em(). It
needs to be in this function because we need both the module
type and the speed, and this is the only function in the init
flow that knows the speed. In contrast,
ixgbe_setup_sfp_modules_X550em() does not know the speed, so we
can't do anything useful here. This is a fundamental difference
from the 82599 flow.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agoixgbe/base: restore advertised autoneg after setting X550em LPLU
Wenzhuo Lu [Wed, 24 Jun 2015 03:25:59 +0000 (11:25 +0800)]
ixgbe/base: restore advertised autoneg after setting X550em LPLU

On systems that support LPLU in the firmware, the driver wouldn't be
aware of the LPLU speed change, and it wouldn't cache the new value when
the driver resumes. This patch emulates the same behavior by restoring
the previous autoneg settings to autoneg_advertised.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agoixgbe/base: update X550em LPLU
Wenzhuo Lu [Wed, 24 Jun 2015 03:25:51 +0000 (11:25 +0800)]
ixgbe/base: update X550em LPLU

This patch updates x550em LPLU (Low Power Link Up) to use the
MAC ops setup_link function pointer.
This removes redundant code and provides iXFI and KR support
between internal and external PHY.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agoixgbe/base: release X540 semaphores in proper order
Wenzhuo Lu [Wed, 24 Jun 2015 03:26:04 +0000 (11:26 +0800)]
ixgbe/base: release X540 semaphores in proper order

Because we acquire two semaphore bits before setting the SWFW_SYNC
register, we should release them in the reverse order that they
were acquired.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agoixgbe/base: fix X550 PCIe master disabling
Wenzhuo Lu [Wed, 24 Jun 2015 03:26:21 +0000 (11:26 +0800)]
ixgbe/base: fix X550 PCIe master disabling

This patch skips the PCI transactions pending check in
ixgbe_disable_pcie_master. The PCI transactions pending bit sticks high
when there were pending transactions, we should wait and then continue
with our reset flow.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agoixgbe/base: fix speed comments
Wenzhuo Lu [Wed, 24 Jun 2015 03:26:23 +0000 (11:26 +0800)]
ixgbe/base: fix speed comments

This patch fixes comment description for setting 2.5G and 5G speeds in
ixgbe_setup_phy_link_generic.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agoixgbe/base: add a shift constant for EEE
Wenzhuo Lu [Wed, 24 Jun 2015 03:25:54 +0000 (11:25 +0800)]
ixgbe/base: add a shift constant for EEE

Adds define for the number of bits needed to shift the EEE_SU register
in order to get the value of TEEE_DLY.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agoixgbe/base: change register definition code style
Wenzhuo Lu [Wed, 24 Jun 2015 03:26:20 +0000 (11:26 +0800)]
ixgbe/base: change register definition code style

This path changes ((P == 0) ? (<value for port 0>) : (<value for port 1>))
register definition into ((P) ? <value for port 1> : <value for port 0>)
style.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agoixgbe/base: update readme
Wenzhuo Lu [Wed, 24 Jun 2015 03:25:50 +0000 (11:25 +0800)]
ixgbe/base: update readme

Update readme file to show the version of the base code.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agoexamples/tep_term: fix vhost dependency
Jijiang Liu [Thu, 25 Jun 2015 08:56:09 +0000 (16:56 +0800)]
examples/tep_term: fix vhost dependency

The VXLAN example needs vhost library.

Signed-off-by: Jijiang Liu <jijiang.liu@intel.com>
9 years agombuf: use offset macro
Cyril Chemparathy [Mon, 22 Jun 2015 18:34:23 +0000 (11:34 -0700)]
mbuf: use offset macro

This patch simply applies the transform previously committed in
scripts/cocci/mtod-offset.cocci.  No other modifications have been
made here.

Signed-off-by: Cyril Chemparathy <cchemparathy@ezchip.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
9 years agombuf: add script to convert code to offset macro
Cyril Chemparathy [Mon, 22 Jun 2015 18:34:22 +0000 (11:34 -0700)]
mbuf: add script to convert code to offset macro

This patch adds a coccinelle (see http://coccinelle.lip6.fr/)
transform to use the newly added rte_pktmbuf_mtod_offset() helper.  In
addition, we add a simple script to apply all available transforms to
a codebase.

Signed-off-by: Cyril Chemparathy <cchemparathy@ezchip.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
9 years agombuf: add macro for offset arithmetic
Cyril Chemparathy [Mon, 22 Jun 2015 18:34:21 +0000 (11:34 -0700)]
mbuf: add macro for offset arithmetic

There are a number of instances in the code where rte_pktmbuf_mtod()
is used to get the mbuf data pointer, only to add an offset before
casting the result to some other header type.  This patch adds a new
rte_pktmbuf_mtod_offset() macro to eliminate these awful double cast
situations.

Signed-off-by: Cyril Chemparathy <cchemparathy@ezchip.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
9 years agoapp/testpmd: pack GRE header
Cyril Chemparathy [Mon, 22 Jun 2015 18:34:20 +0000 (11:34 -0700)]
app/testpmd: pack GRE header

Not packing this causes -Wcast-align breakage on machines that are
strict on alignment.  This patch fixes this bug.

Signed-off-by: Cyril Chemparathy <cchemparathy@ezchip.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
9 years agoeal: add and use unaligned integer types
Cyril Chemparathy [Mon, 22 Jun 2015 18:34:19 +0000 (11:34 -0700)]
eal: add and use unaligned integer types

On machines that are strict on pointer alignment, current code breaks
on GCC's -Wcast-align checks on casts from narrower to wider types.
This patch introduces new unaligned_uint(16|32|64)_t types, which
correctly retain alignment in such cases.  Strict alignment
architectures will need to define CONFIG_RTE_ARCH_STRICT_ALIGN in
order to effect these new types.

Signed-off-by: Cyril Chemparathy <cchemparathy@ezchip.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
9 years agohash: silence warning on pointer arithmetic
Cyril Chemparathy [Mon, 22 Jun 2015 18:34:18 +0000 (11:34 -0700)]
hash: silence warning on pointer arithmetic

Since sig_tbl_bucket_size and key_tbl_key_size are explicitly aligned
at initialization, offset dereferences in the hash table code cannot
possibly be unaligned.  However, the compiler is unaware of this fact
and complains on -Wcast-align.  This patch modifies the code to use
RTE_PTR_ADD(), thereby silencing the compiler by casting through (void
*).

Signed-off-by: Cyril Chemparathy <cchemparathy@ezchip.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
9 years agoethdev: silence warning on pointer arithmetic
Cyril Chemparathy [Mon, 22 Jun 2015 18:34:17 +0000 (11:34 -0700)]
ethdev: silence warning on pointer arithmetic

Statistics offsets in the rte_stats_strings[] array are always 64-bit aligned.
However, the compiler is unaware of this fact and complains on -Wcast-align.
This patch modifies the code to use RTE_PTR_ADD(), thereby silencing the
compiler by casting through (void *).

Signed-off-by: Cyril Chemparathy <cchemparathy@ezchip.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
9 years agombuf: silence warning on pointer arithmetic
Cyril Chemparathy [Mon, 22 Jun 2015 18:34:16 +0000 (11:34 -0700)]
mbuf: silence warning on pointer arithmetic

Translating from an mbuf element to the mbuf pointer does not break alignment
constraints.  However, the compiler is unaware of this fact and complains on
-Wcast-align.  This patch modifies the code to use RTE_PTR_SUB(), thereby
silencing the compiler by casting through (void *).

Signed-off-by: Cyril Chemparathy <cchemparathy@ezchip.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
9 years agomempool: silence warning on pointer arithmetic
Cyril Chemparathy [Mon, 22 Jun 2015 18:34:15 +0000 (11:34 -0700)]
mempool: silence warning on pointer arithmetic

Translating from a mempool object to the mempool pointer does not break
alignment constraints.  However, the compiler is unaware of this fact and
complains on -Wcast-align.  This patch modifies the code to use RTE_PTR_SUB(),
thereby silencing the compiler by casting through (void *).

Signed-off-by: Cyril Chemparathy <cchemparathy@ezchip.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
9 years agomempool: fix doxygen documentation
John McNamara [Tue, 23 Jun 2015 12:07:47 +0000 (13:07 +0100)]
mempool: fix doxygen documentation

Added Doxygen @param for missing API parameter in
rte_mempool_obj_iter(), to fix Doxygen warning. Also added
minor grammar fixes to that function documentation.

Signed-off-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
9 years agopci: fix licenses
Anatoly Burakov [Wed, 10 Jun 2015 10:19:21 +0000 (11:19 +0100)]
pci: fix licenses

Fixes: 88701645c98c ("eal: move interrupt type out of igb_uio")

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agolib: remove extra parenthesis after return
Ferruh Yigit [Mon, 11 May 2015 14:10:25 +0000 (17:10 +0300)]
lib: remove extra parenthesis after return

Remove extra parenthesis from return statements.

Signed-off-by: Ferruh Yigit <ferruhy@gmail.com>
9 years agombuf: fix indent in version map
Huawei Xie [Thu, 18 Jun 2015 17:55:53 +0000 (01:55 +0800)]
mbuf: fix indent in version map

Use tab rather than space.

Signed-off-by: Huawei Xie <huawei.xie@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
9 years agopipeline: add statistics for ports and tables
Pawel Wodkowski [Fri, 19 Jun 2015 11:13:09 +0000 (13:13 +0200)]
pipeline: add statistics for ports and tables

This patch adds statistics collection for librte_pipeline.
Those statistics are disabled by default during build time.

Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
9 years agotable: add stub stats
Maciej Gajdzica [Fri, 19 Jun 2015 10:28:44 +0000 (12:28 +0200)]
table: add stub stats

Added stub table statistics.

Signed-off-by: Maciej Gajdzica <maciejx.t.gajdzica@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
9 years agotable: add lpm stats
Maciej Gajdzica [Fri, 19 Jun 2015 10:28:42 +0000 (12:28 +0200)]
table: add lpm stats

Added lpm table statistics.
Added lpm ipv6 table statistics.

Signed-off-by: Maciej Gajdzica <maciejx.t.gajdzica@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
9 years agotable: add hash stats
Maciej Gajdzica [Fri, 19 Jun 2015 10:28:37 +0000 (12:28 +0200)]
table: add hash stats

Added statistics for hash ext table.
Added statistics for hash key8 table.
Added statistics for hash key16 table.
Added statistics for hash key32 table.
Added statistics for hash_lru table.

Signed-off-by: Maciej Gajdzica <maciejx.t.gajdzica@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
9 years agotable: add array stats
Maciej Gajdzica [Fri, 19 Jun 2015 10:28:36 +0000 (12:28 +0200)]
table: add array stats

Added statistics for array table.

Signed-off-by: Maciej Gajdzica <maciejx.t.gajdzica@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
9 years agotable: add acl stats
Maciej Gajdzica [Fri, 19 Jun 2015 10:28:35 +0000 (12:28 +0200)]
table: add acl stats

Added statistics for ACL table.

Signed-off-by: Maciej Gajdzica <maciejx.t.gajdzica@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
9 years agotable: add stats structure and config option
Maciej Gajdzica [Fri, 19 Jun 2015 10:28:34 +0000 (12:28 +0200)]
table: add stats structure and config option

Added common structure for table statistics.
Added config option to enable table stats collecting.

Signed-off-by: Maciej Gajdzica <maciejx.t.gajdzica@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
9 years agoport: add source stats
Maciej Gajdzica [Fri, 19 Jun 2015 09:41:24 +0000 (11:41 +0200)]
port: add source stats

Added statistics for source port.

Signed-off-by: Maciej Gajdzica <maciejx.t.gajdzica@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
9 years agoport: add sched stats
Maciej Gajdzica [Fri, 19 Jun 2015 09:41:22 +0000 (11:41 +0200)]
port: add sched stats

Added statistics for sched reader port.
Added statistics for sched writer port.

Signed-off-by: Maciej Gajdzica <maciejx.t.gajdzica@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
9 years agoport: add ring stats
Maciej Gajdzica [Fri, 19 Jun 2015 09:41:19 +0000 (11:41 +0200)]
port: add ring stats

Added statistics for ring reader port.
Added statistics for port writer port.
Added statistics for ring writer nodrop port.

Signed-off-by: Maciej Gajdzica <maciejx.t.gajdzica@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
9 years agoport: add reassembly stats
Maciej Gajdzica [Fri, 19 Jun 2015 09:41:18 +0000 (11:41 +0200)]
port: add reassembly stats

Added statistics for IPv4 and IPv6 reassembly ports.

Signed-off-by: Maciej Gajdzica <maciejx.t.gajdzica@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
9 years agoport: add fragmentation stats
Maciej Gajdzica [Fri, 19 Jun 2015 09:41:17 +0000 (11:41 +0200)]
port: add fragmentation stats

Added statistics for IPv4 and IPv6 fragmentation ports.

Signed-off-by: Maciej Gajdzica <maciejx.t.gajdzica@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
9 years agoport: add ethdev stats
Maciej Gajdzica [Fri, 19 Jun 2015 09:41:14 +0000 (11:41 +0200)]
port: add ethdev stats

Added statistics for ethdev reader port.
Added statistics for ethdev writer port.
Added statistics for ethdev writer nodrop port.

Signed-off-by: Maciej Gajdzica <maciejx.t.gajdzica@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
9 years agoport: add stats structures and config option
Maciej Gajdzica [Fri, 19 Jun 2015 09:41:13 +0000 (11:41 +0200)]
port: add stats structures and config option

Added common data structures for port statistics.
Added config option to enable stats collecting.

Signed-off-by: Maciej Gajdzica <maciejx.t.gajdzica@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
9 years agodoc: guidelines for library statistics
Cristian Dumitrescu [Tue, 16 Jun 2015 13:35:57 +0000 (14:35 +0100)]
doc: guidelines for library statistics

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
9 years agodoc: move env/arch guidelines in design section
Thomas Monjalon [Tue, 23 Jun 2015 13:29:59 +0000 (15:29 +0200)]
doc: move env/arch guidelines in design section

Move EAL subdirs guidelines from coding style to design section.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agoexamples/tep_term: add encap/decap configuration
Jijiang Liu [Mon, 22 Jun 2015 16:41:05 +0000 (00:41 +0800)]
examples/tep_term: add encap/decap configuration

Add the encapsulation and decapsulation options.

The two flags are enabled by default.

Sometimes we want to know the performance influence of
the encapsulation and decapsulation operations, and
I think we should add the two configuration options.

Signed-off-by: Jijiang Liu <jijiang.liu@intel.com>
9 years agoexamples/tep_term: add bad Rx checksum statistics
Jijiang Liu [Mon, 22 Jun 2015 16:41:04 +0000 (00:41 +0800)]
examples/tep_term: add bad Rx checksum statistics

Add the bad Rx checksum statistics of inner IP and L4.

The number of packets with bad RX IP and L4 checksum in inner header is recorded.

Signed-off-by: Jijiang Liu <jijiang.liu@intel.com>
9 years agoexamples/tep_term: add TSO offload configuration
Jijiang Liu [Mon, 22 Jun 2015 16:41:03 +0000 (00:41 +0800)]
examples/tep_term: add TSO offload configuration

Add the tso-segsz option for TSO offload.

If the 'tso-segsz' is not 0, it means TSO offload is enabled.

Signed-off-by: Jijiang Liu <jijiang.liu@intel.com>
9 years agoexamples/tep_term: add inner checksum Tx offload configuration
Jijiang Liu [Mon, 22 Jun 2015 16:41:02 +0000 (00:41 +0800)]
examples/tep_term: add inner checksum Tx offload configuration

Add Tx checksum offload configuration for inner header.

For UDP tunneling packet, the inner Tx checksum offload means
inner IPv4 and inner L4(TCP/UDP/SCTP).

Signed-off-by: Jijiang Liu <jijiang.liu@intel.com>
9 years agoexamples/tep_term: add tunnel filter type configuration
Jijiang Liu [Mon, 22 Jun 2015 16:41:01 +0000 (00:41 +0800)]
examples/tep_term: add tunnel filter type configuration

Add the filter types for VXLAN packet.

The following filter type are added here.

  - Inner MAC&VLAN and tenant ID

  - Inner MAC and tenent ID, and Outer MAC

  - Inner MAC and tenant ID

Signed-off-by: Jijiang Liu <jijiang.liu@intel.com>
9 years agoexamples/tep_term: add UDP tunneling port configuration
Jijiang Liu [Mon, 22 Jun 2015 16:41:00 +0000 (00:41 +0800)]
examples/tep_term: add UDP tunneling port configuration

The port number of UDP tunneling packet is configurable.

For i40e, it has 16 entries in total.

Signed-off-by: Jijiang Liu <jijiang.liu@intel.com>
9 years agoexamples/tep_term: implement VXLAN processing
Jijiang Liu [Mon, 22 Jun 2015 16:40:59 +0000 (00:40 +0800)]
examples/tep_term: implement VXLAN processing

Implement the VXLAN packet processing functions.

  - VXLAN port configuration

  - VXLAN tunnel setup

  - VXLAN tunnel destroying

  - VXLAN packet processing for Rx side

  - VXLAN packet processing for Tx side

Signed-off-by: Jijiang Liu <jijiang.liu@intel.com>
Signed-off-by: Thomas Long <thomas.long@intel.com>
9 years agoexamples/tep_term: add structures for VXLAN processing
Jijiang Liu [Mon, 22 Jun 2015 16:40:58 +0000 (00:40 +0800)]
examples/tep_term: add structures for VXLAN processing

Add the common APIs of tunneling packet processing.

We are trying to create a framework for tunneling packet processing, which includes

  - Tunnel port configuration

  - Tunnel setup

  - Tunnel destroying

  - Tunneling packet processing for Rx side

  - Tunneling packet processing for Tx side

  - Tunnel parameter processing

Signed-off-by: Jijiang Liu <jijiang.liu@intel.com>
Signed-off-by: Thomas Long <thomas.long@intel.com>
9 years agoexamples/tep_term: define basic VXLAN port information
Jijiang Liu [Mon, 22 Jun 2015 16:40:57 +0000 (00:40 +0800)]
examples/tep_term: define basic VXLAN port information

Add some basic VXLAN definitions in vxlan.h file.

It includes VXLAN port information and VXLAN device structures.

Signed-off-by: Jijiang Liu <jijiang.liu@intel.com>
Signed-off-by: Thomas Long <thomas.long@intel.com>
9 years agoexamples/tep_term: initialize VXLAN sample
Jijiang Liu [Mon, 22 Jun 2015 16:40:56 +0000 (00:40 +0800)]
examples/tep_term: initialize VXLAN sample

This patch creates the virtio devices management mechanism.

These functions are from the vHost example, which include:

  - virtio device creation.

  - virtio device destroying.

  - virtio device maintenance.

Signed-off-by: Jijiang Liu <jijiang.liu@intel.com>
[Thomas: remove unused function validate_nb_devices()]
[Thomas: add maintainers section]

9 years agoapp/test: fix crash after mbuf allocation failure
Tetsuya Mukawa [Fri, 12 Jun 2015 02:54:00 +0000 (11:54 +0900)]
app/test: fix crash after mbuf allocation failure

The patch fixes potential null pointer accesses in test_mbuf.
If 'm[i]' is null, stop accessing it.

Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
9 years agoexamples/distributor: fix debug macro
Bruce Richardson [Fri, 5 Jun 2015 16:01:17 +0000 (17:01 +0100)]
examples/distributor: fix debug macro

The macro to turn on additional debug output when the app was compiled
with "-DDEBUG" was missing a ";".

Fixes: 07db4a975094 ("examples/distributor: new sample app")

Signed-off-by: Anbarasan Murugesan <anbarasanx.murugesan@intel.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
9 years agoreorder: allow random number as starting point
Simon Kagstrom [Wed, 20 May 2015 11:02:05 +0000 (13:02 +0200)]
reorder: allow random number as starting point

We use sequence numbers from a generator which has potentially started
long before the receiver. Therefore, the first number will typically
be > 0. The rte_reorder code will not work in this case, since the
packet is seen as outside of the buffer.

The patch instead records the first sequence number inserted as the
starting point.

Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net>
Signed-off-by: Johan Faltstrom <johan.faltstrom@netinsight.net>
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
9 years agoport: fix unaligned access to metadata
Daniel Mrzyglod [Fri, 5 Jun 2015 14:55:10 +0000 (16:55 +0200)]
port: fix unaligned access to metadata

Fix RTE_MBUF_METADATA macros to allow for unaligned accesses to
meta-data fields.
Forcing aligned accesses is not really required, so this is removing an
unneeded constraint.
This issue was met during testing of the new version of the ip_pipeline
application. There is no performance impact.
This change has no ABI impact, as the previous code that uses aligned
accesses continues to run without any issues.

Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
9 years agoeal: fix log level of early messages
Keith Wiles [Mon, 8 Jun 2015 21:55:52 +0000 (16:55 -0500)]
eal: fix log level of early messages

The RTE_LOG(DEBUG, ...) messages in rte_eal_cpu_init() are printed
even when the log level on the command line was set to INFO or lower.

The problem is the rte_eal_cpu_init() routine was called before
the command line args are scanned. Setting --log-level=7 now
correctly does not print the messages from the rte_eal_cpu_init() routine.

Signed-off-by: Keith Wiles <keith.wiles@intel.com>
Acked-by: David Marchand <david.marchand@6wind.com>
9 years agolog: fix crash after dump
Jan Blunck [Mon, 1 Jun 2015 09:30:38 +0000 (11:30 +0200)]
log: fix crash after dump

In rte_log_dump_history() the log_history list is reinitialized without
resetting the log_history_size. In the next call to rte_log_add_in_history()
the log_history_size > RTE_LOG_HISTORY and the code unconditionally tries
to remove the first entry:

Program received signal SIGSEGV, Segmentation fault.
rte_log_add_in_history (
    buf=buf@entry=0x7f02035cd000 "[snip]\n", size=size@entry=86)
    at /usr/src/packages/BUILD/lib/librte_eal/common/eal_common_log.c:122

Signed-off-by: Jan Blunck <jblunck@infradead.org>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
9 years agoivshmem: fix crash in corner case
Sergio Gonzalez Monroy [Thu, 18 Jun 2015 12:27:30 +0000 (13:27 +0100)]
ivshmem: fix crash in corner case

Depending on the configured segments it is possible to hit a
segmentation fault as a result of decrementing an unsigned index with
value 0.

To avoid it, exit the loop if the index has value 0.

Fixes: 40b966a211ab ("ivshmem: library changes for mmaping using ivshmem")

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
9 years agokni: ignore double initialization
Marc Sune [Thu, 18 Jun 2015 16:34:48 +0000 (18:34 +0200)]
kni: ignore double initialization

Prevent double initialization of the KNI subsytem.

Signed-off-by: Marc Sune <marc.sune@bisdn.de>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agoring: fix return of new port id on creation
Bruce Richardson [Thu, 18 Jun 2015 13:28:41 +0000 (14:28 +0100)]
ring: fix return of new port id on creation

The rte_eth_from_rings API allowed the creation of an ethdev port at
runtime using rte_rings as the underlying storage. However, the return
value from this function was either 0 or -1, and these values were never
actually documented in the API documentation. Unfortunately, the programmers
guide doc examples for this API implied that the return value from this
function was the port id of the newly created ethdev.

Since this latter behaviour is more useful - and already implied by the
documentation, this patch changes the return 0 to "return
data->port_id". It also adds in doxygen comments for the function so it
can be correctly documented in the API reference.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
9 years agofm10k: fix mac/vlan filtering
Shaopeng He [Mon, 15 Jun 2015 01:26:10 +0000 (09:26 +0800)]
fm10k: fix mac/vlan filtering

This patch includes 3 changes related to MAC/VLAN address table
when the system (e.g. testpmd) is started and closed:
 - remove default MAC address with fixed VLAN 0 which was for the
   debug purpose before the MAC/VLAN filter function was implemented.
 - enable VF MAC/VLAN filter for the first valid MAC address
   and first valid VLAN ID. This is needed for system (e.g. testpmd)
   to setup default MAC address and default VLAN for VF.
   Later attempt to change these default value will be refused by
   under layer shared code and PF host functions.
 - un-register any combination of VLAN and MAC address from fm10k
   switch side MAC table when the system (e.g. testpmd) is closed.

Signed-off-by: Shaopeng He <shaopeng.he@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
Tested-by: Michael Qiu <michael.qiu@intel.com>
9 years agofm10k: update vlan offload features
Shaopeng He [Thu, 18 Jun 2015 07:21:21 +0000 (15:21 +0800)]
fm10k: update vlan offload features

Fm10k PF/VF does not support QinQ; VLAN strip and filter are always on
for PF/VF ports.

Signed-off-by: Shaopeng He <shaopeng.he@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
9 years agofm10k: add mac filtering
Shaopeng He [Thu, 18 Jun 2015 07:21:20 +0000 (15:21 +0800)]
fm10k: add mac filtering

MAC filter function was newly added, each PF and VF can have up to
64 MAC addresses.
VF filter needs support from PF host, which is not available now.

Signed-off-by: Shaopeng He <shaopeng.he@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
9 years agofm10k: update mac table with vlan filtering
Shaopeng He [Thu, 18 Jun 2015 07:21:19 +0000 (15:21 +0800)]
fm10k: update mac table with vlan filtering

VLAN filter was updated to add/delete one static entry in MAC table for
each combination of VLAN and MAC address. More sanity checks were added.

Signed-off-by: Shaopeng He <shaopeng.he@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
9 years agofm10k: fix default mac/vlan in switch
Chen Jing D(Mark) [Fri, 29 May 2015 08:10:44 +0000 (16:10 +0800)]
fm10k: fix default mac/vlan in switch

Since the communication between PF/Switch Manager, VF/PF is
asynchronous through mailbox, it's hard to determine when Switch
Manager/PF host will send the default vlan to PF/VF. So, it's
necessary to set default vlan until the device is started.

Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
Acked-by: Shaopeng He <shaopeng.he@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
9 years agofm10k: check mac address
Chen Jing D(Mark) [Fri, 29 May 2015 08:10:43 +0000 (16:10 +0800)]
fm10k: check mac address

After acquiring MAC address from HW, it's necessary to validate
MAC address before use.

Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
Acked-by: Shaopeng He <shaopeng.he@intel.com>
Tested-by: Michael Qiu <michael.qiu@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
9 years agofm10k: fix switch synchronization
Chen Jing D(Mark) [Fri, 29 May 2015 08:10:42 +0000 (16:10 +0800)]
fm10k: fix switch synchronization

In fm10k, PF driver needs to communicate with switch through
mailbox if it needs to add/delete MAC address.
This fix will validate if switch is ready before going forward.
Then, it is necessary to acquire LPORT_MAP info after issuing
MAC addr request to switch.

Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
Acked-by: Shaopeng He <shaopeng.he@intel.com>
Tested-by: Michael Qiu <michael.qiu@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
9 years agofm10k: fix Tx multi-segment frame
Chen Jing D(Mark) [Fri, 29 May 2015 08:10:41 +0000 (16:10 +0800)]
fm10k: fix Tx multi-segment frame

In TX side, bit FM10K_TXD_FLAG_LAST in TX descriptor only is set
in the last descriptor for multi-segment packets. But current
implementation didn't set all the fields of TX descriptor, which
will cause descriptors processed now to re-use fields set in last
scroll. If FM10K_TXD_FLAG_LAST bit was set in the last round and
it happened this is not the last descriptor of a multi-segnment
packet, HW will send out the incomplete packet out and leads to
data intergrity issue.

Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
Acked-by: Shaopeng He <shaopeng.he@intel.com>
Tested-by: Michael Qiu <michael.qiu@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
9 years agofm10k: fix jumbo frame issue
Chen Jing D(Mark) [Fri, 29 May 2015 08:10:40 +0000 (16:10 +0800)]
fm10k: fix jumbo frame issue

fm10k can't receive frame greater than 1536 and Scatter RX
function can't work correctly. The root cause is
SRRCTL.FM10K_SRRCTL_BUFFER_CHAINING_EN bit is not enabled.

Test report: http://dpdk.org/ml/archives/dev/2015-June/019242.html

Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
Acked-by: Shaopeng He <shaopeng.he@intel.com>
Tested-by: Michael Qiu <michael.qiu@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
9 years agofm10k: fix Rx buffer size
Chen Jing D(Mark) [Fri, 29 May 2015 08:10:39 +0000 (16:10 +0800)]
fm10k: fix Rx buffer size

As RX buffer is aligned to 512B within mbuf, some bytes are reserved
for this purpose, and the worst case could be 511B. But SRR reg
assumes all buffers have the same size. In order to fill the gap,
we'll have to consider the worst case and assume 512B is reserved.
If we don't do so, it's possible for HW to overwrite data to next
mbuf.

Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
Acked-by: Shaopeng He <shaopeng.he@intel.com>
Tested-by: Michael Qiu <michael.qiu@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
9 years agofm10k: fix maximum queue number for VF
Chen Jing D(Mark) [Fri, 12 Jun 2015 07:06:29 +0000 (15:06 +0800)]
fm10k: fix maximum queue number for VF

Both PF and VF shared code in function fm10k_stats_get().
The function works well with PF, but has problem with VF since
VF has less queues than PF.

Fixes: a6061d9e7075 ("fm10k: register PF driver")

Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
9 years agofm10k: remove mbuf size sanity check
Chen Jing D(Mark) [Fri, 12 Jun 2015 07:06:28 +0000 (15:06 +0800)]
fm10k: remove mbuf size sanity check

Original implementation required mbuf size should be greater than
ETHER_MAX_VLAN_FRAME_LEN, which is not necessary. If it's less
than that value, scatter function will be selected and incoming
packets greater than mbuf size will be filled into several mbufs.

Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
9 years agofm10k: support promiscuous mode
Chen Jing D(Mark) [Fri, 12 Jun 2015 07:06:27 +0000 (15:06 +0800)]
fm10k: support promiscuous mode

Add functions to support promiscuous/allmulticast enable and
disable.

Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
Tested-by: Michael Qiu <michael.qiu@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
9 years agoixgbe: fix X550 copper link
Wenzhuo Lu [Tue, 16 Jun 2015 08:07:49 +0000 (16:07 +0800)]
ixgbe: fix X550 copper link

For there're only laser ports on x550 before, we only considered laser
ports for the testpmd CLIs "port start/stop ...". Now we have new x550
devices which have copper ports. Use the API for copper to enable/disable
these ports.

And also let the testpmd CLI "set link-up/down ..." support copper
ports.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
9 years agoixgbe: fix TSO in IPv6
Didier Pallard [Mon, 22 Jun 2015 14:21:18 +0000 (16:21 +0200)]
ixgbe: fix TSO in IPv6

When TSO is used with IPv6, generated frames are incorrect.
L4 frame is OK, but length field of IPv6 header was not populated correctly.

IXGBE_ADVTXD_TUCMD_IPV6 flag is set for better readability, even if it
does nothing.

Signed-off-by: Didier Pallard <didier.pallard@6wind.com>
Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agoixgbevf: fix link status for PF up/down events
Sergio Gonzalez Monroy [Tue, 16 Jun 2015 14:38:48 +0000 (15:38 +0100)]
ixgbevf: fix link status for PF up/down events

Current ixgbe VF base driver only really read the status register when:
 - get_link_status is true
 - link reset
 - mailbox timeout.

We only set get_link_status to true when we start the PF/VF, so
following calls to ixgbe_dev_link_update will just keep the old link
status unless the link has been reset.

Because of this behaviour, when the link status of the PF changes after
the VF has been initialized, we do not read the current status register
from the nic and instead we just keep the old link status.

Fix the problem by setting this field to true before calling
ixgbe_check_link function from base driver. We don't need to check after
this call for get_link_status anymore, so remove it.

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
9 years agoixgbevf: fix Rx function selection
Sergio Gonzalez Monroy [Fri, 12 Jun 2015 15:18:19 +0000 (16:18 +0100)]
ixgbevf: fix Rx function selection

The logic to select ixgbe VF RX function is different than PF side.

There are a few issues with its current state:
 - it does not allow to select ixgbe_recv_pkts_vec among other options.
 - it can cause memory corruption for scatter mode as it does not allocate
   enough entries in sw_ring.
 - when checksum is enabled, incorrect vector RX function is selected.

To solve above issues, change the VF RX function selection logic to
mimic PF side.

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
9 years agoixgbe: fix flow director flexbytes offset
Jingjing Wu [Fri, 19 Jun 2015 06:35:25 +0000 (14:35 +0800)]
ixgbe: fix flow director flexbytes offset

The flexbytes offset can not be set, because the value is over written
when fdir is enabled.
This patch fixes this issue, and also removes some reduplicate lines.

Fixes: d54a9888267c ("ixgbe: support flexpayload configuration of flow director")

Reported-by: David Marchand <david.marchand@6wind.com>
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Tested-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Acked-by: David Marchand <david.marchand@6wind.com>
9 years agomempool: fix style
Olivier Matz [Fri, 19 Jun 2015 16:16:39 +0000 (18:16 +0200)]
mempool: fix style

Do some cosmetic clean-up.
Fix typos, indentation, and doxygen style.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
9 years agomempool: add structure for object trailers
Olivier Matz [Fri, 19 Jun 2015 16:16:38 +0000 (18:16 +0200)]
mempool: add structure for object trailers

Each object stored in mempools are suffixed by a trailer, storing
a cookie in debug mode which help to detect memory corruptions.

Like for headers, introduce a structure that materializes the content of
this trailer.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
9 years agomempool: add structure for object headers
Olivier Matz [Fri, 19 Jun 2015 16:16:37 +0000 (18:16 +0200)]
mempool: add structure for object headers

Each object stored in mempools are prefixed by a header, allowing for
instance to retrieve the mempool pointer from the object. When debug is
enabled, a cookie is also added in this header that helps to detect
corruptions and double-frees.

Introduce a structure that materializes the content of this header,
and will simplify future patches adding things in this header.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
9 years agoapp/test: add hash scalability test using HTM lock elision
Roman Dementiev [Fri, 19 Jun 2015 11:08:23 +0000 (13:08 +0200)]
app/test: add hash scalability test using HTM lock elision

This patch adds a new auto-test for testing the scaling
of concurrent inserts into rte_hash when protected by
the normal spinlock vs. the spinlock with HTM lock
elision. The test also benchmarks single-threaded
access without any locks.

Signed-off-by: Roman Dementiev <roman.dementiev@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
9 years agorwlock: add HTM lock elision for x86
Roman Dementiev [Fri, 19 Jun 2015 11:08:22 +0000 (13:08 +0200)]
rwlock: add HTM lock elision for x86

This patch adds methods that use hardware memory transactions (HTM) on
fast-path for rwlock (a.k.a. lock elision). Here the methods are implemented
for x86 using Restricted Transactional Memory instructions (Intel(r)
Transactional Synchronization Extensions). The implementation fall-backs to
the normal rwlock if HTM is not available or memory transactions fail. This is
not a replacement for all rwlock usages since not all critical sections
protected by locks are friendly to HTM. For example, an attempt to perform
a HW I/O operation inside a hardware memory transaction always aborts
the transaction since the CPU is not able to roll-back should the transaction
fail. Therefore, hardware transactional locks are not advised to be used around
rte_eth_rx_burst() and rte_eth_tx_burst() calls.

Signed-off-by: Roman Dementiev <roman.dementiev@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
9 years agospinlock: add HTM lock elision for x86
Roman Dementiev [Fri, 19 Jun 2015 11:08:21 +0000 (13:08 +0200)]
spinlock: add HTM lock elision for x86

This patch adds methods that use hardware memory transactions (HTM) on fast-path
for spinlocks (a.k.a. lock elision). Here the methods are implemented for x86
using Restricted Transactional Memory instructions (Intel(r) Transactional
Synchronization Extensions). The implementation fall-backs to the normal
spinlock if HTM is not available or memory transactions fail. This is not
a replacement for all spinlock usages since not all critical sections protected
by spinlocks are friendly to HTM. For example, an attempt to perform a HW I/O
operation inside a hardware memory transaction always aborts the transaction
since the CPU is not able to roll-back should the transaction fail.
Therefore, hardware transactional locks are not advised to be used around
rte_eth_rx_burst() and rte_eth_tx_burst() calls.

Signed-off-by: Roman Dementiev <roman.dementiev@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
9 years agodoc: fix doxygen warnings
Thomas Monjalon [Thu, 18 Jun 2015 21:43:06 +0000 (23:43 +0200)]
doc: fix doxygen warnings

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
9 years agodoc: fix doxygen warnings in vhost API
Ouyang Changchun [Fri, 19 Jun 2015 02:20:42 +0000 (10:20 +0800)]
doc: fix doxygen warnings in vhost API

Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
9 years agoacl: add new test cases
Konstantin Ananyev [Mon, 8 Jun 2015 10:41:30 +0000 (11:41 +0100)]
acl: add new test cases

Add several new test cases for ACL to cover different build configurations.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
9 years agoacl: fix ambiguity between test rules
Konstantin Ananyev [Mon, 8 Jun 2015 10:41:29 +0000 (11:41 +0100)]
acl: fix ambiguity between test rules

Some test rules had equal priority for the same category.
That can cause an ambiguity in build trie and test results.
Specify different priority value for each rule from the same category.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
9 years agoacl: remove unused code
Konstantin Ananyev [Mon, 8 Jun 2015 10:41:28 +0000 (11:41 +0100)]
acl: remove unused code

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
9 years agoacl: introduce a macro for bitmask conversion
Konstantin Ananyev [Mon, 8 Jun 2015 10:41:27 +0000 (11:41 +0100)]
acl: introduce a macro for bitmask conversion

Introduce new RTE_ACL_MASKLEN_TO_BITMASK macro, that will be used
in several places inside librte_acl and it's UT.
Simplify and cleanup build_trie() code a bit.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
9 years agoacl: fix unneeded trie splitting for subset of rules
Konstantin Ananyev [Mon, 8 Jun 2015 10:41:26 +0000 (11:41 +0100)]
acl: fix unneeded trie splitting for subset of rules

When rebuilding a trie for limited rule-set,
don't try to split the rule-set even further.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
9 years agoacl: add function to check build input parameters
Konstantin Ananyev [Mon, 8 Jun 2015 10:41:25 +0000 (11:41 +0100)]
acl: add function to check build input parameters

Move check for build confg parameter into a separate function.
Simplify acl_calc_wildness() function.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
9 years agoacl: remove redundant macro
Konstantin Ananyev [Mon, 8 Jun 2015 10:41:24 +0000 (11:41 +0100)]
acl: remove redundant macro

Use global RTE_LEN2MASK macro, instead of local LEN2MASK.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
9 years agoacl: fix invalid rule wildness calculation for bitmask field type
Konstantin Ananyev [Mon, 8 Jun 2015 10:41:23 +0000 (11:41 +0100)]
acl: fix invalid rule wildness calculation for bitmask field type

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>