diff options
author | David S. Miller <davem@davemloft.net> | 2024-04-01 11:28:32 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2024-04-01 11:28:32 +0100 |
commit | 3b4cf29bdab08328dfab5bb7b41a62937ea5b379 (patch) | |
tree | 56a637e4861e796a3919c4f774c057ce3ab34534 /include/net/rps.h | |
parent | d823265dd45bbf14bd67aa476057108feb4143ce (diff) | |
parent | d3ae5f4632c107d3c2eeb97a60fecc6a6f9d6fbe (diff) | |
download | linux-3b4cf29bdab08328dfab5bb7b41a62937ea5b379.tar.gz linux-3b4cf29bdab08328dfab5bb7b41a62937ea5b379.tar.bz2 linux-3b4cf29bdab08328dfab5bb7b41a62937ea5b379.zip |
Merge branch 'net-rps-misc'
Eric Dumazet says:
====================
net: rps: misc changes
Make RPS/RFS a bit more efficient with better cache locality
and heuristics.
Aso shrink include/linux/netdevice.h a bit.
v2: fixed a build issue in patch 6/8 with CONFIG_RPS=n
(Jakub and kernel build bots)
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/rps.h')
-rw-r--r-- | include/net/rps.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/include/net/rps.h b/include/net/rps.h index 7660243e905b..a93401d23d66 100644 --- a/include/net/rps.h +++ b/include/net/rps.h @@ -122,4 +122,32 @@ static inline void sock_rps_record_flow(const struct sock *sk) #endif } +static inline u32 rps_input_queue_tail_incr(struct softnet_data *sd) +{ +#ifdef CONFIG_RPS + return ++sd->input_queue_tail; +#else + return 0; +#endif +} + +static inline void rps_input_queue_tail_save(u32 *dest, u32 tail) +{ +#ifdef CONFIG_RPS + WRITE_ONCE(*dest, tail); +#endif +} + +static inline void rps_input_queue_head_add(struct softnet_data *sd, int val) +{ +#ifdef CONFIG_RPS + WRITE_ONCE(sd->input_queue_head, sd->input_queue_head + val); +#endif +} + +static inline void rps_input_queue_head_incr(struct softnet_data *sd) +{ + rps_input_queue_head_add(sd, 1); +} + #endif /* _NET_RPS_H */ |