mirror of
https://github.com/torvalds/linux.git
synced 2026-07-29 02:31:27 +02:00
Merge branch 'selftests-couple-of-fixes-in-toeplitz-rps-cases'
Gal Pressman says: ==================== selftests: Couple of fixes in Toeplitz RPS cases Fix a couple of bugs in the RPS cases of the Toeplitz selftest. ==================== Link: https://patch.msgid.link/20260112173715.384843-1-gal@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
commit
dbe6b3138f
|
|
@ -485,8 +485,8 @@ static void parse_rps_bitmap(const char *arg)
|
|||
|
||||
bitmap = strtoul(arg, NULL, 0);
|
||||
|
||||
if (bitmap & ~(RPS_MAX_CPUS - 1))
|
||||
error(1, 0, "rps bitmap 0x%lx out of bounds 0..%lu",
|
||||
if (bitmap & ~((1UL << RPS_MAX_CPUS) - 1))
|
||||
error(1, 0, "rps bitmap 0x%lx out of bounds, max cpu %lu",
|
||||
bitmap, RPS_MAX_CPUS - 1);
|
||||
|
||||
for (i = 0; i < RPS_MAX_CPUS; i++)
|
||||
|
|
|
|||
|
|
@ -94,12 +94,14 @@ def _configure_rps(cfg, rps_cpus):
|
|||
mask = 0
|
||||
for cpu in rps_cpus:
|
||||
mask |= (1 << cpu)
|
||||
mask = hex(mask)[2:]
|
||||
|
||||
mask = hex(mask)
|
||||
|
||||
# Set RPS bitmap for all rx queues
|
||||
for rps_file in glob.glob(f"/sys/class/net/{cfg.ifname}/queues/rx-*/rps_cpus"):
|
||||
with open(rps_file, "w", encoding="utf-8") as fp:
|
||||
fp.write(mask)
|
||||
# sysfs expects hex without '0x' prefix, toeplitz.c needs the prefix
|
||||
fp.write(mask[2:])
|
||||
|
||||
return mask
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user