Skip to content

Commit

Permalink
added preliminary RSC capability
Browse files Browse the repository at this point in the history
  • Loading branch information
handong32 committed Apr 8, 2020
1 parent 9fabb7a commit bef8f3a
Show file tree
Hide file tree
Showing 11 changed files with 1,562 additions and 628 deletions.
3 changes: 0 additions & 3 deletions src/native/Debug.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ void ebbrt::kvprintf(const char* __restrict format, va_list va) {
auto len = vsnprintf(nullptr, 0, format, va);
char buffer[len + 1]; // NOLINT
vsnprintf(buffer, len + 1, format, va2);
#ifdef __EBBRT_ENABLE_BAREMETAL_NIC__
console::Write("\r");
#endif
console::Write(buffer);
}

Expand Down
11 changes: 9 additions & 2 deletions src/native/EventManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,18 @@ void ebbrt::EventManager::Process() {

asm volatile(".byte 0x0f, 0x01, 0xc8;"
:: "a" ((void*)&flags), "c" (ecx), "d"(edx));

// https://elixir.bootlin.com/linux/v4.15.1/source/arch/x86/include/asm/mwait.h#L100
ecx = 1;

//eax = 0x20;
eax = 0x60;
//eax = 0x30;
//eax = 0x60;

// C1E state
//eax = 0x1;

// C7 state
eax = 0x30;

asm volatile("sti; .byte 0x0f, 0x01, 0xc9;"
:: "a" (eax), "c" (ecx));
Expand Down
6 changes: 6 additions & 0 deletions src/native/Ixgbe.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ enum l4_type { l4_type_udp = 0, l4_type_tcp, l4_type_sctp, l4_type_rsv };
#define RXFLAG_L4CS (1 << 2)
#define RXFLAG_L4CS_VALID (1 << 3)

#define IXGBE_RX_BUFFER_WRITE 15

#define mb() asm volatile("mfence" ::: "memory")
#define rmb() asm volatile("lfence" ::: "memory")
#define wmb() asm volatile("sfence" ::: "memory")

/***********************
* RX
* Descriptors
Expand Down
Loading

0 comments on commit bef8f3a

Please # to comment.