Commit dbe6b313 authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files

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: default avatarJakub Kicinski <kuba@kernel.org>
parents ddf96c39 cf055f8c
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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++)
+4 −2
Original line number Diff line number Diff line
@@ -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