err = prestera_flower_prio_get(block, f->common.chain_index,
&flower_prio_min, &flower_prio_max); if (err == -ENOENT) /* No flower filters installed on this chain. */ return 0;
if (err) {
NL_SET_ERR_MSG(f->common.extack, "Failed to get flower priorities"); return err;
}
if (f->common.prio <= flower_prio_max && !block->ingress) {
NL_SET_ERR_MSG(f->common.extack, "Failed to add in front of existing flower rules"); return -EOPNOTSUPP;
} if (f->common.prio >= flower_prio_min && block->ingress) {
NL_SET_ERR_MSG(f->common.extack, "Failed to add behind of existing flower rules"); return -EOPNOTSUPP;
}
return 0;
}
int prestera_mall_prio_get(struct prestera_flow_block *block,
u32 *prio_min, u32 *prio_max)
{ if (!block->mall.bound) return -ENOENT;
if (!flow_offload_has_one_action(&f->rule->action)) {
NL_SET_ERR_MSG(f->common.extack, "Only singular actions are supported"); return -EOPNOTSUPP;
}
act = &f->rule->action.entries[0];
if (!prestera_netdev_check(act->dev)) {
NL_SET_ERR_MSG(f->common.extack, "Only Marvell Prestera port is supported"); return -EINVAL;
} if (!tc_cls_can_offload_and_chain0(act->dev, &f->common)) return -EOPNOTSUPP; if (act->id != FLOW_ACTION_MIRRED) return -EOPNOTSUPP; if (protocol != htons(ETH_P_ALL)) return -EOPNOTSUPP;
err = prestera_mall_prio_check(block, f); if (err) return err;
port = netdev_priv(act->dev);
list_for_each_entry(binding, &block->binding_list, list) {
err = prestera_span_rule_add(binding, port, block->ingress); if (err == -EEXIST) return err; if (err) goto rollback;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.