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

Bug fix: Flow Directory. (test_flow_dir) #248

Open
wants to merge 33 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
dfbc44f
Bug fix: Not setting action after adding to table.
Jul 14, 2020
66d1725
Bug fix: Not setting action after adding to table.
Jul 14, 2020
f6d04a9
Removed memset when filling key in flow dir
Jul 17, 2020
6bf658d
Merge bug fix
Jul 17, 2020
524db7f
Styling
Jul 17, 2020
289eaf3
Update onvm ipv4 tuple size.
Jul 17, 2020
785a682
Convert port to big endian when filling key.
Jul 19, 2020
0888f1a
Initialize flow entry to NULL & new feature
Jul 20, 2020
ac08651
Conform to Linter
Jul 20, 2020
179afc0
Update print default service chain.
Jul 20, 2020
a312d3f
Update flow entry variable to be global.
Jul 20, 2020
d88f412
Update destination structs
Jul 21, 2020
1c20d9e
Update readme with new functionality.
bdevierno1 Jul 21, 2020
6e419cb
Removed memset
Jul 22, 2020
7cc7a61
Merge
Jul 22, 2020
94446c6
Conform to Linter
Jul 22, 2020
31447bd
Linter: whitespace
Jul 22, 2020
ed8681c
Merge dev
Jul 23, 2020
887a277
Merge dev
Jul 23, 2020
7c7ae8f
First review. TODO: Resolve memset placement.
Jul 23, 2020
05dff7b
Revert pkt helper changes
Jul 23, 2020
785ee44
Tested with service chains.
Jul 24, 2020
92092ee
Test flow dir.c Ready for review.
Jul 28, 2020
7c79874
Styling and undo changes to speed tester.
Jul 28, 2020
90b77a1
Set Next action when destination is 255
Jul 28, 2020
98b4530
Use pkt rss
Jul 28, 2020
c92b77a
Documentation update. Service ID 255.
bdevierno1 Jul 28, 2020
d113696
Define 255
Jul 29, 2020
0ff3053
Style
Jul 29, 2020
02cf1a4
Update to use latest pktgen
Jul 30, 2020
faa11e6
Merge upstream/develop
Aug 3, 2020
61bff85
Merge remote-tracking branch 'upstream/develop' into test_flow_dir
Jan 14, 2021
965329a
Remove multiple defn for var flow_entry
Jan 14, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/load_balancer/load_balancer.c
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,7 @@ table_lookup_entry(struct rte_mbuf *pkt, struct flow_info **flow) {
return -1;
}

memset(&key, 0, sizeof(struct onvm_ft_ipv4_5tuple));
bdevierno1 marked this conversation as resolved.
Show resolved Hide resolved
int ret = onvm_ft_fill_key_symmetric(&key, pkt);
if (ret < 0)
return -1;
Expand Down
1 change: 1 addition & 0 deletions examples/speed_tester/speed_tester.c
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ nf_setup(struct onvm_nf_local_ctx *nf_local_ctx) {
pmeta->action = ONVM_NF_ACTION_TONF;
pmeta->flags = ONVM_SET_BIT(0, SPEED_TESTER_BIT);

memset(&key, 0, sizeof(struct onvm_ft_ipv4_5tuple));
onvm_ft_fill_key(&key, pkt);
pkt->hash.rss = onvm_softrss(&key);

Expand Down
17 changes: 13 additions & 4 deletions examples/test_flow_dir/test_flow_dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,19 +155,27 @@ static int
packet_handler(struct rte_mbuf *pkt, struct onvm_pkt_meta *meta,
__attribute__((unused)) struct onvm_nf_local_ctx *nf_local_ctx) {
static uint32_t counter = 0;
struct onvm_flow_entry *flow_entry = NULL;
struct onvm_flow_entry *flow_entry;
bdevierno1 marked this conversation as resolved.
Show resolved Hide resolved
int ret;

if (!onvm_pkt_is_ipv4(pkt)) {
meta->action = ONVM_NF_ACTION_DROP;
return 0;
}

if (++counter == print_delay) {
do_stats_display(pkt);
counter = 0;
}

ret = onvm_flow_dir_get_pkt(pkt, &flow_entry);
struct onvm_ft_ipv4_5tuple key;
memset(&key, 0, sizeof(struct onvm_ft_ipv4_5tuple));
onvm_ft_fill_key(&key, pkt);
bdevierno1 marked this conversation as resolved.
Show resolved Hide resolved
ret = onvm_ft_lookup_key(sdn_ft, &key, (char **)flow_entry);
bdevierno1 marked this conversation as resolved.
Show resolved Hide resolved
if (ret >= 0) {
meta->action = ONVM_NF_ACTION_NEXT;
} else {
ret = onvm_flow_dir_add_pkt(pkt, &flow_entry);
ret = onvm_ft_add_key(sdn_ft, &key, (char **)&flow_entry);
if (ret < 0) {
meta->action = ONVM_NF_ACTION_DROP;
meta->destination = 0;
Expand All @@ -176,7 +184,8 @@ packet_handler(struct rte_mbuf *pkt, struct onvm_pkt_meta *meta,
memset(flow_entry, 0, sizeof(struct onvm_flow_entry));
flow_entry->sc = onvm_sc_create();
onvm_sc_append_entry(flow_entry->sc, ONVM_NF_ACTION_TONF, destination);
// onvm_sc_print(flow_entry->sc);
meta->action = ONVM_NF_ACTION_TONF;
meta->destination = destination;
bdevierno1 marked this conversation as resolved.
Show resolved Hide resolved
}
return 0;
}
Expand Down
5 changes: 2 additions & 3 deletions onvm/onvm_nflib/onvm_flow_table.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ struct onvm_ft {
struct onvm_ft_ipv4_5tuple {
uint32_t src_addr;
uint32_t dst_addr;
uint16_t src_port;
uint16_t dst_port;
uint32_t src_port;
uint32_t dst_port;
bdevierno1 marked this conversation as resolved.
Show resolved Hide resolved
uint8_t proto;
};

Expand Down Expand Up @@ -148,7 +148,6 @@ onvm_ft_fill_key(struct onvm_ft_ipv4_5tuple *key, struct rte_mbuf *pkt) {
return -EPROTONOSUPPORT;
}
ipv4_hdr = onvm_pkt_ipv4_hdr(pkt);
memset(key, 0, sizeof(struct onvm_ft_ipv4_5tuple));
bdevierno1 marked this conversation as resolved.
Show resolved Hide resolved
key->proto = ipv4_hdr->next_proto_id;
key->src_addr = ipv4_hdr->src_addr;
key->dst_addr = ipv4_hdr->dst_addr;
Expand Down