Unverified Commit 8ec41fca authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!4649 arm64/mpam: update reminder message about MBHDL option

parents 4fee6fde cb957295
Loading
Loading
Loading
Loading
+9 −13
Original line number Diff line number Diff line
@@ -340,15 +340,16 @@ parse_bw(char *buf, struct resctrl_resource *r,
		return -EINVAL;
	}

	switch (rr->ctrl_features[type].evt) {
	case QOS_MBA_MAX_EVENT_ID:
	case QOS_MBA_PBM_EVENT_ID:
	case QOS_MBA_MIN_EVENT_ID:
	if (kstrtoul(buf, rr->ctrl_features[type].base, &data)) {
		rdt_last_cmd_printf("Non-decimal digit in MB value %s\n", buf);
		return -EINVAL;
	}
		if (data < r->mbw.min_bw) {

	switch (rr->ctrl_features[type].evt) {
	case QOS_MBA_MAX_EVENT_ID:
	case QOS_MBA_PBM_EVENT_ID:
	case QOS_MBA_MIN_EVENT_ID:
		if (data < r->mbw.min_bw || data >= rr->ctrl_features[type].max_wd) {
			rdt_last_cmd_printf("MB value %ld out of range [%d,%d]\n", data,
					r->mbw.min_bw, rr->ctrl_features[type].max_wd - 1);
			return -EINVAL;
@@ -356,19 +357,14 @@ parse_bw(char *buf, struct resctrl_resource *r,
		data = roundup(data, r->mbw.bw_gran);
		break;
	default:
		if (kstrtoul(buf, rr->ctrl_features[type].base, &data)) {
			rdt_last_cmd_printf("Non-decimal digit in MB value %s\n", buf);
		if (data >= rr->ctrl_features[type].max_wd) {
			rdt_last_cmd_printf("MB value %ld exceed %d\n", data,
					rr->ctrl_features[type].max_wd - 1);
			return -EINVAL;
		}
		break;
	}

	if (data >= rr->ctrl_features[type].max_wd) {
		rdt_last_cmd_printf("MB value %ld out of range [%d,%d]\n", data,
				r->mbw.min_bw, rr->ctrl_features[type].max_wd - 1);
		return -EINVAL;
	}

	cfg->new_ctrl[type] = data;
	cfg->ctrl_updated[type] = true;
	cfg->have_new_ctrl = true;