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

porting lwip #123

Merged
merged 1 commit into from
Jun 25, 2024
Merged

porting lwip #123

merged 1 commit into from
Jun 25, 2024

Conversation

lhw2002426
Copy link
Contributor

No description provided.

Makefile Outdated
else ifeq ($(ARCH), aarch64)
ACCEL ?= n
PLATFORM_NAME ?= aarch64-qemu-virt
TARGET := aarch64-unknown-none-softfloat
TARGET_CFLAGS := -mgeneral-regs-only
Copy link
Contributor

Choose a reason for hiding this comment

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

This flag should be reconsidered.

Copy link
Contributor

Choose a reason for hiding this comment

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

This flag is not correct. If this flag is enabled, the compiler will only be allowed to use general registers, which prevents the access to float registers or SIMD registers.

api/ruxos_posix_api/src/imp/fd_ops.rs Outdated Show resolved Hide resolved
api/ruxos_posix_api/src/imp/io_mpx/epoll.rs Outdated Show resolved Hide resolved
api/ruxos_posix_api/src/imp/net.rs Outdated Show resolved Hide resolved
crates/lwip_rust/Cargo.toml Outdated Show resolved Hide resolved
crates/lwip_rust/README.md Outdated Show resolved Hide resolved
crates/lwip_rust/custom/arch/sys_arch.h Outdated Show resolved Hide resolved
crates/lwip_rust/custom/sys_arch.c Outdated Show resolved Hide resolved
modules/axnet/Cargo.toml Outdated Show resolved Hide resolved
modules/axnet/src/lwip_impl/addr.rs Outdated Show resolved Hide resolved
apps/c/httpserver/features.txt Outdated Show resolved Hide resolved
modules/axnet/src/lwip_impl/driver.rs Outdated Show resolved Hide resolved
modules/axnet/src/lwip_impl/udp.rs Outdated Show resolved Hide resolved
modules/axnet/src/smoltcp_impl/mod.rs Outdated Show resolved Hide resolved
modules/axnet/src/smoltcp_impl/tcp.rs Outdated Show resolved Hide resolved
modules/axsync/Cargo.toml Outdated Show resolved Hide resolved
modules/axsync/src/mutex.rs Outdated Show resolved Hide resolved
modules/axsync/src/mutex.rs Outdated Show resolved Hide resolved
modules/rux9p/src/netdev.rs Show resolved Hide resolved
Cargo.toml Outdated Show resolved Hide resolved
Makefile Outdated
else ifeq ($(ARCH), aarch64)
ACCEL ?= n
PLATFORM_NAME ?= aarch64-qemu-virt
TARGET := aarch64-unknown-none-softfloat
TARGET_CFLAGS := -mgeneral-regs-only
Copy link
Contributor

Choose a reason for hiding this comment

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

This flag is not correct. If this flag is enabled, the compiler will only be allowed to use general registers, which prevents the access to float registers or SIMD registers.

@@ -123,14 +123,14 @@ impl Socket {
fn shutdown(&self) -> LinuxResult {
match self {
Socket::Udp(udpsocket) => {
let udpsocket = udpsocket.lock();
let mut udpsocket = udpsocket.lock();
Copy link
Contributor

Choose a reason for hiding this comment

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

why mut?

Copy link
Contributor Author

@lhw2002426 lhw2002426 Jun 19, 2024

Choose a reason for hiding this comment

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

Becuase in modules/axnet/src/lwip_impl/udp.rs line 306 self.pcb.0 = null_mut(); , it directly changes self.pcb.0, so param self of fn shutdown must be mut. Now I will add mutex on self.pcb so it can chenge without mut and replace it by self.pcb.set()

api/ruxos_posix_api/src/imp/net.rs Outdated Show resolved Hide resolved
api/arceos_api/src/imp/net.rs Show resolved Hide resolved
modules/axnet/src/lwip_impl/tcp.rs Outdated Show resolved Hide resolved
modules/axnet/src/lwip_impl/tcp.rs Outdated Show resolved Hide resolved
modules/axnet/src/lwip_impl/udp.rs Outdated Show resolved Hide resolved
use core::net::{IpAddr, Ipv4Addr, SocketAddr};
use driver_9p::_9pDriverOps;
use driver_common::{BaseDriverOps, DeviceType};
use log::*;

pub struct Net9pDev {
socket: TcpSocket,
socket: Mutex<TcpSocket>,
Copy link
Contributor

Choose a reason for hiding this comment

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

Why should this be wrapped with Mutex.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because lwip TcpSocket has member converted from c , so it cannot be shared between threads safely

ulib/axstd/src/net/tcp.rs Show resolved Hide resolved
@lhw2002426 lhw2002426 force-pushed the lwip branch 2 times, most recently from 9443d05 to ef35a96 Compare June 25, 2024 03:41
Copy link
Contributor

Choose a reason for hiding this comment

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

x86_64 and riscv64 should check fp_simd feature as well.

index.html Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

remove this?

index.html.1 Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

remove this.

change license and rollback smoltcp version

rewrite lwip addr Ipv4Addr

rewrite lwip addr Ipv4Addr

delete index
@ken4647 ken4647 merged commit 24fa3dd into syswonder:dev Jun 25, 2024
7 of 10 checks passed
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.

3 participants