@@ -111,12 +111,16 @@ static void flow_free(struct sw_flow *flow)
111111 if (ovs_identifier_is_key (& flow -> id ))
112112 kfree (flow -> id .unmasked_key );
113113 if (flow -> sf_acts )
114- ovs_nla_free_flow_actions ((struct sw_flow_actions __force * )flow -> sf_acts );
114+ ovs_nla_free_flow_actions ((struct sw_flow_actions __force * )
115+ flow -> sf_acts );
115116 /* We open code this to make sure cpu 0 is always considered */
116- for (cpu = 0 ; cpu < nr_cpu_ids ; cpu = cpumask_next (cpu , & flow -> cpu_used_mask ))
117+ for (cpu = 0 ; cpu < nr_cpu_ids ;
118+ cpu = cpumask_next (cpu , & flow -> cpu_used_mask )) {
117119 if (flow -> stats [cpu ])
118120 kmem_cache_free (flow_stats_cache ,
119121 (struct sw_flow_stats __force * )flow -> stats [cpu ]);
122+ }
123+
120124 kmem_cache_free (flow_cache , flow );
121125}
122126
@@ -192,7 +196,7 @@ static void tbl_mask_array_reset_counters(struct mask_array *ma)
192196 * zero based counter we store the value at reset, and subtract it
193197 * later when processing.
194198 */
195- for (i = 0 ; i < ma -> max ; i ++ ) {
199+ for (i = 0 ; i < ma -> max ; i ++ ) {
196200 ma -> masks_usage_zero_cntr [i ] = 0 ;
197201
198202 for_each_possible_cpu (cpu ) {
@@ -273,7 +277,7 @@ static int tbl_mask_array_add_mask(struct flow_table *tbl,
273277
274278 if (ma_count >= ma -> max ) {
275279 err = tbl_mask_array_realloc (tbl , ma -> max +
276- MASK_ARRAY_SIZE_MIN );
280+ MASK_ARRAY_SIZE_MIN );
277281 if (err )
278282 return err ;
279283
@@ -288,7 +292,7 @@ static int tbl_mask_array_add_mask(struct flow_table *tbl,
288292 BUG_ON (ovsl_dereference (ma -> masks [ma_count ]));
289293
290294 rcu_assign_pointer (ma -> masks [ma_count ], new );
291- WRITE_ONCE (ma -> count , ma_count + 1 );
295+ WRITE_ONCE (ma -> count , ma_count + 1 );
292296
293297 return 0 ;
294298}
@@ -309,10 +313,10 @@ static void tbl_mask_array_del_mask(struct flow_table *tbl,
309313 return ;
310314
311315found :
312- WRITE_ONCE (ma -> count , ma_count - 1 );
316+ WRITE_ONCE (ma -> count , ma_count - 1 );
313317
314- rcu_assign_pointer (ma -> masks [i ], ma -> masks [ma_count - 1 ]);
315- RCU_INIT_POINTER (ma -> masks [ma_count - 1 ], NULL );
318+ rcu_assign_pointer (ma -> masks [i ], ma -> masks [ma_count - 1 ]);
319+ RCU_INIT_POINTER (ma -> masks [ma_count - 1 ], NULL );
316320
317321 kfree_rcu (mask , rcu );
318322
@@ -448,16 +452,17 @@ int ovs_flow_tbl_init(struct flow_table *table)
448452
449453static void flow_tbl_destroy_rcu_cb (struct rcu_head * rcu )
450454{
451- struct table_instance * ti = container_of ( rcu , struct table_instance , rcu ) ;
455+ struct table_instance * ti ;
452456
457+ ti = container_of (rcu , struct table_instance , rcu );
453458 __table_instance_destroy (ti );
454459}
455460
456461static void table_instance_flow_free (struct flow_table * table ,
457- struct table_instance * ti ,
458- struct table_instance * ufid_ti ,
459- struct sw_flow * flow ,
460- bool count )
462+ struct table_instance * ti ,
463+ struct table_instance * ufid_ti ,
464+ struct sw_flow * flow ,
465+ bool count )
461466{
462467 hlist_del_rcu (& flow -> flow_table .node [ti -> node_ver ]);
463468 if (count )
@@ -484,9 +489,9 @@ void table_instance_flow_flush(struct flow_table *table,
484489 return ;
485490
486491 for (i = 0 ; i < ti -> n_buckets ; i ++ ) {
487- struct sw_flow * flow ;
488492 struct hlist_head * head = & ti -> buckets [i ];
489493 struct hlist_node * n ;
494+ struct sw_flow * flow ;
490495
491496 hlist_for_each_entry_safe (flow , n , head ,
492497 flow_table .node [ti -> node_ver ]) {
@@ -661,7 +666,7 @@ static int flow_key_start(const struct sw_flow_key *key)
661666 return 0 ;
662667 else
663668 return rounddown (offsetof(struct sw_flow_key , phy ),
664- sizeof (long ));
669+ sizeof (long ));
665670}
666671
667672static bool cmp_key (const struct sw_flow_key * key1 ,
@@ -673,7 +678,7 @@ static bool cmp_key(const struct sw_flow_key *key1,
673678 long diffs = 0 ;
674679 int i ;
675680
676- for (i = key_start ; i < key_end ; i += sizeof (long ))
681+ for (i = key_start ; i < key_end ; i += sizeof (long ))
677682 diffs |= * cp1 ++ ^ * cp2 ++ ;
678683
679684 return diffs == 0 ;
@@ -713,7 +718,7 @@ static struct sw_flow *masked_flow_lookup(struct table_instance *ti,
713718 (* n_mask_hit )++ ;
714719
715720 hlist_for_each_entry_rcu (flow , head , flow_table .node [ti -> node_ver ],
716- lockdep_ovsl_is_held ()) {
721+ lockdep_ovsl_is_held ()) {
717722 if (flow -> mask == mask && flow -> flow_table .hash == hash &&
718723 flow_cmp_masked_key (flow , & masked_key , & mask -> range ))
719724 return flow ;
@@ -897,7 +902,8 @@ static bool ovs_flow_cmp_ufid(const struct sw_flow *flow,
897902 return !memcmp (flow -> id .ufid , sfid -> ufid , sfid -> ufid_len );
898903}
899904
900- bool ovs_flow_cmp (const struct sw_flow * flow , const struct sw_flow_match * match )
905+ bool ovs_flow_cmp (const struct sw_flow * flow ,
906+ const struct sw_flow_match * match )
901907{
902908 if (ovs_identifier_is_ufid (& flow -> id ))
903909 return flow_cmp_masked_key (flow , match -> key , & match -> range );
@@ -916,7 +922,7 @@ struct sw_flow *ovs_flow_tbl_lookup_ufid(struct flow_table *tbl,
916922 hash = ufid_hash (ufid );
917923 head = find_bucket (ti , hash );
918924 hlist_for_each_entry_rcu (flow , head , ufid_table .node [ti -> node_ver ],
919- lockdep_ovsl_is_held ()) {
925+ lockdep_ovsl_is_held ()) {
920926 if (flow -> ufid_table .hash == hash &&
921927 ovs_flow_cmp_ufid (flow , ufid ))
922928 return flow ;
@@ -1107,7 +1113,7 @@ void ovs_flow_masks_rebalance(struct flow_table *table)
11071113 if (!masks_and_count )
11081114 return ;
11091115
1110- for (i = 0 ; i < ma -> max ; i ++ ) {
1116+ for (i = 0 ; i < ma -> max ; i ++ ) {
11111117 struct sw_flow_mask * mask ;
11121118 unsigned int start ;
11131119 int cpu ;
0 commit comments