aboutsummaryrefslogtreecommitdiffstats
path: root/net/openvswitch/flow_table.c
diff options
context:
space:
mode:
authorThomas Graf <tgraf@noironetworks.com>2014-11-06 09:58:52 -0500
committerPravin B Shelar <pshelar@nicira.com>2014-11-09 21:58:44 -0500
commit12eb18f7115884b0c1513dda31b0051121116b3a (patch)
tree9c6003bff7ab289540d55460d9c0a0e1105a3716 /net/openvswitch/flow_table.c
parente8eedb85bd238613332570ac6ae683fee94fbe36 (diff)
openvswitch: Constify various function arguments
Help produce better optimized code. Signed-off-by: Thomas Graf <tgraf@noironetworks.com> Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Diffstat (limited to 'net/openvswitch/flow_table.c')
-rw-r--r--net/openvswitch/flow_table.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/net/openvswitch/flow_table.c b/net/openvswitch/flow_table.c
index 90f8b40a350b..e0a7fefc1edf 100644
--- a/net/openvswitch/flow_table.c
+++ b/net/openvswitch/flow_table.c
@@ -107,7 +107,7 @@ err:
107 return ERR_PTR(-ENOMEM); 107 return ERR_PTR(-ENOMEM);
108} 108}
109 109
110int ovs_flow_tbl_count(struct flow_table *table) 110int ovs_flow_tbl_count(const struct flow_table *table)
111{ 111{
112 return table->count; 112 return table->count;
113} 113}
@@ -401,7 +401,7 @@ static bool flow_cmp_masked_key(const struct sw_flow *flow,
401} 401}
402 402
403bool ovs_flow_cmp_unmasked_key(const struct sw_flow *flow, 403bool ovs_flow_cmp_unmasked_key(const struct sw_flow *flow,
404 struct sw_flow_match *match) 404 const struct sw_flow_match *match)
405{ 405{
406 struct sw_flow_key *key = match->key; 406 struct sw_flow_key *key = match->key;
407 int key_start = flow_key_start(key); 407 int key_start = flow_key_start(key);
@@ -412,7 +412,7 @@ bool ovs_flow_cmp_unmasked_key(const struct sw_flow *flow,
412 412
413static struct sw_flow *masked_flow_lookup(struct table_instance *ti, 413static struct sw_flow *masked_flow_lookup(struct table_instance *ti,
414 const struct sw_flow_key *unmasked, 414 const struct sw_flow_key *unmasked,
415 struct sw_flow_mask *mask) 415 const struct sw_flow_mask *mask)
416{ 416{
417 struct sw_flow *flow; 417 struct sw_flow *flow;
418 struct hlist_head *head; 418 struct hlist_head *head;
@@ -460,7 +460,7 @@ struct sw_flow *ovs_flow_tbl_lookup(struct flow_table *tbl,
460} 460}
461 461
462struct sw_flow *ovs_flow_tbl_lookup_exact(struct flow_table *tbl, 462struct sw_flow *ovs_flow_tbl_lookup_exact(struct flow_table *tbl,
463 struct sw_flow_match *match) 463 const struct sw_flow_match *match)
464{ 464{
465 struct table_instance *ti = rcu_dereference_ovsl(tbl->ti); 465 struct table_instance *ti = rcu_dereference_ovsl(tbl->ti);
466 struct sw_flow_mask *mask; 466 struct sw_flow_mask *mask;
@@ -563,7 +563,7 @@ static struct sw_flow_mask *flow_mask_find(const struct flow_table *tbl,
563 563
564/* Add 'mask' into the mask list, if it is not already there. */ 564/* Add 'mask' into the mask list, if it is not already there. */
565static int flow_mask_insert(struct flow_table *tbl, struct sw_flow *flow, 565static int flow_mask_insert(struct flow_table *tbl, struct sw_flow *flow,
566 struct sw_flow_mask *new) 566 const struct sw_flow_mask *new)
567{ 567{
568 struct sw_flow_mask *mask; 568 struct sw_flow_mask *mask;
569 mask = flow_mask_find(tbl, new); 569 mask = flow_mask_find(tbl, new);
@@ -586,7 +586,7 @@ static int flow_mask_insert(struct flow_table *tbl, struct sw_flow *flow,
586 586
587/* Must be called with OVS mutex held. */ 587/* Must be called with OVS mutex held. */
588int ovs_flow_tbl_insert(struct flow_table *table, struct sw_flow *flow, 588int ovs_flow_tbl_insert(struct flow_table *table, struct sw_flow *flow,
589 struct sw_flow_mask *mask) 589 const struct sw_flow_mask *mask)
590{ 590{
591 struct table_instance *new_ti = NULL; 591 struct table_instance *new_ti = NULL;
592 struct table_instance *ti; 592 struct table_instance *ti;