summaryrefslogtreecommitdiffhomepage
path: root/system-linux.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2018-02-26 12:21:00 +0100
committerFelix Fietkau <nbd@nbd.name>2018-02-26 12:27:09 +0100
commit8cdb17d2c58d5c3ecb57bdaf1981cd72b4948db1 (patch)
treedb150e1f116528e6b9f5b7f206e3feceaa065480 /system-linux.c
parent1be329c66326c86d7a48ba71004fcef7691bbbf9 (diff)
remove rps/xps configuration support
It is overly complex, yet does not cover common scenarios very well. It will be replaced with a simpler shell script that provides a better default policy Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'system-linux.c')
-rw-r--r--system-linux.c42
1 files changed, 0 insertions, 42 deletions
diff --git a/system-linux.c b/system-linux.c
index 0277886..4f3b9b0 100644
--- a/system-linux.c
+++ b/system-linux.c
@@ -1411,46 +1411,6 @@ system_if_get_settings(struct device *dev, struct device_settings *s)
}
}
-static void
-system_if_set_rps_xps_val(const char *path, char *fmt, int val)
-{
- char val_buf[8];
- glob_t gl;
- int i;
-
- if (glob(path, 0, NULL, &gl))
- return;
-
- snprintf(val_buf, sizeof(val_buf), fmt, val);
- for (i = 0; i < gl.gl_pathc; i++)
- system_set_sysctl(gl.gl_pathv[i], val_buf);
-
- globfree(&gl);
-}
-
-static void
-system_if_apply_rps_xps(struct device *dev, struct device_settings *s)
-{
- long n_cpus = sysconf(_SC_NPROCESSORS_ONLN);
- int val, rps_val, rps_flow_cnt, xps_val;
-
- if (n_cpus < 2)
- return;
-
- val = (1 << n_cpus) - 1;
- rps_val = s->rps_val ? s->rps_val : val;
- snprintf(dev_buf, sizeof(dev_buf), "/sys/class/net/%s/queues/*/rps_cpus", dev->ifname);
- system_if_set_rps_xps_val(dev_buf, "%x", s->rps ? rps_val : 0);
-
- rps_flow_cnt = s->rps_flow_cnt ? s->rps_flow_cnt : 0;
- snprintf(dev_buf, sizeof(dev_buf), "/sys/class/net/%s/queues/*/rps_flow_cnt", dev->ifname);
- system_if_set_rps_xps_val(dev_buf, "%d", s->rps ? rps_flow_cnt : 0);
-
- xps_val = s->xps_val ? s->xps_val : val;
- snprintf(dev_buf, sizeof(dev_buf), "/sys/class/net/%s/queues/*/xps_cpus", dev->ifname);
- system_if_set_rps_xps_val(dev_buf, "%x", s->xps ? xps_val : 0);
-}
-
void
system_if_apply_settings(struct device *dev, struct device_settings *s, unsigned int apply_mask)
{
@@ -1526,8 +1486,6 @@ system_if_apply_settings(struct device *dev, struct device_settings *s, unsigned
}
if (s->flags & DEV_OPT_SENDREDIRECTS & apply_mask)
system_set_sendredirects(dev, s->sendredirects ? "1" : "0");
-
- system_if_apply_rps_xps(dev, s);
}
int system_if_up(struct device *dev)