-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from fixstars/feature/runtime-layer
Introduced runtime layer
- Loading branch information
Showing
19 changed files
with
585 additions
and
271 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ GPATH | |
GTAGS | ||
GRTAGS | ||
build* | ||
.vscode | ||
*~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#ifndef LNG_RUNTIME_H | ||
#define LNG_RUNTIME_H | ||
|
||
#if defined(LNG_WITH_DPDK) | ||
struct rte_mempool; | ||
#endif | ||
|
||
namespace lng { | ||
|
||
class Runtime { | ||
public: | ||
enum Type { | ||
DPDK, | ||
DOCA | ||
}; | ||
|
||
virtual void start() = 0; | ||
virtual void stop() = 0; | ||
}; | ||
|
||
#if defined(LNG_WITH_DOCA) | ||
class DOCARuntime : public Runtime { | ||
public: | ||
DOCARuntime(); | ||
|
||
virtual void start() { } | ||
|
||
virtual void stop() { } | ||
}; | ||
#endif | ||
|
||
#if defined(LNG_WITH_DPDK) | ||
|
||
class DPDKRuntime : public Runtime { | ||
public: | ||
virtual void start(); | ||
|
||
virtual void stop(); | ||
|
||
rte_mempool* get_mempool() { | ||
return mbuf_pool_; | ||
} | ||
|
||
private: | ||
rte_mempool* mbuf_pool_; | ||
}; | ||
#endif | ||
|
||
} // lng | ||
|
||
#endif |
Oops, something went wrong.