https://github.com/torvalds/linux
Revision be43224fc0e4697ad0d03107cbaf1ecf26e7ee72 authored by Ido Schimmel on 21 May 2020, 11:46:16 UTC, committed by David S. Miller on 22 May 2020, 23:05:42 UTC
In case the policer drop counter is retrieved when the jiffies value is
a multiple of 64, the counter will not be incremented.

This randomly breaks a selftest [1] the reads the counter twice and
checks that it was incremented:

```
TEST: Trap policer                                                  [FAIL]
	Policer drop counter was not incremented
```

Fix by always incrementing the counter by 1.

[1] tools/testing/selftests/drivers/net/netdevsim/devlink_trap.sh

Fixes: ad188458d012 ("netdevsim: Add devlink-trap policer support")
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 4629ed2
History
Tip revision: be43224fc0e4697ad0d03107cbaf1ecf26e7ee72 authored by Ido Schimmel on 21 May 2020, 11:46:16 UTC
netdevsim: Ensure policer drop counter always increases
Tip revision: be43224
File Mode Size
Documentation
LICENSES
arch
block
certs
crypto
drivers
fs
include
init
ipc
kernel
lib
mm
net
samples
scripts
security
sound
tools
usr
virt
.clang-format -rw-r--r-- 15.8 KB
.cocciconfig -rw-r--r-- 59 bytes
.get_maintainer.ignore -rw-r--r-- 71 bytes
.gitattributes -rw-r--r-- 62 bytes
.gitignore -rw-r--r-- 1.7 KB
.mailmap -rw-r--r-- 15.1 KB
COPYING -rw-r--r-- 496 bytes
CREDITS -rw-r--r-- 97.4 KB
Kbuild -rw-r--r-- 1.3 KB
Kconfig -rw-r--r-- 595 bytes
MAINTAINERS -rw-r--r-- 539.1 KB
Makefile -rw-r--r-- 60.3 KB
README -rw-r--r-- 727 bytes

README

back to top