dpdk.git
9 years agoethdev: new ntuple filter API
Jingjing Wu [Tue, 10 Feb 2015 04:48:28 +0000 (12:48 +0800)]
ethdev: new ntuple filter API

This patch defines ntuple filter type RTE_ETH_FILTER_NTUPLE and its structure rte_eth_ntuple_filter.
It also corrects the typo TCP_UGR_FLAG to TCP_URG_FLAG

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
9 years agoethdev: remove old syn filter API
Jingjing Wu [Wed, 11 Feb 2015 07:51:49 +0000 (15:51 +0800)]
ethdev: remove old syn filter API

Structure rte_syn_filter is removed.
Following APIs are removed:
  - rte_eth_dev_add_syn_filter
  - rte_eth_dev_remove_syn_filter
  - rte_eth_dev_get_syn_filter

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
[Thomas: remove also from version map]

9 years agoapp/testpmd: new commands for syn filter
Jingjing Wu [Wed, 11 Feb 2015 07:51:48 +0000 (15:51 +0800)]
app/testpmd: new commands for syn filter

Following commands of syn filter are removed:
  - add_syn_filter (port_id) priority (high|low) queue (queue_id)
  - remove_syn_filter (port_id)
  - get_syn_filter (port_id)
New command is added for syn filter by using filter_ctrl API and new
syn filter structure:
  - syn_filter (port_id) (add|del) priority (high|low) queue (queue_id)

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
9 years agoixgbe: migrate syn filter to new API
Jingjing Wu [Wed, 11 Feb 2015 07:51:46 +0000 (15:51 +0800)]
ixgbe: migrate syn filter to new API

This patch defines new functions dealing with syn filter.
It removes old functions which deal with syn filter.
Syn filter is dealt with through entrance ixgbe_dev_filter_ctrl.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
9 years agoigb: migrate syn filter to new API
Jingjing Wu [Wed, 11 Feb 2015 07:51:47 +0000 (15:51 +0800)]
igb: migrate syn filter to new API

This patch defines new functions dealing with syn filter.
It removes old functions of syn filter in igb driver.
Syn filter is dealt with through entrance eth_igb_filter_ctrl.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
9 years agoethdev: new syn filter API
Jingjing Wu [Wed, 11 Feb 2015 07:51:45 +0000 (15:51 +0800)]
ethdev: new syn filter API

This patch defines syn filter type RTE_ETH_FILTER_SYN and its structure rte_eth_syn_filter.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
9 years agoethdev: remove old flex filter API
Jingjing Wu [Sat, 21 Feb 2015 01:53:10 +0000 (01:53 +0000)]
ethdev: remove old flex filter API

Structure rte_flex_filter is removed.
Following APIs are removed:
  - rte_eth_dev_add_flex_filter
  - rte_eth_dev_remove_flex_filter
  - rte_eth_dev_get_flex_filter

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
[Thomas: remove also from version map]

9 years agoapp/testpmd: new commands for flex filter
Jingjing Wu [Sat, 21 Feb 2015 01:53:09 +0000 (01:53 +0000)]
app/testpmd: new commands for flex filter

Following commands of flex filter are removed:
  - add_flex_filter (port_id) len (len_value) bytes (bytes_string) mask (mask_value)
    priority (prio_value) queue (queue_id)
  - remove_flex_filter (port_id) index (idx)
  - get_flex_filter (port_id) index (idx)
New command is added for flex filter by using filter_ctrl API and new flex filter structure:
  - flex_filter (port_id) (add|del) len (len_value) bytes (bytes_value) mask (mask_value)
    priority (prio_value) queue (queue_id)

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
9 years agoigb: migrate flex filter to new API
Jingjing Wu [Sat, 21 Feb 2015 01:53:08 +0000 (01:53 +0000)]
igb: migrate flex filter to new API

This patch defines new functions dealing with flex filter.
It removes old functions of flex filter in igb driver.
Syn filter is dealt with through entrance eth_igb_filter_ctrl.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
9 years agoethdev: new flex filter API
Jingjing Wu [Sat, 21 Feb 2015 01:53:07 +0000 (01:53 +0000)]
ethdev: new flex filter API

This patch defines flex filter type RTE_ETH_FILTER_FLEXIBLE and its structure rte_eth_flex_filter.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
9 years agoapp/testpmd: set default flow director mask
Jingjing Wu [Thu, 29 Jan 2015 05:29:23 +0000 (13:29 +0800)]
app/testpmd: set default flow director mask

This patch sets the default value of flow director's mask.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agoapp/testpmd: update display of flow director information
Jingjing Wu [Thu, 29 Jan 2015 05:29:22 +0000 (13:29 +0800)]
app/testpmd: update display of flow director information

update the function to print information includes:
 - capability
 - mask
 - flex configuration

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agoapp/testpmd: update flow director commands
Jingjing Wu [Thu, 29 Jan 2015 05:29:21 +0000 (13:29 +0800)]
app/testpmd: update flow director commands

Add new command to set flow director's mask:
  - flow_director_mask
Update arguments of commands:
  - flow_director_filter
  - flow_director_flex_mask
  - flow_director_flex_payload
Following commands of flow director filter are removed:
  - add_signature_filter
  - upd_signature_filter
  - rm_signature_filter
  - add_perfect_filter
  - upd_perfect_filter
  - rm_perfect_filter
  - set_masks_filter
  - set_ipv6_masks_filter

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agoixgbe: support flow director flush
Jingjing Wu [Thu, 29 Jan 2015 05:29:20 +0000 (13:29 +0800)]
ixgbe: support flow director flush

This patch implement RTE_ETH_FILTER_FLUSH operation to delete all
flow director filters in ixgbe driver.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agoixgbe: migrate flow director info and statistic to new API
Jingjing Wu [Thu, 29 Jan 2015 05:29:19 +0000 (13:29 +0800)]
ixgbe: migrate flow director info and statistic to new API

This patch changes the get info operation to be implemented through
filter_ctrl API and RTE_ETH_FILTER_INFO/RTE_ETH_FILTER_STATS ops.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agoixgbe: support new flow director masks
Jingjing Wu [Thu, 29 Jan 2015 05:29:18 +0000 (13:29 +0800)]
ixgbe: support new flow director masks

This patch implement the mask configuration of flow director filter,
by using the mask defined in rte_fdir_conf instead of callback function
fdir_set_masks.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agoethdev: add new flow director masks
Jingjing Wu [Thu, 29 Jan 2015 05:29:17 +0000 (13:29 +0800)]
ethdev: add new flow director masks

This patch defines structure rte_eth_fdir_masks.
It extends rte_fdir_conf and rte_eth_fdir_info to contain mask's configuration.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agoethdev: remove flexbytes offset from flow director
Jingjing Wu [Thu, 29 Jan 2015 05:29:16 +0000 (13:29 +0800)]
ethdev: remove flexbytes offset from flow director

This patch removes the flexbytes_offset from rte_fdir_conf, because
the flexible payload setting is done by flex_conf instead of flexbytes_offset.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agoixgbe: support flexpayload configuration of flow director
Jingjing Wu [Thu, 29 Jan 2015 05:29:13 +0000 (13:29 +0800)]
ixgbe: support flexpayload configuration of flow director

This patch implement the flexpayload configuration of flow director filter.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agoethdev: extend flow type and flexible payload type for flow director
Jingjing Wu [Thu, 29 Jan 2015 05:29:12 +0000 (13:29 +0800)]
ethdev: extend flow type and flexible payload type for flow director

This patch adds RTE_ETH_FLOW_TYPE_RAW and RTE_ETH_RAW_PAYLOAD to support the
flexible payload is started from the beginning of the packet.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agoixgbe: migrate flow director filtering to new API
Jingjing Wu [Thu, 29 Jan 2015 05:29:11 +0000 (13:29 +0800)]
ixgbe: migrate flow director filtering to new API

This patch changes the add/delete/update operations to be implemented through
filter_ctrl API and RTE_ETH_FILTER_ADD/RTE_ETH_FILTER_DELETE/RTE_ETH_FILTER_UPDATE ops.
It also removes the callback functions:
 - ixgbe_eth_dev_ops.fdir_add_signature_filter
 - ixgbe_eth_dev_ops.fdir_update_signature_filter
 - ixgbe_eth_dev_ops.fdir_remove_signature_filter
 - ixgbe_eth_dev_ops.fdir_add_perfect_filter
 - ixgbe_eth_dev_ops.fdir_update_perfect_filter
 - ixgbe_eth_dev_ops.fdir_remove_perfect_filter

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agotools: enable binding device to uio_pci_generic
Danny Zhou [Fri, 20 Feb 2015 16:59:17 +0000 (16:59 +0000)]
tools: enable binding device to uio_pci_generic

Add uio_pci_generic to the list of supported kernel drivers.

Signed-off-by: Danny Zhou <danny.zhou@intel.com>
Tested-by: Qun Wan <qun.wan@intel.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
9 years agoeal/linux: toggle interrupt for uio_pci_generic
Danny Zhou [Fri, 20 Feb 2015 16:59:16 +0000 (16:59 +0000)]
eal/linux: toggle interrupt for uio_pci_generic

enable/disable interrupt by manipulating a control bit of command
register on NIC's PCIe configuration space.

Signed-off-by: Danny Zhou <danny.zhou@intel.com>
Tested-by: Qun Wan <qun.wan@intel.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
9 years agoeal/linux: enable uio_pci_generic support
Danny Zhou [Fri, 20 Feb 2015 16:59:15 +0000 (16:59 +0000)]
eal/linux: enable uio_pci_generic support

Change the EAL PCI code so that it can work with both the
uio_pci_generic in-tree driver, as well as the igb_uio
DPDK-specific driver.

This involves changes to
1) Modify method of retrieving BAR resource mapping information
2) Mapping using resource files in /sys rather than /dev/uio*
2) Setup bus master bit in NIC's PCIe configuration space for
uio_pci_generic.

Signed-off-by: Danny Zhou <danny.zhou@intel.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
9 years agoapp/test: add unit tests for link bonding mode 6
Maciej Gajdzica [Fri, 20 Feb 2015 16:09:23 +0000 (17:09 +0100)]
app/test: add unit tests for link bonding mode 6

Added 4 unit tests checking link bonding mode 6 behavior.

Also modified virtual_pmd so it is possible to provide packets,
that should be received with rx_burst and to inspect packets
transmitted by tx_burst.

In packet_burst_generator.c function creating eth_header is
modified, so it accepts ether_type as a parameter and function
creating arp_header is added. Updated other unit tests to get
rid of compilation errors.

Signed-off-by: Maciej Gajdzica <maciejx.t.gajdzica@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
9 years agobond: rename mode 5
Daniel Mrzyglod [Fri, 20 Feb 2015 16:09:22 +0000 (17:09 +0100)]
bond: rename mode 5

This patch modify mode older name from
BONDING_MODE_ADAPTIVE_TRANSMIT_LOAD_BALANCING to BONDING_MODE_TLB
This patch also changes order of TEST_ASSERT macro in
test_tlb_verify_slave_link_status_change_failover.

Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
9 years agoexamples/bond: add example application for link bonding mode 6
Michal Jastrzebski [Fri, 20 Feb 2015 16:09:21 +0000 (17:09 +0100)]
examples/bond: add example application for link bonding mode 6

This patch contains an example for link bonding mode 6.
It interact with user by a command prompt. Available commands are:
Start - starts ARP_thread which respond to ARP_requests and sends
ARP_updates (this
Is enabled by default after startup),
Stop  -stops ARP_thread,
Send count ip - send count ARP requests for IP,
Show - prints basic bond information, like IPv4 statistics from clients
Help,
Quit.
The best way to test mode 6 is to use this example together with
previous patch:
[PATCH 3/4] bond: add debug info for mode 6 link bonding.
Connect clients thru switch to bonding machine and send:
arping -c 1 bond_ip or
generate IPv4 traffic to bond_ip (IPv4 traffic from different clients
should be then balanced on slaves in round robin manner).

Signed-off-by: Michal Jastrzebski <michalx.k.jastrzebski@intel.com>
Signed-off-by: Maciej Gajdzica <maciejx.t.gajdzica@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
9 years agobond: add debug info for mode 6
Michal Jastrzebski [Fri, 20 Feb 2015 16:09:20 +0000 (17:09 +0100)]
bond: add debug info for mode 6

This patch add some debug information when using link bonding mode 6.
It prints basic information about ARP packets on RX and TX (MAC, ip,
packet number, arp packet type).
If CONFIG_RTE_LIBRTE_BOND_DEBUG_ALB == y.
If CONFIG_RTE_LIBRTE_BOND_DEBUG_ALB_L1 is enabled instead of previous
one, use show command to see IPv4 balancing from clients.

Signed-off-by: Michal Jastrzebski <michalx.k.jastrzebski@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
9 years agobond: add mode 6
Maciej Gajdzica [Fri, 20 Feb 2015 16:09:19 +0000 (17:09 +0100)]
bond: add mode 6

This mode includes adaptive TLB and receive load balancing (RLB). In RLB
the bonding driver intercepts ARP replies send by local system and
overwrites its source MAC address, so that different peers send data to
the server on different slave interfaces. When local system sends ARP
request, it saves IP information from it. When ARP reply from that peer
is received, its MAC is stored, one of slave MACs assigned and ARP reply
send to that peer.

Signed-off-by: Maciej Gajdzica <maciejx.t.gajdzica@intel.com>
Signed-off-by: Michal Jastrzebski <michalx.k.jastrzebski@intel.com>
Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
9 years agonet: change arp header struct declaration
Maciej Gajdzica [Fri, 20 Feb 2015 16:09:18 +0000 (17:09 +0100)]
net: change arp header struct declaration

Changed MAC address type from uint8_t[6] to struct ether_addr and IP
address type from uint8_t[4] to uint32_t to make it consistent with
other DPDK code using MAC and IP addresses. It allows us to use
is_same_ether_addr and ether_addr_copy functions on MAC addresses in ARP header.  Also
removed union from arp_hdr struct to make calls to arp_data items
shorter. Updated test-pmd to match new arp_hdr version.

Signed-off-by: Maciej Gajdzica <maciejx.t.gajdzica@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
[Thomas: doxygenize comments]

9 years agovirtio: remove Rx hotspots from early return
Ouyang Changchun [Mon, 9 Feb 2015 01:14:13 +0000 (09:14 +0800)]
virtio: remove Rx hotspots from early return

Remove those hotspots which is unnecessary when early returning occurs.

Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
9 years agovirtio: use port IO to get PCI resource
Ouyang Changchun [Mon, 9 Feb 2015 01:14:06 +0000 (09:14 +0800)]
virtio: use port IO to get PCI resource

Make virtio not require UIO for some security reasons, this is to match
6WIND's virtio-net-pmd.

Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
9 years agovirtio: free mbuf's with threshold
Stephen Hemminger [Mon, 9 Feb 2015 01:14:05 +0000 (09:14 +0800)]
virtio: free mbuf's with threshold

This makes virtio driver work like ixgbe. Transmit buffers are
held until a transmit threshold is reached. The previous behavior
was to hold mbuf's until the ring entry was reused which caused
more memory usage than needed.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
9 years agovirtio: set MAC address
Stephen Hemminger [Mon, 9 Feb 2015 01:14:04 +0000 (09:14 +0800)]
virtio: set MAC address

Need to have do special things to set default mac address.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
9 years agovirtio: suport multiple MAC addresses
Stephen Hemminger [Mon, 9 Feb 2015 01:14:03 +0000 (09:14 +0800)]
virtio: suport multiple MAC addresses

Virtio support multiple MAC addresses.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
9 years agovirtio: support vlan filtering
Stephen Hemminger [Mon, 9 Feb 2015 01:14:02 +0000 (09:14 +0800)]
virtio: support vlan filtering

Virtio supports vlan filtering.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
9 years agovirtio: fix states handling during initialization
Stephen Hemminger [Mon, 9 Feb 2015 01:13:58 +0000 (09:13 +0800)]
virtio: fix states handling during initialization

Change order of initialization to match Linux kernel.
Don't blow away control queue by doing reset when stopped.

Calling dev_stop then dev_start would not work.
Dev_stop was calling virtio reset and that would clear all queues
and clear all feature negotiation.
Resolved by only doing reset on device removal.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
9 years agovirtio: move allocation before initialization
Stephen Hemminger [Mon, 9 Feb 2015 01:14:01 +0000 (09:14 +0800)]
virtio: move allocation before initialization

If allocation fails, don't want to leave virtio device stuck
in middle of initialization sequence.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
9 years agoexamples/vhost: add vlan strip command line option
Ouyang Changchun [Mon, 9 Feb 2015 01:14:10 +0000 (09:14 +0800)]
examples/vhost: add vlan strip command line option

Support turn on/off RX VLAN strip on host, this let guest get the chance of
using its software VLAN strip functionality.

Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
9 years agoexamples/vhost: avoid inserting vlan twice
Ouyang Changchun [Mon, 9 Feb 2015 01:14:09 +0000 (09:14 +0800)]
examples/vhost: avoid inserting vlan twice

Check if it has already been vlan-tagged packet, if true, avoid inserting a
duplicated vlan tag into it.

This is a possible case when guest has the capability of inserting vlan tag.

Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
9 years agovirtio: use soft vlan strip with mergeable Rx packets
Ouyang Changchun [Mon, 9 Feb 2015 01:14:11 +0000 (09:14 +0800)]
virtio: use soft vlan strip with mergeable Rx packets

To keep the consistent logic with normal Rx path, the mergeable
Rx path also needs software vlan strip/decap if it is enabled.

Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
9 years agovirtio: use soft vlan encap/decap
Stephen Hemminger [Mon, 9 Feb 2015 01:13:55 +0000 (09:13 +0800)]
virtio: use soft vlan encap/decap

Implement VLAN stripping in software. This allows application
to be device independent.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
9 years agoether: add soft vlan encap/decap
Stephen Hemminger [Mon, 9 Feb 2015 01:13:54 +0000 (09:13 +0800)]
ether: add soft vlan encap/decap

It is helpful to allow device drivers that don't support hardware
VLAN stripping to emulate this in software. This allows application
to be device independent.

Avoid discarding shared mbufs. Make a copy in rte_vlan_insert() of any
packet to be tagged that has a reference count > 1.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
9 years agovirtio: remove redundant alignment field
Stephen Hemminger [Mon, 9 Feb 2015 01:13:57 +0000 (09:13 +0800)]
virtio: remove redundant alignment field

Since vq_alignment is constant (always 4K), it does not
need to be part of the vring struct.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
9 years agovirtio: remove unnecessary adapter structure
Stephen Hemminger [Mon, 9 Feb 2015 01:13:56 +0000 (09:13 +0800)]
virtio: remove unnecessary adapter structure

Cleanup virtio code by eliminating unnecessary nesting of
virtio hardware structure inside adapter structure.
Also allows removing unneeded macro, making code clearer.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
9 years agovirtio: support link state interrupt
Stephen Hemminger [Mon, 9 Feb 2015 01:13:53 +0000 (09:13 +0800)]
virtio: support link state interrupt

Virtio has link state interrupt which can be used.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
9 years agovirtio: allow starting with link down
Stephen Hemminger [Mon, 9 Feb 2015 01:13:52 +0000 (09:13 +0800)]
virtio: allow starting with link down

Starting driver with link down should be ok, it is with every
other driver. So just allow it.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
9 years agovirtio: fix update of vring descriptor index
Ouyang Changchun [Mon, 9 Feb 2015 01:14:15 +0000 (09:14 +0800)]
virtio: fix update of vring descriptor index

Updating the vring descriptor index should be done before notifying host;
Remove 2 duplicated store memory barriers in both Rx and Tx path because there is
store memory barrier in vq_update_avail_idx function;
Notify the host only if packets actually transmitted(nb_tx > 0).

Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
9 years agovirtio: use weaker barriers
Stephen Hemminger [Mon, 9 Feb 2015 01:13:51 +0000 (09:13 +0800)]
virtio: use weaker barriers

The DPDK driver only has to deal with the case of running on PCI
and with SMP. In this case, the code can use the weaker barriers
instead of using hard (fence) barriers. This will help performance.
The rationale is explained in Linux kernel virtio_ring.h.

To make it clearer that this is a virtio thing and not some generic
barrier, prefix the barrier calls with virtio_.

Add missing (and needed) barrier between updating ring data
structure and notifying host.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
9 years agovirtio: check packet headroom at compile time
Stephen Hemminger [Mon, 9 Feb 2015 01:14:00 +0000 (09:14 +0800)]
virtio: check packet headroom at compile time

Better to check at compile time than fail at runtime.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
9 years agovirtio: make a function local
Stephen Hemminger [Mon, 9 Feb 2015 01:13:59 +0000 (09:13 +0800)]
virtio: make a function local

Make vtpci_get_status a local function as it is used in one file.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
9 years agovirtio: rearrange resource initialization
Stephen Hemminger [Mon, 9 Feb 2015 01:13:50 +0000 (09:13 +0800)]
virtio: rearrange resource initialization

For clarity make the setup of PCI resources for Linux into a function rather
than block of code #ifdef'd in middle of dev_init.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
9 years agoi40e: fix build with gcc 5
Panu Matilainen [Thu, 19 Feb 2015 11:21:10 +0000 (13:21 +0200)]
i40e: fix build with gcc 5

Eliminate ambiguity in the condition which trips up a "logical not
is only applied to the left..." warning from gcc 5, causing build
failure with -Werror. Besides non-ambiguous, the condition is
far more obvious this way.

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
9 years agoapp/testpmd: fix uninitialized flow control variables
Pablo de Lara [Tue, 17 Feb 2015 15:52:36 +0000 (15:52 +0000)]
app/testpmd: fix uninitialized flow control variables

rx_fc_en and tx_fc_en in cmd_link_flow_ctrl_set_parsed
could be used without being initialized.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
9 years agoixgbe: forbid building vpmd without Rx bulk alloc
Thomas Monjalon [Thu, 29 Jan 2015 22:18:34 +0000 (23:18 +0100)]
ixgbe: forbid building vpmd without Rx bulk alloc

CONFIG_RTE_LIBRTE_IXGBE_RX_ALLOW_BULK_ALLOC is a prerequisite
of CONFIG_RTE_IXGBE_INC_VECTOR.

Reported-by: Alexander Belyakov <abelyako@gmail.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agoixgbe: fix vector receive of chained mbuf
Bruce Richardson [Fri, 6 Feb 2015 13:41:08 +0000 (13:41 +0000)]
ixgbe: fix vector receive of chained mbuf

When the vector pmd was receiving a mix of packets of various sizes,
some of which were split across multiple mbufs, there was an issue
with reassembly of the jumbo frames. This was due to a skipped increment
when using "continue" in a while loop. Changing the loop to a "for"
loop fixes this problem, by ensuring the increment is always performed.

Reported-by: Prashant Upadhyaya <praupadhyaya@gmail.com>
Reported-by: Martin Weiser <martin.weiser@allegro-packets.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Martin Weiser <martin.weiser@allegro-packets.com>
9 years agoixgbe: fix big endian access
Xuelin Shi [Thu, 12 Feb 2015 01:19:50 +0000 (09:19 +0800)]
ixgbe: fix big endian access

ixgbe is little endian, but cpu maybe not.
add necessary conversions.
    rte_cpu_to_le_32(...) for PCI write
    rte_le_to_cpu_32(...) for PCI read.

Signed-off-by: Xuelin Shi <xuelin.shi@freescale.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agoe1000: fix big endian access
Xuelin Shi [Thu, 12 Feb 2015 01:26:52 +0000 (09:26 +0800)]
e1000: fix big endian access

e1000 is little endian, but cpu maybe not.
add necessary conversions.

rte_cpu_to_le_32(...) for PCI write
rte_le_to_cpu_32(...) for PCI read.

Signed-off-by: Xuelin Shi <xuelin.shi@freescale.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agoeal/linux: fix fscanf format mismatch
Sergio Gonzalez Monroy [Thu, 12 Feb 2015 15:39:37 +0000 (15:39 +0000)]
eal/linux: fix fscanf format mismatch

Variables are unsigned int but format scans for signed int.

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
9 years agoeal: fix dynamic link with virtio
Sergio Gonzalez Monroy [Thu, 12 Feb 2015 15:40:54 +0000 (15:40 +0000)]
eal: fix dynamic link with virtio

Building shared libraries and using virtio PMD results in undefined
reference to 'rte_eal_iopl_init'.

Add missing function to eal version map.

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
9 years agocmdline: fix check in port list parsing
Olivier Matz [Wed, 4 Feb 2015 09:49:25 +0000 (10:49 +0100)]
cmdline: fix check in port list parsing

The argument ressize contains the size of the result buffer which
should be large enough to store the parsed result of a token. In
this case, it should be larger or equal to sizeof(cmdline_portlist_t)
(4 bytes), not PORTLIST_TOKEN_SIZE which is the max size of the token
string.

This is not a critical, it fixes cases where the total length of the
parsed instruction is greater than the maximum.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
9 years agodoc: add requirements for x32 ABI
Daniel Mrzyglod [Mon, 16 Feb 2015 16:27:14 +0000 (17:27 +0100)]
doc: add requirements for x32 ABI

Add requirements about compiler and distribution support.

Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
9 years agomk: support x32 ABI
Daniel Mrzyglod [Thu, 13 Nov 2014 12:01:31 +0000 (12:01 +0000)]
mk: support x32 ABI

x32 ABI provides benefits of x86-64 while using 32-bit pointers and
avoiding overhead of 64-bit pointers.

Test report: http://dpdk.org/ml/archives/dev/2015-February/012599.html

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Tested-by: Haifeng Tang <haifengx.tang@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
9 years agobond: change warning
Michal Jastrzebski [Fri, 12 Dec 2014 09:14:40 +0000 (09:14 +0000)]
bond: change warning

Remove function name from warning.

Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
9 years agobond: fix symbol export
Tomasz Kulasek [Fri, 13 Feb 2015 10:38:16 +0000 (11:38 +0100)]
bond: fix symbol export

rte_eth_bond_8023ad_setup and rte_eth_bond_8023ad_conf_get entries need
to be exported to be used by test application for shared libraries
compilation.

Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
9 years agoapp/test: link with ring pmd when needed
Tomasz Kulasek [Fri, 13 Feb 2015 10:38:15 +0000 (11:38 +0100)]
app/test: link with ring pmd when needed

This patch links test application against librte_pmd_ring.so for shared
libraries. It's required as long as librte_pmd_ring provides some additional
routines used for testing purposes and must be "hard-linked".

Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
9 years agoapp/test: unit tests for bonding mode 4
Tomasz Kulasek [Fri, 13 Feb 2015 10:38:14 +0000 (11:38 +0100)]
app/test: unit tests for bonding mode 4

This patch adds unit tests for mode 4. It is split into separate
file to avoid problems with other modes that does not need to
look into packets payload.
This patch includes also a modification of maximum number of ports
used in their tests for bonding modes 0-3 from 16 to 6.

Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
9 years agoapp/test: rework assert macros
Tomasz Kulasek [Fri, 13 Feb 2015 10:38:13 +0000 (11:38 +0100)]
app/test: rework assert macros

Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
9 years agoring: fix MAC per device
Tomasz Kulasek [Mon, 19 Jan 2015 11:56:41 +0000 (12:56 +0100)]
ring: fix MAC per device

Initialization procedure fix to allow per device MAC configuration.

Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
9 years agoring: add MAC address add/remove
Tomasz Kulasek [Mon, 19 Jan 2015 11:56:40 +0000 (12:56 +0100)]
ring: add MAC address add/remove

Added MAC addr add/remove dummy callbacks.

Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
9 years agoring: add link up/down
Tomasz Kulasek [Mon, 19 Jan 2015 11:56:39 +0000 (12:56 +0100)]
ring: add link up/down

Link up and down implementation.

Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
9 years agobond: fix memory leak on kvargs processing failure
Declan Doherty [Fri, 13 Feb 2015 10:27:26 +0000 (10:27 +0000)]
bond: fix memory leak on kvargs processing failure

identified by klockwork scan

Signed-off-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
9 years agoethdev: return status of stats read
Jia Yu [Fri, 7 Nov 2014 17:31:51 +0000 (09:31 -0800)]
ethdev: return status of stats read

rte_eth_stats_get is to get physical device statistics. Without
return status, caller does not know whether function fails or not
(i.e. invalid port_id, driver has no stats_get callback). Caller
cannot differiente normal 0 stats or error case. This fix adds
a return status to the function.

Signed-off-by: Jia Yu <jyu@vmware.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agoethdev: update link status after start
Jia Yu [Fri, 7 Nov 2014 17:31:50 +0000 (09:31 -0800)]
ethdev: update link status after start

Since LSR interrupt is disabled by pmd drivers, link status in rte_eth_device is always down.
Bond slave_configure() enables LSR interrupt on devices to get notification if link status
changes. However, the LSC interrupt at device start time is still lost.

In this fix, call link_update to read link status from hardware
register at device start time.

Signed-off-by: Jia Yu <jyu@vmware.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agomaintainers: add and claim reorder
Sergio Gonzalez Monroy [Wed, 18 Feb 2015 14:58:18 +0000 (14:58 +0000)]
maintainers: add and claim reorder

Add files related to reorder library and claim it.

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agodoc: new packet ordering app description
Sergio Gonzalez Monroy [Wed, 18 Feb 2015 14:58:17 +0000 (14:58 +0000)]
doc: new packet ordering app description

This patch describes how to build and run he new packet ordering sample
application that exercises the reorder library.

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
9 years agodoc: new reorder library description
Sergio Gonzalez Monroy [Wed, 18 Feb 2015 14:58:16 +0000 (14:58 +0000)]
doc: new reorder library description

This patch introduces a new section in the programmers guide describing
the reorder library.

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
9 years agoexamples/packet_ordering: new sample app
Sergio Gonzalez Monroy [Wed, 18 Feb 2015 14:58:15 +0000 (14:58 +0000)]
examples/packet_ordering: new sample app

This new app makes use of the librte_reorder library.

It requires at least 3 lcores for RX, Workers (1 or more) and TX threads.
Communication between RX-Workers and Workers-TX is done by using rings.
The flow of mbufs is the following:
 * RX thread gets mbufs from driver, set sequence number and enqueue
   them in ring.
 * Workers dequeue mbufs from ring, do some 'work' and enqueue mbufs in
   ring.
 * TX dequeue mbufs from ring, inserts them in reorder buffer, drains
   mbufs from reorder and sends them to the driver.

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
[Thomas: add in examples/Makefile]

9 years agoapp/test: new reorder unit test
Sergio Gonzalez Monroy [Wed, 18 Feb 2015 14:58:14 +0000 (14:58 +0000)]
app/test: new reorder unit test

Adding new reorder unit test for the test app.
The command to run the unit test from the test shell is: reorder_autotest

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
9 years agoreorder: new library
Sergio Gonzalez Monroy [Wed, 18 Feb 2015 14:58:13 +0000 (14:58 +0000)]
reorder: new library

This library provides reordering capability for out of order mbufs based
on a sequence number in the mbuf structure.

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Signed-off-by: Richardson Bruce <bruce.richardson@intel.com>
Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
9 years agodevargs: remove limit on parameters length
David Marchand [Fri, 13 Feb 2015 15:03:14 +0000 (16:03 +0100)]
devargs: remove limit on parameters length

As far as I know, there is no reason why we should have a limit on the length of
parameters that can be given for a device.
Remove this limit by using dynamic allocations.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agodevargs: indent and cleanup
David Marchand [Fri, 13 Feb 2015 15:03:13 +0000 (16:03 +0100)]
devargs: indent and cleanup

Prepare for next commit.
Fix some indent issues, refactor error code.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agoapp/test: fix devargs tests
David Marchand [Fri, 13 Feb 2015 15:03:15 +0000 (16:03 +0100)]
app/test: fix devargs tests

Add missing free for devargs->args and fix tests.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agomaintainers: claim for fm10k review
Chen Jing D(Mark) [Thu, 12 Feb 2015 10:06:07 +0000 (18:06 +0800)]
maintainers: claim for fm10k review

Claim for fm10k polling mode driver review.

Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agofm10k: add PF and VF interrupt handling
Jeff Shaw [Wed, 4 Feb 2015 08:33:53 +0000 (16:33 +0800)]
fm10k: add PF and VF interrupt handling

1. Add functions to enable PF/VF interrupt.
2. Add function to process error message passed from interrupt.
2. Add 2 interrupt handling functions, one for PF and one for VF.
2. Enable interrupt after completing initialization of NIC.

Signed-off-by: Jeff Shaw <jeffrey.b.shaw@intel.com>
Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
9 years agofm10k: add VF support
Jeff Shaw [Wed, 4 Feb 2015 08:26:16 +0000 (16:26 +0800)]
fm10k: add VF support

fm10k pmd driver will support both PF and VF device with single
copy of code. The reason is NIC maps registers with same
function in PF and VF to same PCI I/O address. Then, PF/VF drivers
use same address to access registers belonging to it, HW will
translate the request to correct units.

For some functionalities that are unique to PF, driver will check
current driver type and behave correctly.

Signed-off-by: Jeff Shaw <jeffrey.b.shaw@intel.com>
Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
9 years agofm10k: add vlan filter
Jeff Shaw [Wed, 4 Feb 2015 08:23:31 +0000 (16:23 +0800)]
fm10k: add vlan filter

Add fm10k_vlan_filter_set to set vlan.

Signed-off-by: Jeff Shaw <jeffrey.b.shaw@intel.com>
Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
9 years agofm10k: add scatter receive
Jeff Shaw [Wed, 4 Feb 2015 08:20:06 +0000 (16:20 +0800)]
fm10k: add scatter receive

1. Add fm10k_recv_scattered_pkts function to receive jumbo frame
   and multi-segment packets.
2. Configure correct receive function in rx_init and dev_init.

Signed-off-by: Jeff Shaw <jeffrey.b.shaw@intel.com>
Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
9 years agofm10k: add PF RSS
Jeff Shaw [Wed, 4 Feb 2015 08:12:28 +0000 (16:12 +0800)]
fm10k: add PF RSS

1. Configure RSS in fm10k_dev_rx_init function.
2. Add fm10k_rss_hash_update and fm10k_rss_hash_conf_get to get
   and inquery RSS configuration.

Signed-off-by: Jeff Shaw <jeffrey.b.shaw@intel.com>
Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
9 years agofm10k: add receive and tranmit
Jeff Shaw [Wed, 4 Feb 2015 08:04:02 +0000 (16:04 +0800)]
fm10k: add receive and tranmit

1. Add fm10k_recv_pkts and fm10k_xmit_pkts functions.
2. Link app function pointer to actual fm10k recv/xmit
   functions.
3. Change Makefile to compile new file fm10k_rxtx.c

Signed-off-by: Jeff Shaw <jeffrey.b.shaw@intel.com>
Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
9 years agofm10k: add dev start/stop
Jeff Shaw [Wed, 4 Feb 2015 07:47:01 +0000 (15:47 +0800)]
fm10k: add dev start/stop

1. Add function to initialize RX queues.
2. Add function to initialize TX queues.
3. Add fm10k_dev_start, fm10k_dev_stop and fm10k_dev_close
   functions.
4. Add function to close mailbox service.

Signed-off-by: Jeff Shaw <jeffrey.b.shaw@intel.com>
Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
9 years agofm10k: add Rx/Tx single queue start/stop
Jeff Shaw [Tue, 3 Feb 2015 11:07:01 +0000 (19:07 +0800)]
fm10k: add Rx/Tx single queue start/stop

1. Add 4 functions fm10k_dev_rx_queue_start,
   fm10k_dev_rx_queue_stop, fm10k_dev_tx_queue_start,
   and fm10k_dev_tx_queue_stop.
2. verify Rx packet buffer alignment is valid.
   Hardware requires specific alignment for Rx packet buffers. At
   least one of the following two conditions must be satisfied.
       1) Address is 512B aligned
       2) Address is 8B aligned and buffer does not cross 4K boundary.

   Alignment is checked by the driver when the Rx queue is reset. It
   is assumed that if an entire descriptor ring can be filled with
   buffers containing valid alignment, then all buffers in that mempool
   have valid address alignment. It is the responsibility of the user
   to ensure all buffers have valid alignment, as it is the user who
   creates the mempool.

   It is assumed the buffer needs only to store a maximum size Ethernet
   frame.

Signed-off-by: Jeff Shaw <jeffrey.b.shaw@intel.com>
Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
9 years agofm10k: add Tx queue setup/release
Jeff Shaw [Tue, 3 Feb 2015 10:57:34 +0000 (18:57 +0800)]
fm10k: add Tx queue setup/release

Add fm10k_tx_queue_setup and fm10k_tx_queue_release functions.

Signed-off-by: Jeff Shaw <jeffrey.b.shaw@intel.com>
Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
9 years agofm10k: add Rx queue setup/release
Jeff Shaw [Tue, 3 Feb 2015 10:48:40 +0000 (18:48 +0800)]
fm10k: add Rx queue setup/release

Add fm10k_rx_queue_setup and fm10k_rx_queue_release functions.

Signed-off-by: Jeff Shaw <jeffrey.b.shaw@intel.com>
Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
9 years agofm10k: add reta query/update
Jeff Shaw [Tue, 3 Feb 2015 09:41:25 +0000 (17:41 +0800)]
fm10k: add reta query/update

1. Add fm10k_reta_update and fm10k_reta_query functions.
2. Add fm10k_link_update and fm10k_dev_infos_get functions.

Signed-off-by: Jeff Shaw <jeffrey.b.shaw@intel.com>
Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
9 years agofm10k: register PF driver
Jeff Shaw [Wed, 4 Feb 2015 10:48:49 +0000 (18:48 +0800)]
fm10k: register PF driver

1. Add init function to scan and initialize fm10k PF device.
2. Add implementation to register fm10k pmd PF driver.
3. Add 3 functions fm10k_dev_configure, fm10k_stats_get and
   fm10k_stats_get.
4. Add fm10k.h to define macros and basic data structure.
5. Add fm10k_logs.h to control log message output.
6. Change config/common_bsdapp and config/common_linuxapp, add
   macros to control fm10k pmd driver compile for linux and bsd.
7. Add Makefile.
8. Change lib/Makefile to add fm10k driver into compile list.
9. Change mk/rte.app.mk to add fm10k lib into link.
10. Add ABI version of librte_pmd_fm10k

Signed-off-by: Jeff Shaw <jeffrey.b.shaw@intel.com>
Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
Signed-off-by: Michael Qiu <michael.qiu@intel.com>
9 years agoeal: add fm10k device id
Jeff Shaw [Tue, 3 Feb 2015 08:05:07 +0000 (16:05 +0800)]
eal: add fm10k device id

Add fm10k device ID list into rte_pci_dev_ids.h.

Signed-off-by: Jeff Shaw <jeffrey.b.shaw@intel.com>
Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
9 years agofm10k: add base driver
Jeff Shaw [Tue, 3 Feb 2015 07:57:59 +0000 (15:57 +0800)]
fm10k: add base driver

Base driver is developed and maintained by Intel ND team, includes
basic functional service to Intel Ethernet Switch FM10000 Series
of silicons.
Any suggestion on bug fix and improvement within this directory is
welcome, but need this team to change and update.

Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
9 years agoi40e: add debug logs for Tx context descriptors
Olivier Matz [Fri, 13 Feb 2015 09:22:51 +0000 (10:22 +0100)]
i40e: add debug logs for Tx context descriptors

This could be useful to have this values for debug purposes.

Suggested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Jijiang Liu <jijiang.liu@intel.com>
9 years agoi40e: fix offloading of outer checksum for IPIP tunnel
Olivier Matz [Fri, 13 Feb 2015 09:22:50 +0000 (10:22 +0100)]
i40e: fix offloading of outer checksum for IPIP tunnel

When offloading the checksums of ipip tunnels, m->l2_len is set to 0
as there is no tunnel or inner l2 header. Since this is a valid value
remove the test.

By the way, also remove the same test with l3_len because at this
point, it is expected that the software provides proper values in the
mbuf. It should avoid a test in dataplane processing and therefore
slightly increase performance.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Jijiang Liu <jijiang.liu@intel.com>