Commit Graph

2334 Commits

Author SHA1 Message Date
Wenzhuo Lu
d4c9ffd4fe ixgbe/base: disable X550em FEC to save power
The FEC (Forward Error Correction) feature can improve BER (Bit Error Rate)
but uses more power to do so. It also cannot be used with
EEE (Energy Efficient Ethernet).
EEE is an important feature, and we have no known BER issues, so FEC
is not needed.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-15 22:42:44 +02:00
Wenzhuo Lu
e9c72a4129 ixgbe/base: fix X550em mux after MAC reset
The I2C mux control relies on the SDP setting in the ESDP register
so it is necessary to restore the value after a MAC reset. So,
put the code in a function so it can be used in more than one place.

Fixes: d2e72774e5 ("ixgbe/base: support X550")

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-15 22:42:38 +02:00
Wenzhuo Lu
937e5f5b25 ixgbe/base: reset X550em CS4227 when needed
On some hardware platforms, the CS4227 does not initialize properly.
Detect those cases and reset it appropriately.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-15 22:42:34 +02:00
Wenzhuo Lu
241d31f473 ixgbe/base: issue firmware command when resetting X550em
The driver now needs to issue a firmware command to inform the
firmware that a driver is coming up. This prevents the possibility
of the firmware and the driver configuring the PHY at the same
time. Upon completion of the command, the firmware will no longer
be configuring the PHY.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-15 22:42:30 +02:00
Wenzhuo Lu
487b329e5e ixgbe/base: reduce i2c retry count for X550
A retry count of 10 is likely to run into problems on X550 devices
that have to detect and reset unresponsive CS4227 devices. So,
reduce the I2C retry count to 3 for X550 and above. This should
avoid any possible regressions in existing devices.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-15 18:24:40 +02:00
Wenzhuo Lu
7e61e847c1 ixgbe/base: provide unlocked i2c methods
Most I2C accesses take and release semaphores for each access. It's
also necessary to perform multiple I2C operations under the same
holding of the semaphore, so provide unlocked I2C methods for that
purpose.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-15 18:24:40 +02:00
Wenzhuo Lu
44d15731e3 ixgbe/base: remove useless function
Remove the function which is not called by the drivers.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-15 18:24:40 +02:00
Wenzhuo Lu
5f79e8a7ce ixgbe/base: fix tunnelled UDP and TCP frames in flow director
All bits in FDIRTCPM and FDIRUDPM are set to 1 when
ixgbe_fdir_set_input_mask_82599 is called. Not settings these bits will cause
TCP and UDP packets to be filtered out when NVGRE or VXLAN mode is enabled.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-15 18:24:40 +02:00
Wenzhuo Lu
683a2c8a28 ixgbe/base: check return value after calling
This patch moves the check of the return value from
ixgbe_start_hw_generic after the function is called.
Previously we had the code to disable relaxed ordering in
between, which seems a bit out of place.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-15 18:24:40 +02:00
Wenzhuo Lu
17e80ad00f ixgbe/base: fix typos
Remove the redundant "from".

There's a typo in the code comment for FC end
of Frame Exception (FCEOFe/IPE), so fixed the typo.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-15 18:24:02 +02:00
Wenzhuo Lu
cd417874b2 ixgbe/base: update copyright and readme
Update copyright in every file.
Update README file.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-15 17:52:36 +02:00
Simon Kagstrom
a7de7e6beb eal: allow combining -m and --no-huge
Needed to run as non-root but with higher memory allocations, and
removes a constraint on no-huge mode being limited to 64M. A usage
example is if running with file input with the pcap PMD, which can be
done as non-root after this patch via e.g.,

    ./test-dpdk --no-huge -m 1024 -l 0,1 -n3
		--vdev 'eth_pcap0,rx_pcap=eth-rx.pcap,tx_pcap=eth-tx.pcap'

Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net>
Signed-off-by: Johan Faltstrom <johan.faltstrom@netinsight.net>
Acked-by: David Marchand <david.marchand@6wind.com>
2015-06-15 16:03:38 +02:00
John McNamara
a8a9262de3 app/test: return error code on failed tests
This change returns a system error code if tests fail when
running any of the "make test" targets.

This allows the tests to report failures while running in
continuous integration environments.

Previously "make test" returned $? == 0 for all combinations
of success, failure and exception conditions.

Signed-off-by: John McNamara <john.mcnamara@intel.com>
2015-06-15 15:17:52 +02:00
Gaetan Rivet
a3894e2fbc app/test: fix default numa memory assignment
Each test requires a certain minimal amount of memory.
Spreading memory on all sockets means that the test will get less memory than
what it wanted on multi sockets system.
So replace all_sockets() with per_sockets().

Also doubled memory on group_5 as current requirement is not enough.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Signed-off-by: David Marchand <david.marchand@6wind.com>
2015-06-15 15:04:22 +02:00
Ding Zhi
c76ee0d0ee app/testpmd: fix default flow control values
This variable has undefined values in some cases.

Fixes: 422a20a4e6 ("app/testpmd: fix uninitialized flow control variables")

Signed-off-by: Ding Zhi <zhi.ding@6wind.com>
Signed-off-by: David Marchand <david.marchand@6wind.com>
[Thomas: split lines to conform with guidelines]
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2015-06-15 12:01:06 +02:00
Michal Jastrzebski
db935d0171 examples/qos_sched: use librte_cfgfile
This is a modification of qos_sched example to use
librte_cfgfile for parsing configuration file.

Signed-off-by: Michal Jastrzebski <michalx.k.jastrzebski@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2015-06-15 11:18:25 +02:00
Nelio Laranjeiro
d6145abec4 mlx4: fix 32-bit build
Fix warning messages "cast to pointer from integer of different size" when
compiling DPDK in 32 bit with Mellanox PMD.

SGE addresses are 64 bit integers, converting them to pointers must be done
through uintptr_t to avoid compilation warnings when those have a different
size.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2015-06-12 17:38:14 +02:00
Krishna Murthy
f75f65abf3 vhost: enable live migration
When we migrate VM, without this feature, qemu will report error:
"migrate: Migration disabled: vhost lacks VHOST_F_LOG_ALL feature".

Signed-off-by: Krishna Murthy <krishna.j.murthy@intel.com>
2015-06-12 17:07:24 +02:00
Olivier Matz
f20b50b946 mbuf: optimize refcnt update
In __rte_pktmbuf_prefree_seg(), there was an optimization to avoid using
a costly atomic operation when updating the mbuf reference counter if
its value is 1. Indeed, it means that we are the only owner of the mbuf,
and therefore nobody can change it at the same time.

We can generalize this optimization directly in rte_mbuf_refcnt_update()
so the other callers of this function, like rte_pktmbuf_attach(), can
also take advantage of this optimization.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2015-06-12 16:16:50 +02:00
Ivan Boule
8443ce8193 app/testpmd: fix reply to a multicast ICMP request
Set the IP source and destination addresses in the IP header of the
ICMP reply as follows:
  - Use the request IP source address as the reply IP destination address
  - If the request IP destination address is a multicast IP address
      - choose a reply IP source address different from the request IP
        source address,
      - re-compute the IP header checksum.
    Otherwise
      - switch the request IP source and destination addresses in the
        reply,
      - keep the IP header checksum unchanged.

Signed-off-by: Ivan Boule <ivan.boule@6wind.com>
2015-06-12 15:55:38 +02:00
Ivan Boule
d4f891b5fc ixgbe: add multicast MAC address filtering
Support the function "set_mc_addr_list" in the "ixgbe" and in the
"ixgbe-vf" Poll Mode Drivers.

Signed-off-by: Ivan Boule <ivan.boule@6wind.com>
2015-06-12 15:55:38 +02:00
Ivan Boule
23138c4a88 e1000: add multicast MAC address filtering
Support the PMD function "set_mc_addr_list" in the "igb", "igb-vf",
and "em" Poll Mode Drivers.

Signed-off-by: Ivan Boule <ivan.boule@6wind.com>
2015-06-12 15:55:38 +02:00
Ivan Boule
8fff667578 app/testpmd: new command to add/remove multicast MAC addresses
Add the new interactive command:
    mcast_addr add|remove X <mcast_addr>
to add/remove the multicast MAC address <mcast_addr> to/from the set of
multicast addresses filtered by port <X>.
Command used to test the function "rte_eth_dev_set_mc_addr_list"
that has been added to the API of PMDs.

Signed-off-by: Ivan Boule <ivan.boule@6wind.com>
2015-06-12 15:55:38 +02:00
Ivan Boule
64b7acd861 ethdev: add multicast address filtering
With the current PMD API, the receipt of multicast packets on a given
port can only be enabled by invoking the "rte_eth_allmulticast_enable"
function.
This method may not work on Virtual Functions in SR-IOV architectures
when the host PF driver does not allow such operation on VFs.
In such cases, joined multicast addresses must be individually added
in the set of multicast addresses that are filtered by the [VF] port.

For this purpose, a new function "set_mc_addr_list" is introduced
into the set of functions that are exported by a Poll Mode Driver.

Signed-off-by: Ivan Boule <ivan.boule@6wind.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
[Thomas: export new function in .map]
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2015-06-12 15:55:30 +02:00
Damjan Marion
9e71668b42 virtio: fix crash if CQ is not negotiated
Fix NULL dereference if virtio control queue is not negotiated.

Signed-off-by: Damjan Marion <damarion@cisco.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2015-06-12 14:50:06 +02:00
Stephen Hemminger
d78deadae4 virtio: fix ring size negotiation
Negotiate the virtio ring size. The host may allow for very large
rings but application may only want a smaller ring.
Conversely, if the number of descriptors requested exceeds the virtio
host queue size, then just silently use the smaller host size.

This fixes issues with virtio in non-QEMU envirionments.
For example Google Compute Engine allows up to 16K elements
in ring.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Changchun Ouyang <changchun.ouyang@intel.com>
2015-06-12 14:44:59 +02:00
Stephen Hemminger
4a92b67151 virtio: clarify feature bit handling
Change the features from bit mask to bit number. This allows the
DPDK driver to use the definitions from Linux (yes the header
files already use a license compatiable with DPDK). This makes DPDK
driver handle future feature bit changes.

Get rid of double negative code in the feature bit intialization.
Instead just have a new define with the list of feature bits implemented.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Changchun Ouyang <changchun.ouyang@intel.com>
2015-06-12 14:43:40 +02:00
Stephen Hemminger
2704623620 virtio: do not set mac table unless negotiated
Don't attempt to set the MAC address table unless the host allows
it in feature negotiation. Also, don't return a value from mac_table_set
since all callers ignore the return value.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Changchun Ouyang <changchun.ouyang@intel.com>
2015-06-12 14:40:15 +02:00
Stephen Hemminger
e9e414a41a virtio: do not enable/disable Rx modes unless supported
If negotiation with host says that controlling Rx mode is
not supported, then don't try.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Changchun Ouyang <changchun.ouyang@intel.com>
2015-06-12 14:36:38 +02:00
Stephen Hemminger
4ecce8356e virtio: remove blank lines
Putting blank line between function and following conditional
just wastes screen space, and makes code less obvious.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Changchun Ouyang <changchun.ouyang@intel.com>
2015-06-12 14:35:10 +02:00
Stephen Hemminger
6c52c126f2 drivers: explicit initialization of pci drivers
Upcoming drivers will need to be able to support other bus types.
This is a transparent change to how struct eth_driver is initialized.
It has not function or ABI layout impact, but makes adding a later
bus type (Xen, Hyper-V, ...) much easier.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2015-06-12 11:10:10 +02:00
Stephen Hemminger
0e433e5f08 examples: fix whitespace
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2015-06-12 11:10:10 +02:00
Stephen Hemminger
f3618dcbcf app: fix whitespace
Fix trailing whitespace, space before tab and empty lines at end of file.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
[Thomas: fix indent and alignment in test_acl.h and test_sched.c]
2015-06-12 11:10:10 +02:00
Stephen Hemminger
a84b014cb5 drivers: fix whitespace
Note: ignored whitespace issues in base (external code).

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-12 11:10:10 +02:00
Stephen Hemminger
a43a55472f lib: fix whitespace
More places with trailing whitespace, and empty blank lines

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2015-06-12 11:10:10 +02:00
Stephen Hemminger
364ea77481 kni: fix whitespace
Ran this code base through a script which:
  - removes trailing whitespace
  - removes space before tabs
  - removes blank lines at end of file

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-12 11:10:10 +02:00
Stephen Hemminger
9aca9fc204 eal: fix whitespace
Eliminate trailing whitespace, space after tabs, and extra blank lines

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2015-06-12 11:10:10 +02:00
Stephen Hemminger
0cd54d9c17 mk, scripts: remove useless blank lines
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2015-06-12 11:10:02 +02:00
Stephen Hemminger
ce6bc60c57 vmxnet3: fix spelling
Fix spelling errors in strings and comments.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Yong Wang <yongwang@vmware.com>
2015-06-11 14:19:38 +02:00
Sergio Gonzalez Monroy
d2c0806724 mk: fix combined library build
The combined lib was being created after building the lib root dir.
With the new directory hierarchy, it should be created after the
drivers root dir instead.

Fixes: 980ed498eb ("drivers: create new directory")

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Tested-by: Li Wei <lw@cn.fujitsu.com>
2015-06-10 12:21:37 +02:00
Helin Zhang
c1715402df i40evf: fix jumbo frame support
It wouldn't check the configured maximum packet length, and then
the scattered receiving function wouldn't be selected at all even
if it wants to receive a jumbo frame. The fix is to select the
correct RX function according to the configurations.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
2015-06-04 12:01:56 +02:00
Bruce Richardson
36032e46be doc: add coding style
Add coding standards document to guides directory. This document
codifies the current DPDK C coding conventions, to make it easier for
contributors to see the format their code should be in.

Signed-off-by: Siobhan Butler <siobhan.a.butler@intel.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2015-06-04 11:48:28 +02:00
Konstantin Ananyev
229ea9a71c acl: remove subtree calculations at build stage
As now subtree_id is not used acl_merge_trie() any more,
there is no point to calculate and maintain that information.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2015-06-04 11:14:45 +02:00
Konstantin Ananyev
cd1fd93090 acl: add new test case for ranges build
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2015-06-04 11:14:45 +02:00
Konstantin Ananyev
2f372ab5c9 acl: fix matching rule
Reported by Zi Hu:
"
cat test_data/rule1
@192.168.0.0/24 192.168.0.0/24 400 : 500 0 : 52 6/0xff
@192.168.0.0/24 192.168.0.0/24 400 : 500 54 : 65280 6/0xff
@192.168.0.0/24 192.168.0.0/24 400 : 500 0 : 65535 6/0xff

cat test_data/trace1
0xc0a80005 0xc0a80009 450 53 0x06

I run the test by:
sudo ./testacl -n 2 -c 4 -- --rulesf=./test_data/rule1
 --tracef=./test_data/trace1

The result shows that the packet matches the second rule,  which is wrong.
The dest port of the pkt is 53, so it should match the third rule.
"

Indeed there is problem at ACL build stage.
Sometimes acl_merge_trie() is too aggressive in trying to conserve
space at build time.
So it takes a wrong assumptions and didn't duplicate a node,
even when it should.
The easiest and safest fix seems to always duplicate a left non-root/non-leaf
node first, and let the further code to destroy the node, if it is not needed.

Reported-by: Zi Hu <huzilucky@gmail.com>
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2015-06-04 11:14:45 +02:00
Stephen Hemminger
e46e3ba5f0 bonding: remove useless memset
Remove 2 unneeded memset's.  The info area is already cleared rte_eth_dev_info_get
and the statistics buffer is cleared by rte_eth_stats_get

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2015-06-04 10:46:45 +02:00
Stephen Hemminger
8ade036008 null: remove useless memset
The stats area is already cleared before calling eth_stats_get().

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2015-06-04 10:46:45 +02:00
Stephen Hemminger
e6c8156f65 ethdev: remove useless memset
eth_stats is already cleared by rte_eth_stats_get

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2015-06-04 10:46:45 +02:00
Bruce Richardson
94ef296414 eal/linux: fix numa node detection
Using the "physical_package_id" as a fallback for determining the
numa node of a core tends to be unreliable. Fix this by using a
detection routine which reads the numa information from
/sys/devices/system/node and just returns a numa node of 0 on
failure.

Reported-by: Wang Sheng-Hui <shhuiw@gmail.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2015-06-03 18:01:53 +02:00
Andrey Chilikin
bd785f6f67 examples/l3fwd: make destination mac address configurable
Add a command-line parameter to l3fwd, to allow the user to specify the
destination mac address for each ethernet port used.

Signed-off-by: Andrey Chilikin <andrey.chilikin@intel.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2015-06-03 15:51:50 +02:00