Shahaf Shuler [Wed, 10 Jan 2018 09:09:18 +0000 (11:09 +0200)]
app/testpmd: adjust on the fly VLAN configuration
On ethdev there is an API to configure VLAN offloads after the port
was started and without reconfiguration of the port or queues.
In the current design of the application, when the Rx offloads are
changed (through "port config all" CLI command) the port configuration
is overwritten, therefore the configuration made for the VLAN is lost.
This patch is to address the issue by a configuration of each port Rx
offloads separately instead of using the global Rx config. Such
adjustment is required due to the conversion of the application to the
new offloads API.
Signed-off-by: Shahaf Shuler <shahafs@mellanox.com> Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Shahaf Shuler [Wed, 10 Jan 2018 09:09:16 +0000 (11:09 +0200)]
app/testpmd: remove txqflags option
Since testpmd is now using the new Ethdev offloads API and there is
a way configure each of the tx offloads from CLI or command line,
there is no need for the txqflags configuration anymore.
Shahaf Shuler [Wed, 10 Jan 2018 09:09:14 +0000 (11:09 +0200)]
app/testpmd: cleanup internal Tx offloads flags field
The tx_ol_flags field was used in order to control the different
Tx offloads set. After the conversion to the new Ethdev Tx offloads API
it is not needed anymore as the offloads configuration is stored in
ethdev structs.
Signed-off-by: Shahaf Shuler <shahafs@mellanox.com> Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
This patch mandates the port to be stopped when configure the Tx
offloads. This is because the PMD must be aware to the offloads changes
on the device and queue configuration.
Signed-off-by: Shahaf Shuler <shahafs@mellanox.com> Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Hemant Agrawal [Mon, 18 Dec 2017 07:56:49 +0000 (13:26 +0530)]
net/ixgbe: fix ARM big endian build
fixes the following compilation error on compiling with ARM BE compiler
ixgbe_common.c: In function ‘ixgbe_host_interface_command’:
ixgbe_common.c:4610:22: error: passing argument 1 of
‘__builtin_bswap32’ makes integer from pointer without a cast
[-Werror=int-conversion]
IXGBE_LE32_TO_CPUS(&buffer[bi]);
^ Fixes: aa4fc14d2cee ("ixgbe: update base driver") Cc: stable@dpdk.org Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Hemant Agrawal [Mon, 18 Dec 2017 07:56:48 +0000 (13:26 +0530)]
net/i40e: fix ARM big endian build
This patch fixes the following error observed when
compiling with ARM BE compiler.
i40e_ethdev.c: In function ‘i40e_dev_tunnel_filter_set’:
i40e_ethdev.c:6988:5: error: lvalue required as unary ‘&’ operand
&rte_cpu_to_le_32(ipv4_addr),
Hemant Agrawal [Mon, 18 Dec 2017 07:56:46 +0000 (13:26 +0530)]
lpm: fix ARM big endian build
Compiling on ARM BE using Linaro toolchain caused following
error/warnings.
rte_lpm.c: In function ‘add_depth_big_v20’:
rte_lpm.c:911:4: error: braces around scalar initializer [-Werror]
{ .group_idx = (uint8_t)tbl8_group_index, },
^
rte_lpm.c:911:4: note: (near initialization for
‘new_tbl24_entry.depth’)
rte_lpm.c:911:6:error: field name not in record or union initializer
{ .group_idx = (uint8_t)tbl8_group_index, },
^
rte_lpm.c:911:6: note: (near initialization for
‘new_tbl24_entry.depth’)
rte_lpm.c:914:13: error: initialized field overwritten
[-Werror=override-init]
.depth = 0,
Fixes: dc81ebbacaeb ("lpm: extend IPv4 next hop field") Cc: stable@dpdk.org Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Anatoly Burakov [Fri, 22 Dec 2017 10:30:36 +0000 (10:30 +0000)]
vfio: fix enabled check on error
rte_eal_check_module() might return -1, which would have been a
"not false" condition for mod_available. Fix that to only report
vfio being enabled if rte_eal_check_module() returns 1.
Fixes: 221f7c220d6b ("vfio: move global config out of PCI files") Cc: stable@dpdk.org Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Anatoly Burakov [Thu, 21 Dec 2017 16:54:24 +0000 (16:54 +0000)]
malloc: fix end for bounded elements
In cases when alignment is bigger than boundary, we may incorrectly
calculate end of a bounded malloc element.
Consider this: suppose we are allocating a bounded malloc element
that should be of 128 bytes in size, bounded to 128 bytes and
aligned on a 256-byte boundary. Suppose our malloc element ends
at 0x140 - that is, 256 plus one cacheline.
So, right at the start, we are aligning our new_data_start to
include the required element size, and to be aligned on a specified
boundary - so new_data_start becomes 0. This fails the following
bounds check, because our element cannot go above 128 bytes from
the start, and we are at 320. So, we enter the bounds handling
branch.
While we're in there, we are aligning end_pt to our boundedness
requirement of 128 byte, and end up with 0x100 (since 256 is
128-byte aligned). We recalculate new_data_size and it stays at
0, however our end is at 0x100, which is beyond the 128 byte
boundary, and we report inability to reserve a bounded element
when we could have.
This patch adds an end_pt recalculation after new_data_start
adjustment - we already know that size <= bound, so we can do it
safely - and we then correctly report that we can, in fact, try
using this element for bounded malloc allocation.
Fixes: fafcc11985a2 ("mem: rework memzone to be allocated by malloc") Cc: stable@dpdk.org Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Anatoly Burakov [Thu, 21 Dec 2017 17:32:04 +0000 (17:32 +0000)]
malloc: protect stats with lock
When we're gathering statistics, we are traversing the freelist,
which may change under our feet in multithreaded scenario. This
is verified by occasional segfaults when running malloc autotest
on a machine with big amount of cores.
This patch protects malloc heap stats call with a lock. It changes
its definition in the process due to locking invalidating the
const-ness, but this isn't a public API, so that's OK.
Anatoly Burakov [Thu, 21 Dec 2017 18:07:07 +0000 (18:07 +0000)]
memzone: fix leak on allocation error
We check if there's space in config after we allocated the memzone,
but if there isn't, we never free it back. This patch adds memzone
free if there's no room in memzone config.
Harry van Haaren [Fri, 12 Jan 2018 10:27:18 +0000 (10:27 +0000)]
service: add attribute for number of invocations
This commit adds a new attribute to the service cores attributes
API, which allows the application to retrieve the number of times
that a service-core called the service to perform its action.
Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Harry van Haaren [Fri, 12 Jan 2018 10:27:17 +0000 (10:27 +0000)]
service: add reset all attributes for service
This commit introduces a new API, allowing the application to
reset attributes of a service like the cycle count. Given this
functionality is now exposed to the user, remove the resetting
of stats during a dump() call.
Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Harry van Haaren [Fri, 12 Jan 2018 10:27:16 +0000 (10:27 +0000)]
service: add attribute get function
This commit adds a new function to the service API to allow
the application to retrieve items about each individual service
in the system. A unit test checks the return values of a variety
of invalid and valid calls.
Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Nipun Gupta [Wed, 3 Jan 2018 15:39:04 +0000 (21:09 +0530)]
bus/fslmc: change EQCR stashing threshold to 1
Changing the EQCR stashing threshold boosts the performance
of l3fwd application on LS2088 by more than 20% as it helps
in burst packet processing at the Tx side. CPU is immediately
informed about the empty EQCR entries once consumed by the
hardware.
Zhiyong Yang [Wed, 10 Jan 2018 02:32:26 +0000 (10:32 +0800)]
bus/pci: fix interrupt handler type
For virtio legacy device, testpmd startup fails when using uio_pci_generic.
The issue is caused by invoking the function pci_ioport_map. The correct
value of intr_handle.type is already set before calling it, we should avoid
overwriting the default value "RTE_INTR_HANDLE_UNKNOWN" in this function.
Besides, the removal has no harm to other cases because it is set to 0 by a
memset on the whole struct during allocation in the function pci_scan_one.
Such assignments are removed in the meanwhile in pci_uio_map_resource(),
pci_vfio_map_resource_primary() and pci_vfio_map_resource_secondary() in
order to keep consistencies and avoid future questions.
Fixes: 756ce64b1ecd ("eal: introduce PCI ioport API") Cc: stable@dpdk.org Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> Reviewed-by: Thomas Monjalon <thomas@monjalon.net>
Thomas Monjalon [Fri, 1 Dec 2017 00:27:10 +0000 (01:27 +0100)]
bus/vdev: add custom scan hook
The scan callback allows to spawn a vdev automatically
given some custom scan rules.
It is especially useful to create a TAP device automatically
connected to a netdevice as remote.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: Jianfeng Tan <jianfeng.tan@intel.com>
Thomas Monjalon [Thu, 30 Nov 2017 21:27:01 +0000 (22:27 +0100)]
eal/x86: get hypervisor name
The CPUID instruction is caught by hypervisor which can return
a flag indicating one is running, and its name.
Suggested-by: Stephen Hemminger <sthemmin@microsoft.com> Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Update rte_mbuf_sanity_check() to check sanity of data_len and pkt_len
fields. For segmented packets it is supposed that head's pkt_len field
should be the sum of all segments data_len values.
Signed-off-by: Ilya V. Matveychikov <matvejchikov@gmail.com> Acked-by: Olivier Matz <olivier.matz@6wind.com>
Marko Kovacevic [Tue, 12 Dec 2017 14:03:27 +0000 (14:03 +0000)]
power: clean KVM files
rename private header file rte_power_kvm_vm.c
to power_kvm_vm.c. This prevents the private
functions from leaking into the documentation.
Change any private functions from
rte_<function_name> to just <function_name>.
Reserve the rte_ for public functions
Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com> Acked-by: David Hunt <david.hunt@intel.com>
Marko Kovacevic [Tue, 12 Dec 2017 14:03:26 +0000 (14:03 +0000)]
power: clean ACPI files
Rename private header file rte_power_acpi_cpufreq.c
to power_acpi_cpufreq.c.This prevents the private
functions from leaking into the documentation.
Change any private functions from rte_<function_name>
to just <function_name>.Reserve the rte_ for public functions.
Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com> Acked-by: David Hunt <david.hunt@intel.com>
Marko Kovacevic [Tue, 12 Dec 2017 14:03:24 +0000 (14:03 +0000)]
power: changed unsigned to unsigned int
Since this patch-set attempts to clean up the power library,
and there are many instances of "unsigned" caught by checkpatch,
it was decided to clean these up first rather than have them included
in the later patches in the patch set. And would also minimise this
type of error being caught by checkpatch in the future
Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com> Acked-by: David Hunt <david.hunt@intel.com>
This patch fixes a potential bug, which was not consistently
showing up in the unit tests. The issue was that the service-
lcore being started was not in a "WAIT" state, and hence EAL
would return -EBUSY instead of launching the lcore.
In order to ensure a core is in a launch-ready state, the application
must call rte_eal_wait_lcore, to ensure that the core has completed
its previous task, and that EAL is ready to re-launch it.
The call to rte_eal_wait_lcore() is explicitly not in the
service core function, to make it visible to the application.
Requiring an explicit function call ensures the developer sees
that a lcore could block in the rte_eal_wait_lcore() function
if the core hasn't returned from its previous function.
From a usability perspective, hiding the wait_lcore() inside
service cores would cause confusion.
This patch adds rte_eal_wait_lcore() calls to the unit tests,
to ensure that the lcores for testing functionality are ready
to run the test.
Fixes: 21698354c832 ("service: introduce service cores concept") Cc: stable@dpdk.org Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com> Acked-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
This patch fixes the reset of the service core,
that when rte_service_lcore_del() is called, the
lcore_role is restored to RTE.
This issue was reported as when running the unit tests, an
error was thrown that "failed to allocate lcore". Investigating
revealed that the state of the service-cores after del() was
not allowing a core to be re-used at a later point in time.
Fixes: 21698354c832 ("service: introduce service cores concept") Cc: stable@dpdk.org Reported-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com> Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com> Acked-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Jiayu Hu [Wed, 10 Jan 2018 14:03:12 +0000 (22:03 +0800)]
gro: support VxLAN GRO
This patch adds a framework that allows GRO on tunneled packets.
Furthermore, it leverages that framework to provide GRO support for
VxLAN-encapsulated packets. Supported VxLAN packets must have an outer
IPv4 header, and contain an inner TCP/IPv4 packet.
VxLAN GRO doesn't check if input packets have correct checksums and
doesn't update checksums for output packets. Additionally, it assumes
the packets are complete (i.e., MF==0 && frag_off==0), when IP
fragmentation is possible (i.e., DF==0).
Signed-off-by: Jiayu Hu <jiayu.hu@intel.com> Reviewed-by: Junjie Chen <junjie.j.chen@intel.com> Tested-by: Lei Yao <lei.a.yao@intel.com>
Jiayu Hu [Wed, 10 Jan 2018 14:03:11 +0000 (22:03 +0800)]
gro: comply RFC 6864 to process IPv4 ID
This patch complies RFC 6864 to process IPv4 ID fields. Specifically, GRO
ingores IPv4 ID fields for the packets whose DF bit is 1, and checks IPv4
ID fields for the packets whose DF bit is 0.
Signed-off-by: Jiayu Hu <jiayu.hu@intel.com> Reviewed-by: Junjie Chen <junjie.j.chen@intel.com>
Jiayu Hu [Wed, 10 Jan 2018 14:03:10 +0000 (22:03 +0800)]
gro: cleanup
This patch updates codes as follows:
- change appropriate names for internal structures, variants and functions
- update comments and the content of the gro programmer guide for better
understanding
- remove needless check and redundant comments
Signed-off-by: Jiayu Hu <jiayu.hu@intel.com> Reviewed-by: Junjie Chen <junjie.j.chen@intel.com>
Ferruh Yigit [Tue, 12 Dec 2017 18:39:56 +0000 (18:39 +0000)]
kni: fix build dependency
kni library has a dependency to new PCI library, adding that dependency.
build error:
CC rte_kni.o
In file included from dpdk/lib/librte_kni/rte_kni.c:48:0:
dpdk/build/include/rte_kni.h:49:21:
fatal error: rte_pci.h: No such file or directory
#include <rte_pci.h>
^
Fixes: c752998b5e2e ("pci: introduce library and driver") Cc: stable@dpdk.org Reported-by: Bernard Iremonger <bernard.iremonger@intel.com> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com> Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
Rami Rosen [Fri, 29 Dec 2017 12:08:13 +0000 (14:08 +0200)]
doc: fix typo in KNI sample app guide
This trivial patch fixes a typo in sample apps guide, in
the kernel nic interface (kni) section.
Using "-config", as it is now today in this doc, will not
work and will emit an error; it should be "--config" instead,
and this patch fixes it accordingly.
Jasvinder Singh [Mon, 20 Nov 2017 16:39:19 +0000 (16:39 +0000)]
app/testpmd: add commands for metering and policing
Add following CLIs to testpmd application;
- show port metering and policing capabilities.
- enable/disable meter of the MTR object.
- update the MTR object dscp table entries.
Jasvinder Singh [Mon, 20 Nov 2017 16:39:18 +0000 (16:39 +0000)]
app/testpmd: clean metering and policing commands
This patch updates the metering and policing CLIs as follows:
- change name of set port meter CLI to create port meter and add meter
enable option, dscp table entries arguments, action mask, policer actions
and previous meter color option as an input color
- set the right metering algorithm in add meter profile CLIs related to
srtcm(rfc2697) and trtcm(rfc2698,rfc4115)
- change clear flag type from uint32_t to string in show meter stats CLI
Yanglong Wu [Tue, 2 Jan 2018 05:35:42 +0000 (13:35 +0800)]
app/testpmd: fix port id allocation
In the feature of increasing port_id range from 8 bits to 16 bits,
vlan port_id allocation function was forget to substitute UINT8 with
UINT16, so the vlan port_id was allocated as a inccrete number.
Fixes: 28caa76aea71 ("app/testpmd: fix port id type") Cc: stable@dpdk.org Signed-off-by: Yanglong Wu <yanglong.wu@intel.com> Reviewed-by: Zhiyong Yang <zhiyong.yang@intel.com> Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Kefu Chai [Fri, 1 Dec 2017 11:22:39 +0000 (19:22 +0800)]
contigmem: fix build on FreeBSD 12
include <sys/vmmeter.h> to fix build
otherwise the build fails with FreeBSD 12, like
In file included from contigmem.c:57:
/usr/srcs/head/src/sys/vm/vm_phys.h:122:10: error:
use of undeclared identifier 'vm_cnt'
return (vm_cnt.v_free_count += adj);
^
Signed-off-by: Kefu Chai <tchaikov@gmail.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Thomas Monjalon [Fri, 5 Jan 2018 11:33:20 +0000 (12:33 +0100)]
devtools: ignore checkpatch warning for maintainers file
The script checkpatch.pl from Linux is enforcing a tab
in the MAINTAINERS file (Linux commit 628f91a28649).
It can be ignored in our wrapper checkpatches.sh.
Suggested-by: Remy Horton <remy.horton@intel.com> Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: Remy Horton <remy.horton@intel.com> Acked-by: Stephen Hemminger <stephen@networkplumber.org>
bus/pci: do not use kernel version to determine MSIX defines
In real life, kernel version is only weakly corolated with presence
or absence of defines in header files. Instead, check directly if
the needed value is defined.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Olivier Matz [Fri, 22 Dec 2017 15:59:02 +0000 (16:59 +0100)]
net: update licence for network headers
To be compliant with the DPDK licensing guidelines, switch to
BSD-3-Clause. It can be done safely since the BSD headers from which
these files derive also exist as a BSD-3-Clause license in FreeBSD.
Hemant Agrawal [Tue, 19 Dec 2017 10:14:38 +0000 (15:44 +0530)]
license: introduce SPDX identifiers
The DPDK uses the Open Source BSD-3-Clause license for the core libraries
and drivers. The kernel components are naturally GPLv2 licensed.
Many of the files in the DPDK source code contain the full text of the
applicable license. For example, most of the BSD-3-Clause files contain a
full copy of the BSD-3-Clause license text.
Including big blocks of License headers in all files blows up the source
code with mostly redundant information. An additional problem is that even
the same licenses are referred to by a number of slightly varying text
blocks (full, abbreviated, different indentation, line wrapping and/or
white space, with obsolete address information, ...) which makes validation
and automatic processing a nightmare.
To make this easier, DPDK uses of a single line reference to
Unique License Identifiers in source files as defined by the Linux
Foundation's SPDX project https://spdk.org.
Adding license information in this fashion, rather than adding full license
text, can be more efficient for developers; decreases errors; and improves
automated detection of licenses. The current set of valid, predefined SPDX
identifiers is set forth on the SPDX License List at
https://spdx.org/licenses/.
For example, to label a file as subject to the BSD-3-Clause license,
the following text would be used as the top line of the file.
SPDX-License-Identifier: BSD-3-Clause
Note: Any new file contributions in DPDK shall adhere to the above scheme.
It is also recommended to replace or at least amend the existing license
text in the code with SPDX-License-Identifiers.
Any exception to DPDK IP policies shall be approved by DPDK tech board and
DPDK Governing Board. Steps for any exception approval:
1. Mention the appropriate license identifier form SPDX. If the license is
not listed in SPDX Licenses. It is the submitters responsibiliity to get
it first listed.
2. Get the required approval from the DPDK Technical Board. Technical board
may advise the author to check alternate means first. If no other
alternatives are found and the merit of the contributions are important
for DPDK's mission, it may decide on such exception with two-thirds vote
of the members.
3. Technical board then approach Governing board for such limited approval
for the given contribution only.
Any approvals shall be documented in "licenses/exceptions.txt" with record
dates.
Note: From the legal point of view, this patch is supposed to be only a
change to the textual representation of the license information, but in no
way any change to the actual license terms. With this patch applied, all
files will still be licensed under the same terms they were before.
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> Acked-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Thomas Monjalon <thomas@monjalon.net>