-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use dpdk graph framework and add some basic nodes. Signed-off-by: Guvenc Gulce <[email protected]>
- Loading branch information
Showing
25 changed files
with
1,107 additions
and
324 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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
[*.{build,h,c}] | ||
|
||
charset = utf-8 | ||
indent_style = tab | ||
indent_size = 4 |
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,16 @@ | ||
#ifndef __INCLUDE_DP_MBUF_DYN_PRIV_H__ | ||
#define __INCLUDE_DP_MBUF_DYN_PRIV_H__ | ||
|
||
#include "node_api.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
int rte_mbuf_dyn_flow_register(); | ||
struct dp_mbuf_priv1 *get_dp_mbuf_priv1(struct rte_mbuf *m); | ||
void init_dp_mbuf_priv1(struct rte_mbuf *m); | ||
#ifdef __cplusplus | ||
} | ||
#endif | ||
#endif |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1 +1,3 @@ | ||
install_headers('dp_service.h', 'dp_port.h', 'dpdk_layer.h', 'handlers/arp_handler.h', 'handler.h') | ||
install_headers('dp_service.h', 'node_api.h', 'dp_port.h', 'dpdk_layer.h', | ||
'nodes/arp_node_priv.h', 'nodes/ipv4_lookup_priv.h', | ||
'nodes/tx_node_priv.h', 'dp_mbuf_dyn.h') |
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,36 @@ | ||
#ifndef __PUBLIC_API_H__ | ||
#define __PUBLIC_API_H__ | ||
|
||
#include <rte_common.h> | ||
#include <rte_flow.h> | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
struct dp_flow { | ||
struct rte_flow_attr attr; | ||
struct rte_flow_item pattern[5]; | ||
struct rte_flow_action action[5]; | ||
int pattern_cnt; | ||
int action_cnt; | ||
int valid; | ||
}; | ||
|
||
struct dp_mbuf_priv1 { | ||
struct dp_flow *flow_ptr; | ||
}; | ||
|
||
struct rx_node_config | ||
{ | ||
uint16_t port_id; | ||
uint16_t queue_id; | ||
}; | ||
|
||
int config_rx_node(struct rx_node_config* cfg); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif |
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,30 @@ | ||
#ifndef __INCLUDE_ARP_NODE_PRIV_H__ | ||
#define __INCLUDE_ARP_NODE_PRIV_H__ | ||
|
||
#include "dpdk_layer.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
enum | ||
{ | ||
ARP_NEXT_DROP, | ||
ARP_NEXT_MAX | ||
}; | ||
|
||
struct arp_node_ctx | ||
{ | ||
uint16_t next; | ||
}; | ||
|
||
struct arp_node_main { | ||
uint16_t next_index[DP_MAX_PORTS]; | ||
}; | ||
|
||
struct rte_node_register *arp_node_get(void); | ||
int arp_set_next(uint16_t port_id, uint16_t next_index); | ||
#ifdef __cplusplus | ||
} | ||
#endif | ||
#endif |
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,30 @@ | ||
#ifndef __INCLUDE_IPV4_LOOKUP_NODE_PRIV_H__ | ||
#define __INCLUDE_IPV4_LOOKUP_NODE_PRIV_H__ | ||
|
||
#include "dpdk_layer.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
enum | ||
{ | ||
IPV4_LOOKUP_NEXT_DROP, | ||
IPV4_LOOKUP_NEXT_MAX | ||
}; | ||
|
||
struct ipv4_lookup_node_ctx | ||
{ | ||
uint16_t next; | ||
}; | ||
|
||
struct ipv4_lookup_node_main { | ||
uint16_t next_index[DP_MAX_PORTS]; | ||
}; | ||
|
||
struct rte_node_register *ipv4_lookup_node_get(void); | ||
int ipv4_lookup_set_next(uint16_t port_id, uint16_t next_index); | ||
#ifdef __cplusplus | ||
} | ||
#endif | ||
#endif |
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,32 @@ | ||
#ifndef __INCLUDE_TX_NODE_PRIV_H__ | ||
#define __INCLUDE_TX_NODE_PRIV_H__ | ||
|
||
#include "dpdk_layer.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
enum | ||
{ | ||
TX_NEXT_DROP, | ||
TX_NEXT_MAX | ||
}; | ||
|
||
struct tx_node_ctx | ||
{ | ||
uint16_t port_id; | ||
uint16_t queue_id; | ||
uint16_t next; | ||
}; | ||
|
||
struct ethdev_tx_node_main { | ||
uint32_t nodes[DP_MAX_PORTS]; | ||
}; | ||
|
||
struct ethdev_tx_node_main *tx_node_data_get(void); | ||
struct rte_node_register *tx_node_get(void); | ||
#ifdef __cplusplus | ||
} | ||
#endif | ||
#endif |
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,37 @@ | ||
#include "rte_mbuf_dyn.h" | ||
#include "dp_mbuf_dyn.h" | ||
|
||
static const struct rte_mbuf_dynfield dp_mbuf_dynfield_desc = { | ||
.name = "dp_node_dynfield_flow_ptr", | ||
.size = sizeof(struct dp_mbuf_priv1), | ||
.align = __alignof__(struct dp_mbuf_priv1), | ||
}; | ||
|
||
static int priv1_offset = -1; | ||
|
||
struct dp_mbuf_priv1* get_dp_mbuf_priv1(struct rte_mbuf *m) | ||
{ | ||
if (priv1_offset >= 0) | ||
return RTE_MBUF_DYNFIELD(m, priv1_offset, struct dp_mbuf_priv1 *); | ||
else | ||
return NULL; | ||
} | ||
|
||
void init_dp_mbuf_priv1(struct rte_mbuf *m) | ||
{ | ||
if (priv1_offset >= 0) { | ||
struct dp_mbuf_priv1 *temp; | ||
temp = RTE_MBUF_DYNFIELD(m, priv1_offset, struct dp_mbuf_priv1 *); | ||
temp->flow_ptr = NULL; | ||
} | ||
} | ||
|
||
int rte_mbuf_dyn_flow_register(int *field_offset) | ||
{ | ||
priv1_offset = rte_mbuf_dynfield_register(&dp_mbuf_dynfield_desc); | ||
if (priv1_offset < 0) | ||
return -1; | ||
|
||
return 0; | ||
} | ||
|
Oops, something went wrong.