net/mlx5e: Use flag to properly monitor a flow rule offloading state
authorHadar Hen Zion <hadarh@mellanox.com>
Tue, 14 Feb 2017 12:03:45 +0000 (14:03 +0200)
committerSaeed Mahameed <saeedm@mellanox.com>
Sun, 30 Apr 2017 13:03:09 +0000 (16:03 +0300)
commit0b67a38fe699ee60c56d193d33c9c7392cabaea7
tree4822f70f6a93723b81f2d79cf1b827a9963f03d6
parent1a8552bd81af5f4f19b26ac58e8c85866d4f7de8
net/mlx5e: Use flag to properly monitor a flow rule offloading state

Instead of relaying on the 'flow->rule' pointer value which can be
valid or invalid (in case the FW returns an error while trying to offload
the rule), monitor the rule state using a flag.

In downstream patch which adds support to IP tunneling neigh update
flow, a TC rule could be cached in the driver and not offloaded into the
HW. In this case, the flow handle pointer stays NULL.

Check the offloaded flag to properly deal with rules which are currently
not offloaded when querying rule statistics.

This patch doesn't add any new functionality.

Signed-off-by: Hadar Hen Zion <hadarh@mellanox.com>
Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c