Commit graph

214 commits

Author SHA1 Message Date
Michael Hope 69b76d7305 samples: zperf: fix an unaligned access in the UDP uploader
zperf takes a potentially unaligned netowrk packet, casts it to a
struct, and then dereferences the fields.  This causes a crash on
cores that don't support unaligned access such as the Cortex-M0+.

Use the UNALIGNED_GET helper instead.

Signed-off-by: Michael Hope <mlhx@google.com>
2020-06-15 10:30:35 +03:00
Kumar Gala a1b77fd589 zephyr: replace zephyr integer types with C99 types
git grep -l 'u\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/u\(8\|16\|32\|64\)_t/uint\1_t/g"
	git grep -l 's\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/s\(8\|16\|32\|64\)_t/int\1_t/g"

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-06-08 08:23:57 -05:00
Marc Herbert 2cd51a33ce samples: make find_package(Zephyr...) REQUIRED
This provides a better error message when building with CMake and
forgetting ZEPHYR_BASE or not registering Zephyr in the CMake package
registry. See parent commit for more details (split from parent for
better readability).

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-05-29 10:47:25 +02:00
Jukka Rissanen 88d1d43842 samples: net: zperf: Refactor because of timeout overhaul
Convert to use k_timeout_t

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-04-09 16:07:03 +03:00
Torsten Rasmussen 407b49b35c cmake: use find_package to locate Zephyr
Using find_package to locate Zephyr.

Old behavior was to use $ENV{ZEPHYR_BASE} for inclusion of boiler plate
code.

Whenever an automatic run of CMake happend by the build system / IDE
then it was required that ZEPHYR_BASE was defined.
Using ZEPHYR_BASE only to locate the Zephyr package allows CMake to
cache the base variable and thus allowing subsequent invocation even
if ZEPHYR_BASE is not set in the environment.

It also removes the risk of strange build results if a user switchs
between different Zephyr based project folders and forgetting to reset
ZEPHYR_BASE before running ninja / make.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-03-27 16:23:46 +01:00
Jukka Rissanen 0297e7ec15 samples: net: zperf: Ignore out of net_buf issue
If we ran out of net_buf's while sending, ignore the issue
and try to finish the test instead. Solving the "running out
of network buffers" case would require careful tuning of
number of network buffers, buffer size, upload speed etc. which
is difficult to solve with generic buffer count options.

The user should tweak mainly the CONFIG_NET_BUF_TX_COUNT option.
Optionally CONFIG_NET_PKT_TX_COUNT can be changed too. Information
about these options is printed to console after the test is finished.

Fixes #20315

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-12-10 10:00:53 +02:00
Jukka Rissanen c03af056a0 samples: net: zperf: Clarify that only iPerf 2.0.5 is supported
As the iPerf2 protocol is not documented properly, depend on
exact iPerf 2.0.5 version when testing.

Fixes #20313

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-11-05 09:29:15 -05:00
Andrei Emeltchenko 299c9fedd4 samples: net: Clean up netusb overlay configuration
Clean up configs which do not belong to Ethernet over USB.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-10-04 21:23:53 +03:00
Johann Fischer 75b490efc2 sample: zperf: enable test for the shield link board ETH
Enable test for the shield link board ETH.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-09-12 11:30:19 +03:00
Jukka Rissanen 1c65789d85 samples: net: zperf: Use proper value in k_busy_wait()
The wait time value should be in microseconds.

Fixes #18059

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-08-07 12:24:23 +02:00
Anas Nashif 578ae40761 boards: remove quarl_se_c1000
This board and SoC was discontinued some time ago and is currently not
maintained in the zephyr tree.
Remove all associated configurations and variants from the tree.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-07-29 21:30:25 -07:00
Peter A. Bigot 0626c8f1d3 samples: add board customization for native_posix_64
Sample applications for display functions do not work on native_posix_64
due to missing overrides.  Clone the native_posix_64 Kconfig override
for all samples that have a native_posix Kconfig override.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-07-17 15:29:42 -07:00
Nicolas Pitre 6609c12516 tests: enable native_posix_64 testing
Whenever conditions are applied to native_posix, they should apply to
native_posix_64 too.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-07-16 10:41:11 -07:00
Anas Nashif 9ab2a56751 cleanup: include/: move misc/printk.h to sys/printk.h
move misc/printk.h to sys/printk.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Benjamin Valentin 7c09695344 net/icmpv6: Allow for arbitrary payload data in ICMP echo
Allow for including arbitrary data in net_icmpv6_send_echo_request()
that will be echoed verbatim by the receiver.

This allows to use ICMP echo for diagnostic use cases, e.g. by testing
packet framentation (large payload) or measuring round-trip-time.

Signed-off-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2019-04-26 09:05:14 +03:00
Bub Wei 57e7ddb7b0 samples: net: zperf: Remove unnecessary main
main function is not necessary.
And without main here, it is possible to import these
samples zperf files in another project.

Signed-off-by: Bub Wei <bub.wei@unisoc.com>
2019-04-25 16:18:49 +03:00
Bub Wei ee442c2b66 samples: net: zperf: Add __packed for zperf_udp_datagram
UDP packet from net is not 4-byte aligned.
So we have to add __packed for zperf_udp_datagram.

Fixes #15605.

Signed-off-by: Bub Wei <bub.wei@unisoc.com>
2019-04-23 13:14:35 +03:00
Anas Nashif 3ae52624ff license: cleanup: add SPDX Apache-2.0 license identifier
Update the files which contain no license information with the
'Apache-2.0' SPDX license identifier.  Many source files in the tree are
missing licensing information, which makes it harder for compliance
tools to determine the correct license.

By default all files without license information are under the default
license of Zephyr, which is Apache version 2.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-04-07 08:45:22 -04:00
Anas Nashif da5f185e06 samples: add test identifier
Add unique identifier instead of just 'test' for samples.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-03-29 17:44:11 -04:00
Patrik Flykt 24d71431e9 all: Add 'U' suffix when using unsigned variables
Add a 'U' suffix to values when computing and comparing against
unsigned variables.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2019-03-28 17:15:58 -05:00
Jukka Rissanen 059a14e166 samples: net: zperf: Update the README file
Clarify what iPerf version was used when testing this sample
application. It was iPerf 2.0.9 which worked ok, for example
iPerf 2.0.13 did not work properly with UDP uploader (client)
mode.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-03-25 22:48:32 -04:00
Jukka Rissanen 24de2f7e01 samples: net: zperf: Fix TCP uploader
Try to construct a proper iperf client header to the payload
as the server expects that. It is not sure if this is needed
or correct as there is no proper documentation for the iPerf2
protocol.

Fixes #14665

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-03-25 22:48:32 -04:00
Jukka Rissanen cbeeb510c0 samples: net: zperf: Fix UDP uploader
Try to construct a proper iperf client header to the payload
as the server expects that. It is not sure if this is proper
way to do the iperf header as there is no documentation about
iPerf protocol anyway (except the iPerf source code).

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-03-25 22:48:32 -04:00
Robert Lubos e39aed53a2 samples: net: Update overlay-bt.conf in various samples
`CONFIG_NET_L2_BT` no longer forces required BT configuration, but
depends on a user to set a valid configuration instead. Hence, we
need to select a proper configuration in the overlay config file.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2019-03-20 11:32:40 -05:00
Tomasz Bursztyka 03bfc5dd0f net/context: Remove token parameter from net_context_send/sendto
And also to the relevant callbacks.

That parameter is not used anywhere so it is useless.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-03-20 10:27:14 -05:00
Tomasz Bursztyka f8a091104e net/pkt: Remove _new suffix to net_pkt_get_data_new function
Now that legacy - and unrelated - function named net_pkt_get_data has
been removed, we can rename net_pkt_get_data_new relevantly.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-03-20 10:27:14 -05:00
Tomasz Bursztyka 172fe5a87b net/context: Remove _new suffix on net_context_send/sendto functions
Now that legacy functions are removew, let's rename the new functions by
removing the _new suffix.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-03-20 10:27:14 -05:00
Tomasz Bursztyka fa58d1e6ce samples/net: Switch zperf sample to new net_context API
No need to build the net_pkt, just send the buffer directly.

Let's reuse already parsed ip/proto headers as well.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-03-14 08:41:08 +01:00
Jukka Rissanen 6368ed4edf samples: net: zperf: Fix the readme file
As there is no shell submodules any more, the "zperf" command
needs to be written in every command.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-03-13 01:52:09 +01:00
Jukka Rissanen b9f6bdfe08 samples: net: zperf: Fix TCP download command
The TCP download command was not handling TCP session and
connection closing properly.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-03-13 01:52:09 +01:00
Jukka Rissanen 0cd9b3e267 samples: net: zperf: Make client work in native_posix
As the clock does not run same way in native_posix, do some
tricks here.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-03-13 01:52:09 +01:00
Sebastian Bøe 4e5300ba7f cmake: Drop all in-tree usage 'set_conf_file'
Port all users of 'set_conf_file' to use the built-in rules
instead. This follows the convention-over-configuration principle to
make the system as a whole simpler and more consistent.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2019-03-01 09:44:09 +01:00
Krzysztof Chruscinski 3605e48c44 shell: Modify subcommands to use SHELL_STATIC_SUBCMD_SET_CREATE
It is planned to deprecate SHELL_CREATE_STATIC_SUBCMD_SET macro
which is replaced by SHELL_STATIC_SUBCMD_SET_CREATE.

Additionally, removed irrelevant comments about alphabetical
ordering which is no longer needed.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-02-20 07:31:35 -05:00
Bub Wei 55a0e7001d samples: net: zperf: Refactor udp_received
Use the state machine states to determine if the session has ended.
This way zperf will properly reply stat packet to remote client even if
duration of the session is non zero.

Also we don't need to update counter (received packet number) at end of
the session.

Note: if id < 0, it means session end, otherwise it's session ongoing.
(id is the first feild of application data from remote client).

Signed-off-by: Bub Wei <bub.wei@unisoc.com>
2019-02-18 15:12:27 -05:00
Kumar Gala 861c82d05f samples: net: zperf: rename WLAN to WIFI
We refer to it as WIFI and not WLAN, so use that CONFIG symbol and
string.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-11 22:29:58 -05:00
Tomasz Bursztyka 4b78a251d7 net/context: Make recv_cb providing the ip and protocol headers
If status is 0, both ip_hdr and proto_hdr will own a pointer to the
relevant IP and Protocol headers. In order to know which of ipv4/ipv6
and udp/tcp one will need to use respectively net_pkt_family(pkt) and
net_context_get_ip_proto(context).

Having access to those headers directly, many callbacks will not need
to parse the packet again no get the src/dst addresses or the src/dst
ports. This will be change after this commit.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-02-01 14:34:38 +02:00
Anas Nashif 5060ca6a30 cmake: increase minimal required version to 3.13.1
Move to latest cmake version with many bug fixes and enhancements.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-01-03 11:51:29 -05:00
Bub Wei c356b5786f samples: net: zperf: Support existing IP
Considering that IP can be set dynamically by DHCP
or statically before test previously, we could have
alternative way by supporting both setting IP and
existing IP.

Signed-off-by: Bub Wei <bub.wei@unisoc.com>
2018-12-13 14:20:25 +02:00
Jukka Rissanen 86689030e8 net: Clarify logging in networking code
Remove network specific default and max log level setting
and start to use the zephyr logging values for those.

Remove LOG_MODULE_REGISTER() from net_core.h and place the
calls into .c files. This is done in order to avoid weird
compiler errors in some cases and to make the code look similar
as other subsystems.

Fixes #11343
Fixes #11659

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-12-07 12:00:04 +02:00
Jakub Rzeszutko b928b71756 shell: rename shell_help_print function
Function printing help has been renamed to shell_help.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-12-05 15:15:44 +01:00
Jakub Rzeszutko e0be6a10b3 shell: printing command's help by shell engine
Removed printing command help from help handler. It is now
realized by the shell engine. This change saves a lot of flash
but still allows to print help in command handler with function
shell_help_print.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-12-05 15:15:44 +01:00
Jakub Rzeszutko 5451ff2848 shell: remove "options" concept
Removing help "options" from shell API.

Currently SHELL_OPT macro is not used by users. What is more
commit: a89690d10f ignores possible options created in
command handler by the user. As a result they are not printed
in help message.

Second, currntly implemented "options" in command handlers options are
implemented without SHELL_OPT macro.

And last but not least this change will allow to implement
help handler in a way that user will not need to think about calling
functions printing help in a command handler.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-12-05 15:15:44 +01:00
Patrik Flykt 079f55d519 samples: Add 'U' to unsigned variable assignments
Add 'U' to a value when assigning it to an unsigned variable.
MISRA-C rule 7.2

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2018-12-04 22:51:56 -05:00
Jakub Rzeszutko 1a220b4e80 shell: decrease built-in commands flash usage
Rephrase some help messages to decrease flash usage.
Deactivate shell history feature for test test_netusb_rndis

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-12-04 15:53:02 -05:00
Bub Wei c9db778042 samples: net: zperf: Refactor zperf_*_receiver_init
Drop tcp and udp rx threads which are just setting
and returning.

Signed-off-by: Bub Wei <bub.wei@unisoc.com>
2018-12-04 14:01:23 +02:00
Bub Wei a127984613 samples: net: zperf: Remove invalid forever sleep
We are not expecting forever k_sleep in multithreading.
And k_sleep is empty in non-multihreading.
So remove invalid forever sleep to avoid the below issue.

ASSERTION FAIL [duration != (-1)] @ zephyr/kernel/sched.c:807

Please refer to _impl_k_sleep api in zephyr/kernel/sched.c:807

Signed-off-by: Bub Wei <bub.wei@unisoc.com>
2018-12-03 14:43:49 +02:00
Anas Nashif f3f91f88d6 samples: zperf: expand test coverage
depend on USB device and increase RAM requirements.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-12-02 22:36:41 -05:00
Bub Wei b5ae7da269 samples: net: zperf: Allow to build with IPv4 or IPv6 only
context4/6 is initilalized in net_context_get function
which is restricted under CONFIG_NET_IPV4/IPV6 with
IS_EANBLED macro. So add the same macro check for
net_context_put function to avoid NET_ASSERT(context).

Signed-off-by: Bub Wei <bub.wei@unisoc.com>
2018-11-30 14:18:34 +02:00
Bub Wei 3c4bb10127 samples: net: Fix zperf build issue
If NET_IPV6 is disabled, build issue happens as below.

zephyr/samples/net/zperf/src/zperf_tcp_receiver.c: In function ‘zperf_tcp_rx_thread’:
zephyr/samples/net/zperf/src/zperf_tcp_receiver.c:171:9: error: ‘in6_addr_my’ undeclared (first use in this function)
        &in6_addr_my->sin6_addr);
         ^~~~~~~~~~~
zephyr/samples/net/zperf/src/zperf_tcp_receiver.c:171:9: note: each undeclared identifier is reported only once for each function it appears in
zephyr/samples/net/zperf/src/zperf_tcp_receiver.c: In function ‘zperf_tcp_receiver_init’:
zephyr/samples/net/zperf/src/zperf_tcp_receiver.c:250:3: error: ‘in6_addr_my’ undeclared (first use in this function)
   in6_addr_my = zperf_get_sin6();
   ^~~~~~~~~~~
*** [CMakeFiles/app.dir/src/zperf_tcp_receiver.c.obj] error 1
*** [CMakeFiles/app.dir/all] error 2

Signed-off-by: Bub Wei <bub.wei@unisoc.com>
2018-11-29 10:35:50 -08:00
Jakub Rzeszutko 59c23b11ff shell: wildcard active by default
Wildcard plugin is active by default.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-11-06 17:12:41 -05:00
Jukka Rissanen d83ade773f samples: net: zperf: Remove task_profiler as it is not used
The task_profiler is not needed nor used by zperf so remove
it from CMakefile.

Fixes #11051

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-11-03 23:53:28 +02:00
Jukka Rissanen cf063fe85b net: Rename net_is_xxx...() functions to net_xxx_is...()
Unify the function naming for various network checking functions.

For example:
     net_is_ipv6_addr_loopback() -> net_ipv6_is_addr_loopback()
     net_is_my_ipv6_maddr() -> net_ipv6_is_my_maddr()
etc.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-11-02 14:52:33 -04:00
Reto Schneider 7eabab2f5d samples, tests: Use semi-accurate project names
When using an IDE (e.g. Eclipse, Qt Creator), the project name gets
displayed. This greatly simplifies the navigation between projects when
having many of them open at the same time. Naming every project "NONE"
defeats this functionality.

This patch tries to use sensible project names while not duplicating
too much of what is already represented in the path. This is done by
using the name of the directory the relevant CMakeLists.txt file is
stored in. To ensure unique project names in the samples (and again, in
the tests folder) folder, small manual adjustments have been done.

Signed-off-by: Reto Schneider <code@reto-schneider.ch>
2018-10-27 21:31:25 -04:00
Jukka Rissanen da699e4a3b samples: net: zperf: UDP download cmd params incorrectly checked
The "zperf udp download" optional port parameter was not properly
checked, the default port check branch was never reached.
Fix also the same issue in tcp download command.

Coverity-CID: 188881
Fixes #10758

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-23 14:23:24 +03:00
Andy Ross 220d4f8347 sys_clock.h: Make "global variable" APIs into proper functions
The existing API defined sys_clock_{hw_cycles,ticks}_per_sec as simple
"variables" to be shared, except that they were only real storage in
certain modes (the HPET driver, basically) and everywhere else they
were a build constant.

Properly, these should be an API defined by the timer driver (who
controls those rates) and consumed by the clock subsystem.  So give
them function syntax as a stepping stone to get there.

Note that this also removes the deprecated variable
_sys_clock_us_per_tick rather than give it the same treatment.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2018-10-16 15:03:10 -04:00
Anas Nashif deaab90641 tests/samples: cleanup tags
Remove redundant 'sample' tag and add something that matches the
functionality and features being tested, demonstrated.

Avoid short abbriviations and using full names for fs.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-16 09:17:51 -04:00
Jukka Rissanen 7cd17d58ca samples: net: zperf: Convert to use the new shell
Use new shell instead of the legacy one. This commit also fixes
the configuration file mess and allows the program to be run on
more hardware.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-15 11:14:02 +03:00
Andrei Emeltchenko c7567fe025 samples: zperf: Fix sanity check with NET, USB and logs
Decrease number of buffer for sanity check, in real sample logs
consuming a lot of memory might be traded for buffers. The sample was
failing for quark_se_c1000_devboard.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-10-08 12:54:57 -04:00
Jukka Rissanen 22c8ccbca9 samples: net: zperf: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Krzysztof Chruscinski 527256501f shell: Rename shell to legacy_shell
New shell implementation is on the way. For now old one and all
references are kept to be gradually replaced by new shell.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-09-19 09:30:29 -04:00
Flavio Ceolin da49f2e440 coccicnelle: Ignore return of memset
The return of memset is never checked. This patch explicitly ignore
the return to avoid MISRA-C violations.

The only directory excluded directory was ext/* since it contains
only imported code.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-09-14 16:55:37 -04:00
Anas Nashif a2248782a2 kernel: event_logger: remove kernel_event_logger
Move to more generic tracing hooks that can be implemented in different
ways and do not interfere with the kernel.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-08-21 05:45:47 -07:00
Sebastian Bøe 55ee53ce91 cmake: Prepend 'cmake_minimum_required()' into 'app' build scripts
Prepend the text 'cmake_minimum_required(VERSION 3.8.2)' into the
application and test build scripts.

Modern versions of CMake will spam users with a deprecation warning
when the toplevel CMakeLists.txt does not specify a CMake
version. This is documented in bug #8355.

To resolve this we include a cmake_minimum_required() line into the
toplevel build scripts. Additionally, cmake_minimum_required is
invoked from within boilerplate.cmake. The highest version will be
enforced.

This patch allows us to afterwards change CMake policy CMP000 from OLD
to NEW which in turn finally rids us of the verbose warning.

The extra boilerplate is considered more acceptable than the verbosity
of the CMP0000 policy.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-08-15 04:06:50 -07:00
Paul Sokolovsky 028aae1ec9 net: config: Rename Kconfig options to correspond to library name
This finishes refactor of splitting off net_config library name from
net_app library, started in c60df1311, c89a06dbc. This commit makes
sure that Kconfig options are prefixed with CONFIG_NET_CONFIG_
instead of CONFIG_NET_APP_, and propagates these changes thru the
app configs in the tree.

Also, minor dependency, etc. tweaks are made.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-08-13 18:42:31 -07:00
Anas Nashif 87de383c66 tests: CONFIG_ARC_INIT is n by default
CONFIG_ARC_INIT is set to 'n' by default, no need to set this in the
prj.conf.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-07-30 15:17:51 -04:00
Piotr Zięcik 2fe998cdef kernel: Deprecate sys_clock_us_per_tick variable.
On some architectures tick time cannot be expressed as integer
number of microseconds, introducing error in calculations using
sys_clock_us_per_tick variable.

This commit deprecates the sys_clock_us_per_tick variable and
replaces its usage by more precise calculations based on
sys_clock_hw_cycles_per_sec and sys_clock_ticks_per_sec.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2018-07-20 00:03:52 -04:00
Jukka Rissanen 2dbde4a1fa samples: net: zperf: Remove config files for Galileo board
The support for Galileo board is bitrotted as the config file
contains obsolete values. As testing this old board is difficult
lets remove the config files. These can be re-introduced with
proper and tested settings if needed.

Fixes #7814

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-05-24 08:02:04 -04:00
Kumar Gala 91d80445f9 samples: net: zperf: Remove dead Kconfig symbol from galileo conf
CONFIG_DEBUG_IP_BUFS was commented out but specified in galileo
specific conf files.  The Kconfig symbol doesn't exist so lets remove
it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-05-23 17:57:06 -04:00
Loic Poulain 7c5c222ca0 samples: net: Add test cases for USB EEM
Add test for zperf and http_server apps.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2018-04-06 06:50:34 -04:00
Loic Poulain 175dd9600e net: samples: Reduce net pkt RAM usage
There are 174 RX/TX net pkt reserved, this make build fail
with some boards due to ram overflow (e.g quark_se_c1000).
Fix this by reducing NET_PKT RX/TX reserve to 100, which
seems fair enough for this use case. Moreover, don't think
there is any reason to have more NET_PKT than NET_BUF.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2018-03-16 14:45:24 -07:00
Johan Hedberg 1d131338bc net: samples: zperf: Reduce quark_se_c1000_devboard buffer counts
This gives a bit more margin to the available RAM.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-02-10 09:20:42 +02:00
Andrei Emeltchenko c3a9f8d4f8 usb: sanitycheck: Clean up sample.yaml
Remove old sample VID/PID and use new style.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-02-05 06:39:50 -08:00
Paul Sokolovsky 6bab4998ba samples: net: zperf: Fix only IPv4/only IPv6 build, better messages
The code couldn't really build with only CONFIG_NET_IPV4 or
CONFIG_NET_IPV6 enabled, because some parts weren't covered
by #ifdef's. Regroup the code to get it covered.

Also, improve error/notice messages.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-01-22 10:15:27 +02:00
Andrei Emeltchenko 314d182f79 samples: zperf: Add USB RNDIS configuration check
Add configuration for zperf sample allowing to build USB dongle with
zperf for testing.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-01-17 18:53:05 -05:00
Andrei Emeltchenko 7e80f41162 usb: Rename SYS_LOG_USB to SYS_LOG_USB_DEVICE
At the moment CONFIG_SYS_LOG_USB_LEVEL name does not specify that this
is log level for the Device Stack. Make it clear renaming to the
proper name.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-01-17 18:53:05 -05:00
Ravi kumar Veeramally a0371ae92f net: tcp: Add initial support for TIMEWAIT timer
Right now in FIN_WAIT1 state, if we receive FIN+ACK message, then
tcp state changed to FIN_WAIT2 on ACK flag and immediately on FIN
flag state changed to TIME_WAIT. Then final ACK is prepared and sent
(in queue at-least) to peer. Again immediately state changed to
TCP_CLOSED, where context is freed. net_context_put frees context
and releases tcp connection. Final ACK packet which is in queue
is dropped.

As a side effect of freed ACK packet, peer device keep on sending
FIN+ACK messages (that's why we see a lot of "TCP spurious
retransimission" messages in wireshark). As a result
of context free (respective connection handler also removed), we see
lot of packets dropped at connection input handler and replying with
ICMP error messages (destination unreachable).

To fix this issue, timewait timer support is required. When tcp
connection state changed to TIMEWAIT state, it should wait until
TIMEWAIT_TIMETOUT before changing state to TCP_CLOSED. It's
appropriate to close the tcp connection after timewait timer expiry.

Note: Right now timeout value is constant (250ms). But it should
be 2 * MSL (Maximum segment lifetime).

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-12-31 11:58:27 -05:00
Anas Nashif b5b8095749 samples: bluetooth and net samples need test setup
remove build_only and make them depend on test harness (bluetooth)

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif 23f81eeb42 tests/samples: fixed yaml syntax
Use a map directory, avoid the list which makes parsing a bit
cumbersome.

Fixes #5109

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-11 14:47:08 -05:00
Jukka Rissanen 37247bda78 samples: net: zperf: Ignore error when creating TCP sample pkt
When sending TCP sample packet, just fill the packet to max and
ignore any overflow error.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-22 10:10:31 -05:00
Jukka Rissanen 93c426e778 samples: net: zperf: Check UDP pkt before accessing it
Check that we do not try to access fragment when UDP packet is
received if pkt is NULL. In practice this should not happen for
UDP but do the checks in proper order anyway.

Coverity-CID: 179252
Fixes #5057

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-22 07:44:10 -05:00
Jukka Rissanen f7f671d18b samples: net: zperf: Check pkt before accessing it
The pkt was accessed before NULL check.

Coverity-CID: 179250
Fixes #5059

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-22 07:44:10 -05:00
Jukka Rissanen b0b053e91e samples: net: zperf: Remove deadcode
As we are checking that pkt is not NULL already in the start
of the function, remove the checks later in the code in function
zperf_tcp_receiver.c:tcp_received()

Coverity-CID: 179248
Fixes #5061

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-22 07:44:10 -05:00
Luiz Augusto von Dentz 697e5698b3 net: samples: Remove CONFIG_NET_L2_BT_ZEP1656
CONFIG_NET_L2_BT_ZEP1656 should only be used with older Linux up to
4.11 which by now should have been updated in all distros.

For those sticking with older distros should select it manually as
it does breaks IID address it should never be used in production.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-11-16 10:41:07 +02:00
Jukka Rissanen 3c0a0053fa samples: net: Remove QEMU_NET_STACK setting from CMakeLists.txt
The QEMU_NET_STACK is enabled automatically if building
a networking application to QEMU so no need to do it for
each networking sample.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-10 14:52:53 +02:00
Sebastian Bøe 0829ddfe9a kbuild: Removed KBuild
Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00
Sebastian Bøe 12f8f76165 Introduce cmake-based rewrite of KBuild
Introducing CMake is an important step in a larger effort to make
Zephyr easy to use for application developers working on different
platforms with different development environment needs.

Simplified, this change retains Kconfig as-is, and replaces all
Makefiles with CMakeLists.txt. The DSL-like Make language that KBuild
offers is replaced by a set of CMake extentions. These extentions have
either provided simple one-to-one translations of KBuild features or
introduced new concepts that replace KBuild concepts.

This is a breaking change for existing test infrastructure and build
scripts that are maintained out-of-tree. But for FW itself, no porting
should be necessary.

For users that just want to continue their work with minimal
disruption the following should suffice:

Install CMake 3.8.2+

Port any out-of-tree Makefiles to CMake.

Learn the absolute minimum about the new command line interface:

$ cd samples/hello_world
$ mkdir build && cd build
$ cmake -DBOARD=nrf52_pca10040 ..

$ cd build
$ make

PR: zephyrproject-rtos#4692
docs: http://docs.zephyrproject.org/getting_started/getting_started.html

Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00
Andrei Emeltchenko fb4dfa9d6f net: samples: Add netusb configuration to zperf
Add configuration for USB CDC ECM Ethernet Networking.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-11-08 10:55:50 -05:00
Andrei Emeltchenko 6048c0cd2f net: Fix zperf TCP build
Fix zperf for TCP tests.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-11-08 10:55:50 -05:00
Tomasz Bursztyka 1b77ee12ea samples/net: Reducing prj*.conf files by relevantly removing 6Lo option
If NET_L2_IEEE802154 and NET_IPV6 are enabled:
- NET_6LO is enabled
- NET_L2_IEEE802154_FRAGMENT is enabled

Thus removing setting this config options to yes where applicable.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-10-28 14:28:02 -04:00
Anas Nashif 0356590df5 tests: samples: fix yaml syntax
Fix indentation and syntax and make it pass yamllint tool.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-15 08:15:00 -04:00
Tomasz Bursztyka 91df111386 samples/net: Getting rid of common ieee802154 settings altogether.
Only ieee802154 should have been using it, but it ended in various
samples that did not require it anymore once they've been using
net_app. Unlike former samples settings, net_app settings are tied to
net_app, so let's just forget about all of it and silently use net_app.
If something goes wrong in setting net options, it will be a unique
place.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-10-05 07:17:50 -04:00
Johan Hedberg 2975ca0754 Bluetooth: Kconfig: Rename CONFIG_BLUETOOTH_* to CONFIG_BT_*
The API name space for Bluetooth is bt_* and BT_* so it makes sense to
align the Kconfig name space with this. The additional benefit is that
this also makes the names shorter. It is also in line with what Linux
uses for Bluetooth Kconfig entries.

Some Bluetooth-related Networking Kconfig defines are renamed as well
in order to be consistent, such as NET_L2_BLUETOOTH.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-08-09 11:14:19 +03:00
Jukka Rissanen 0c243dfe8c samples: net: Remove IEEE 802.15.4 sample setup
The IEEE 802.15.4 settings are applied automatically by
net_app_init() function is is enabled by default.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-08-07 21:52:51 -04:00
Luiz Augusto von Dentz 4c9ebb9d9c net: zperf: Remove dependency on ipss sample service
The so called Router role don't require the IPSS, nor it should
advertise since it is not the peripheral in this case.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-08-04 18:18:40 +03:00
Inaky Perez-Gonzalez 3d498dd10c build: workaround build bug in tests
When an app uses a construct such as:

obj-y = main.o ../../../../samples/bluetooth/gatt/hrs.o

in its makefile, it causes said object module to be built in the
source tree, not in the object tree.

When building massively parallel, this usually resuls on the files
getting corrupted, leading to bugs such as:

https://jira.zephyrproject.org/browse/ZEP-2316
https://jira.zephyrproject.org/browse/ZEP-2317

src/../../../../samples/bluetooth/gatt/.gap.o.cmd:3: warning: NUL character seen; rest of line ignored
src/../../../../samples/bluetooth/gatt/.gap.o.cmd:4: warning: NUL character seen; rest of line ignored
src/../../../../samples/bluetooth/gatt/.gap.o.cmd:5: *** missing separator.  Stop.

as multiple build are trying to touch the same file in the source tree
and of course, race and causes a build bug.

We have known about this issue for a long time, but it requires
modifications in the build system that there is no time to tackle.

A suggested workaround is to include the source files into a local .c
file, so this is what this patch does, to remove the random noise.

Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2017-07-27 14:09:40 -04:00
Anas Nashif ca0ad13a61 net: enable SLIP only on QEMU targets
In many networking tests we had to configure SLIP in the prj.conf
leaving those configurations Qemu specific. This change enables SLIP for
QEMU targets automatically and allows reuse of prj.conf for multiple
boards.

Additionally, the TUN options is removed. This option was not used
anywhere.

To enable self-contained networking tests that do not depend on SLIP, we
introduce the new option NET_TEST which disables TAP and allows testing
in QEMU without the need for a host interface.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-07-26 10:57:48 -04:00
Geoff Gustafson 1405627c37 net: context: Use K_NO_WAIT instead of 0 for timeout
Signed-off-by: Geoff Gustafson <geoff@linux.intel.com>
2017-07-10 10:59:28 +03:00
Jukka Rissanen 6ce9d8e882 samples: net: zperf: Add net tag
This sample app should be tested whenever net tag is specified.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-07-07 15:24:00 +03:00
Jukka Rissanen 3604c391e6 net: udp: Remove NET_UDP_HDR() macro and direct access to net_buf
Remove NET_UDP_HDR() macro as we cannot safely access UDP header
via it if the network packet header spans over multiple net_buf
fragments.

Fixed also the UDP unit tests so that they pass correctly.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-07-07 15:24:00 +03:00
Anas Nashif 68d7a207ae ethernet: fix Kconfig option for ETHERNET
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-07-05 12:43:13 -04:00