diff options
author | Arend Van Spriel <arend.vanspriel@broadcom.com> | 2018-04-30 13:15:46 +0200 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2018-05-02 23:47:18 +0200 |
commit | 2612d51d2fb0078212ec78c665805daa524f745b (patch) | |
tree | 8fe55d2748b8e627fab2e873cfc1554ff0d73484 /backport | |
parent | b6e5d4b1fc135b71eb380c01f3a3803d5606e269 (diff) |
backport-include: deal with struct sock::sk_pacing_shift
In kernel 4.15 the field sk_pacing_shift was introduced to allow
(wifi) drivers to change the behaviour of TSQ. In 4.16 a helper
function was added which mac80211 is using. So backport the helper
which is just a stub for kernels prior to 4.15.
Cc: Eric Dumazet <edumazet@google.com>
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'backport')
-rw-r--r-- | backport/backport-include/net/sock.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/backport/backport-include/net/sock.h b/backport/backport-include/net/sock.h index 89191f37..39bf0087 100644 --- a/backport/backport-include/net/sock.h +++ b/backport/backport-include/net/sock.h @@ -63,4 +63,16 @@ static inline void sk_clear_bit(int nr, struct sock *sk) } #endif /* < 4.5 */ +#if LINUX_VERSION_IS_LESS(4,16,0) +#define sk_pacing_shift_update LINUX_BACKPORT(sk_pacing_shift_update) +static inline void sk_pacing_shift_update(struct sock *sk, int val) +{ +#if LINUX_VERSION_IS_GEQ(4,15,0) + if (!sk || !sk_fullsock(sk) || sk->sk_pacing_shift == val) + return; + sk->sk_pacing_shift = val; +#endif /* >= 4.15 */ +} +#endif /* < 4.16 */ + #endif /* __BACKPORT_NET_SOCK_H */ |