diff options
author | Eelco Chaudron <echaudro@redhat.com> | 2023-02-07 15:06:23 +0100 |
---|---|---|
committer | Ilya Maximets <i.maximets@ovn.org> | 2023-02-09 00:44:31 +0100 |
commit | 188da42e3dbb558c33a1c3f2aae0940d23331528 (patch) | |
tree | dd3b18c1204d8e5c046bca8475104194ae245be7 | |
parent | a77b8a32c18805592a2c4626c5d16941d8927ea9 (diff) | |
download | openvswitch-188da42e3dbb558c33a1c3f2aae0940d23331528.tar.gz |
netdev-offload-tc: If the flow has not been used, report it as such.
If a tc flow was installed but has not yet been used, report it as such.
In addition, add a delay to the "IGMP - flood under normal action" test
case to make it work with many repetitions. This delay is also present
in other ICMP/IGMP tests.
Fixes: f98e418fbdb6 ("tc: Add tc flower functions")
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Acked-by: Roi Dayan <roid@nvidia.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Tested-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
-rw-r--r-- | lib/tc.c | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -1366,7 +1366,19 @@ get_user_hz(void) static void nl_parse_tcf(const struct tcf_t *tm, struct tc_flower *flower) { - uint64_t lastused = time_msec() - (tm->lastuse * 1000 / get_user_hz()); + uint64_t lastused; + + /* On creation both tm->install and tm->lastuse are set to jiffies + * by the kernel. So if both values are the same, the flow has not been + * used yet. + * + * Note that tm->firstuse can not be used due to some kernel bug, i.e., + * hardware offloaded flows do not update tm->firstuse. */ + if (tm->lastuse == tm->install) { + lastused = 0; + } else { + lastused = time_msec() - (tm->lastuse * 1000 / get_user_hz()); + } if (flower->lastused < lastused) { flower->lastused = lastused; |