mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 06:15:47 +00:00
Avoid indeterminate statistics in offload implementations.
A lot of the offload implementations didn't bother to initialize the statistics they were supposed to return. I don't know whether any of the callers actually use them, but it looked wrong. Found by inspection. Acked-by: Ilya Maximets <i.maximets@ovn.org> Signed-off-by: Ben Pfaff <blp@ovn.org>
This commit is contained in:
@@ -1143,7 +1143,7 @@ static int
|
||||
netdev_tc_flow_put(struct netdev *netdev, struct match *match,
|
||||
struct nlattr *actions, size_t actions_len,
|
||||
const ovs_u128 *ufid, struct offload_info *info,
|
||||
struct dpif_flow_stats *stats OVS_UNUSED)
|
||||
struct dpif_flow_stats *stats)
|
||||
{
|
||||
static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 20);
|
||||
enum tc_qdisc_hook hook = get_tc_qdisc_hook(netdev);
|
||||
@@ -1448,6 +1448,9 @@ netdev_tc_flow_put(struct netdev *netdev, struct match *match,
|
||||
|
||||
err = tc_replace_flower(ifindex, prio, handle, &flower, block_id, hook);
|
||||
if (!err) {
|
||||
if (stats) {
|
||||
memset(stats, 0, sizeof *stats);
|
||||
}
|
||||
add_ufid_tc_mapping(ufid, flower.prio, flower.handle, netdev, ifindex);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user