mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-01-18 17:57:36 +07:00
net/xps: Fix calculation of initial number of xps queues
The existing code breaks on architectures where the L1 cache size (L1_CACHE_BYTES) is smaller or equal the size of struct xps_map. The new code ensures that we get at minimum one initial xps queue, or even more as long as it fits into the next multiple of L1_CACHE_SIZE. Signed-off-by: Helge Deller <deller@gmx.de> Acked-by: Alexander Duyck <aduyck@mirantis.com>
This commit is contained in:
parent
b696e5e938
commit
c59f419bdd
@ -718,8 +718,8 @@ struct xps_map {
|
||||
u16 queues[0];
|
||||
};
|
||||
#define XPS_MAP_SIZE(_num) (sizeof(struct xps_map) + ((_num) * sizeof(u16)))
|
||||
#define XPS_MIN_MAP_ALLOC ((L1_CACHE_BYTES - sizeof(struct xps_map)) \
|
||||
/ sizeof(u16))
|
||||
#define XPS_MIN_MAP_ALLOC ((L1_CACHE_ALIGN(offsetof(struct xps_map, queues[1])) \
|
||||
- sizeof(struct xps_map)) / sizeof(u16))
|
||||
|
||||
/*
|
||||
* This structure holds all XPS maps for device. Maps are indexed by CPU.
|
||||
|
Loading…
Reference in New Issue
Block a user