diff options
| author | 2020-08-26 15:55:54 -0700 | |
|---|---|---|
| committer | 2020-08-26 15:55:54 -0700 | |
| commit | 751e42515efbe00cf8fe8c8bb160a207364dbb2b (patch) | |
| tree | c36f4686f70d69dd88ed5ab35c3dab6eee472178 /include | |
| parent | Merge branch 'Add-Ethernet-support-for-Intel-Keem-Bay-SoC' (diff) | |
| parent | net/mlx4_en: RX, Add a prefetch command for small L1_CACHE_BYTES (diff) | |
Merge branch 'net_prefetch-API'
Tariq Toukan says:
====================
net_prefetch API
This patchset adds a common net API for L1 cacheline size-aware prefetch.
Patch 1 introduces the common API in net and aligns the drivers to use it.
Patches 2 and 3 add usage in mlx4 and mlx5 Eth drivers.
Series generated against net-next commit:
079f921e9f4d Merge tag 'batadv-next-for-davem-20200824' of git://git.open-mesh.org/linux-merge
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/netdevice.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index b0e303f6603f..b8abe1d7aa0b 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -2193,6 +2193,22 @@ int netdev_get_num_tc(struct net_device *dev) return dev->num_tc; } +static inline void net_prefetch(void *p) +{ + prefetch(p); +#if L1_CACHE_BYTES < 128 + prefetch((u8 *)p + L1_CACHE_BYTES); +#endif +} + +static inline void net_prefetchw(void *p) +{ + prefetchw(p); +#if L1_CACHE_BYTES < 128 + prefetchw((u8 *)p + L1_CACHE_BYTES); +#endif +} + void netdev_unbind_sb_channel(struct net_device *dev, struct net_device *sb_dev); int netdev_bind_sb_channel_queue(struct net_device *dev, |
