Skip to content

Pull GARP TX support #2748

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 18 commits into
base: v3.5.99-ncs1-branch
Choose a base branch
from
Open

Conversation

krish2718
Copy link
Contributor

GARP TX helps in maintaining ARP entries in the network to avoid timing out when DUT is in power-save.

Note: DNM added as this is intended for sharing with customer without a planned release post 2.6.4.

rlubos and others added 18 commits March 19, 2025 20:47
Add support for gratuitous ARP transmission by Zephyr network stack.
This allows to prematurely fill the peer ARP table, so there's no need
to send an explicit request when peer needs to send an actual packet.

The gratuitous ARP is send when the network interface is brought up
(joins the network) or a new IP address is added. The gratuitous ARP
request is also sent periodically, with a configurable interval time.
The gratuitous ARP should also be sent whenever MAC address of the
interface is changed, but as Zephyr only allows to do this when
interface is down, this is already covered by the first case (interface
brought up).

Signed-off-by: Robert Lubos <[email protected]>
(cherry picked from commit 6551e6f)
… is enabled

Add you config to the build-all net tests, to make sure everything build
properly.

Signed-off-by: Robert Lubos <[email protected]>
(cherry picked from commit f003087)
The netmask should be tied to the IPv4 address instead of being
global for the network interface.

If there is only one IPv4 address specified to the network interface,
nothing changes from user point of view. But if there are more than
one IPv4 address / network interface, the netmask must be specified
to each address separately.

This means that net_if_ipv4_get_netmask() and net_if_ipv4_set_netmask()
functions should not be used as they only work reliably if there is
only one IPv4 address in the network interface.

The new net_if_ipv4_get_netmask_by_addr() and
net_if_ipv4_set_netmask_by_addr() functions should be used as they make
sure that the netmask is tied to correct IPv4 address in the network
interface.

Signed-off-by: Jukka Rissanen <[email protected]>
(cherry picked from commit 1b0f9e8)
This commit deprecates these legacy netmask get/set routines

net_if_ipv4_set_netmask()
net_if_ipv4_set_netmask_by_index()
net_if_ipv4_get_netmask()

as they do not work well if there are multiple IPv4 address
assigned to the network interface.

User should use these functions instead

net_if_ipv4_set_netmask_by_addr()
net_if_ipv4_set_netmask_by_addr_by_index()
net_if_ipv4_get_netmask_by_addr()

as they make sure the netmask it bound to correct IPv4 address.

Signed-off-by: Jukka Rissanen <[email protected]>
(cherry picked from commit 58b2a3d)
When we receive the subnet mask option from the server, we
cannot yet set the netmask to the network interface as the
mask is tied to the IP address we received from the server.
We need to delay the setting of netmask until we have added
the requested IP address to the interface.

Signed-off-by: Jukka Rissanen <[email protected]>
(cherry picked from commit 7072e75)
Allow the driver to compile without `CONFIG_NET_NATIVE_IPV4`. This can
happen if the driver is only desired for SSID scanning.

Signed-off-by: Jordan Yates <[email protected]>
(cherry picked from commit 7e7ab49)
…tting API

Make sure that the drivers use the new IPv4 netmask setting API.

Signed-off-by: Jukka Rissanen <[email protected]>
(cherry picked from commit 8860a81)
Commit 55802e5 fixed error handling of
TX errors, in case ARP request was generated. There are however also
other places where post-ARP cleanup should be done on the TX path (like
running out of buffers for Ethernet L2 header allocation).

This commit fixes those cases in ethernet_send(), where function would
exit early and report error after ARP prepare stage.

Signed-off-by: Robert Lubos <[email protected]>
(cherry picked from commit 6708228)
…ering

Register a multicast monitor for ethernet if HW MAC filtering is supported

Signed-off-by: Pieter De Gendt <[email protected]>
(cherry picked from commit af8ba2a)
The network tests at tests/net use simulated network interfaces
and set CONFIG_NET_TEST to indicate that. If the config option
is set, then we do not want any extra Ethernet driver to
complicate the testing scenario so all external Ethernet
network interfaces should be disabled.

Signed-off-by: Jukka Rissanen <[email protected]>
(cherry picked from commit bf31b09)
Add a macro variant for ethernet devices with instances.

Signed-off-by: Pieter De Gendt <[email protected]>
(cherry picked from commit 2531394)
…option

Add low level support for setting IP_PKTINFO or IPV6_RECVPKTINFO
socket options. The support is disabled by default.

Signed-off-by: Jukka Rissanen <[email protected]>
(cherry picked from commit c3acd56)
Add a Kconfig symbol to allow building ethernet device driver without
an L2 layer.

Signed-off-by: Pieter De Gendt <[email protected]>
(cherry picked from commit e99b522)
Re-implement the VLAN support inside the network stack.
All the user facing APIs stay as is but internally the VLANs
are implemented using the L2 virtual interfaces.

Signed-off-by: Jukka Rissanen <[email protected]>
(cherry picked from commit 2058d8f)
Update the tests because of the VLAN overhaul.

Signed-off-by: Jukka Rissanen <[email protected]>
(cherry picked from commit c28ca1c)
… interface

The network interface parameter for net_eth_get_vlan_tag() should
be the VLAN interface so use the search loop properly.
Earlier the main interface could be checked.

Add also test cases for this so that we can catch that the func
works properly.

Signed-off-by: Jukka Rissanen <[email protected]>
(cherry picked from commit d40abe8)
…N one

We were missing a helper function that can be used to check
whether the given function is the virtual VLAN interface.

Signed-off-by: Jukka Rissanen <[email protected]>
(cherry picked from commit 07599e3)
…sk setting API

Make sure that the samples use the new IPv4 netmask setting API.

Signed-off-by: Jukka Rissanen <[email protected]>
(cherry picked from commit 3c0fe6b)
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants