dpdk.git
9 years agoscripts: fix symbol overriding in configuration
David Marchand [Thu, 27 Nov 2014 11:29:05 +0000 (12:29 +0100)]
scripts: fix symbol overriding in configuration

When redefining the same symbol in configuration (basically after an inclusion),
we need to undefine the previous symbol to avoid "redefined" errors.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agonet: fix conflict with libc
Thomas Monjalon [Thu, 27 Nov 2014 11:28:17 +0000 (12:28 +0100)]
net: fix conflict with libc

It was impossible to include netinet/in.h and rte_ip.h
because the IP protocols were redefined.
It is removed because useless.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Ivan Boule <ivan.boule@6wind.com>
9 years agoapp/testpmd: fix RSS flags size
Jia Yu [Fri, 7 Nov 2014 15:43:01 +0000 (07:43 -0800)]
app/testpmd: fix RSS flags size

Since commit 8a387fa85f02 ("ethdev: more RSS flags") in DPDK 1.7,
RSS flags have increased.
According to rss_hf definition in rte_eth_rss_conf, it shall be uint64 type.
Using uint16 will get truncated value, and cause incorrect output. This
fix corrected this issue.

Signed-off-by: Jia Yu <jyu@vmware.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agomempool: avoid dump crash with null pointer
Keith Wiles [Sun, 28 Sep 2014 05:28:44 +0000 (05:28 +0000)]
mempool: avoid dump crash with null pointer

Check the FILE *f and rte_mempool *mp pointers for NULL.

Signed-off-by: Keith Wiles <keith.wiles@windriver.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
9 years agoadd prefix to cache line macros
Sergio Gonzalez Monroy [Wed, 19 Nov 2014 12:26:06 +0000 (12:26 +0000)]
add prefix to cache line macros

CACHE_LINE_SIZE is a macro defined in machine/param.h in FreeBSD and
conflicts with DPDK macro version.
Adding RTE_ prefix to avoid conflicts.
CACHE_LINE_MASK and CACHE_LINE_ROUNDUP are also prefixed.

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
[Thomas: updated on HEAD, including PPC]

9 years agoeal/bsd: remove unused HPET support
Sergio Gonzalez Monroy [Thu, 20 Nov 2014 14:06:59 +0000 (14:06 +0000)]
eal/bsd: remove unused HPET support

The HPET support in the BSD EAL was copied directly from the Linux version,
but did not actually work on FreeBSD. We replace this old code with a simple
compiler message that informs the user that we don't support HPET on BSD if
they enable such support in the build-time configuration file.

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
9 years agoeal/bsd: use sysctl to get TSC frequency
Sergio Gonzalez Monroy [Thu, 20 Nov 2014 14:06:58 +0000 (14:06 +0000)]
eal/bsd: use sysctl to get TSC frequency

BSD provides the TSC frequency value through sysctl.

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
9 years agodoc: no more bare metal environment
Thomas Monjalon [Thu, 27 Nov 2014 10:02:11 +0000 (11:02 +0100)]
doc: no more bare metal environment

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agoexamples: no more bare metal environment
David Marchand [Fri, 26 Sep 2014 14:04:02 +0000 (16:04 +0200)]
examples: no more bare metal environment

Signed-off-by: David Marchand <david.marchand@6wind.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
9 years agoapp: no more bare metal environment
David Marchand [Fri, 26 Sep 2014 14:04:01 +0000 (16:04 +0200)]
app: no more bare metal environment

Signed-off-by: David Marchand <david.marchand@6wind.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
9 years agoeal: no more bare metal environment
David Marchand [Fri, 26 Sep 2014 14:04:00 +0000 (16:04 +0200)]
eal: no more bare metal environment

Signed-off-by: David Marchand <david.marchand@6wind.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
9 years agomk: no more bare metal environment
David Marchand [Fri, 26 Sep 2014 14:03:59 +0000 (16:03 +0200)]
mk: no more bare metal environment

Signed-off-by: David Marchand <david.marchand@6wind.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
9 years agoconfig: no more bare metal environment
David Marchand [Fri, 26 Sep 2014 14:03:58 +0000 (16:03 +0200)]
config: no more bare metal environment

Signed-off-by: David Marchand <david.marchand@6wind.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
9 years agombuf: sort TCP segmentation offload flag
Thomas Monjalon [Thu, 27 Nov 2014 09:35:56 +0000 (10:35 +0100)]
mbuf: sort TCP segmentation offload flag

Due to reordering conflicts, the TSO flag was not sorted.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agoeal/linux: fix remaining checks for 64-bit architectures
David Marchand [Mon, 24 Nov 2014 15:18:51 +0000 (16:18 +0100)]
eal/linux: fix remaining checks for 64-bit architectures

RTE_ARCH_X86_64 can not be used as a way to determine if we are building for
64bits cpus. Instead, RTE_ARCH_64 should be used.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Chao Zhu <chaozhu@linux.vnet.ibm.com>
9 years agoi40e: add ethertype filter
jingjing.wu [Thu, 13 Nov 2014 12:49:55 +0000 (20:49 +0800)]
i40e: add ethertype filter

Handle the RTE_ETH_FILTER_ADD and RTE_ETH_FILTER_DELETE operations
on ethertype filter.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Jijiang Liu <jijiang.liu@intel.com>
9 years agoethdev: add ethertype filter
jingjing.wu [Thu, 13 Nov 2014 12:49:54 +0000 (20:49 +0800)]
ethdev: add ethertype filter

A new structure of ethertype filter is defined in rte_eth_ctrl.h
for filter_ctrl api

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Jijiang Liu <jijiang.liu@intel.com>
9 years agoenic: build integration
Sujith Sankar [Tue, 25 Nov 2014 17:26:41 +0000 (22:56 +0530)]
enic: build integration

Signed-off-by: Sujith Sankar <ssujith@cisco.com>
Acked-by: David Marchand <david.marchand@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
[Thomas: enable for BSD - not tested]
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agoenic: new driver
Sujith Sankar [Tue, 25 Nov 2014 17:26:43 +0000 (22:56 +0530)]
enic: new driver

Signed-off-by: Sujith Sankar <ssujith@cisco.com>
Acked-by: David Marchand <david.marchand@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
9 years agoenic/base: common code
Sujith Sankar [Tue, 25 Nov 2014 17:26:42 +0000 (22:56 +0530)]
enic/base: common code

VNIC common code is partially shared with ENIC kernel mode driver.

Signed-off-by: Sujith Sankar <ssujith@cisco.com>
Acked-by: David Marchand <david.marchand@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
9 years agoenic: license
Sujith Sankar [Tue, 25 Nov 2014 17:26:40 +0000 (22:56 +0530)]
enic: license

Signed-off-by: Sujith Sankar <ssujith@cisco.com>
9 years agoapp/testpmd: fix build for IBM Power
Chao Zhu [Tue, 25 Nov 2014 22:17:17 +0000 (17:17 -0500)]
app/testpmd: fix build for IBM Power

This patch fixes compiling problems on IBM Power architecture and turn
on the test-pmd compiling option in configuration file. Actually, this
is an big endian compiling fix.

Signed-off-by: Chao Zhu <chaozhu@linux.vnet.ibm.com>
Acked-by: David Marchand <david.marchand@6wind.com>
9 years agoapp/test: fix finding the second smallest memory segment
Chao Zhu [Tue, 25 Nov 2014 22:17:16 +0000 (17:17 -0500)]
app/test: fix finding the second smallest memory segment

Curent implementation in test_memzone.c has bugs in finding the
second smallest memory segment. It's the last smallest memory segment,
but it's not the second smallest memory segment. This bug may cause test
failure in some cases. This patch fixes this bug.

Signed-off-by: Chao Zhu <chaozhu@linux.vnet.ibm.com>
Acked-by: David Marchand <david.marchand@6wind.com>
9 years agomem: support layout of IBM Power
Chao Zhu [Tue, 25 Nov 2014 22:17:15 +0000 (17:17 -0500)]
mem: support layout of IBM Power

The mmap of hugepage files on IBM Power starts from high address to low
address. This is different from x86. This patch modified the memory
segment detection code to get the correct memory segment layout on Power
architecture. This patch also added a commond ARCH_PPC_64 definition for
64 bit systems.

Signed-off-by: Chao Zhu <chaozhu@linux.vnet.ibm.com>
Acked-by: David Marchand <david.marchand@6wind.com>
9 years agomem: add huge page sizes for IBM Power
Chao Zhu [Tue, 25 Nov 2014 22:17:14 +0000 (17:17 -0500)]
mem: add huge page sizes for IBM Power

IBM Power architecture has different huge page sizes (16MB, 16GB) than
x86.This patch defines RTE_PGSIZE_16M and RTE_PGSIZE_16G in the
rte_page_sizes enum variable and adds huge page size support of DPDK
for IBM Power architecture.

Signed-off-by: Chao Zhu <chaozhu@linux.vnet.ibm.com>
Acked-by: David Marchand <david.marchand@6wind.com>
9 years agomk: define cache size for IBM Power
Chao Zhu [Tue, 25 Nov 2014 22:17:13 +0000 (17:17 -0500)]
mk: define cache size for IBM Power

IBM Power architecture has different cache line size (128 bytes) than
x86 (64 bytes). This patch defines CACHE_LINE_SIZE to 128 bytes to
override the default value 64 bytes to support IBM Power Architecture.

Signed-off-by: Chao Zhu <chaozhu@linux.vnet.ibm.com>
Acked-by: David Marchand <david.marchand@6wind.com>
9 years agoeal/linux: disable iopl operation for IBM Power
Chao Zhu [Tue, 25 Nov 2014 22:17:12 +0000 (17:17 -0500)]
eal/linux: disable iopl operation for IBM Power

iopl() call is mostly for the i386 architecture. In Power and other
architecture, it doesn't exist. This patch modified rte_eal_iopl_init()
and make it return -1 for Power and other architecture. Thus
rte_config.flags will not contain EAL_FLG_HIGH_IOPL flag for other
architecture.

Signed-off-by: Chao Zhu <chaozhu@linux.vnet.ibm.com>
Acked-by: David Marchand <david.marchand@6wind.com>
9 years agoeal/ppc: cpu flag checks for IBM Power
Chao Zhu [Tue, 25 Nov 2014 22:17:11 +0000 (17:17 -0500)]
eal/ppc: cpu flag checks for IBM Power

IBM Power processor doesn't have CPU flag hardware registers. This patch
uses aux vector software register to get CPU flags and add CPU flag
checking support for IBM Power architecture.

Signed-off-by: Chao Zhu <chaozhu@linux.vnet.ibm.com>
Acked-by: David Marchand <david.marchand@6wind.com>
9 years agoeal/ppc: vector memcpy for IBM Power
Chao Zhu [Tue, 25 Nov 2014 22:17:10 +0000 (17:17 -0500)]
eal/ppc: vector memcpy for IBM Power

The SSE based memory copy in DPDK only support x86. This patch adds
altivec based memory copy functions for IBM Power architecture. This
patch includes altivec.h which requires GCC version>= 4.8.

Signed-off-by: Chao Zhu <chaozhu@linux.vnet.ibm.com>
Acked-by: David Marchand <david.marchand@6wind.com>
9 years agoeal/ppc: spinlock operations for IBM Power
Chao Zhu [Tue, 25 Nov 2014 22:17:09 +0000 (17:17 -0500)]
eal/ppc: spinlock operations for IBM Power

This patch adds spinlock operations for IBM Power architecture.

Signed-off-by: Chao Zhu <chaozhu@linux.vnet.ibm.com>
Acked-by: David Marchand <david.marchand@6wind.com>
9 years agoeal/ppc: prefetch operations for IBM Power
Chao Zhu [Tue, 25 Nov 2014 22:17:08 +0000 (17:17 -0500)]
eal/ppc: prefetch operations for IBM Power

This patch add architecture specific prefetch operations for IBM Power
architecture.

Signed-off-by: Chao Zhu <chaozhu@linux.vnet.ibm.com>
Acked-by: David Marchand <david.marchand@6wind.com>
9 years agoeal/ppc: cpu cycle operations for IBM Power
Chao Zhu [Tue, 25 Nov 2014 22:17:07 +0000 (17:17 -0500)]
eal/ppc: cpu cycle operations for IBM Power

IBM Power architecture doesn't have TSC register to get CPU cycles. This
patch implements the time base register read instead of TSC register of
x86 on IBM Power architecture.

Signed-off-by: Chao Zhu <chaozhu@linux.vnet.ibm.com>
Acked-by: David Marchand <david.marchand@6wind.com>
9 years agoeal/ppc: byte order operations for IBM Power
Chao Zhu [Tue, 25 Nov 2014 22:17:06 +0000 (17:17 -0500)]
eal/ppc: byte order operations for IBM Power

This patch adds architecture specific byte order operations for IBM Power
architecture. Power architecture support both big endian and little
endian. This patch also adds a RTE_ARCH_BIG_ENDIAN micro.

Signed-off-by: Chao Zhu <chaozhu@linux.vnet.ibm.com>
Acked-by: David Marchand <david.marchand@6wind.com>
9 years agoeal/ppc: atomic operations for IBM Power
Chao Zhu [Tue, 25 Nov 2014 22:17:05 +0000 (17:17 -0500)]
eal/ppc: atomic operations for IBM Power

This patch adds architecture specific atomic operation file for IBM
Power architecture CPU.

Signed-off-by: Chao Zhu <chaozhu@linux.vnet.ibm.com>
Acked-by: David Marchand <david.marchand@6wind.com>
9 years agomk: introduce IBM Power architecture
Chao Zhu [Tue, 25 Nov 2014 22:17:04 +0000 (17:17 -0500)]
mk: introduce IBM Power architecture

To make DPDK run on IBM Power architecture, configuration files for
Power architecuture are added. Also, the compiling related .mk files are
added.

Signed-off-by: Chao Zhu <chaozhu@linux.vnet.ibm.com>
Acked-by: David Marchand <david.marchand@6wind.com>
10 years agoapp/testpmd: add a verbose mode to checksum forward engine
Olivier Matz [Wed, 26 Nov 2014 15:04:55 +0000 (16:04 +0100)]
app/testpmd: add a verbose mode to checksum forward engine

If the user specifies 'set verbose 1' in testpmd command line,
the csum forward engine will dump some informations about received
and transmitted packets, especially which flags are set and what
values are assigned to l2_len, l3_len, l4_len and tso_segsz.

This can help someone implementing TSO or hardware checksum offload to
understand how to configure the mbufs.

Example of output for one packet:

 --------------
 rx: l2_len=14 ethertype=800 l3_len=20 l4_proto=6 l4_len=20
 tx: m->l2_len=14 m->l3_len=20 m->l4_len=20
 tx: m->tso_segsz=800
 tx: flags=PKT_TX_IP_CKSUM PKT_TX_TCP_SEG
 --------------

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
10 years agoapp/testpmd: support TSO in checksum forward engine
Olivier Matz [Wed, 26 Nov 2014 15:04:54 +0000 (16:04 +0100)]
app/testpmd: support TSO in checksum forward engine

Add two new commands in testpmd:

- tso set <segsize> <portid>
- tso show <portid>

These commands can be used enable TSO when transmitting TCP packets in
the csum forward engine. Ex:

  set fwd csum
  tx_checksum set ip hw 0
  tso set 800 0
  start

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
10 years agoixgbe: support TCP segmentation offload
Olivier Matz [Wed, 26 Nov 2014 15:04:53 +0000 (16:04 +0100)]
ixgbe: support TCP segmentation offload

Implement TSO (TCP segmentation offload) in ixgbe driver. The driver is
now able to use PKT_TX_TCP_SEG mbuf flag and mbuf hardware offload infos
(l2_len, l3_len, l4_len, tso_segsz) to configure the hardware support of
TCP segmentation.

In ixgbe, when doing TSO, the IP length must not be included in the TCP
pseudo header checksum. A new function ixgbe_fix_tcp_phdr_cksum() is
used to fix the pseudo header checksum of the packet before giving it to
the hardware.

In the patch, the tx_desc_cksum_flags_to_olinfo() and
tx_desc_ol_flags_to_cmdtype() functions have been reworked to make them
clearer. This should not impact performance as gcc (version 4.8 in my
case) is smart enough to convert the tests into a code that does not
contain any branch instruction.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
10 years agombuf: generic support for TCP segmentation offload
Olivier Matz [Wed, 26 Nov 2014 15:04:52 +0000 (16:04 +0100)]
mbuf: generic support for TCP segmentation offload

Some of the NICs supported by DPDK have a possibility to accelerate TCP
traffic by using segmentation offload. The application prepares a packet
with valid TCP header with size up to 64K and deleguates the
segmentation to the NIC.

Implement the generic part of TCP segmentation offload in rte_mbuf. It
introduces 2 new fields in rte_mbuf: l4_len (length of L4 header in bytes)
and tso_segsz (MSS of packets).

To delegate the TCP segmentation to the hardware, the user has to:

- set the PKT_TX_TCP_SEG flag in mbuf->ol_flags (this flag implies
  PKT_TX_TCP_CKSUM)
- set the flag PKT_TX_IPV4 or PKT_TX_IPV6
- set PKT_TX_IP_CKSUM if it's IPv4, and set the IP checksum to 0 in
  the packet
- fill the mbuf offload information: l2_len, l3_len, l4_len, tso_segsz
- calculate the pseudo header checksum without taking ip_len in account,
  and set it in the TCP header, for instance by using
  rte_ipv4_phdr_cksum(ip_hdr, ol_flags)

The API is inspired from ixgbe hardware (the next commit adds the
support for ixgbe), but it seems generic enough to be used for other
hw/drivers in the future.

This commit also reworks the way l2_len and l3_len are used in igb
and ixgbe drivers as the l2_l3_len is not available anymore in mbuf.

Signed-off-by: Mirek Walukiewicz <miroslaw.walukiewicz@intel.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
10 years agonet: new checksum functions
Olivier Matz [Wed, 26 Nov 2014 15:04:51 +0000 (16:04 +0100)]
net: new checksum functions

Introduce new functions to calculate checksums. These new functions
are derivated from the ones provided csumonly.c but slightly reworked.
There is still some room for future optimization of these functions
(maybe SSE/AVX, ...).

This API will be modified in tbe next commits by the introduction of
TSO that requires a different pseudo header checksum to be set in the
packet.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
10 years agoapp/testpmd: rework checksum forward engine
Olivier Matz [Wed, 26 Nov 2014 15:04:50 +0000 (16:04 +0100)]
app/testpmd: rework checksum forward engine

The csum forward engine was becoming too complex to be used and
extended (the next commits want to add the support of TSO):

- no explaination about what the code does
- code is not factorized, lots of code duplicated, especially between
  ipv4/ipv6
- user command line api: use of bitmasks that need to be calculated by
  the user
- the user flags don't have the same semantic:
  - for legacy IP/UDP/TCP/SCTP, it selects software or hardware checksum
  - for other (vxlan), it selects between hardware checksum or no
    checksum
- the code relies too much on flags set by the driver without software
  alternative (ex: PKT_RX_TUNNEL_IPV4_HDR). It is nice to be able to
  compare a software implementation with the hardware offload.

This commit tries to fix these issues, and provide a simple definition
of what is done by the forward engine:

 * Receive a burst of packets, and for supported packet types:
 *  - modify the IPs
 *  - reprocess the checksum in SW or HW, depending on testpmd command line
 *    configuration
 * Then packets are transmitted on the output port.
 *
 * Supported packets are:
 *   Ether / (vlan) / IP|IP6 / UDP|TCP|SCTP .
 *   Ether / (vlan) / IP|IP6 / UDP / VxLAN / Ether / IP|IP6 / UDP|TCP|SCTP
 *
 * The network parser supposes that the packet is contiguous, which may
 * not be the case in real life.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
10 years agoapp/testpmd: fix use of offload flags
Olivier Matz [Wed, 26 Nov 2014 15:04:49 +0000 (16:04 +0100)]
app/testpmd: fix use of offload flags

In testpmd the rte_port->tx_ol_flags flag was used in 2 incompatible
manners:
- sometimes used with testpmd specific flags (0xff for checksums, and
  bit 11 for vlan)
- sometimes assigned to m->ol_flags directly, which is wrong in case
  of checksum flags

This commit replaces the hardcoded values by named definitions, which
are not compatible with mbuf flags. The testpmd forward engines are
fixed to use the flags properly.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
10 years agombuf: get the name of offload flags
Olivier Matz [Wed, 26 Nov 2014 15:04:48 +0000 (16:04 +0100)]
mbuf: get the name of offload flags

In test-pmd (rxonly.c), the code is able to dump the list of ol_flags.
The issue is that the list of flags in the application has to be
synchronized with the flags defined in rte_mbuf.h.

This patch introduces 2 new functions rte_get_rx_ol_flag_name()
and rte_get_tx_ol_flag_name() that returns the name of a flag from
its mask. It also fixes rxonly.c to use this new functions and to
display the proper flags.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
10 years agombuf: remove too specific flags mask
Olivier Matz [Wed, 26 Nov 2014 15:04:47 +0000 (16:04 +0100)]
mbuf: remove too specific flags mask

This definition is specific to Intel PMD drivers and its definition
"indicate what bits required for building TX context" shows that it
should not be in the generic rte_mbuf.h but in the PMD driver.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agombuf: add help about Tx checksum flags
Olivier Matz [Wed, 26 Nov 2014 15:04:46 +0000 (16:04 +0100)]
mbuf: add help about Tx checksum flags

Describe how to use hardware checksum API.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agombuf: reorder Tx flags
Olivier Matz [Wed, 26 Nov 2014 15:04:45 +0000 (16:04 +0100)]
mbuf: reorder Tx flags

The tx mbuf flags are now ordered from the lowest value to the
the highest. Add comments to explain where to add new flags.

By the way, move the PKT_TX_VXLAN_CKSUM at the right place.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
10 years agoixgbe: fix flags variable size to 64 bits
Olivier Matz [Wed, 26 Nov 2014 15:04:44 +0000 (16:04 +0100)]
ixgbe: fix flags variable size to 64 bits

Since commit 4332beee9 "mbuf: expand ol_flags field to 64-bits", the
packet flags are now 64 bits wide. Some occurences were forgotten in
the ixgbe driver.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agoigb/ixgbe: fix IP checksum calculation
Olivier Matz [Wed, 26 Nov 2014 15:04:43 +0000 (16:04 +0100)]
igb/ixgbe: fix IP checksum calculation

According to Intel® 82599 10 GbE Controller Datasheet (Table 7-38), both
L2 and L3 lengths are needed to offload the IP checksum.

Note that the e1000 driver does not need to be patched as it already
contains the fix.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
10 years agoapp/test: vm power management
Alan Carew [Tue, 25 Nov 2014 16:18:11 +0000 (16:18 +0000)]
app/test: vm power management

Updated the unit tests to cover both librte_power implementations as well as
the external API.

Signed-off-by: Alan Carew <alan.carew@intel.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
10 years agopower: integration of vm power management
Alan Carew [Tue, 25 Nov 2014 16:18:10 +0000 (16:18 +0000)]
power: integration of vm power management

librte_power now contains both rte_power_acpi_cpufreq and rte_power_kvm_vm
implementations.

Signed-off-by: Alan Carew <alan.carew@intel.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
10 years agopower: packet format for vm power management
Alan Carew [Tue, 25 Nov 2014 16:18:09 +0000 (16:18 +0000)]
power: packet format for vm power management

Provides a command packet format for host and guest.

Signed-off-by: Alan Carew <alan.carew@intel.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
10 years agopower: common interface for guest and host
Alan Carew [Tue, 25 Nov 2014 16:18:08 +0000 (16:18 +0000)]
power: common interface for guest and host

Moved the current librte_power implementation to rte_power_acpi_cpufreq, with
renaming of functions only.
Added rte_power_kvm_vm implementation to support Power Management from a VM.

librte_power now hides the implementation based on the environment used.
A new call rte_power_set_env() can explicidly set the environment, if not
called then auto-detection takes place.

rte_power_kvm_vm is subset of the librte_power APIs, the following is supported:
 rte_power_init(unsigned lcore_id)
 rte_power_exit(unsigned lcore_id)
 rte_power_freq_up(unsigned lcore_id)
 rte_power_freq_down(unsigned lcore_id)
 rte_power_freq_min(unsigned lcore_id)
 rte_power_freq_max(unsigned lcore_id)

The other unsupported APIs return -ENOTSUP

Signed-off-by: Alan Carew <alan.carew@intel.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
10 years agopower: vm communication channels in guest
Alan Carew [Tue, 25 Nov 2014 16:18:07 +0000 (16:18 +0000)]
power: vm communication channels in guest

Allows for the opening of Virtio-Serial devices on a VM, where a DPDK
application can send packets to the host based monitor. The packet formatted is
specified in channel_commands.h
Each device appears as a serial device in path
/dev/virtio-ports/virtio.serial.port.<agent_type>.<lcore_num> where each lcore
in a DPDK application has exclusive to a device/channel.
Each channel is opened in non-blocking mode, after a successful open a test
packet is send to the host to ensure the host side is monitoring.

Signed-off-by: Alan Carew <alan.carew@intel.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
10 years agoexamples/vm_power: cli in guest
Alan Carew [Tue, 25 Nov 2014 16:18:06 +0000 (16:18 +0000)]
examples/vm_power: cli in guest

Provides a small sample application(guest_vm_power_mgr) to run on a VM.
The application is run by providing a core mask(-c) and number of memory
channels(-n). The core mask corresponds to the number of lcore channels to
attempt to open. A maximum of 64 channels per VM is allowed. The channels must
be monitored by the host.
After successful initialisation a CPU frequency command can be sent to the host
using:
set_cpu_freq <lcore_num> <up|down|min|max>.

Signed-off-by: Alan Carew <alan.carew@intel.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
10 years agoexamples/vm_power: vm power management application
Alan Carew [Tue, 25 Nov 2014 16:18:05 +0000 (16:18 +0000)]
examples/vm_power: vm power management application

For launching CLI thread and Monitor thread and initialising
resources.
Requires a minimum of two lcores to run, additional cores specified by eal core
mask are not used.

Signed-off-by: Alan Carew <alan.carew@intel.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
10 years agoexamples/vm_power: cpu frequency in host
Alan Carew [Tue, 25 Nov 2014 16:18:04 +0000 (16:18 +0000)]
examples/vm_power: cpu frequency in host

A wrapper around librte_power(using ACPI cpufreq), providing locking around the
non-threadsafe library, allowing for frequency changes based on core masks and
core numbers from both the CLI thread and epoll monitor thread.

Signed-off-by: Alan Carew <alan.carew@intel.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
10 years agoexamples/vm_power: cli in host
Alan Carew [Tue, 25 Nov 2014 16:18:03 +0000 (16:18 +0000)]
examples/vm_power: cli in host

The CLI is used for administrating the channel monitor and manager and
manually setting the CPU frequency on the host.

Supports the following commands:
 add_vm [Mul-choice STRING]: add_vm|rm_vm <name>, add a VM for subsequent
  operations with the CLI or remove a previously added VM from the VM Power
  Manager

 rm_vm [Mul-choice STRING]: add_vm|rm_vm <name>, add a VM for subsequent
  operations with the CLI or remove a previously added VM from the VM Power
  Manager

 add_channels [Fixed STRING]: add_channels <vm_name> <list>|all, add
  communication channels for the specified VM, the virtio channels must be
  enabled in the VM configuration(qemu/libvirt) and the associated VM must be
  active. <list> is a comma-separated list of channel numbers to add, using the
  keyword 'all' will attempt to add all channels for the VM

 set_channel_status [Fixed STRING]:
  set_channel_status <vm_name> <list>|all enabled|disabled,  enable or disable
  the communication channels in list(comma-separated) for the specified VM,
  alternatively list can be replaced with keyword 'all'. Disabled channels will
  still receive packets on the host, however the commands they specify will be
  ignored. Set status to 'enabled' to begin processing requests again.

 show_vm [Fixed STRING]: show_vm <vm_name>, prints the information on the
  specified VM(s), the information lists the number of vCPUS, the pinning to
  pCPU(s) as a bit mask, along with any communication channels associated with
  each VM

 show_cpu_freq_mask [Fixed STRING]: show_cpu_freq_mask <mask>, Get the current
  frequency for each core specified in the mask

 set_cpu_freq_mask [Fixed STRING]: set_cpu_freq <core_mask> <up|down|min|max>,
  Set the current frequency for the cores specified in <core_mask> by scaling
  each up/down/min/max.

 show_cpu_freq [Fixed STRING]: Get the current frequency for the specified core

 set_cpu_freq [Fixed STRING]: set_cpu_freq <core_num> <up|down|min|max>,
  Set the current frequency for the specified core by scaling up/down/min/max

 quit [Fixed STRING]: close the application

Signed-off-by: Alan Carew <alan.carew@intel.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
10 years agoexamples/vm_power: channel manager and monitor in host
Alan Carew [Tue, 25 Nov 2014 16:18:02 +0000 (16:18 +0000)]
examples/vm_power: channel manager and monitor in host

The manager is responsible for adding communications channels to the Monitor
thread, tracking and reporting VM state and employs the libvirt API for
synchronization with the KVM Hypervisor. The manager interacts with the
Hypervisor to discover the mapping of virtual CPUS(vCPUs) to the host
physical CPUS(pCPUs) and to inspect the VM running state.

The manager provides the following functionality to the CLI:
1) Connect to a libvirtd instance, default: qemu:///system
2) Add a VM to an internal list, each VM is identified by a "name" which must
   correspond a valid libvirt Domain Name.
3) Add communication channels associated with a VM to the epoll based Monitor
   thread.
   The channels must exist and be in the form of:
   /tmp/powermonitor/<vm_name>.<channel_number>. Each channel is a
   Virtio-Serial endpoint configured as an AF_UNIX file socket and opened in
   non-blocking mode.
   Each VM can have a maximum of 64 channels associated with it.
4) Disable or re-enable VM communication channels, channels once added to the
   Monitor thread remain in that threads control, however acting on channel
   requests can be disabled and renabled via CLI.

The monitor is an epoll based infinite loop running in a separate thread that
waits on channel events from VMs and calls the corresponding functions. Channel
definitions from the manager are registered via the epoll event opaque pointer
when calling epoll_ctl(EPOLL_CTL_ADD), this allows for obtaining the channels
file descriptor for reading EPOLLIN events and mapping the vCPU to pCPU(s)
associated with a request from a particular VM.

Signed-off-by: Alan Carew <alan.carew@intel.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
10 years agoexamples/skeleton: very simple code for packet forwarding
Bruce Richardson [Fri, 14 Nov 2014 14:31:50 +0000 (14:31 +0000)]
examples/skeleton: very simple code for packet forwarding

This is a very simple example app for doing packet forwarding with the
Intel DPDK. It's designed to serve as a start point for people new to
the Intel DPDK and who want to develop a new app.

Therefore it's meant to:
* have as good a performance out-of-the-box as possible, using the
  best-known settings for configuring the PMDs, so that any new apps can
  be based off it.
* be kept as short as possible to make it easy to understand it and get
  started with it.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agoeal/linux: map pci memory resources after hugepages
Anatoly Burakov [Tue, 11 Nov 2014 10:09:25 +0000 (10:09 +0000)]
eal/linux: map pci memory resources after hugepages

Multi-process DPDK application must mmap hugepages and PCI resources
into the same virtual address space. By default the virtual addresses
are chosen by the primary process automatically when calling the mmap.
But sometimes the chosen virtual addresses aren't usable in secondary
process - for example, secondary process is linked with more libraries
than primary process, and the library occupies the same address space
that the primary process has requested for PCI mappings.

This patch makes EAL try and map PCI BARs right after the hugepages
(instead of location chosen by mmap) in virtual memory, so that PCI BARs
have less chance of ending up in random places in virtual memory.

Signed-off-by: Liang Xu <liang.xu@cinfotech.cn>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agoconfig: support 128 cores
Didier Pallard [Tue, 22 Apr 2014 10:20:25 +0000 (10:20 +0000)]
config: support 128 cores

New platforms have more than 64 cores.
Set default max cores number to 128.

Signed-off-by: Didier Pallard <didier.pallard@6wind.com>
Acked-by: David Marchand <david.marchand@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agoeal: add option --master-lcore
Simon Kuenzer [Tue, 8 Jul 2014 08:28:30 +0000 (10:28 +0200)]
eal: add option --master-lcore

Enable users to specify the lcore id that is used as master lcore.

Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
10 years agoeal: get relative core index
Patrick Lu [Wed, 11 Jun 2014 20:45:09 +0000 (13:45 -0700)]
eal: get relative core index

EAL -c option allows the user to enable any lcore in the system.
Often times, the user app wants to know 1st enabled core, 2nd
enabled core, etc, rather than phyical core ID (rte_lcore_id().)

The new API rte_lcore_index() will return an index from enabled lcores
starting from zero.

Signed-off-by: Patrick Lu <patrick.lu@intel.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agoeal: add core list input format
Didier Pallard [Fri, 27 Jun 2014 14:09:32 +0000 (16:09 +0200)]
eal: add core list input format

In current version, used cores can only be specified using a bitmask.
It will now be possible to specify cores in 2 different ways:
- Using a bitmask (-c [0x]nnn): bitmask must be in hex format
- Using a list in following format: -l <c1>[-c2][,c3[-c4],...]

The letter -l can stand for lcore or list.

-l 0-7,16-23,31 being equivalent to -c 0x80FF00FF

Signed-off-by: Didier Pallard <didier.pallard@6wind.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agoeal: factorize configuration adjustment
Thomas Monjalon [Thu, 20 Nov 2014 21:57:22 +0000 (22:57 +0100)]
eal: factorize configuration adjustment

Some adjustments are done after options parsing and are common
to Linux and BSD.

Remove process_type adjustment in rte_config_init() because
it is already done in eal_parse_args().
eal_proc_type_detect() is kept duplicated because it open a
file descriptor which is used later in each eal.c.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agoeal: factorize options sanity check
Thomas Monjalon [Mon, 17 Nov 2014 09:14:10 +0000 (10:14 +0100)]
eal: factorize options sanity check

No need to have duplicated check for common options.

Some flags are set for options -c and -m in order to simplify the
checks.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agoeal: factorize internal config reset
Thomas Monjalon [Mon, 17 Nov 2014 09:08:39 +0000 (10:08 +0100)]
eal: factorize internal config reset

Now that internal config structure is common to Linux and BSD,
we can have a common function to initialize it.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agoeal: fix header guards
Thomas Monjalon [Fri, 21 Nov 2014 14:26:17 +0000 (15:26 +0100)]
eal: fix header guards

Some guards are missing or have a wrong name.
Others have LINUXAPP in their name but are now common.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agoeal: factorize common headers
Thomas Monjalon [Mon, 17 Nov 2014 08:07:59 +0000 (09:07 +0100)]
eal: factorize common headers

No need to have different headers for Linux and BSD.
These files are identicals with exception of internal config which has
uio and vfio fields only useful for Linux.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agoeal: move internal headers in source directory
Thomas Monjalon [Mon, 17 Nov 2014 07:46:24 +0000 (08:46 +0100)]
eal: move internal headers in source directory

The directory include/ should be reserved to public headers.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agoethdev: fix doxygen comments about RSS
Thomas Monjalon [Mon, 24 Nov 2014 22:06:25 +0000 (23:06 +0100)]
ethdev: fix doxygen comments about RSS

The parameters port_id didn't match with comments about port.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agobond: fix doxygen
Thomas Monjalon [Mon, 24 Nov 2014 21:16:44 +0000 (22:16 +0100)]
bond: fix doxygen

There is no parameter delay_ms in *_delay_get functions.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
10 years agoapp/testpmd: set socket id when adding new port
Declan Doherty [Mon, 24 Nov 2014 16:33:40 +0000 (16:33 +0000)]
app/testpmd: set socket id when adding new port

Signed-off-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
10 years agopci: new ixgbe devices
Ouyang Changchun [Tue, 25 Nov 2014 05:02:42 +0000 (13:02 +0800)]
pci: new ixgbe devices

EAL misses 4 device ID but base codes support them, so add them into EAL.

Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
10 years agoapp/testpmd: configure flow director flexible payload
Jingjing Wu [Fri, 21 Nov 2014 00:46:56 +0000 (08:46 +0800)]
app/testpmd: configure flow director flexible payload

Test command is added to configure flexible payload

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
10 years agoapp/testpmd: configure flow director flexible mask
Jingjing Wu [Fri, 21 Nov 2014 00:46:55 +0000 (08:46 +0800)]
app/testpmd: configure flow director flexible mask

test command added to configure flexible mask

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
10 years agoi40e: take flow director flexible payload configuration
Jingjing Wu [Fri, 21 Nov 2014 00:46:54 +0000 (08:46 +0800)]
i40e: take flow director flexible payload configuration

configure flexible payload and flex mask in i40e driver
It includes arguments verification and HW setting.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
10 years agoethdev: add flow director flexible payload setting in port config
Jingjing Wu [Fri, 21 Nov 2014 00:46:53 +0000 (08:46 +0800)]
ethdev: add flow director flexible payload setting in port config

add flexible payload setting in eth_conf

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
10 years agoapp/testpmd: display flow director information
Jingjing Wu [Fri, 21 Nov 2014 00:46:52 +0000 (08:46 +0800)]
app/testpmd: display flow director information

display flow director's information, includes
 - statistics
 - configuration
 - capability

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
10 years agoi40e: get flow director statistics
Jingjing Wu [Fri, 21 Nov 2014 00:46:51 +0000 (08:46 +0800)]
i40e: get flow director statistics

implement operation to get flow director statistics in i40e pmd driver

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
10 years agoethdev: get flow director statistics
Jingjing Wu [Fri, 21 Nov 2014 00:46:50 +0000 (08:46 +0800)]
ethdev: get flow director statistics

define structures for getting flow director statistics

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
10 years agoi40e: get flow director information
Jingjing Wu [Fri, 21 Nov 2014 00:46:49 +0000 (08:46 +0800)]
i40e: get flow director information

implement operation to get flow director information in i40e pmd driver, includes
 - mode
 - supported flow types
 - table space
 - flexible payload size and granularity
 - configured flexible payload and mask information

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
10 years agoethdev: get flow director information
Jingjing Wu [Fri, 21 Nov 2014 00:46:48 +0000 (08:46 +0800)]
ethdev: get flow director information

define structures for getting flow director information includes:
 - mode
 - supported flow types
 - table space
 - flexible payload size and granularity
 - configured flexible payload and mask information

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
10 years agoapp/testpmd: flush flow director table
Jingjing Wu [Fri, 21 Nov 2014 00:46:47 +0000 (08:46 +0800)]
app/testpmd: flush flow director table

Test command is added to flush flow director table

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
10 years agoi40e: flush flow director table
Jingjing Wu [Fri, 21 Nov 2014 00:46:46 +0000 (08:46 +0800)]
i40e: flush flow director table

implement operation to flush flow director table

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
10 years agoapp/testpmd: print extended flow director info
Jingjing Wu [Fri, 21 Nov 2014 00:46:45 +0000 (08:46 +0800)]
app/testpmd: print extended flow director info

Extended fdir info is printed in rxonly fwd engine when fdir match.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
10 years agoi40e: report flow director matching
Jingjing Wu [Fri, 21 Nov 2014 00:46:44 +0000 (08:46 +0800)]
i40e: report flow director matching

setting the FDIR flag and report FD_ID plus flex bytes in mbuf if match

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
10 years agombuf: extend flow director field
Jingjing Wu [Fri, 21 Nov 2014 00:46:43 +0000 (08:46 +0800)]
mbuf: extend flow director field

fdir field in rte_mbuf is extended to support flex bytes reported when fdir match.
8 flex bytes can be reported in maximum.
The reported flex bytes are part of flexible payload.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
10 years agoi40e: flow director matching counter
Jingjing Wu [Fri, 21 Nov 2014 00:46:42 +0000 (08:46 +0800)]
i40e: flow director matching counter

support to get the fdir_match counter

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
10 years agoapp/testpmd: add or delete flow director filter
Jingjing Wu [Fri, 21 Nov 2014 00:46:41 +0000 (08:46 +0800)]
app/testpmd: add or delete flow director filter

Commands are added to test adding or deleting flow director filters.
10 flow types in flow director are supported: ipv4, ipv4-frag, tcpv4, udpv4, sctpv4, ipv6, ipv6-frag, tcpv6, udpv6, sctpv6

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
10 years agoi40e: add or delete flow director
Jingjing Wu [Fri, 21 Nov 2014 00:46:40 +0000 (08:46 +0800)]
i40e: add or delete flow director

deal with two operations for flow director
 - RTE_ETH_FILTER_ADD
 - RTE_ETH_FILTER_DELETE
encode the flow inputs to programming packet
sent the packet to filter programming queue and check status on the status report queue

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
10 years agoi40e: transition between flow type and pctype
Jingjing Wu [Fri, 21 Nov 2014 00:46:39 +0000 (08:46 +0800)]
i40e: transition between flow type and pctype

- macros to validate flow_type and pctype
- functions for transition between flow_type and pctype:
  - i40e_flowtype_to_pctype
  - i40e_pctype_to_flowtype

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
10 years agoethdev: structures to add or delete flow director
Jingjing Wu [Fri, 21 Nov 2014 00:46:38 +0000 (08:46 +0800)]
ethdev: structures to add or delete flow director

define structures to add or delete flow director filter
  - struct rte_eth_fdir_filter

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
10 years agoi40e: initialize flow director flexible payload setting
Jingjing Wu [Fri, 21 Nov 2014 00:46:37 +0000 (08:46 +0800)]
i40e: initialize flow director flexible payload setting

set flexible payload related registers to default value at initialization time.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
10 years agoi40e: tear down flow director
Jingjing Wu [Fri, 21 Nov 2014 00:46:36 +0000 (08:46 +0800)]
i40e: tear down flow director

release fortville resources on flow director, includes
 - queue 0 pair release
 - release vsi

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
10 years agoi40e: set up and initialize flow director
Jingjing Wu [Fri, 21 Nov 2014 00:46:35 +0000 (08:46 +0800)]
i40e: set up and initialize flow director

set up fortville resources to support flow director, includes
 - queue 0 pair allocated and set up for flow director
 - create vsi
 - reserve memzone for flow director programming packet

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
10 years agoi40evf: support querying and updating redirection table
Helin Zhang [Sat, 15 Nov 2014 16:03:44 +0000 (00:03 +0800)]
i40evf: support querying and updating redirection table

Support of updating/querying redirection table has been added for VF.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
10 years agoethdev: support multiple sizes of redirection table
Helin Zhang [Sat, 15 Nov 2014 16:03:43 +0000 (00:03 +0800)]
ethdev: support multiple sizes of redirection table

As 40G NIC supports different sizes (128/512/64 entries) of
redirection table from that (128 entries) of 1G and 10G NICs,
support of multiple sizes of redirection table is needed.
It includes,
* Redefine 'struct rte_eth_rss_reta' in ethdev.
  - To 'struct rte_eth_rss_reta_entry64' which contains 64
    entries and 64 bits mask.
  - Array of above new structure can be used for any number of
    redirection table entries, as long as the number is multiple
    of 64. This is quite flexible for the future expanding of
    redirection table.
* Redefinition of relevant interfaces in ethdev.
  - Interface of reta update has been redefined with new parameters.
  - Interface of reta query has been redefined with new parameters.
* Rework of 1G PMD in igb.
  - reta update has been reworked.
  - reta query has been reworked.
* Rework of 10G PMD in ixgbe.
  - reta update has been reworked.
  - reta query has been reworked.
* Rework of 40G PMD (PF only) in i40e.
  - reta update has been reworked.
  - reta query has been reworked.
* Implement relevant commands in testpmd.

Test report: http://dpdk.org/ml/archives/dev/2014-November/008362.html

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Tested-by: Erlu Chen <erlu.chen@intel.com>
10 years agoi40e: add redirection table size in device info
Helin Zhang [Sat, 15 Nov 2014 16:03:42 +0000 (00:03 +0800)]
i40e: add redirection table size in device info

Returning redirection table size has been supported in ops of
'dev_infos_get' for both PF and VF. Default RX/TX configurations
of VF can be returned in ops of 'dev_infos_get', while it was
missed before.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
10 years agoixgbe: add redirection table size in device info
Helin Zhang [Sat, 15 Nov 2014 16:03:41 +0000 (00:03 +0800)]
ixgbe: add redirection table size in device info

As more and more information are different between PF and VF, ops
of 'dev_infos_get' has been implemented respectively. In addition,
returning redirection table size has been supported in it.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>