linux-stable/drivers/net
Arthur Kiyanovski 2a6e5fa2f4 net: ena: fix uses of round_jiffies()
>From the documentation of round_jiffies():
"Rounds a time delta  in the future (in jiffies) up or down to
(approximately) full seconds. This is useful for timers for which
the exact time they fire does not matter too much, as long as
they fire approximately every X seconds.
By rounding these timers to whole seconds, all such timers will fire
at the same time, rather than at various times spread out. The goal
of this is to have the CPU wake up less, which saves power."

There are 2 parts to this patch:
================================
Part 1:
-------
In our case we need timer_service to be called approximately every
X=1 seconds, and the exact time does not matter, so using round_jiffies()
is the right way to go.

Therefore we add round_jiffies() to the mod_timer() in ena_timer_service().

Part 2:
-------
round_jiffies() is used in check_for_missing_keep_alive() when
getting the jiffies of the expiration of the keep_alive timeout. Here it
is actually a mistake to use round_jiffies() because we want the exact
time when keep_alive should expire and not an approximate rounded time,
which can cause early, false positive, timeouts.

Therefore we remove round_jiffies() in the calculation of
keep_alive_expired() in check_for_missing_keep_alive().

Fixes: 82ef30f13b ("net: ena: add hardware hints capability to the driver")
Fixes: 1738cd3ed3 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)")
Signed-off-by: Arthur Kiyanovski <akiyano@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-11 17:08:30 -08:00
..
appletalk
arcnet
bonding bonding/alb: properly access headers in bond_alb_xmit() 2020-02-05 14:28:09 +01:00
caif
can ioremap changes for 5.6 2020-01-27 13:03:00 -08:00
dsa net: dsa: mv88e6xxx: Prevent truncation of longer interrupt names 2020-02-10 14:01:43 +01:00
ethernet net: ena: fix uses of round_jiffies() 2020-02-11 17:08:30 -08:00
fddi Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next 2020-01-28 16:02:33 -08:00
fjes Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next 2020-01-28 16:02:33 -08:00
hamradio
hippi
hyperv hv_netvsc: Fix XDP refcnt for synthetic and VF NICs 2020-02-07 11:33:01 +01:00
ieee802154
ipvlan
netdevsim netdevsim: fix ptr_ret.cocci warnings 2020-02-05 13:55:32 +01:00
phy Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-02-04 13:32:20 +00:00
plip
ppp pptp: support sockets bound to an interface 2020-01-15 23:13:09 +01:00
slip Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-01-26 10:40:21 +01:00
team
usb qmi_wwan: unconditionally reject 2 ep interfaces 2020-02-10 14:03:27 +01:00
vmxnet3 vmxnet3: Remove always false conditional statement 2020-01-08 16:07:21 -08:00
wan ARM: SoC-related driver updates 2020-02-08 14:04:19 -08:00
wimax
wireguard wireguard: noise: reject peers with low order public keys 2020-02-05 14:14:18 +01:00
wireless wireless-drivers fixes for v5.6 2020-02-08 15:03:11 +01:00
xen-netback net: xen-netback: hash.c: Use built-in RCU list checking 2020-01-17 10:57:22 +01:00
Kconfig USB/Thunderbolt/PHY driver updates for 5.6-rc1 2020-01-29 10:09:44 -08:00
LICENSE.SRC
Makefile USB/Thunderbolt/PHY driver updates for 5.6-rc1 2020-01-29 10:09:44 -08:00
Space.c
dummy.c
eql.c
geneve.c
gtp.c gtp: use __GFP_NOWARN to avoid memalloc warning 2020-02-04 12:38:50 +01:00
ifb.c
loopback.c
macsec.c net: macsec: PN wrap callback 2020-01-14 11:31:41 -08:00
macvlan.c Merge ra.kernel.org:/pub/scm/linux/kernel/git/netdev/net 2020-01-19 22:10:04 +01:00
macvtap.c
mdio.c
mii.c
net_failover.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
sungem_phy.c
tap.c net: tap: use skb_list_walk_safe helper for gso segments 2020-01-08 15:19:55 -08:00
thunderbolt.c
tun.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-01-26 10:40:21 +01:00
veth.c bpf, xdp: Remove no longer required rcu_read_{un}lock() 2020-01-27 11:16:25 +01:00
virtio_net.c bpf, xdp: virtio_net use access ptr macro for xdp enable check 2020-01-27 11:16:25 +01:00
vrf.c
vsockmon.c
vxlan.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-01-09 12:13:43 -08:00
xen-netfront.c