Message ID | 20200514183309.64035-1-i.maximets@ovn.org |
---|---|
State | Accepted |
Delegated to: | Ilya Maximets |
Headers | show |
Series | [ovs-dev] ofproto: Fix statistics of removed flow. | expand |
On 2020-05-14 9:33 PM, Ilya Maximets wrote: > 'fr' is a new variable on the stack. '+=' here adds the real statistics > to a random stack memory. > > Fixes: 164413156cf9 ("Add offload packets statistics") > Signed-off-by: Ilya Maximets <i.maximets@ovn.org> > --- > ofproto/ofproto.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c > index 0fbd6c380..59f06aa94 100644 > --- a/ofproto/ofproto.c > +++ b/ofproto/ofproto.c > @@ -6085,8 +6085,8 @@ ofproto_rule_send_removed(struct rule *rule) > fr.hard_timeout = rule->hard_timeout; > ovs_mutex_unlock(&rule->mutex); > rule->ofproto->ofproto_class->rule_get_stats(rule, &stats, &used); > - fr.packet_count += stats.n_packets; > - fr.byte_count += stats.n_bytes; > + fr.packet_count = stats.n_packets; > + fr.byte_count = stats.n_bytes; > connmgr_send_flow_removed(connmgr, &fr); > ovs_mutex_unlock(&ofproto_mutex); > } > Acked-by: Roi Dayan <roid@mellanox.com>
On 5/14/20 9:43 PM, Roi Dayan wrote: > > > On 2020-05-14 9:33 PM, Ilya Maximets wrote: >> 'fr' is a new variable on the stack. '+=' here adds the real statistics >> to a random stack memory. >> >> Fixes: 164413156cf9 ("Add offload packets statistics") >> Signed-off-by: Ilya Maximets <i.maximets@ovn.org> >> --- >> ofproto/ofproto.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c >> index 0fbd6c380..59f06aa94 100644 >> --- a/ofproto/ofproto.c >> +++ b/ofproto/ofproto.c >> @@ -6085,8 +6085,8 @@ ofproto_rule_send_removed(struct rule *rule) >> fr.hard_timeout = rule->hard_timeout; >> ovs_mutex_unlock(&rule->mutex); >> rule->ofproto->ofproto_class->rule_get_stats(rule, &stats, &used); >> - fr.packet_count += stats.n_packets; >> - fr.byte_count += stats.n_bytes; >> + fr.packet_count = stats.n_packets; >> + fr.byte_count = stats.n_bytes; >> connmgr_send_flow_removed(connmgr, &fr); >> ovs_mutex_unlock(&ofproto_mutex); >> } >> > > Acked-by: Roi Dayan <roid@mellanox.com> > Thanks! Applied to master and branch-2.13. Best regards, Ilya Maximets.
diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index 0fbd6c380..59f06aa94 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -6085,8 +6085,8 @@ ofproto_rule_send_removed(struct rule *rule) fr.hard_timeout = rule->hard_timeout; ovs_mutex_unlock(&rule->mutex); rule->ofproto->ofproto_class->rule_get_stats(rule, &stats, &used); - fr.packet_count += stats.n_packets; - fr.byte_count += stats.n_bytes; + fr.packet_count = stats.n_packets; + fr.byte_count = stats.n_bytes; connmgr_send_flow_removed(connmgr, &fr); ovs_mutex_unlock(&ofproto_mutex); }
'fr' is a new variable on the stack. '+=' here adds the real statistics to a random stack memory. Fixes: 164413156cf9 ("Add offload packets statistics") Signed-off-by: Ilya Maximets <i.maximets@ovn.org> --- ofproto/ofproto.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)