Skip to content

Commit

Permalink
feat(baremetal NIC): initial push for baremetal NIC
Browse files Browse the repository at this point in the history
Only works on Intel 82599 family based NICs
  • Loading branch information
handong32 committed Feb 6, 2018
1 parent 0cdf0a4 commit f8a4188
Show file tree
Hide file tree
Showing 17 changed files with 3,063 additions and 26 deletions.
3 changes: 2 additions & 1 deletion src/IOBuf.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

#include <algorithm>
#include <cassert>
#include <cstring>
#include <forward_list>
#include <memory>
#include <vector>
#include <cstring>

#include <boost/iterator/iterator_facade.hpp>

Expand Down Expand Up @@ -64,6 +64,7 @@ class IOBuf {
}

void TrimEnd(size_t amount) { length_ -= amount; }
void SetLength(size_t amount) { length_ = amount; }

bool IsChained() const { return Next() != this; }

Expand Down
20 changes: 20 additions & 0 deletions src/native/GeneralPurposeAllocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,26 @@

namespace ebbrt {

// handler used in Pci.cc code to handle faults on multicores when mapping
// device
class MulticorePciFaultHandler : public ebbrt::VMemAllocator::PageFaultHandler {
ebbrt::Pfn vpage_;
ebbrt::Pfn ppage_;
size_t size_;

public:
void SetMap(ebbrt::Pfn va, ebbrt::Pfn pa, size_t s) {
vpage_ = va;
ppage_ = pa;
size_ = s;
}

void HandleFault(ebbrt::idt::ExceptionFrame* ef,
uintptr_t faulted_address) override {
ebbrt::vmem::MapMemory(vpage_, ppage_, size_);
}
};

// page fault handler for mapping in physical pages
// to virtual pages on all cores
class LargeRegionFaultHandler : public ebbrt::VMemAllocator::PageFaultHandler {
Expand Down
Loading

0 comments on commit f8a4188

Please sign in to comment.