-
Notifications
You must be signed in to change notification settings - Fork 37
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
Lwip echoserver #25
base: master
Are you sure you want to change the base?
Lwip echoserver #25
Conversation
Signed-off-by: Lucy <[email protected]>
Signed-off-by: Lucy <[email protected]>
Signed-off-by: Lucy <[email protected]>
I've added the "Test with:" in the description, so the github CI run will use these PRs. |
apps/lwipserver2/CMakeLists.txt
Outdated
find_package(projects_libs REQUIRED) | ||
|
||
set(CAmkESCPP ON CACHE BOOL "" FORCE) | ||
if("${KernelArch}" STREQUAL "x86") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't we just use the boolean flags
if("${KernelArch}" STREQUAL "x86") | |
if(KernelArchARM) | |
... | |
elseif(KernelArchX86) | |
... |
set(cpp_define -DKernelArchX86) | ||
elseif("${KernelArch}" STREQUAL "arm") | ||
set(cpp_define -DKernelArchArm) | ||
endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's give it a clear error message here for anything else and avoid potentially undefined default behavior
else()
message(FATAL_ERROR "Unsupported architecture: '${KernelArch}'.")
endif()
apps/lwipserver2/CMakeLists.txt
Outdated
LIBS | ||
${libs} | ||
LD_FLAGS | ||
-Wl,--section-start=.note.gnu.build-id=0x400920 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It this just a copy paste from somewhere? Maybe add a comment about this, that this is just optional to set a specific build ID. The kernel is using -Wl,--build-id=none" # Ensure reproducible builds
here.
#define TX_BUFS 510 | ||
#define RX_BUFS 510 | ||
|
||
/* Size used for ethernet buffers */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PLease add the note again that this is the next 2^n for the 1500 byte MTU. I assume that this buffer size is independent of the buffer size that ius set it the other PRs, might be good to mention this in the comment also, so it's clear there are not pitfalls in here.
/* Maximum connected TCP clients */ | ||
#define MAX_TCP_CLIENTS 5 | ||
|
||
/* Size of initial TCP socket reads */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a note why exactly this value is chosen? Is it random or related to TCP headers?
/* Size of initial TCP socket reads */ | ||
#define TCP_READ_SIZE 1400 | ||
|
||
/* Max size of UDP socket reads */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, is it random or related to UDP headers?
#define DMA_ALLOC_SIZE (DMA_RING_ALLOC_SIZE + BUF_SIZE * (TX_BUFS + RX_BUFS)) | ||
|
||
|
||
/* Heap size */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a comment how the heap is used, so there is a rough explanation what influcenses this?
attribute int cnode_size_bits = 12; | ||
attribute int simple_untyped20_pool = 2; | ||
attribute int promiscuous_mode = 1; | ||
attribute int heap_size = 0x10000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a comment here what drives this heap size?
emits FDT resource; | ||
} | ||
|
||
component LWIPServer { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder, is there a way to have one common generic CAmkES file with the server that includes the platform specific driver files? So this can be extended to other platforms easily without copy/pasting common things?
|
||
# This application only works on hardware at the moment, not simulation | ||
# set(SIMULATION OFF CACHE BOOL "" FORCE) | ||
if("${KernelArch}" STREQUAL "x86") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if("${KernelArch}" STREQUAL "x86") | |
if(KernelArchX86) |
set(KernelIOMMU ON CACHE BOOL "" FORCE) | ||
endif() | ||
|
||
set(cpp_define -DKernelArchArm) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be set only for KernelArchARM
- if this must be set at all?
|
||
static ps_io_ops_t *ops; | ||
|
||
static int peer_id; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unsigned int
?
#include <echo/tuning_params.h> | ||
|
||
component LWIPServer { | ||
include "lwipserver.h"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the purpose of this include? It causes a lot of compiler errors and removing it seems to fix them.
I was able to successfully test this with imx8mm, but not able to yet with x86_64. Are there any special configuration options required for x86_64? |
Signed-off-by: Lucy <[email protected]>
@kent-mcleod Yes sorry i was missing one patch. It should work now with normal configurations with KernelExportPMCUser on. |
@@ -35,7 +34,7 @@ DeclareCAmkESComponent( | |||
LIBS | |||
${libs} | |||
LD_FLAGS | |||
-Wl,--section-start=.note.gnu.build-id=0x400920 | |||
-Wl,--section-start=.note.gnu.build-id=0x400920 #Ensure reproducible build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does 0x400920
have an meaning actually or could this be simply "1" also?
This is a simple 2 component echo server with a driver in one address space and the network stack and echo server in the other. This has been benchmarked and tested on the imx8mm-evk and Haswell3 systems.
Corresponding PRs are:
Test with: seL4/global-components#33, seL4/projects_libs#15, seL4/util_libs#126