Skip to content
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

Create sDDF LWIP Library #238

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Create sDDF LWIP Library #238

wants to merge 3 commits into from

Conversation

Courtney3141
Copy link
Contributor

The changes in this PR create a reusable interfacing library for sDDF networking and LWIP. The generic components of lwip.c have been moved into a separate library file lib_sddf_lwip.c and may now be used by any microkit component that wishes to use sDDF networking and LWIP. These functionalities are largely:

  • LWIP - sDDF initialisation
  • Passing incoming packets received from sDDF to LWIP upon being notified by the sDDF network RX virt
  • Passing outgoing packets from LWIP to the sDDF network TX virt
  • Deciding whether the network virtualisers need to be notified after packet processing
  • DHCP initialisation

Currently the library (of one c file) is built as a static archive using a makefile snippet. This implicitly relies on some standard library functions such as memcpy being available. Although the current makefile snippet works fine for the echo server example, there are two issues with it going forward:

  1. If the library is to be made via makefile snippets, the makefile it is being included in must provide the necessary standard library functions.
  2. The compilation of the library is dependent on the client's LWIP configuration. This is due to the library implicitly including the client's lwipopts.h config file, as well as the SDDF_LWIP_NUM_BUFFS constant which determines how much memory needs to be allocated for pbufs (currently passed in as a build time parameter).

This library has also been integrated in LionsOS for both NFS and micropython components, and works successfully. Although since the above two issues have not yet been resolved, the library object file is made in each of the makefiles of micropython and NFS, rather than in the main Kitty and Webserver makefiles themselves.

Copy link
Contributor

@wom-bat wom-bat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General idea is good, some minor issues.

examples/echo_server/echo.mk Outdated Show resolved Hide resolved
examples/echo_server/echo.mk Outdated Show resolved Hide resolved
examples/echo_server/echo.mk Outdated Show resolved Hide resolved
examples/echo_server/echo.mk Show resolved Hide resolved
examples/echo_server/echo.mk Outdated Show resolved Hide resolved
include/sddf/network/util.h Outdated Show resolved Hide resolved
network/lib_sddf_lwip/lib_sddf_lwip.c Show resolved Hide resolved
network/lib_sddf_lwip/lib_sddf_lwip.mk Outdated Show resolved Hide resolved
network/lib_sddf_lwip/lib_sddf_lwip.mk Outdated Show resolved Hide resolved
network/lib_sddf_lwip/lib_sddf_lwip.mk Outdated Show resolved Hide resolved
@Ivan-Velickovic Ivan-Velickovic linked an issue Sep 17, 2024 that may be closed by this pull request
@JE-Archer JE-Archer force-pushed the lwip_sddf_library branch 2 times, most recently from 0f893d2 to 767a210 Compare January 13, 2025 00:42
Copy link
Contributor

@wom-bat wom-bat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a few minor fixes

network/lib_sddf_lwip/lib_sddf_lwip.c Outdated Show resolved Hide resolved
network/lib_sddf_lwip/lib_sddf_lwip.mk Outdated Show resolved Hide resolved
network/lib_sddf_lwip/lib_sddf_lwip.mk Show resolved Hide resolved
@JE-Archer JE-Archer force-pushed the lwip_sddf_library branch 6 times, most recently from 166da18 to 291d391 Compare January 15, 2025 06:16
@JE-Archer JE-Archer marked this pull request as ready for review January 15, 2025 06:21
@JE-Archer JE-Archer force-pushed the lwip_sddf_library branch 3 times, most recently from 18359bf to 0ceec77 Compare January 22, 2025 00:21
@JE-Archer JE-Archer force-pushed the lwip_sddf_library branch 2 times, most recently from c0afc7b to ecdec83 Compare January 30, 2025 05:24
@JE-Archer JE-Archer changed the base branch from main to pragma-once January 30, 2025 05:26
Base automatically changed from pragma-once to main January 30, 2025 05:39
@JE-Archer JE-Archer force-pushed the lwip_sddf_library branch 3 times, most recently from e6cfb58 to 95ea4fb Compare January 30, 2025 07:30
@JE-Archer JE-Archer changed the base branch from main to sdfgen_0.16.0 January 30, 2025 07:30
Base automatically changed from sdfgen_0.16.0 to main January 30, 2025 08:27
JE-Archer and others added 3 commits January 31, 2025 13:32
Co-authored-by: Courtney Darville <[email protected]>
Signed-off-by: James Archer <[email protected]>
Co-authored-by: Courtney Darville <[email protected]>
Co-authored-by: James Archer <[email protected]>
Signed-off-by: James Archer <[email protected]>
Co-authored-by: Courtney Darville <[email protected]>
Co-authored-by: James Archer <[email protected]>
Signed-off-by: James Archer <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Making it easier to write networking clients
4 participants