]> git.proxmox.com Git - mirror_iproute2.git/commit
lib: Extract from iplink_vlan a helper to parse key:value arrays
authorPetr Machata <me@pmachata.org>
Thu, 12 Nov 2020 22:24:44 +0000 (23:24 +0100)
committerDavid Ahern <dsahern@gmail.com>
Sat, 14 Nov 2020 02:43:15 +0000 (19:43 -0700)
commit28e663ee65b53096edd3629a017aad04fe5bb13d
tree847e3e78a1be5e9ecc460f3762920db9670620db
parent6dd778e8378988658955c10870b4b5396940f1f9
lib: Extract from iplink_vlan a helper to parse key:value arrays

VLAN netdevices have two similar attributes: ingress-qos-map and
egress-qos-map. These attributes can be configured with a series of
802.1-priority-to-skb-priority (and vice versa) mappings. A reusable helper
along those lines will be handy for configuration of various
priority-to-tc, tc-to-algorithm, and other arrays in DCB.

Therefore extract the logic to a function parse_mapping(), move to utils.c,
and dispatch to utils.c from iplink_vlan.c. That necessitates extraction of
a VLAN-specific parse_qos_mapping(). Do that, and propagate addattr_l()
return value up, unlike the original.

Signed-off-by: Petr Machata <me@pmachata.org>
Signed-off-by: David Ahern <dsahern@gmail.com>
include/utils.h
ip/iplink_vlan.c
lib/utils.c