zephyr/samples/net/sockets/net_mgmt
Robert Lubos 913b06251d samples: net: sockets: net_mgmt: Increase main thread priority
net_mgmt sockets do not implement internal queue but use
net_mgmt_event_wait() internally to receive events. As a consequence,
in case of events burst, some events may be lost if the receiving
thread has lower priority than the net_mgmt thread.

This was visible in the sample, where only DAD event was reported
properly, as IPv6 Add/Remove events were triggered in pair with
corresponding multicast events (from solicited-node multicast
address).

We can mitigate this by increasing main thread priority to be at the
same priority as net_mgmt thread, so that the receiving thread (main)
has a chance to run in between event reports.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-06-25 10:25:37 -04:00
..
src
CMakeLists.txt
README.rst
prj.conf samples: net: sockets: net_mgmt: Increase main thread priority 2024-06-25 10:25:37 -04:00
sample.yaml samples: net: net_mgmt: Fix build failure on multiple boards 2024-04-04 17:02:04 +02:00

README.rst

.. zephyr:code-sample:: sockets-net-mgmt
   :name: Network management socket
   :relevant-api: bsd_sockets net_if

   Listen to network management events using a network management socket.

Overview
********

The net-mgmt-socket sample application for Zephyr implements a listener
for network management events that the networking subsystem is sending.

The source code for this sample application can be found at:
:zephyr_file:`samples/net/sockets/net_mgmt`.

Requirements
************

- :ref:`networking_with_host`

Building and Running
********************

There are multiple ways to use this application. One of the most common
usage scenario is to run echo-server application inside QEMU. This is
described in :ref:`networking_with_qemu`.

Build net-mgmt socket sample application like this:

.. zephyr-app-commands::
   :zephyr-app: samples/net/sockets/net_mgmt
   :board: <board to use>
   :conf: <config file to use>
   :goals: build
   :compact:

Example building for the native_sim board:

.. zephyr-app-commands::
   :zephyr-app: samples/net/sockets/net_mgmt
   :host-os: unix
   :board: native_sim
   :conf: prj.conf
   :goals: run
   :compact: