X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=datapath%2Fhwtable_dummy%2Fhwtable_dummy.c;h=b78d364315efe07eb14cef5f31155c23572cdd4b;hb=57d52057650716ee354ebbe588d2a884ccabc81f;hp=e3e0eb411857914b7ae3c0c60363057f378acb9a;hpb=4f546834ac37ff964f732e12c3abbcb16f7570e2;p=openvswitch diff --git a/datapath/hwtable_dummy/hwtable_dummy.c b/datapath/hwtable_dummy/hwtable_dummy.c index e3e0eb41..b78d3643 100644 --- a/datapath/hwtable_dummy/hwtable_dummy.c +++ b/datapath/hwtable_dummy/hwtable_dummy.c @@ -97,6 +97,24 @@ static int table_dummy_insert(struct sw_table *swt, struct sw_flow *flow) return 0; } +static int table_dummy_modify(struct sw_table *swt, + const struct sw_flow_key *key, + const struct ofp_action *actions, int n_actions) +{ + struct sw_table_dummy *td = (struct sw_table_dummy *) swt; + struct sw_flow *flow; + unsigned int count = 0; + + list_for_each_entry (flow, &td->flows, node) { + if (flow_matches_1wild(&flow->key, key)) { + flow_replace_acts(flow, actions, n_actions); + /* xxx Do whatever is necessary to modify the entry in hardware */ + count++; + } + } + return count; +} + static int do_delete(struct sw_table *swt, struct sw_flow *flow) { @@ -233,6 +251,7 @@ static struct sw_table *table_dummy_create(void) swt = &td->swt; swt->lookup = table_dummy_lookup; swt->insert = table_dummy_insert; + swt->modify = table_dummy_modify; swt->delete = table_dummy_delete; swt->timeout = table_dummy_timeout; swt->destroy = table_dummy_destroy;