dpdk.git
9 years agoacl: add function to check build input parameters
Konstantin Ananyev [Mon, 8 Jun 2015 10:41:25 +0000 (11:41 +0100)]
acl: add function to check build input parameters

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

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

Use global RTE_LEN2MASK macro, instead of local LEN2MASK.

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

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
9 years agoport: add ring writer nodrop
Maciej Gajdzica [Thu, 21 May 2015 12:28:44 +0000 (14:28 +0200)]
port: add ring writer nodrop

When ring_writer_nodrop port fails to send data, it tries to resend.
Operation is aborted when maximum number of retries is reached.

Signed-off-by: Maciej Gajdzica <maciejx.t.gajdzica@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
9 years agoport: add ethdev writer nodrop
Maciej Gajdzica [Thu, 21 May 2015 12:28:43 +0000 (14:28 +0200)]
port: add ethdev writer nodrop

When ethdev_writer_nodrop port fails to send data, it tries to resend.
Operation is aborted when maximum number of retries is reached.

Signed-off-by: Maciej Gajdzica <maciejx.t.gajdzica@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
9 years agoport: new Tx burst implementation of ring writer
Maciej Gajdzica [Thu, 21 May 2015 12:28:42 +0000 (14:28 +0200)]
port: new Tx burst implementation of ring writer

New implementation sends burst without copying data to internal buffer
if it is possible. It is similar to tx_bulk function in ethdev_writer
port.

Signed-off-by: Maciej Gajdzica <maciejx.t.gajdzica@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
9 years agoport: remove an ethdev writer implementation
Maciej Gajdzica [Thu, 21 May 2015 12:28:41 +0000 (14:28 +0200)]
port: remove an ethdev writer implementation

There was two implementations of tx_bulk function in ethdev_writer port.
The function to run is chosen with WRITER_APPROACH define. This patch
removes WRITER_APPROACH = 0 implementation, as it seems to be slower.

Signed-off-by: Maciej Gajdzica <maciejx.t.gajdzica@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
9 years agodoc: fix doxygen warnings in QoS API
Michal Jastrzebski [Wed, 17 Jun 2015 14:37:02 +0000 (16:37 +0200)]
doc: fix doxygen warnings in QoS API

This patch fix doxygen warnings when generating documentation
for qos_meter and qos_sched.

Signed-off-by: Michal Jastrzebski <michalx.k.jastrzebski@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
9 years agovhost: remove unnecessary descriptor length updates
Ouyang Changchun [Tue, 9 Jun 2015 01:03:04 +0000 (09:03 +0800)]
vhost: remove unnecessary descriptor length updates

Remove these unnecessary vring descriptor length updating, vhost should
not change them.
virtio in front end should assign value to desc.len for both rx and tx.

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

Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
9 years agovhost: rework mergeable Rx
Ouyang Changchun [Tue, 9 Jun 2015 01:03:03 +0000 (09:03 +0800)]
vhost: rework mergeable Rx

Extract codes into a function:
update_secure_len which is used to accumulate the buffer len in the
vring descriptors and to fill struct buf_vec.

Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
9 years agovhost: refine code style
Ouyang Changchun [Tue, 9 Jun 2015 01:03:02 +0000 (09:03 +0800)]
vhost: refine code style

Remove unnecessary new line.

Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
9 years agovhost: fix enqueue/dequeue to handle chained vring descriptors
Ouyang Changchun [Tue, 9 Jun 2015 01:03:01 +0000 (09:03 +0800)]
vhost: fix enqueue/dequeue to handle chained vring descriptors

Vring enqueue need consider the 2 cases:
 1. use separate descriptors to contain virtio header and actual data,
    e.g. the first descriptor is for virtio header, and then followed
    by descriptors for actual data.
 2. virtio header and some data are put together in one descriptor,
    e.g. the first descriptor contain both virtio header and part of
    actual data, and then followed by more descriptors for rest of packet
    data, current DPDK based virtio-net pmd implementation is this case;

So does vring dequeue, it should not assume vring descriptor is chained
or not chained, it should use desc->flags to check whether it is chained
or not. This patch also fixes TX corrupt issue when vhost co-work with
virtio-net driver which uses one single vring descriptor (header and data
are in one descriptor) for virtio tx process on default.

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

Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
9 years agokni: fix ioctl in container
Wenfeng Liu [Mon, 15 Jun 2015 04:07:33 +0000 (00:07 -0400)]
kni: fix ioctl in container

In containers like docker, current->pid returns current process's global
PID instead of its own PID under containers's PID namespace, and
get_net_ns_by_pid() suppose to accept a virtual PID under its own
namespace, so we should use task_pid_vnr(current) to get current process's
virtual PID instead of current->pid.

Signed-off-by: Wenfeng Liu <liuwf@arraynetworks.com.cn>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agokni: fix multicast ioctl handling
Simon Kagstrom [Tue, 2 Jun 2015 07:21:55 +0000 (09:21 +0200)]
kni: fix multicast ioctl handling

We did some (very basic) tests with IGMP, which involves adding
multicast addresses to ETH interfaces. This is done via the ip tool,
an example can be found on e.g.,

  http://superuser.com/questions/324824/linux-built-in-or-open-source-program-to-join-multicast-group

and this will fail on KNI interfaces because of an unimplemented ioctl
SIOCADDMULTI. The patch simply adds an empty callback for set_rx_mode
(typically used for setting up hardware) so that the ioctl succeeds.
This is the same thing as the Linux tap interface does.

Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net>
Signed-off-by: Johan Faltstrom <johan.faltstrom@netinsight.net>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agokni: fix Rx loop limit
Jay Rolette [Wed, 3 Jun 2015 19:18:57 +0000 (14:18 -0500)]
kni: fix Rx loop limit

Loop processing packets dequeued from rx_q was using the number of
packets requested, not how many it actually received.

Variable rename to make code a little more clear

Signed-off-by: Jay Rolette <rolette@infiniteio.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agokni: optimize Rx burst size computation
Jay Rolette [Wed, 3 Jun 2015 19:18:56 +0000 (14:18 -0500)]
kni: optimize Rx burst size computation

No reason to check out many entries are in kni->rx_q prior to
actually pulling them from the fifo. You can't dequeue more than
are there anyway. Max entries to dequeue is either the max batch
size or however much space is available on kni->free_q (lesser of the two).

Signed-off-by: Jay Rolette <rolette@infiniteio.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agokni: optimize single thread loop
Jay Rolette [Wed, 3 Jun 2015 19:18:55 +0000 (14:18 -0500)]
kni: optimize single thread loop

Do not need the 'safe' version of list_for_each_entry() if you are
not deleting from the list as you iterate over it.

Signed-off-by: Jay Rolette <rolette@infiniteio.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agokni: add link status update
Vijayakumar Muthuvel Manickam [Tue, 16 Jun 2015 06:39:54 +0000 (02:39 -0400)]
kni: add link status update

Implement .ndo_change_carrier to enable
DPDK applications to propagate link state changes to
kni virtual interfaces through sysfs

Signed-off-by: Vijayakumar Muthuvel Manickam <mmvijay@gmail.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agokni: query the name of an instance
Bruce Richardson [Wed, 27 May 2015 13:47:49 +0000 (14:47 +0100)]
kni: query the name of an instance

When a KNI object is created, a name is assigned to it which is stored
internally. There is also an API function to look up a KNI object by
name, but there is no API to query the current name of an existing
KNI object. This patch adds just such an API.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agohash: fix typo in jhash comments
Thomas Monjalon [Tue, 16 Jun 2015 10:14:48 +0000 (12:14 +0200)]
hash: fix typo in jhash comments

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agoapp/test: verify more jhash functions
Pablo de Lara [Wed, 10 Jun 2015 15:25:27 +0000 (16:25 +0100)]
app/test: verify more jhash functions

Added new test that verifies that rte_jhash_1words,
rte_jhash_2words and rte_jhash_3words return the same
values as rte_jhash.

Note that this patch has been added after the update
of the jhash function because these 3 functions did not
return the same values as rte_jhash before

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
9 years agohash: rename a jhash function
Pablo de Lara [Wed, 10 Jun 2015 15:25:26 +0000 (16:25 +0100)]
hash: rename a jhash function

Changed name to something more meaningful,
and mark rte_jhash2 as deprecated.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
9 years agohash: remove duplicated code
Pablo de Lara [Wed, 10 Jun 2015 15:25:25 +0000 (16:25 +0100)]
hash: remove duplicated code

rte_jhash is basically like __rte_jhash_2hashes but
it returns only 1 hash, instead of 2.
In order to remove duplicated code, rte_jhash calls __rte_jhash_2hashes,
passing 0 as the second seed and returning just the first hash value.
(performance penalty is negligible)

The same is done with rte_jhash2. Also, rte_jhash2 is just an specific case
where keys are multiple of 32 bits, and where no key alignment check is required.
So,to avoid duplicated code, the function calls __rte_jhash_2hashes
with check_align = 0 (to use the optimal path)

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
9 years agohash: add new jhash functions
Pablo de Lara [Wed, 10 Jun 2015 15:25:24 +0000 (16:25 +0100)]
hash: add new jhash functions

With the jhash update, two new functions were introduced:

- rte_jhash_2hashes: Same as rte_jhash, but takes two seeds
                     and return two hashes (uint32_ts)

- rte_jhash2_2hashes: Same as rte_jhash2, but takes two seeds
                     and return two hashes (uint32_ts)

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
[Thomas: fix doxygen typos]

9 years agohash: update jhash function with the latest available
Pablo de Lara [Wed, 10 Jun 2015 15:25:23 +0000 (16:25 +0100)]
hash: update jhash function with the latest available

Jenkins hash function was developed originally in 1996,
and was integrated in first versions of DPDK.
The function has been improved in 2006,
achieving up to 35% better performance, compared to the original one.

This patch integrates that code into the rte_jhash library.
It also updates the precalculated hash values in the unit test,
as the code now returns different values (expected).

A final note has been added in release notes for stating
the changes made.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
9 years agoapp/test: add new functional tests for hash functions
Pablo de Lara [Wed, 10 Jun 2015 15:25:22 +0000 (16:25 +0100)]
app/test: add new functional tests for hash functions

In order to make sure that the hash functions are returning
the correct values, new tests have been added:

- First test compares precalculated hash values with values calculated
from the existing hash functions.
- Second test compares values returned from rte_jhash2 and rte_jhash,
expecting same return (only for multiple of 4 bytes keys)

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
9 years agoapp/test: change order of loops in hash function tests
Pablo de Lara [Wed, 10 Jun 2015 15:25:21 +0000 (16:25 +0100)]
app/test: change order of loops in hash function tests

In order to see more clearly the performance difference
between different hash functions, order of the loops
have been changed, so it iterates first through initial values,
then key sizes and then the hash functions.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
9 years agoapp/test: update hash key size range and initial values
Pablo de Lara [Wed, 10 Jun 2015 15:25:20 +0000 (16:25 +0100)]
app/test: update hash key size range and initial values

Previous key sizes used for testing did not have much purpose.
This patch substitutes them with some more meaninful
(standard multiple of 2 key sizes, plus IPv4/v6 tuple and others)

Also an arbitrary initial value has been added to increase
the test coverage, and RTE_DIM macro is used to iterate the loops.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
9 years agoapp/test: improve accuracy on hash measurements
Pablo de Lara [Wed, 10 Jun 2015 15:25:19 +0000 (16:25 +0100)]
app/test: improve accuracy on hash measurements

Cycles per hash calculation were measured per single operation.
It is much more accurate to run several iterations between measurements
and divide by number of iterations.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
9 years agoapp/test: move hash performance tests to separate file
Pablo de Lara [Wed, 10 Jun 2015 15:25:18 +0000 (16:25 +0100)]
app/test: move hash performance tests to separate file

This patch moves hash function performance tests to a separate file,
so user can check performance of the existing hash functions quicker,
without having to run all the other hash operation performance tests,
which takes some time.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
9 years agoixgbe: fix X550 flow director check
Wenzhuo Lu [Mon, 15 Jun 2015 05:59:26 +0000 (13:59 +0800)]
ixgbe: fix X550 flow director check

On x550, flow director doesn't support other IP packets directly.
If we want to monitor IP other packets, the L4 protocol and ports must
be masked. It means, on x550, if we want to add a flow director filter
for other IP packets, a flow director mask must have been configed to
mask L4 protocol and ports.

Return err when the user try to config a flow director filter for other
IP packets without flow director mask configed before. And print err log
for it.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
9 years agoixgbe/base: restrict EEE to X550em KR backplane
Wenzhuo Lu [Fri, 5 Jun 2015 05:21:58 +0000 (13:21 +0800)]
ixgbe/base: restrict EEE to X550em KR backplane

This patch sets the setup_EEE function pointer to NULL for the
interfaces which do not support EEE (Energy Efficient Ethernet).
Currently only the KR backplane interface (0x15AB) supports EEE.
Setting this pointer to NULL prevents EEE registers from being
incorrectly modified and gives base drivers a flag to check for
EEE support.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agoixgbe/base: add X550em PHY reset
Wenzhuo Lu [Fri, 5 Jun 2015 05:21:57 +0000 (13:21 +0800)]
ixgbe/base: add X550em PHY reset

This patch adds x550em PHY reset function ixgbe_reset_phy_t_X550em.
ixgbe_reset_phy_t_X550em calls the reset PHY generic, and then enables
the x550em PHY LASI(Link Alarm Status Interrupt) interrupts.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agoixgbe/base: fix lan id before first i2c access
Wenzhuo Lu [Fri, 5 Jun 2015 05:21:56 +0000 (13:21 +0800)]
ixgbe/base: fix lan id before first i2c access

Set the lan_id before the first I2C access. The existing call was
clearly being done after a previous I2C access in the same function
and that can't be right, so call the set_lan_id method earlier. At
this point it probably doesn't matter for this QSFP function, but
it makes sense to do it consistently anyway.

On X550, be sure to set the lan_id before using it to configure the
mux control output, else the mux will not be controlled.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agoixgbe/base: fix lan id for X550em
Wenzhuo Lu [Fri, 5 Jun 2015 05:21:45 +0000 (13:21 +0800)]
ixgbe/base: fix lan id for X550em

The introduction of ixgbe_get_bus_info_X550em failed to call the
set_lan_id method to set the func and lan_id and deal with port-
swapped configurations. Add the call to resolve the problem.

Fixes: 4cf0bb32a912 ("ixgbe/base: get X550 bus info")

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agoixgbe/base: add X550em link check
Wenzhuo Lu [Fri, 5 Jun 2015 05:21:55 +0000 (13:21 +0800)]
ixgbe/base: add X550em link check

This patch adds ixgbe_check_link_t_X550em for checking x550em
PHY link. We check that both the MAC and external x550em PHY have link.
This is to avoid a false link up between the internal and external PHY
when the external PHY doesn't have link.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agoixgbe/base: add X550em PHY interrupt and forced speeds
Wenzhuo Lu [Fri, 5 Jun 2015 05:21:54 +0000 (13:21 +0800)]
ixgbe/base: add X550em PHY interrupt and forced speeds

This patch adds x550em external PHY interrupt and forced 1G/10G
support. Support includes enabling and handling Link Status
Change and Thermal Sensor interrupt. ixgbe_handle_lasi has been added
to the API for handling the interrupts received from x550em PHY.
ixgbe_enable_lasi_ext_t_x550em and ixgbe_get_lasi_ext_t_x550em have been
added to X550em to enable mask and check interrupt flags for x550em PHY.

Forced 1G/10G link speed is handled via ixgbe_setup_mac_link_t_X550em.
ixgbe_setup_mac_link_t_X550em sets up the internal PHY and
external PHY link to either 10G or 1G based on the user selected auto
advertised link speed setting. Then sets up the external PHY auto
advertised link speed.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agoixgbe/base: add X550em autoneg flow control
Wenzhuo Lu [Fri, 5 Jun 2015 05:21:53 +0000 (13:21 +0800)]
ixgbe/base: add X550em autoneg flow control

This patch adds x550em Auto neg Flow Control support to
ixgbe_device_supports_autoneg_fc and sets the x550em setup_fc function
pointer to ixgbe_setup_fc_generic. ixgbe_setup_fc_generic is used for
x550em because flow control is setup on the external PHY via MDIO, when
ixgbe_setup_fc_X550em sets up flow control on the internal PHY.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agoixgbe/base: rework X550em PHY setup function
Wenzhuo Lu [Fri, 5 Jun 2015 05:21:52 +0000 (13:21 +0800)]
ixgbe/base: rework X550em PHY setup function

This patch cleans up the ixgbe_setup_internal_phy_ x550em() function as follows:
 - Renames it to ixgbe_setup_internal_phy_t_x550em to clarify that it is
   specific to copper
 - Returns an error if called for non-copper devices
 - Corrects the comments
 - Removed the LASI(Link Alarm Status Interrupt) status register checks as
   this was incorrect and never worked correctly anyway.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agoixgbe/base: fix init handling of X550em link down
Wenzhuo Lu [Fri, 5 Jun 2015 05:21:51 +0000 (13:21 +0800)]
ixgbe/base: fix init handling of X550em link down

This patch changes the return value for ixgbe_setup_internal_phy_t_x550em
when link is down to IXGBE_SUCCESS.
The driver will call ixgbe_setup_internal_phy_t_x550em when a link status
change is reported. The links status change can occur on link up or link
down, and if the link status change is for link down then there is no iXFI
setup necessary and no error condition needs to be returned.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agoixgbe/base: move i2c mux function for X550em
Wenzhuo Lu [Fri, 5 Jun 2015 05:21:50 +0000 (13:21 +0800)]
ixgbe/base: move i2c mux function for X550em

The following patch moves the handling of the I2C MUX (which is only
used for x550em SFP+ devices) out of the ixgbe_x540.c file and
into the ixgbe_x550.c file where it belongs.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agoixgbe/base: new simplified X550em init flow
Wenzhuo Lu [Fri, 5 Jun 2015 05:21:49 +0000 (13:21 +0800)]
ixgbe/base: new simplified X550em init flow

The init flow is simplified. We no longer wait for the PHY FW init
complete bit to be set as this bit is only set once by the PHY at power
on and then cleared on the first read. So only the first instance of
running SW (or possibly MAC FW) needs to initialize the PHY.

The PHY initialization has been simplified and now only requires that
the PHY FW be "un-stalled". SW no longer needs to put the PHY in
low-power mode or enable the transceiver.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agoixgbe/base: fix X550em flow control for KR backplane
Wenzhuo Lu [Fri, 5 Jun 2015 05:21:48 +0000 (13:21 +0800)]
ixgbe/base: fix X550em flow control for KR backplane

For the KR backplane which is different from other backplane,
in that we can't use auto-negotiation to determine the
mode. Instead, use whatever the user configured.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agoixgbe/base: add X550em LPLU support
Wenzhuo Lu [Fri, 5 Jun 2015 05:21:47 +0000 (13:21 +0800)]
ixgbe/base: add X550em LPLU support

This patch adds SW Low Power Link Up (LPLU) support for x550em PHY.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agoixgbe/base: add SFP+ dual-speed support
Wenzhuo Lu [Fri, 5 Jun 2015 05:21:46 +0000 (13:21 +0800)]
ixgbe/base: add SFP+ dual-speed support

This patch adds SFP+ dual-speed support.
82599 fiber link code was moved from ixgbe_82599.c to ixgbe_commom.c
for use by X550em, and the API was updated to support the common code
usage. SFP MAC link code is added to x550em.

Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agoixgbe/base: disable X550em FEC to save power
Wenzhuo Lu [Fri, 5 Jun 2015 05:21:44 +0000 (13:21 +0800)]
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>
9 years agoixgbe/base: fix X550em mux after MAC reset
Wenzhuo Lu [Fri, 5 Jun 2015 05:21:43 +0000 (13:21 +0800)]
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: d2e72774e58c ("ixgbe/base: support X550")

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agoixgbe/base: reset X550em CS4227 when needed
Wenzhuo Lu [Fri, 5 Jun 2015 05:21:42 +0000 (13:21 +0800)]
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>
9 years agoixgbe/base: issue firmware command when resetting X550em
Wenzhuo Lu [Fri, 5 Jun 2015 05:21:41 +0000 (13:21 +0800)]
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>
9 years agoixgbe/base: reduce i2c retry count for X550
Wenzhuo Lu [Fri, 5 Jun 2015 05:21:40 +0000 (13:21 +0800)]
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>
9 years agoixgbe/base: provide unlocked i2c methods
Wenzhuo Lu [Fri, 5 Jun 2015 05:21:39 +0000 (13:21 +0800)]
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>
9 years agoixgbe/base: remove useless function
Wenzhuo Lu [Fri, 5 Jun 2015 05:21:38 +0000 (13:21 +0800)]
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>
9 years agoixgbe/base: fix tunnelled UDP and TCP frames in flow director
Wenzhuo Lu [Fri, 5 Jun 2015 05:21:37 +0000 (13:21 +0800)]
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>
9 years agoixgbe/base: check return value after calling
Wenzhuo Lu [Fri, 5 Jun 2015 05:21:36 +0000 (13:21 +0800)]
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>
9 years agoixgbe/base: fix typos
Wenzhuo Lu [Fri, 5 Jun 2015 05:21:34 +0000 (13:21 +0800)]
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>
9 years agoixgbe/base: update copyright and readme
Wenzhuo Lu [Fri, 5 Jun 2015 05:21:33 +0000 (13:21 +0800)]
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>
9 years agoeal: allow combining -m and --no-huge
Simon Kagstrom [Wed, 27 May 2015 09:30:16 +0000 (11:30 +0200)]
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>
9 years agoapp/test: return error code on failed tests
John McNamara [Thu, 11 Jun 2015 14:48:56 +0000 (15:48 +0100)]
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>
9 years agoapp/test: fix default numa memory assignment
Gaetan Rivet [Mon, 1 Jun 2015 12:11:00 +0000 (14:11 +0200)]
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>
9 years agoapp/testpmd: fix default flow control values
Ding Zhi [Mon, 1 Jun 2015 12:11:09 +0000 (14:11 +0200)]
app/testpmd: fix default flow control values

This variable has undefined values in some cases.

Fixes: 422a20a4e62d ("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>
9 years agoexamples/qos_sched: use librte_cfgfile
Michal Jastrzebski [Fri, 5 Jun 2015 09:28:17 +0000 (11:28 +0200)]
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>
9 years agomlx4: fix 32-bit build
Nelio Laranjeiro [Fri, 22 May 2015 14:17:31 +0000 (16:17 +0200)]
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>
9 years agovhost: enable live migration
Krishna Murthy [Wed, 27 May 2015 03:01:31 +0000 (11:01 +0800)]
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>
9 years agombuf: optimize refcnt update
Olivier Matz [Mon, 8 Jun 2015 14:57:22 +0000 (16:57 +0200)]
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>
9 years agoapp/testpmd: fix reply to a multicast ICMP request
Ivan Boule [Thu, 28 May 2015 15:05:23 +0000 (17:05 +0200)]
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>
9 years agoixgbe: add multicast MAC address filtering
Ivan Boule [Thu, 28 May 2015 15:05:22 +0000 (17:05 +0200)]
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>
9 years agoe1000: add multicast MAC address filtering
Ivan Boule [Thu, 28 May 2015 15:05:21 +0000 (17:05 +0200)]
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>
9 years agoapp/testpmd: new command to add/remove multicast MAC addresses
Ivan Boule [Thu, 28 May 2015 15:05:20 +0000 (17:05 +0200)]
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>
9 years agoethdev: add multicast address filtering
Ivan Boule [Fri, 29 May 2015 08:56:25 +0000 (10:56 +0200)]
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>
9 years agovirtio: fix crash if CQ is not negotiated
Damjan Marion [Mon, 25 May 2015 10:20:52 +0000 (12:20 +0200)]
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>
9 years agovirtio: fix ring size negotiation
Stephen Hemminger [Thu, 11 Jun 2015 15:53:27 +0000 (08:53 -0700)]
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>
9 years agovirtio: clarify feature bit handling
Stephen Hemminger [Thu, 11 Jun 2015 15:53:26 +0000 (08:53 -0700)]
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>
9 years agovirtio: do not set mac table unless negotiated
Stephen Hemminger [Thu, 11 Jun 2015 15:53:25 +0000 (08:53 -0700)]
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>
9 years agovirtio: do not enable/disable Rx modes unless supported
Stephen Hemminger [Thu, 11 Jun 2015 15:53:24 +0000 (08:53 -0700)]
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>
9 years agovirtio: remove blank lines
Stephen Hemminger [Thu, 11 Jun 2015 15:53:23 +0000 (08:53 -0700)]
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>
9 years agodrivers: explicit initialization of pci drivers
Stephen Hemminger [Fri, 29 May 2015 15:47:51 +0000 (08:47 -0700)]
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>
9 years agoexamples: fix whitespace
Stephen Hemminger [Thu, 4 Jun 2015 14:43:25 +0000 (07:43 -0700)]
examples: fix whitespace

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
9 years agoapp: fix whitespace
Stephen Hemminger [Thu, 4 Jun 2015 14:43:24 +0000 (07:43 -0700)]
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]

9 years agodrivers: fix whitespace
Stephen Hemminger [Thu, 4 Jun 2015 14:43:27 +0000 (07:43 -0700)]
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>
9 years agolib: fix whitespace
Stephen Hemminger [Thu, 4 Jun 2015 14:43:23 +0000 (07:43 -0700)]
lib: fix whitespace

More places with trailing whitespace, and empty blank lines

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
9 years agokni: fix whitespace
Stephen Hemminger [Thu, 4 Jun 2015 14:43:19 +0000 (07:43 -0700)]
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>
9 years agoeal: fix whitespace
Stephen Hemminger [Thu, 4 Jun 2015 14:43:20 +0000 (07:43 -0700)]
eal: fix whitespace

Eliminate trailing whitespace, space after tabs, and extra blank lines

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
9 years agomk, scripts: remove useless blank lines
Stephen Hemminger [Thu, 4 Jun 2015 14:43:26 +0000 (07:43 -0700)]
mk, scripts: remove useless blank lines

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
9 years agovmxnet3: fix spelling
Stephen Hemminger [Wed, 10 Jun 2015 16:09:37 +0000 (09:09 -0700)]
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>
9 years agomk: fix combined library build
Sergio Gonzalez Monroy [Tue, 9 Jun 2015 09:37:28 +0000 (10:37 +0100)]
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: 980ed498eb1dd0 ("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>
9 years agoi40evf: fix jumbo frame support
Helin Zhang [Thu, 4 Jun 2015 06:54:32 +0000 (14:54 +0800)]
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>
9 years agodoc: add coding style
Bruce Richardson [Wed, 3 Jun 2015 13:58:13 +0000 (14:58 +0100)]
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>
9 years agoacl: remove subtree calculations at build stage
Konstantin Ananyev [Wed, 3 Jun 2015 17:45:19 +0000 (18:45 +0100)]
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>
9 years agoacl: add new test case for ranges build
Konstantin Ananyev [Wed, 3 Jun 2015 17:45:18 +0000 (18:45 +0100)]
acl: add new test case for ranges build

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
9 years agoacl: fix matching rule
Konstantin Ananyev [Wed, 3 Jun 2015 17:45:17 +0000 (18:45 +0100)]
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>
9 years agobonding: remove useless memset
Stephen Hemminger [Wed, 3 Jun 2015 21:13:10 +0000 (14:13 -0700)]
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>
9 years agonull: remove useless memset
Stephen Hemminger [Wed, 3 Jun 2015 21:13:12 +0000 (14:13 -0700)]
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>
9 years agoethdev: remove useless memset
Stephen Hemminger [Wed, 3 Jun 2015 21:13:11 +0000 (14:13 -0700)]
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>
9 years agoeal/linux: fix numa node detection
Bruce Richardson [Wed, 22 Apr 2015 13:31:55 +0000 (14:31 +0100)]
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>
9 years agoexamples/l3fwd: make destination mac address configurable
Andrey Chilikin [Mon, 18 May 2015 12:13:24 +0000 (13:13 +0100)]
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>
9 years agoexamples/load_balancer: fix build with gcc 5.1
Thomas Monjalon [Tue, 2 Jun 2015 13:42:08 +0000 (15:42 +0200)]
examples/load_balancer: fix build with gcc 5.1

GCC 5.1 detects more out-of-bounds accesses:
error: array subscript is above array bounds [-Werror=array-bounds]

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
9 years agoip_frag: fix build with gcc 5.1
Bruce Richardson [Fri, 29 May 2015 14:34:14 +0000 (15:34 +0100)]
ip_frag: fix build with gcc 5.1

On Fedora 22, with GCC 5.1, errors are reported due to array accesses
being potentially out of bounds. This commit fixes this by adding in an
extra bounds check to the loop counter.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
9 years agonull: fix build with gcc 5.1
Bruce Richardson [Fri, 29 May 2015 14:34:16 +0000 (15:34 +0100)]
null: fix build with gcc 5.1

On Fedora 22, with GCC 5.1, errors are reported due to array accesses
being potentially out of bounds. This commit fixes this by adding in an
extra bounds check to the loop counters, or, in the case of stats reset,
by blindly zeroing the whole array, rather than just the part that is in
use.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
9 years agoi40e: fix build with gcc 5.1
Bruce Richardson [Fri, 29 May 2015 14:34:15 +0000 (15:34 +0100)]
i40e: fix build with gcc 5.1

On Fedora 22, with GCC 5.1, errors are reported due to array accesses
being potentially out of bounds. This commit fixes this by adding in an
extra bounds check to the loop counter.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
9 years agomem: fix build with gcc 5.1
Bruce Richardson [Fri, 29 May 2015 14:34:13 +0000 (15:34 +0100)]
mem: fix build with gcc 5.1

On Fedora 22, with GCC 5.1, errors are reported due to array accesses
being potentially out of bounds. This commit fixes this by ensuring the
bounds check in the loop takes account of the array size.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>