Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'tools-ynl-gen-add-support-for-inherited-selector-and-therefore-tc'

Jakub Kicinski says:

====================
tools: ynl-gen: add support for "inherited" selector and therefore TC

Add C codegen support for constructs needed by TC, namely passing
sub-message selector from a lower nest, and sub-messages with
fixed headers.
====================

Link: https://patch.msgid.link/20250520161916.413298-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+500 -287
+270 -244
Documentation/netlink/specs/tc.yaml
··· 2 2 3 3 name: tc 4 4 protocol: netlink-raw 5 + uapi-header: linux/pkt_cls.h 5 6 protonum: 0 6 7 7 8 doc: ··· 13 12 - 14 13 name: tcmsg 15 14 type: struct 15 + header: linux/rtnetlink.h 16 16 members: 17 17 - 18 18 name: family ··· 35 33 name: info 36 34 type: u32 37 35 - 38 - name: tc-cls-flags 36 + name: cls-flags 37 + enum-name: 39 38 type: flags 40 39 entries: 41 40 - skip-hw ··· 45 42 - not-in-nw 46 43 - verbose 47 44 - 48 - name: tc-flower-key-ctrl-flags 45 + name: flower-key-ctrl-flags 46 + name-prefix: tca-flower-key-flags- 47 + enum-name: 49 48 type: flags 50 49 entries: 51 50 - frag ··· 635 630 - 636 631 name: tc-ratespec 637 632 type: struct 633 + header: linux/pkt_sched.h 638 634 members: 639 635 - 640 636 name: cell-log ··· 1192 1186 name: firstuse 1193 1187 type: u64 1194 1188 - 1195 - name: tc-gen 1189 + name: tc-gact 1196 1190 type: struct 1197 1191 members: 1198 1192 - ··· 1383 1377 type: s32 1384 1378 attribute-sets: 1385 1379 - 1386 - name: tc-attrs 1380 + name: attrs 1381 + name-prefix: tca- 1387 1382 attributes: 1388 1383 - 1389 1384 name: kind ··· 1392 1385 - 1393 1386 name: options 1394 1387 type: sub-message 1395 - sub-message: tc-options-msg 1388 + sub-message: options-msg 1396 1389 selector: kind 1397 1390 - 1398 1391 name: stats ··· 1443 1436 name: ext-warn-msg 1444 1437 type: string 1445 1438 - 1446 - name: tc-act-attrs 1439 + name: act-attrs 1440 + name-prefix: tca-act- 1447 1441 attributes: 1448 1442 - 1449 1443 name: kind ··· 1452 1444 - 1453 1445 name: options 1454 1446 type: sub-message 1455 - sub-message: tc-act-options-msg 1447 + sub-message: act-options-msg 1456 1448 selector: kind 1457 1449 - 1458 1450 name: index ··· 1460 1452 - 1461 1453 name: stats 1462 1454 type: nest 1463 - nested-attributes: tc-act-stats-attrs 1455 + nested-attributes: tca-stats-attrs 1464 1456 - 1465 1457 name: pad 1466 1458 type: pad ··· 1480 1472 name: in-hw-count 1481 1473 type: u32 1482 1474 - 1483 - name: tc-act-stats-attrs 1484 - attributes: 1485 - - 1486 - name: basic 1487 - type: binary 1488 - struct: gnet-stats-basic 1489 - - 1490 - name: rate-est 1491 - type: binary 1492 - struct: gnet-stats-rate-est 1493 - - 1494 - name: queue 1495 - type: binary 1496 - struct: gnet-stats-queue 1497 - - 1498 - name: app 1499 - type: binary 1500 - - 1501 - name: rate-est64 1502 - type: binary 1503 - struct: gnet-stats-rate-est64 1504 - - 1505 - name: pad 1506 - type: pad 1507 - - 1508 - name: basic-hw 1509 - type: binary 1510 - struct: gnet-stats-basic 1511 - - 1512 - name: pkt64 1513 - type: u64 1514 - - 1515 - name: tc-act-bpf-attrs 1475 + name: act-bpf-attrs 1476 + name-prefix: tca-act-bpf- 1477 + header: linux/tc_act/tc_bpf.h 1516 1478 attributes: 1517 1479 - 1518 1480 name: tm ··· 1513 1535 name: id 1514 1536 type: binary 1515 1537 - 1516 - name: tc-act-connmark-attrs 1538 + name: act-connmark-attrs 1539 + name-prefix: tca-connmark- 1540 + header: linux/tc_act/tc_connmark.h 1517 1541 attributes: 1518 1542 - 1519 1543 name: parms ··· 1528 1548 name: pad 1529 1549 type: pad 1530 1550 - 1531 - name: tc-act-csum-attrs 1551 + name: act-csum-attrs 1552 + name-prefix: tca-csum- 1553 + header: linux/tc_act/tc_csum.h 1532 1554 attributes: 1533 1555 - 1534 1556 name: parms ··· 1543 1561 name: pad 1544 1562 type: pad 1545 1563 - 1546 - name: tc-act-ct-attrs 1564 + name: act-ct-attrs 1565 + name-prefix: tca-ct- 1566 + header: linux/tc_act/tc_ct.h 1547 1567 attributes: 1548 1568 - 1549 1569 name: parms ··· 1607 1623 name: helper-proto 1608 1624 type: u8 1609 1625 - 1610 - name: tc-act-ctinfo-attrs 1626 + name: act-ctinfo-attrs 1627 + name-prefix: tca-ctinfo- 1628 + header: linux/tc_act/tc_ctinfo.h 1611 1629 attributes: 1612 1630 - 1613 1631 name: pad ··· 1643 1657 name: stats-cpmark-set 1644 1658 type: u64 1645 1659 - 1646 - name: tc-act-gate-attrs 1660 + name: act-gate-attrs 1661 + name-prefix: tca-gate- 1662 + header: linux/tc_act/tc_gate.h 1647 1663 attributes: 1648 1664 - 1649 1665 name: tm ··· 1679 1691 name: clockid 1680 1692 type: s32 1681 1693 - 1682 - name: tc-act-ife-attrs 1694 + name: act-ife-attrs 1695 + name-prefix: tca-ife- 1696 + header: linux/tc_act/tc_ife.h 1683 1697 attributes: 1684 1698 - 1685 1699 name: parms ··· 1706 1716 name: pad 1707 1717 type: pad 1708 1718 - 1709 - name: tc-act-mirred-attrs 1719 + name: act-mirred-attrs 1720 + name-prefix: tca-mirred- 1721 + header: linux/tc_act/tc_mirred.h 1710 1722 attributes: 1711 1723 - 1712 1724 name: tm ··· 1724 1732 name: blockid 1725 1733 type: binary 1726 1734 - 1727 - name: tc-act-mpls-attrs 1735 + name: act-mpls-attrs 1736 + name-prefix: tca-mpls- 1737 + header: linux/tc_act/tc_mpls.h 1728 1738 attributes: 1729 1739 - 1730 1740 name: tm ··· 1756 1762 name: bos 1757 1763 type: u8 1758 1764 - 1759 - name: tc-act-nat-attrs 1765 + name: act-nat-attrs 1766 + name-prefix: tca-nat- 1767 + header: linux/tc_act/tc_nat.h 1760 1768 attributes: 1761 1769 - 1762 1770 name: parms ··· 1771 1775 name: pad 1772 1776 type: pad 1773 1777 - 1774 - name: tc-act-pedit-attrs 1778 + name: act-pedit-attrs 1779 + name-prefix: tca-pedit- 1780 + header: linux/tc_act/tc_pedit.h 1775 1781 attributes: 1776 1782 - 1777 1783 name: tm ··· 1796 1798 name: key-ex 1797 1799 type: binary 1798 1800 - 1799 - name: tc-act-police-attrs 1800 - attributes: 1801 - - 1802 - name: tbf 1803 - type: binary 1804 - struct: tc-police 1805 - - 1806 - name: rate 1807 - type: binary # TODO 1808 - - 1809 - name: peakrate 1810 - type: binary # TODO 1811 - - 1812 - name: avrate 1813 - type: u32 1814 - - 1815 - name: result 1816 - type: u32 1817 - - 1818 - name: tm 1819 - type: binary 1820 - struct: tcf-t 1821 - - 1822 - name: pad 1823 - type: pad 1824 - - 1825 - name: rate64 1826 - type: u64 1827 - - 1828 - name: peakrate64 1829 - type: u64 1830 - - 1831 - name: pktrate64 1832 - type: u64 1833 - - 1834 - name: pktburst64 1835 - type: u64 1836 - - 1837 - name: tc-act-simple-attrs 1801 + name: act-simple-attrs 1802 + name-prefix: tca-def- 1803 + header: linux/tc_act/tc_defact.h 1838 1804 attributes: 1839 1805 - 1840 1806 name: tm ··· 1814 1852 name: pad 1815 1853 type: pad 1816 1854 - 1817 - name: tc-act-skbedit-attrs 1855 + name: act-skbedit-attrs 1856 + name-prefix: tca-skbedit- 1857 + header: linux/tc_act/tc_skbedit.h 1818 1858 attributes: 1819 1859 - 1820 1860 name: tm ··· 1850 1886 name: queue-mapping-max 1851 1887 type: u16 1852 1888 - 1853 - name: tc-act-skbmod-attrs 1889 + name: act-skbmod-attrs 1890 + name-prefix: tca-skbmod- 1891 + header: linux/tc_act/tc_skbmod.h 1854 1892 attributes: 1855 1893 - 1856 1894 name: tm ··· 1874 1908 name: pad 1875 1909 type: pad 1876 1910 - 1877 - name: tc-act-tunnel-key-attrs 1911 + name: act-tunnel-key-attrs 1912 + name-prefix: tca-tunnel-key- 1913 + header: linux/tc_act/tc_tunnel_key.h 1878 1914 attributes: 1879 1915 - 1880 1916 name: tm ··· 1926 1958 name: no-frag 1927 1959 type: flag 1928 1960 - 1929 - name: tc-act-vlan-attrs 1961 + name: act-vlan-attrs 1962 + name-prefix: tca-vlan- 1963 + header: linux/tc_act/tc_vlan.h 1930 1964 attributes: 1931 1965 - 1932 1966 name: tm ··· 1957 1987 name: push-eth-src 1958 1988 type: binary 1959 1989 - 1960 - name: tc-basic-attrs 1990 + name: basic-attrs 1991 + name-prefix: tca-basic- 1961 1992 attributes: 1962 1993 - 1963 1994 name: classid ··· 1966 1995 - 1967 1996 name: ematches 1968 1997 type: nest 1969 - nested-attributes: tc-ematch-attrs 1998 + nested-attributes: ematch-attrs 1970 1999 - 1971 2000 name: act 1972 2001 type: indexed-array 1973 2002 sub-type: nest 1974 - nested-attributes: tc-act-attrs 2003 + nested-attributes: act-attrs 1975 2004 - 1976 2005 name: police 1977 2006 type: nest 1978 - nested-attributes: tc-police-attrs 2007 + nested-attributes: police-attrs 1979 2008 - 1980 2009 name: pcnt 1981 2010 type: binary ··· 1984 2013 name: pad 1985 2014 type: pad 1986 2015 - 1987 - name: tc-bpf-attrs 2016 + name: bpf-attrs 2017 + name-prefix: tca-bpf- 1988 2018 attributes: 1989 2019 - 1990 2020 name: act 1991 2021 type: indexed-array 1992 2022 sub-type: nest 1993 - nested-attributes: tc-act-attrs 2023 + nested-attributes: act-attrs 1994 2024 - 1995 2025 name: police 1996 2026 type: nest 1997 - nested-attributes: tc-police-attrs 2027 + nested-attributes: police-attrs 1998 2028 - 1999 2029 name: classid 2000 2030 type: u32 ··· 2024 2052 name: id 2025 2053 type: u32 2026 2054 - 2027 - name: tc-cake-attrs 2055 + name: cake-attrs 2056 + name-prefix: tca-cake- 2028 2057 attributes: 2029 2058 - 2030 2059 name: pad ··· 2082 2109 name: fwmark 2083 2110 type: u32 2084 2111 - 2085 - name: tc-cake-stats-attrs 2112 + name: cake-stats-attrs 2113 + name-prefix: tca-cake-stats- 2086 2114 attributes: 2087 2115 - 2088 2116 name: pad ··· 2116 2142 name: tin-stats 2117 2143 type: indexed-array 2118 2144 sub-type: nest 2119 - nested-attributes: tc-cake-tin-stats-attrs 2145 + nested-attributes: cake-tin-stats-attrs 2120 2146 - 2121 2147 name: deficit 2122 2148 type: s32 ··· 2136 2162 name: blue-timer-us 2137 2163 type: s32 2138 2164 - 2139 - name: tc-cake-tin-stats-attrs 2165 + name: cake-tin-stats-attrs 2166 + name-prefix: tca-cake-tin-stats- 2140 2167 attributes: 2141 2168 - 2142 2169 name: pad ··· 2215 2240 name: flow-quantum 2216 2241 type: u32 2217 2242 - 2218 - name: tc-cbs-attrs 2243 + name: cbs-attrs 2244 + name-prefix: tca-cbs- 2219 2245 attributes: 2220 2246 - 2221 2247 name: parms 2222 2248 type: binary 2223 2249 struct: tc-cbs-qopt 2224 2250 - 2225 - name: tc-cgroup-attrs 2251 + name: cgroup-attrs 2252 + name-prefix: tca-cgroup- 2226 2253 attributes: 2227 2254 - 2228 2255 name: act 2229 2256 type: indexed-array 2230 2257 sub-type: nest 2231 - nested-attributes: tc-act-attrs 2258 + nested-attributes: act-attrs 2232 2259 - 2233 2260 name: police 2234 2261 type: nest 2235 - nested-attributes: tc-police-attrs 2262 + nested-attributes: police-attrs 2236 2263 - 2237 2264 name: ematches 2238 2265 type: binary 2239 2266 - 2240 - name: tc-choke-attrs 2267 + name: choke-attrs 2268 + name-prefix: tca-choke- 2241 2269 attributes: 2242 2270 - 2243 2271 name: parms ··· 2256 2278 name: max-p 2257 2279 type: u32 2258 2280 - 2259 - name: tc-codel-attrs 2281 + name: codel-attrs 2282 + name-prefix: tca-codel- 2260 2283 attributes: 2261 2284 - 2262 2285 name: target ··· 2275 2296 name: ce-threshold 2276 2297 type: u32 2277 2298 - 2278 - name: tc-drr-attrs 2299 + name: drr-attrs 2300 + name-prefix: tca-drr- 2279 2301 attributes: 2280 2302 - 2281 2303 name: quantum 2282 2304 type: u32 2283 2305 - 2284 - name: tc-ematch-attrs 2306 + name: ematch-attrs 2307 + name-prefix: tca-ematch- 2308 + attr-max-name: tca-ematch-tree-max 2285 2309 attributes: 2286 2310 - 2287 2311 name: tree-hdr ··· 2294 2312 name: tree-list 2295 2313 type: binary 2296 2314 - 2297 - name: tc-flow-attrs 2315 + name: flow-attrs 2316 + name-prefix: tca-flow- 2298 2317 attributes: 2299 2318 - 2300 2319 name: keys ··· 2327 2344 - 2328 2345 name: police 2329 2346 type: nest 2330 - nested-attributes: tc-police-attrs 2347 + nested-attributes: police-attrs 2331 2348 - 2332 2349 name: ematches 2333 2350 type: binary ··· 2335 2352 name: perturb 2336 2353 type: u32 2337 2354 - 2338 - name: tc-flower-attrs 2355 + name: flower-attrs 2356 + name-prefix: tca-flower- 2339 2357 attributes: 2340 2358 - 2341 2359 name: classid ··· 2348 2364 name: act 2349 2365 type: indexed-array 2350 2366 sub-type: nest 2351 - nested-attributes: tc-act-attrs 2367 + nested-attributes: act-attrs 2352 2368 - 2353 2369 name: key-eth-dst 2354 2370 type: binary ··· 2427 2443 - 2428 2444 name: flags 2429 2445 type: u32 2430 - enum: tc-cls-flags 2446 + enum: cls-flags 2431 2447 enum-as-flags: true 2432 2448 - 2433 2449 name: key-vlan-id ··· 2532 2548 name: key-flags 2533 2549 type: u32 2534 2550 byte-order: big-endian 2535 - enum: tc-flower-key-ctrl-flags 2551 + enum: flower-key-ctrl-flags 2536 2552 enum-as-flags: true 2537 2553 - 2538 2554 name: key-flags-mask 2539 2555 type: u32 2540 2556 byte-order: big-endian 2541 - enum: tc-flower-key-ctrl-flags 2557 + enum: flower-key-ctrl-flags 2542 2558 enum-as-flags: true 2543 2559 - 2544 2560 name: key-icmpv4-code ··· 2661 2677 - 2662 2678 name: key-enc-opts 2663 2679 type: nest 2664 - nested-attributes: tc-flower-key-enc-opts-attrs 2680 + nested-attributes: flower-key-enc-opts-attrs 2665 2681 - 2666 2682 name: key-enc-opts-mask 2667 2683 type: nest 2668 - nested-attributes: tc-flower-key-enc-opts-attrs 2684 + nested-attributes: flower-key-enc-opts-attrs 2669 2685 - 2670 2686 name: in-hw-count 2671 2687 type: u32 ··· 2712 2728 - 2713 2729 name: key-mpls-opts 2714 2730 type: nest 2715 - nested-attributes: tc-flower-key-mpls-opt-attrs 2731 + nested-attributes: flower-key-mpls-opt-attrs 2716 2732 - 2717 2733 name: key-hash 2718 2734 type: u32 ··· 2740 2756 - 2741 2757 name: key-cfm 2742 2758 type: nest 2743 - nested-attributes: tc-flower-key-cfm-attrs 2759 + nested-attributes: flower-key-cfm-attrs 2744 2760 - 2745 2761 name: key-spi 2746 2762 type: u32 ··· 2753 2769 name: key-enc-flags 2754 2770 type: u32 2755 2771 byte-order: big-endian 2756 - enum: tc-flower-key-ctrl-flags 2772 + enum: flower-key-ctrl-flags 2757 2773 enum-as-flags: true 2758 2774 - 2759 2775 name: key-enc-flags-mask 2760 2776 type: u32 2761 2777 byte-order: big-endian 2762 - enum: tc-flower-key-ctrl-flags 2778 + enum: flower-key-ctrl-flags 2763 2779 enum-as-flags: true 2764 2780 - 2765 - name: tc-flower-key-enc-opts-attrs 2781 + name: flower-key-enc-opts-attrs 2782 + name-prefix: tca-flower-key-enc-opts- 2766 2783 attributes: 2767 2784 - 2768 2785 name: geneve 2769 2786 type: nest 2770 - nested-attributes: tc-flower-key-enc-opt-geneve-attrs 2787 + nested-attributes: flower-key-enc-opt-geneve-attrs 2771 2788 - 2772 2789 name: vxlan 2773 2790 type: nest 2774 - nested-attributes: tc-flower-key-enc-opt-vxlan-attrs 2791 + nested-attributes: flower-key-enc-opt-vxlan-attrs 2775 2792 - 2776 2793 name: erspan 2777 2794 type: nest 2778 - nested-attributes: tc-flower-key-enc-opt-erspan-attrs 2795 + nested-attributes: flower-key-enc-opt-erspan-attrs 2779 2796 - 2780 2797 name: gtp 2781 2798 type: nest 2782 - nested-attributes: tc-flower-key-enc-opt-gtp-attrs 2799 + nested-attributes: flower-key-enc-opt-gtp-attrs 2783 2800 - 2784 - name: tc-flower-key-enc-opt-geneve-attrs 2801 + name: flower-key-enc-opt-geneve-attrs 2802 + name-prefix: tca-flower-key-enc-opt-geneve- 2785 2803 attributes: 2786 2804 - 2787 2805 name: class ··· 2795 2809 name: data 2796 2810 type: binary 2797 2811 - 2798 - name: tc-flower-key-enc-opt-vxlan-attrs 2812 + name: flower-key-enc-opt-vxlan-attrs 2813 + name-prefix: tca-flower-key-enc-opt-vxlan- 2799 2814 attributes: 2800 2815 - 2801 2816 name: gbp 2802 2817 type: u32 2803 2818 - 2804 - name: tc-flower-key-enc-opt-erspan-attrs 2819 + name: flower-key-enc-opt-erspan-attrs 2820 + name-prefix: tca-flower-key-enc-opt-erspan- 2805 2821 attributes: 2806 2822 - 2807 2823 name: ver ··· 2818 2830 name: hwid 2819 2831 type: u8 2820 2832 - 2821 - name: tc-flower-key-enc-opt-gtp-attrs 2833 + name: flower-key-enc-opt-gtp-attrs 2834 + name-prefix: tca-flower-key-enc-opt-gtp- 2822 2835 attributes: 2823 2836 - 2824 2837 name: pdu-type ··· 2828 2839 name: qfi 2829 2840 type: u8 2830 2841 - 2831 - name: tc-flower-key-mpls-opt-attrs 2842 + name: flower-key-mpls-opt-attrs 2843 + name-prefix: tca-flower-key-mpls-opt- 2844 + attr-max-name: tca-flower-key-mpls-opt-lse-max 2832 2845 attributes: 2833 2846 - 2834 2847 name: lse-depth ··· 2848 2857 name: lse-label 2849 2858 type: u32 2850 2859 - 2851 - name: tc-flower-key-cfm-attrs 2860 + name: flower-key-cfm-attrs 2861 + name-prefix: tca-flower-key-cfm- 2852 2862 attributes: 2853 2863 - 2854 2864 name: md-level ··· 2858 2866 name: opcode 2859 2867 type: u8 2860 2868 - 2861 - name: tc-fw-attrs 2869 + name: fw-attrs 2870 + name-prefix: tca-fw- 2862 2871 attributes: 2863 2872 - 2864 2873 name: classid ··· 2867 2874 - 2868 2875 name: police 2869 2876 type: nest 2870 - nested-attributes: tc-police-attrs 2877 + nested-attributes: police-attrs 2871 2878 - 2872 2879 name: indev 2873 2880 type: string ··· 2875 2882 name: act 2876 2883 type: indexed-array 2877 2884 sub-type: nest 2878 - nested-attributes: tc-act-attrs 2885 + nested-attributes: act-attrs 2879 2886 - 2880 2887 name: mask 2881 2888 type: u32 2882 2889 - 2883 - name: tc-gred-attrs 2890 + name: gred-attrs 2891 + name-prefix: tca-gred- 2884 2892 attributes: 2885 2893 - 2886 2894 name: parms ··· 2907 2913 nested-attributes: tca-gred-vq-list-attrs 2908 2914 - 2909 2915 name: tca-gred-vq-list-attrs 2916 + name-prefix: tca-gred-vq- 2910 2917 attributes: 2911 2918 - 2912 2919 name: entry ··· 2916 2921 multi-attr: true 2917 2922 - 2918 2923 name: tca-gred-vq-entry-attrs 2924 + name-prefix: tca-gred-vq- 2919 2925 attributes: 2920 2926 - 2921 2927 name: pad ··· 2955 2959 name: flags 2956 2960 type: u32 2957 2961 - 2958 - name: tc-hfsc-attrs 2962 + name: hfsc-attrs 2959 2963 attributes: 2960 2964 - 2961 2965 name: rsc ··· 2967 2971 name: usc 2968 2972 type: binary 2969 2973 - 2970 - name: tc-hhf-attrs 2974 + name: hhf-attrs 2975 + name-prefix: tca-hhf- 2971 2976 attributes: 2972 2977 - 2973 2978 name: backlog-limit ··· 2992 2995 name: non-hh-weight 2993 2996 type: u32 2994 2997 - 2995 - name: tc-htb-attrs 2998 + name: htb-attrs 2999 + name-prefix: tca-htb- 2996 3000 attributes: 2997 3001 - 2998 3002 name: parms ··· 3025 3027 name: offload 3026 3028 type: flag 3027 3029 - 3028 - name: tc-matchall-attrs 3030 + name: matchall-attrs 3031 + name-prefix: tca-matchall- 3029 3032 attributes: 3030 3033 - 3031 3034 name: classid ··· 3035 3036 name: act 3036 3037 type: indexed-array 3037 3038 sub-type: nest 3038 - nested-attributes: tc-act-attrs 3039 + nested-attributes: act-attrs 3039 3040 - 3040 3041 name: flags 3041 3042 type: u32 ··· 3047 3048 name: pad 3048 3049 type: pad 3049 3050 - 3050 - name: tc-etf-attrs 3051 + name: etf-attrs 3052 + name-prefix: tca-etf- 3051 3053 attributes: 3052 3054 - 3053 3055 name: parms 3054 3056 type: binary 3055 3057 struct: tc-etf-qopt 3056 3058 - 3057 - name: tc-ets-attrs 3059 + name: ets-attrs 3060 + name-prefix: tca-ets- 3058 3061 attributes: 3059 3062 - 3060 3063 name: nbands ··· 3067 3066 - 3068 3067 name: quanta 3069 3068 type: nest 3070 - nested-attributes: tc-ets-attrs 3069 + nested-attributes: ets-attrs 3071 3070 - 3072 3071 name: quanta-band 3073 3072 type: u32 ··· 3075 3074 - 3076 3075 name: priomap 3077 3076 type: nest 3078 - nested-attributes: tc-ets-attrs 3077 + nested-attributes: ets-attrs 3079 3078 - 3080 3079 name: priomap-band 3081 3080 type: u8 3082 3081 multi-attr: true 3083 3082 - 3084 - name: tc-fq-attrs 3083 + name: fq-attrs 3084 + name-prefix: tca-fq- 3085 3085 attributes: 3086 3086 - 3087 3087 name: plimit ··· 3153 3151 sub-type: s32 3154 3152 doc: Weights for each band 3155 3153 - 3156 - name: tc-fq-codel-attrs 3154 + name: fq-codel-attrs 3155 + name-prefix: tca-fq-codel- 3157 3156 attributes: 3158 3157 - 3159 3158 name: target ··· 3190 3187 name: ce-threshold-mask 3191 3188 type: u8 3192 3189 - 3193 - name: tc-fq-pie-attrs 3190 + name: fq-pie-attrs 3191 + name-prefix: tca-fq-pie- 3194 3192 attributes: 3195 3193 - 3196 3194 name: limit ··· 3230 3226 name: dq-rate-estimator 3231 3227 type: u32 3232 3228 - 3233 - name: tc-netem-attrs 3229 + name: netem-attrs 3230 + name-prefix: tca-netem- 3234 3231 attributes: 3235 3232 - 3236 3233 name: corr ··· 3252 3247 - 3253 3248 name: loss 3254 3249 type: nest 3255 - nested-attributes: tc-netem-loss-attrs 3250 + nested-attributes: netem-loss-attrs 3256 3251 - 3257 3252 name: rate 3258 3253 type: binary ··· 3284 3279 name: prng-seed 3285 3280 type: u64 3286 3281 - 3287 - name: tc-netem-loss-attrs 3282 + name: netem-loss-attrs 3283 + name-prefix: netem-loss- 3288 3284 attributes: 3289 3285 - 3290 3286 name: gi ··· 3298 3292 doc: Gilbert Elliot models 3299 3293 struct: tc-netem-gemodel 3300 3294 - 3301 - name: tc-pie-attrs 3295 + name: pie-attrs 3296 + name-prefix: tca-pie- 3302 3297 attributes: 3303 3298 - 3304 3299 name: target ··· 3326 3319 name: dq-rate-estimator 3327 3320 type: u32 3328 3321 - 3329 - name: tc-police-attrs 3322 + name: police-attrs 3323 + name-prefix: tca-police- 3330 3324 attributes: 3331 3325 - 3332 3326 name: tbf ··· 3335 3327 struct: tc-police 3336 3328 - 3337 3329 name: rate 3338 - type: binary 3330 + type: binary # TODO 3339 3331 - 3340 3332 name: peakrate 3341 - type: binary 3333 + type: binary # TODO 3342 3334 - 3343 3335 name: avrate 3344 3336 type: u32 ··· 3365 3357 name: pktburst64 3366 3358 type: u64 3367 3359 - 3368 - name: tc-qfq-attrs 3360 + name: qfq-attrs 3361 + name-prefix: tca-qfq- 3369 3362 attributes: 3370 3363 - 3371 3364 name: weight ··· 3375 3366 name: lmax 3376 3367 type: u32 3377 3368 - 3378 - name: tc-red-attrs 3369 + name: red-attrs 3370 + name-prefix: tca-red- 3379 3371 attributes: 3380 3372 - 3381 3373 name: parms ··· 3398 3388 name: mark-block 3399 3389 type: u32 3400 3390 - 3401 - name: tc-route-attrs 3391 + name: route-attrs 3392 + name-prefix: tca-route4- 3402 3393 attributes: 3403 3394 - 3404 3395 name: classid ··· 3416 3405 - 3417 3406 name: police 3418 3407 type: nest 3419 - nested-attributes: tc-police-attrs 3408 + nested-attributes: police-attrs 3420 3409 - 3421 3410 name: act 3422 3411 type: indexed-array 3423 3412 sub-type: nest 3424 - nested-attributes: tc-act-attrs 3413 + nested-attributes: act-attrs 3425 3414 - 3426 - name: tc-taprio-attrs 3415 + name: taprio-attrs 3416 + name-prefix: tca-taprio-attr- 3427 3417 attributes: 3428 3418 - 3429 3419 name: priomap ··· 3433 3421 - 3434 3422 name: sched-entry-list 3435 3423 type: nest 3436 - nested-attributes: tc-taprio-sched-entry-list 3424 + nested-attributes: taprio-sched-entry-list 3437 3425 - 3438 3426 name: sched-base-time 3439 3427 type: s64 3440 3428 - 3441 3429 name: sched-single-entry 3442 3430 type: nest 3443 - nested-attributes: tc-taprio-sched-entry 3431 + nested-attributes: taprio-sched-entry 3444 3432 - 3445 3433 name: sched-clockid 3446 3434 type: s32 ··· 3465 3453 - 3466 3454 name: tc-entry 3467 3455 type: nest 3468 - nested-attributes: tc-taprio-tc-entry-attrs 3456 + nested-attributes: taprio-tc-entry-attrs 3469 3457 - 3470 - name: tc-taprio-sched-entry-list 3458 + name: taprio-sched-entry-list 3459 + name-prefix: tca-taprio-sched- 3471 3460 attributes: 3472 3461 - 3473 3462 name: entry 3474 3463 type: nest 3475 - nested-attributes: tc-taprio-sched-entry 3464 + nested-attributes: taprio-sched-entry 3476 3465 multi-attr: true 3477 3466 - 3478 - name: tc-taprio-sched-entry 3467 + name: taprio-sched-entry 3468 + name-prefix: tca-taprio-sched-entry- 3479 3469 attributes: 3480 3470 - 3481 3471 name: index ··· 3492 3478 name: interval 3493 3479 type: u32 3494 3480 - 3495 - name: tc-taprio-tc-entry-attrs 3481 + name: taprio-tc-entry-attrs 3482 + name-prefix: tca-taprio-tc-entry- 3496 3483 attributes: 3497 3484 - 3498 3485 name: index ··· 3505 3490 name: fp 3506 3491 type: u32 3507 3492 - 3508 - name: tc-tbf-attrs 3493 + name: tbf-attrs 3494 + name-prefix: tca-tbf- 3509 3495 attributes: 3510 3496 - 3511 3497 name: parms ··· 3534 3518 name: pad 3535 3519 type: pad 3536 3520 - 3537 - name: tc-act-sample-attrs 3521 + name: act-sample-attrs 3522 + name-prefix: tca-sample- 3523 + header: linux/tc_act/tc_sample.h 3538 3524 attributes: 3539 3525 - 3540 3526 name: tm ··· 3545 3527 - 3546 3528 name: parms 3547 3529 type: binary 3548 - struct: tc-gen 3530 + struct: tc-gact 3549 3531 - 3550 3532 name: rate 3551 3533 type: u32 ··· 3559 3541 name: pad 3560 3542 type: pad 3561 3543 - 3562 - name: tc-act-gact-attrs 3544 + name: act-gact-attrs 3545 + name-prefix: tca-gact- 3546 + header: linux/tc_act/tc_gact.h 3563 3547 attributes: 3564 3548 - 3565 3549 name: tm ··· 3570 3550 - 3571 3551 name: parms 3572 3552 type: binary 3573 - struct: tc-gen 3553 + struct: tc-gact 3574 3554 - 3575 3555 name: prob 3576 3556 type: binary ··· 3580 3560 type: pad 3581 3561 - 3582 3562 name: tca-stab-attrs 3563 + name-prefix: tca-stab- 3583 3564 attributes: 3584 3565 - 3585 3566 name: base ··· 3591 3570 type: binary 3592 3571 - 3593 3572 name: tca-stats-attrs 3573 + name-prefix: tca-stats- 3574 + header: linux/gen_stats.h 3594 3575 attributes: 3595 3576 - 3596 3577 name: basic ··· 3626 3603 name: pkt64 3627 3604 type: u64 3628 3605 - 3629 - name: tc-u32-attrs 3606 + name: u32-attrs 3607 + name-prefix: tca-u32- 3630 3608 attributes: 3631 3609 - 3632 3610 name: classid ··· 3648 3624 - 3649 3625 name: police 3650 3626 type: nest 3651 - nested-attributes: tc-police-attrs 3627 + nested-attributes: police-attrs 3652 3628 - 3653 3629 name: act 3654 3630 type: indexed-array 3655 3631 sub-type: nest 3656 - nested-attributes: tc-act-attrs 3632 + nested-attributes: act-attrs 3657 3633 - 3658 3634 name: indev 3659 3635 type: string ··· 3674 3650 3675 3651 sub-messages: 3676 3652 - 3677 - name: tc-options-msg 3653 + name: options-msg 3678 3654 formats: 3679 3655 - 3680 3656 value: basic 3681 - attribute-set: tc-basic-attrs 3657 + attribute-set: basic-attrs 3682 3658 - 3683 3659 value: bpf 3684 - attribute-set: tc-bpf-attrs 3660 + attribute-set: bpf-attrs 3685 3661 - 3686 3662 value: bfifo 3687 3663 fixed-header: tc-fifo-qopt 3688 3664 - 3689 3665 value: cake 3690 - attribute-set: tc-cake-attrs 3666 + attribute-set: cake-attrs 3691 3667 - 3692 3668 value: cbs 3693 - attribute-set: tc-cbs-attrs 3669 + attribute-set: cbs-attrs 3694 3670 - 3695 3671 value: cgroup 3696 - attribute-set: tc-cgroup-attrs 3672 + attribute-set: cgroup-attrs 3697 3673 - 3698 3674 value: choke 3699 - attribute-set: tc-choke-attrs 3675 + attribute-set: choke-attrs 3700 3676 - 3701 3677 value: clsact # no content 3702 3678 - 3703 3679 value: codel 3704 - attribute-set: tc-codel-attrs 3680 + attribute-set: codel-attrs 3705 3681 - 3706 3682 value: drr 3707 - attribute-set: tc-drr-attrs 3683 + attribute-set: drr-attrs 3708 3684 - 3709 3685 value: etf 3710 - attribute-set: tc-etf-attrs 3686 + attribute-set: etf-attrs 3711 3687 - 3712 3688 value: ets 3713 - attribute-set: tc-ets-attrs 3689 + attribute-set: ets-attrs 3714 3690 - 3715 3691 value: flow 3716 - attribute-set: tc-flow-attrs 3692 + attribute-set: flow-attrs 3717 3693 - 3718 3694 value: flower 3719 - attribute-set: tc-flower-attrs 3695 + attribute-set: flower-attrs 3720 3696 - 3721 3697 value: fq 3722 - attribute-set: tc-fq-attrs 3698 + attribute-set: fq-attrs 3723 3699 - 3724 3700 value: fq_codel 3725 - attribute-set: tc-fq-codel-attrs 3701 + attribute-set: fq-codel-attrs 3726 3702 - 3727 3703 value: fq_pie 3728 - attribute-set: tc-fq-pie-attrs 3704 + attribute-set: fq-pie-attrs 3729 3705 - 3730 3706 value: fw 3731 - attribute-set: tc-fw-attrs 3707 + attribute-set: fw-attrs 3732 3708 - 3733 3709 value: gred 3734 - attribute-set: tc-gred-attrs 3710 + attribute-set: gred-attrs 3735 3711 - 3736 3712 value: hfsc 3737 3713 fixed-header: tc-hfsc-qopt 3738 3714 - 3739 3715 value: hhf 3740 - attribute-set: tc-hhf-attrs 3716 + attribute-set: hhf-attrs 3741 3717 - 3742 3718 value: htb 3743 - attribute-set: tc-htb-attrs 3719 + attribute-set: htb-attrs 3744 3720 - 3745 3721 value: ingress # no content 3746 3722 - 3747 3723 value: matchall 3748 - attribute-set: tc-matchall-attrs 3724 + attribute-set: matchall-attrs 3749 3725 - 3750 3726 value: mq # no content 3751 3727 - ··· 3757 3733 - 3758 3734 value: netem 3759 3735 fixed-header: tc-netem-qopt 3760 - attribute-set: tc-netem-attrs 3736 + attribute-set: netem-attrs 3761 3737 - 3762 3738 value: pfifo 3763 3739 fixed-header: tc-fifo-qopt ··· 3769 3745 fixed-header: tc-fifo-qopt 3770 3746 - 3771 3747 value: pie 3772 - attribute-set: tc-pie-attrs 3748 + attribute-set: pie-attrs 3773 3749 - 3774 3750 value: plug 3775 3751 fixed-header: tc-plug-qopt ··· 3778 3754 fixed-header: tc-prio-qopt 3779 3755 - 3780 3756 value: qfq 3781 - attribute-set: tc-qfq-attrs 3757 + attribute-set: qfq-attrs 3782 3758 - 3783 3759 value: red 3784 - attribute-set: tc-red-attrs 3760 + attribute-set: red-attrs 3785 3761 - 3786 3762 value: route 3787 - attribute-set: tc-route-attrs 3763 + attribute-set: route-attrs 3788 3764 - 3789 3765 value: sfb 3790 3766 fixed-header: tc-sfb-qopt ··· 3793 3769 fixed-header: tc-sfq-qopt-v1 3794 3770 - 3795 3771 value: taprio 3796 - attribute-set: tc-taprio-attrs 3772 + attribute-set: taprio-attrs 3797 3773 - 3798 3774 value: tbf 3799 - attribute-set: tc-tbf-attrs 3775 + attribute-set: tbf-attrs 3800 3776 - 3801 3777 value: u32 3802 - attribute-set: tc-u32-attrs 3778 + attribute-set: u32-attrs 3803 3779 - 3804 - name: tc-act-options-msg 3780 + name: act-options-msg 3805 3781 formats: 3806 3782 - 3807 3783 value: bpf 3808 - attribute-set: tc-act-bpf-attrs 3784 + attribute-set: act-bpf-attrs 3809 3785 - 3810 3786 value: connmark 3811 - attribute-set: tc-act-connmark-attrs 3787 + attribute-set: act-connmark-attrs 3812 3788 - 3813 3789 value: csum 3814 - attribute-set: tc-act-csum-attrs 3790 + attribute-set: act-csum-attrs 3815 3791 - 3816 3792 value: ct 3817 - attribute-set: tc-act-ct-attrs 3793 + attribute-set: act-ct-attrs 3818 3794 - 3819 3795 value: ctinfo 3820 - attribute-set: tc-act-ctinfo-attrs 3796 + attribute-set: act-ctinfo-attrs 3821 3797 - 3822 3798 value: gact 3823 - attribute-set: tc-act-gact-attrs 3799 + attribute-set: act-gact-attrs 3824 3800 - 3825 3801 value: gate 3826 - attribute-set: tc-act-gate-attrs 3802 + attribute-set: act-gate-attrs 3827 3803 - 3828 3804 value: ife 3829 - attribute-set: tc-act-ife-attrs 3805 + attribute-set: act-ife-attrs 3830 3806 - 3831 3807 value: mirred 3832 - attribute-set: tc-act-mirred-attrs 3808 + attribute-set: act-mirred-attrs 3833 3809 - 3834 3810 value: mpls 3835 - attribute-set: tc-act-mpls-attrs 3811 + attribute-set: act-mpls-attrs 3836 3812 - 3837 3813 value: nat 3838 - attribute-set: tc-act-nat-attrs 3814 + attribute-set: act-nat-attrs 3839 3815 - 3840 3816 value: pedit 3841 - attribute-set: tc-act-pedit-attrs 3817 + attribute-set: act-pedit-attrs 3842 3818 - 3843 3819 value: police 3844 - attribute-set: tc-act-police-attrs 3820 + attribute-set: police-attrs 3845 3821 - 3846 3822 value: sample 3847 - attribute-set: tc-act-sample-attrs 3823 + attribute-set: act-sample-attrs 3848 3824 - 3849 3825 value: simple 3850 - attribute-set: tc-act-simple-attrs 3826 + attribute-set: act-simple-attrs 3851 3827 - 3852 3828 value: skbedit 3853 - attribute-set: tc-act-skbedit-attrs 3829 + attribute-set: act-skbedit-attrs 3854 3830 - 3855 3831 value: skbmod 3856 - attribute-set: tc-act-skbmod-attrs 3832 + attribute-set: act-skbmod-attrs 3857 3833 - 3858 3834 value: tunnel_key 3859 - attribute-set: tc-act-tunnel-key-attrs 3835 + attribute-set: act-tunnel-key-attrs 3860 3836 - 3861 3837 value: vlan 3862 - attribute-set: tc-act-vlan-attrs 3838 + attribute-set: act-vlan-attrs 3863 3839 - 3864 3840 name: tca-stats-app-msg 3865 3841 formats: 3866 3842 - 3867 3843 value: cake 3868 - attribute-set: tc-cake-stats-attrs 3844 + attribute-set: cake-stats-attrs 3869 3845 - 3870 3846 value: choke 3871 3847 fixed-header: tc-choke-xstats ··· 3899 3875 3900 3876 operations: 3901 3877 enum-model: directional 3878 + name-prefix: rtm- 3902 3879 list: 3903 3880 - 3904 3881 name: newqdisc 3905 3882 doc: Create new tc qdisc. 3906 - attribute-set: tc-attrs 3883 + attribute-set: attrs 3907 3884 fixed-header: tcmsg 3908 3885 do: 3909 3886 request: ··· 3919 3894 - 3920 3895 name: delqdisc 3921 3896 doc: Delete existing tc qdisc. 3922 - attribute-set: tc-attrs 3897 + attribute-set: attrs 3923 3898 fixed-header: tcmsg 3924 3899 do: 3925 3900 request: ··· 3927 3902 - 3928 3903 name: getqdisc 3929 3904 doc: Get / dump tc qdisc information. 3930 - attribute-set: tc-attrs 3905 + attribute-set: attrs 3931 3906 fixed-header: tcmsg 3932 - do: 3907 + do: &getqdisc-do 3933 3908 request: 3934 3909 value: 38 3935 3910 attributes: ··· 3948 3923 - chain 3949 3924 - ingress-block 3950 3925 - egress-block 3926 + dump: *getqdisc-do 3951 3927 - 3952 3928 name: newtclass 3953 3929 doc: Get / dump tc traffic class information. 3954 - attribute-set: tc-attrs 3930 + attribute-set: attrs 3955 3931 fixed-header: tcmsg 3956 3932 do: 3957 3933 request: ··· 3961 3935 - 3962 3936 name: deltclass 3963 3937 doc: Get / dump tc traffic class information. 3964 - attribute-set: tc-attrs 3938 + attribute-set: attrs 3965 3939 fixed-header: tcmsg 3966 3940 do: 3967 3941 request: ··· 3969 3943 - 3970 3944 name: gettclass 3971 3945 doc: Get / dump tc traffic class information. 3972 - attribute-set: tc-attrs 3946 + attribute-set: attrs 3973 3947 fixed-header: tcmsg 3974 3948 do: 3975 3949 request: ··· 3980 3954 - 3981 3955 name: newtfilter 3982 3956 doc: Get / dump tc filter information. 3983 - attribute-set: tc-attrs 3957 + attribute-set: attrs 3984 3958 fixed-header: tcmsg 3985 3959 do: 3986 3960 request: ··· 3989 3963 - 3990 3964 name: deltfilter 3991 3965 doc: Get / dump tc filter information. 3992 - attribute-set: tc-attrs 3966 + attribute-set: attrs 3993 3967 fixed-header: tcmsg 3994 3968 do: 3995 3969 request: ··· 4000 3974 - 4001 3975 name: gettfilter 4002 3976 doc: Get / dump tc filter information. 4003 - attribute-set: tc-attrs 3977 + attribute-set: attrs 4004 3978 fixed-header: tcmsg 4005 3979 do: 4006 3980 request: ··· 4023 3997 - 4024 3998 name: newchain 4025 3999 doc: Get / dump tc chain information. 4026 - attribute-set: tc-attrs 4000 + attribute-set: attrs 4027 4001 fixed-header: tcmsg 4028 4002 do: 4029 4003 request: ··· 4032 4006 - 4033 4007 name: delchain 4034 4008 doc: Get / dump tc chain information. 4035 - attribute-set: tc-attrs 4009 + attribute-set: attrs 4036 4010 fixed-header: tcmsg 4037 4011 do: 4038 4012 request: ··· 4042 4016 - 4043 4017 name: getchain 4044 4018 doc: Get / dump tc chain information. 4045 - attribute-set: tc-attrs 4019 + attribute-set: attrs 4046 4020 fixed-header: tcmsg 4047 4021 do: 4048 4022 request:
+2 -2
include/uapi/linux/neighbour.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 2 - #ifndef __LINUX_NEIGHBOUR_H 3 - #define __LINUX_NEIGHBOUR_H 2 + #ifndef _UAPI__LINUX_NEIGHBOUR_H 3 + #define _UAPI__LINUX_NEIGHBOUR_H 4 4 5 5 #include <linux/types.h> 6 6 #include <linux/netlink.h>
+9 -1
tools/net/ynl/Makefile.deps
··· 35 35 $(call get_hdr_inc,__LINUX_IF_ADDR_H,if_addr.h) 36 36 CFLAGS_rt-link:=$(call get_hdr_inc,__LINUX_RTNETLINK_H,rtnetlink.h) \ 37 37 $(call get_hdr_inc,_LINUX_IF_LINK_H,if_link.h) 38 - CFLAGS_rt-neigh:=$(call get_hdr_inc,__LINUX_RTNETLINK_H,rtnetlink.h) 38 + CFLAGS_rt-neigh:=$(call get_hdr_inc,__LINUX_RTNETLINK_H,rtnetlink.h) \ 39 + $(call get_hdr_inc,__LINUX_NEIGHBOUR_H,neighbour.h) 39 40 CFLAGS_rt-route:=$(call get_hdr_inc,__LINUX_RTNETLINK_H,rtnetlink.h) 40 41 CFLAGS_rt-rule:=$(call get_hdr_inc,__LINUX_FIB_RULES_H,fib_rules.h) 42 + CFLAGS_tc:= $(call get_hdr_inc,__LINUX_RTNETLINK_H,rtnetlink.h) \ 43 + $(call get_hdr_inc,__LINUX_PKT_SCHED_H,pkt_sched.h) \ 44 + $(call get_hdr_inc,__LINUX_PKT_CLS_H,pkt_cls.h) \ 45 + $(call get_hdr_inc,_TC_CT_H,tc_act/tc_ct.h) \ 46 + $(call get_hdr_inc,_TC_MIRRED_H,tc_act/tc_mirred.h) \ 47 + $(call get_hdr_inc,_TC_SKBEDIT_H,tc_act/tc_skbedit.h) \ 48 + $(call get_hdr_inc,_TC_TUNNEL_KEY_H,tc_act/tc_tunnel_key.h) 41 49 CFLAGS_tcp_metrics:=$(call get_hdr_inc,_LINUX_TCP_METRICS_H,tcp_metrics.h)
+1 -1
tools/net/ynl/generated/Makefile
··· 23 23 24 24 SPECS_DIR:=../../../../Documentation/netlink/specs 25 25 SPECS_PATHS=$(wildcard $(SPECS_DIR)/*.yaml) 26 - GENS_UNSUP=conntrack nftables tc 26 + GENS_UNSUP=conntrack nftables 27 27 GENS=$(filter-out ${GENS_UNSUP},$(patsubst $(SPECS_DIR)/%.yaml,%,${SPECS_PATHS})) 28 28 SRCS=$(patsubst %,%-user.c,${GENS}) 29 29 HDRS=$(patsubst %,%-user.h,${GENS})
+6 -2
tools/net/ynl/lib/ynl-priv.h
··· 213 213 NLMSG_HDRLEN + fixed_hdr_sz); attr; \ 214 214 (attr) = ynl_attr_next(ynl_nlmsg_end_addr(nlh), attr)) 215 215 216 - #define ynl_attr_for_each_nested(attr, outer) \ 216 + #define ynl_attr_for_each_nested_off(attr, outer, offset) \ 217 217 for ((attr) = ynl_attr_first(outer, outer->nla_len, \ 218 - sizeof(struct nlattr)); attr; \ 218 + sizeof(struct nlattr) + offset); \ 219 + attr; \ 219 220 (attr) = ynl_attr_next(ynl_attr_data_end(outer), attr)) 221 + 222 + #define ynl_attr_for_each_nested(attr, outer) \ 223 + ynl_attr_for_each_nested_off(attr, outer, 0) 220 224 221 225 #define ynl_attr_for_each_payload(start, len, attr) \ 222 226 for ((attr) = ynl_attr_first(start, len, 0); attr; \
+131 -37
tools/net/ynl/pyynl/ynl_gen_c.py
··· 685 685 f"{self.enum_name}, {at}{var}->{self.c_name})") 686 686 687 687 def _attr_get(self, ri, var): 688 - get_lines = [f"if ({self.nested_render_name}_parse(&parg, attr))", 688 + pns = self.family.pure_nested_structs[self.nested_attrs] 689 + args = ["&parg", "attr"] 690 + for sel in pns.external_selectors(): 691 + args.append(f'{var}->{sel.name}') 692 + get_lines = [f"if ({self.nested_render_name}_parse({', '.join(args)}))", 689 693 "return YNL_PARSE_CB_ERROR;"] 690 694 init_lines = [f"parg.rsp_policy = &{self.nested_render_name}_nest;", 691 695 f"parg.data = &{var}->{self.c_name};"] ··· 894 890 895 891 def _attr_typol(self): 896 892 typol = f'.type = YNL_PT_NEST, .nest = &{self.nested_render_name}_nest, ' 897 - typol += f'.is_submsg = 1, .selector_type = {self.attr_set[self["selector"]].value} ' 893 + typol += '.is_submsg = 1, ' 894 + # Reverse-parsing of the policy (ynl_err_walk() in ynl.c) does not 895 + # support external selectors. No family uses sub-messages with external 896 + # selector for requests so this is fine for now. 897 + if not self.selector.is_external(): 898 + typol += f'.selector_type = {self.attr_set[self["selector"]].value} ' 898 899 return typol 899 900 900 901 def _attr_get(self, ri, var): 901 902 sel = c_lower(self['selector']) 902 - get_lines = [f'if (!{var}->{sel})', 903 + if self.selector.is_external(): 904 + sel_var = f"_sel_{sel}" 905 + else: 906 + sel_var = f"{var}->{sel}" 907 + get_lines = [f'if (!{sel_var})', 903 908 f'return ynl_submsg_failed(yarg, "%s", "%s");' % 904 909 (self.name, self['selector']), 905 - f"if ({self.nested_render_name}_parse(&parg, {var}->{sel}, attr))", 910 + f"if ({self.nested_render_name}_parse(&parg, {sel_var}, attr))", 906 911 "return YNL_PARSE_CB_ERROR;"] 907 912 init_lines = [f"parg.rsp_policy = &{self.nested_render_name}_nest;", 908 913 f"parg.data = &{var}->{self.c_name};"] ··· 927 914 self.attr.is_selector = True 928 915 self._external = False 929 916 else: 930 - raise Exception("Passing selectors from external nests not supported") 917 + # The selector will need to get passed down thru the structs 918 + self.attr = None 919 + self._external = True 920 + 921 + def set_attr(self, attr): 922 + self.attr = attr 923 + 924 + def is_external(self): 925 + return self._external 931 926 932 927 933 928 class Struct: 934 - def __init__(self, family, space_name, type_list=None, 929 + def __init__(self, family, space_name, type_list=None, fixed_header=None, 935 930 inherited=None, submsg=None): 936 931 self.family = family 937 932 self.space_name = space_name ··· 947 926 # Use list to catch comparisons with empty sets 948 927 self._inherited = inherited if inherited is not None else [] 949 928 self.inherited = [] 929 + self.fixed_header = None 930 + if fixed_header: 931 + self.fixed_header = 'struct ' + c_lower(fixed_header) 950 932 self.submsg = submsg 951 933 952 934 self.nested = type_list is None ··· 999 975 if self._inherited != new_inherited: 1000 976 raise Exception("Inheriting different members not supported") 1001 977 self.inherited = [c_lower(x) for x in sorted(self._inherited)] 978 + 979 + def external_selectors(self): 980 + sels = [] 981 + for name, attr in self.attr_list: 982 + if isinstance(attr, TypeSubMessage) and attr.selector.is_external(): 983 + sels.append(attr.selector) 984 + return sels 1002 985 1003 986 def free_needs_iter(self): 1004 987 for _, attr in self.attr_list: ··· 1253 1222 self._load_root_sets() 1254 1223 self._load_nested_sets() 1255 1224 self._load_attr_use() 1225 + self._load_selector_passing() 1256 1226 self._load_hooks() 1257 1227 1258 1228 self.kernel_policy = self.yaml.get('kernel-policy', 'split') ··· 1348 1316 nested = spec['nested-attributes'] 1349 1317 if nested not in self.root_sets: 1350 1318 if nested not in self.pure_nested_structs: 1351 - self.pure_nested_structs[nested] = Struct(self, nested, inherited=inherit) 1319 + self.pure_nested_structs[nested] = \ 1320 + Struct(self, nested, inherited=inherit, 1321 + fixed_header=spec.get('fixed-header')) 1352 1322 else: 1353 1323 raise Exception(f'Using attr set as root and nested not supported - {nested}') 1354 1324 ··· 1372 1338 1373 1339 attrs = [] 1374 1340 for name, fmt in submsg.formats.items(): 1375 - attrs.append({ 1341 + attr = { 1376 1342 "name": name, 1377 - "type": "nest", 1378 1343 "parent-sub-message": spec, 1379 - "nested-attributes": fmt['attribute-set'] 1380 - }) 1344 + } 1345 + if 'attribute-set' in fmt: 1346 + attr |= { 1347 + "type": "nest", 1348 + "nested-attributes": fmt['attribute-set'], 1349 + } 1350 + if 'fixed-header' in fmt: 1351 + attr |= { "fixed-header": fmt["fixed-header"] } 1352 + elif 'fixed-header' in fmt: 1353 + attr |= { 1354 + "type": "binary", 1355 + "struct": fmt["fixed-header"], 1356 + } 1357 + else: 1358 + attr["type"] = "flag" 1359 + attrs.append(attr) 1381 1360 1382 1361 self.attr_sets[nested] = AttrSet(self, { 1383 1362 "name": nested, ··· 1483 1436 if attr in rs_members['reply']: 1484 1437 spec.set_reply() 1485 1438 1439 + def _load_selector_passing(self): 1440 + def all_structs(): 1441 + for k, v in reversed(self.pure_nested_structs.items()): 1442 + yield k, v 1443 + for k, _ in self.root_sets.items(): 1444 + yield k, None # we don't have a struct, but it must be terminal 1445 + 1446 + for attr_set, struct in all_structs(): 1447 + for _, spec in self.attr_sets[attr_set].items(): 1448 + if 'nested-attributes' in spec: 1449 + child_name = spec['nested-attributes'] 1450 + elif 'sub-message' in spec: 1451 + child_name = spec.sub_message 1452 + else: 1453 + continue 1454 + 1455 + child = self.pure_nested_structs.get(child_name) 1456 + for selector in child.external_selectors(): 1457 + if selector.name in self.attr_sets[attr_set]: 1458 + sel_attr = self.attr_sets[attr_set][selector.name] 1459 + selector.set_attr(sel_attr) 1460 + else: 1461 + raise Exception("Passing selector thru more than one layer not supported") 1462 + 1486 1463 def _load_global_policy(self): 1487 1464 global_set = set() 1488 1465 attr_set_name = None ··· 1556 1485 self.op_mode = op_mode 1557 1486 self.op = op 1558 1487 1559 - self.fixed_hdr = None 1488 + fixed_hdr = op.fixed_header if op else None 1560 1489 self.fixed_hdr_len = 'ys->family->hdr_len' 1561 1490 if op and op.fixed_header: 1562 - self.fixed_hdr = 'struct ' + c_lower(op.fixed_header) 1563 1491 if op.fixed_header != family.fixed_header: 1564 1492 if family.is_classic(): 1565 - self.fixed_hdr_len = f"sizeof({self.fixed_hdr})" 1493 + self.fixed_hdr_len = f"sizeof(struct {c_lower(fixed_hdr)})" 1566 1494 else: 1567 1495 raise Exception(f"Per-op fixed header not supported, yet") 1568 1496 ··· 1601 1531 type_list = [] 1602 1532 if op_dir in op[op_mode]: 1603 1533 type_list = op[op_mode][op_dir]['attributes'] 1604 - self.struct[op_dir] = Struct(family, self.attr_set, type_list=type_list) 1534 + self.struct[op_dir] = Struct(family, self.attr_set, 1535 + fixed_header=fixed_hdr, 1536 + type_list=type_list) 1605 1537 if op_mode == 'event': 1606 - self.struct['reply'] = Struct(family, self.attr_set, type_list=op['event']['attributes']) 1538 + self.struct['reply'] = Struct(family, self.attr_set, 1539 + fixed_header=fixed_hdr, 1540 + type_list=op['event']['attributes']) 1607 1541 1608 1542 def type_empty(self, key): 1609 - return len(self.struct[key].attr_list) == 0 and self.fixed_hdr is None 1543 + return len(self.struct[key].attr_list) == 0 and \ 1544 + self.struct['request'].fixed_header is None 1610 1545 1611 1546 def needs_nlflags(self, direction): 1612 1547 return self.op_mode == 'do' and direction == 'request' and self.family.is_classic() ··· 1934 1859 1935 1860 i = 0 1936 1861 for name, arg in struct.member_list(): 1937 - cw.p('[%d] = { .type = YNL_PT_SUBMSG, .name = "%s", .nest = &%s_nest, },' % 1938 - (i, name, arg.nested_render_name)) 1862 + nest = "" 1863 + if arg.type == 'nest': 1864 + nest = f" .nest = &{arg.nested_render_name}_nest," 1865 + cw.p('[%d] = { .type = YNL_PT_SUBMSG, .name = "%s",%s },' % 1866 + (i, name, nest)) 1939 1867 i += 1 1940 1868 1941 1869 cw.block_end(line=';') ··· 2048 1970 if struct.submsg is None: 2049 1971 local_vars.append('struct nlattr *nest;') 2050 1972 init_lines.append("nest = ynl_attr_nest_start(nlh, attr_type);") 1973 + if struct.fixed_header: 1974 + local_vars.append('void *hdr;') 1975 + struct_sz = f'sizeof({struct.fixed_header})' 1976 + init_lines.append(f"hdr = ynl_nlmsg_put_extra_header(nlh, {struct_sz});") 1977 + init_lines.append(f"memcpy(hdr, &obj->_hdr, {struct_sz});") 2051 1978 2052 1979 has_anest = False 2053 1980 has_count = False ··· 2084 2001 2085 2002 2086 2003 def _multi_parse(ri, struct, init_lines, local_vars): 2004 + if struct.fixed_header: 2005 + local_vars += ['void *hdr;'] 2087 2006 if struct.nested: 2088 - iter_line = "ynl_attr_for_each_nested(attr, nested)" 2007 + if struct.fixed_header: 2008 + iter_line = f"ynl_attr_for_each_nested_off(attr, nested, sizeof({struct.fixed_header}))" 2009 + else: 2010 + iter_line = "ynl_attr_for_each_nested(attr, nested)" 2089 2011 else: 2090 - if ri.fixed_hdr: 2091 - local_vars += ['void *hdr;'] 2092 2012 iter_line = "ynl_attr_for_each(attr, nlh, yarg->ys->family->hdr_len)" 2093 2013 if ri.op.fixed_header != ri.family.fixed_header: 2094 2014 if ri.family.is_classic(): 2095 - iter_line = f"ynl_attr_for_each(attr, nlh, sizeof({ri.fixed_hdr}))" 2015 + iter_line = f"ynl_attr_for_each(attr, nlh, sizeof({struct.fixed_header}))" 2096 2016 else: 2097 2017 raise Exception(f"Per-op fixed header not supported, yet") 2098 2018 ··· 2137 2051 for arg in struct.inherited: 2138 2052 ri.cw.p(f'dst->{arg} = {arg};') 2139 2053 2140 - if ri.fixed_hdr: 2141 - if ri.family.is_classic(): 2054 + if struct.fixed_header: 2055 + if struct.nested: 2056 + ri.cw.p('hdr = ynl_attr_data(nested);') 2057 + elif ri.family.is_classic(): 2142 2058 ri.cw.p('hdr = ynl_nlmsg_data(nlh);') 2143 2059 else: 2144 2060 ri.cw.p('hdr = ynl_nlmsg_data_offset(nlh, sizeof(struct genlmsghdr));') 2145 - ri.cw.p(f"memcpy(&dst->_hdr, hdr, sizeof({ri.fixed_hdr}));") 2061 + ri.cw.p(f"memcpy(&dst->_hdr, hdr, sizeof({struct.fixed_header}));") 2146 2062 for anest in sorted(all_multi): 2147 2063 aspec = struct[anest] 2148 2064 ri.cw.p(f"if (dst->{aspec.c_name})") ··· 2240 2152 parse_rsp_nested_prototype(ri, struct, suffix='') 2241 2153 2242 2154 var = 'dst' 2155 + local_vars = {'const struct nlattr *attr = nested;', 2156 + f'{struct.ptr_name}{var} = yarg->data;', 2157 + 'struct ynl_parse_arg parg;'} 2158 + 2159 + for _, arg in struct.member_list(): 2160 + _, _, l_vars = arg._attr_get(ri, var) 2161 + local_vars |= set(l_vars) if l_vars else set() 2243 2162 2244 2163 ri.cw.block_start() 2245 - ri.cw.write_func_lvar(['const struct nlattr *attr = nested;', 2246 - f'{struct.ptr_name}{var} = yarg->data;', 2247 - 'struct ynl_parse_arg parg;']) 2248 - 2164 + ri.cw.write_func_lvar(list(local_vars)) 2249 2165 ri.cw.p('parg.ys = yarg->ys;') 2250 2166 ri.cw.nl() 2251 2167 ··· 2260 2168 2261 2169 ri.cw.block_start(line=f'{kw} (!strcmp(sel, "{name}"))') 2262 2170 get_lines, init_lines, _ = arg._attr_get(ri, var) 2263 - for line in init_lines: 2171 + for line in init_lines or []: 2264 2172 ri.cw.p(line) 2265 2173 for line in get_lines: 2266 2174 ri.cw.p(line) ··· 2275 2183 def parse_rsp_nested_prototype(ri, struct, suffix=';'): 2276 2184 func_args = ['struct ynl_parse_arg *yarg', 2277 2185 'const struct nlattr *nested'] 2186 + for sel in struct.external_selectors(): 2187 + func_args.append('const char *_sel_' + sel.name) 2278 2188 if struct.submsg: 2279 2189 func_args.insert(1, 'const char *sel') 2280 2190 for arg in struct.inherited: ··· 2342 2248 ret_err = 'NULL' 2343 2249 local_vars += [f'{type_name(ri, rdir(direction))} *rsp;'] 2344 2250 2345 - if ri.fixed_hdr: 2251 + if ri.struct["request"].fixed_header: 2346 2252 local_vars += ['size_t hdr_len;', 2347 2253 'void *hdr;'] 2348 2254 ··· 2366 2272 ri.cw.p(f"yrs.yarg.rsp_policy = &{ri.struct['reply'].render_name}_nest;") 2367 2273 ri.cw.nl() 2368 2274 2369 - if ri.fixed_hdr: 2275 + if ri.struct['request'].fixed_header: 2370 2276 ri.cw.p("hdr_len = sizeof(req->_hdr);") 2371 2277 ri.cw.p("hdr = ynl_nlmsg_put_extra_header(nlh, hdr_len);") 2372 2278 ri.cw.p("memcpy(hdr, &req->_hdr, hdr_len);") ··· 2412 2318 'struct nlmsghdr *nlh;', 2413 2319 'int err;'] 2414 2320 2415 - if ri.fixed_hdr: 2321 + if ri.struct['request'].fixed_header: 2416 2322 local_vars += ['size_t hdr_len;', 2417 2323 'void *hdr;'] 2418 2324 ··· 2433 2339 else: 2434 2340 ri.cw.p(f"nlh = ynl_gemsg_start_dump(ys, {ri.nl.get_family_id()}, {ri.op.enum_name}, 1);") 2435 2341 2436 - if ri.fixed_hdr: 2342 + if ri.struct['request'].fixed_header: 2437 2343 ri.cw.p("hdr_len = sizeof(req->_hdr);") 2438 2344 ri.cw.p("hdr = ynl_nlmsg_put_extra_header(nlh, hdr_len);") 2439 2345 ri.cw.p("memcpy(hdr, &req->_hdr, hdr_len);") ··· 2510 2416 if ri.needs_nlflags(direction): 2511 2417 ri.cw.p('__u16 _nlmsg_flags;') 2512 2418 ri.cw.nl() 2513 - if ri.fixed_hdr: 2514 - ri.cw.p(ri.fixed_hdr + ' _hdr;') 2419 + if struct.fixed_header: 2420 + ri.cw.p(struct.fixed_header + ' _hdr;') 2515 2421 ri.cw.nl() 2516 2422 2517 2423 for type_filter in ['present', 'len', 'count']:
+1
tools/net/ynl/samples/.gitignore
··· 6 6 rt-addr 7 7 rt-link 8 8 rt-route 9 + tc
+80
tools/net/ynl/samples/tc.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + #include <stdio.h> 3 + #include <string.h> 4 + 5 + #include <ynl.h> 6 + 7 + #include <net/if.h> 8 + 9 + #include "tc-user.h" 10 + 11 + static void tc_qdisc_print(struct tc_getqdisc_rsp *q) 12 + { 13 + char ifname[IF_NAMESIZE]; 14 + const char *name; 15 + 16 + name = if_indextoname(q->_hdr.tcm_ifindex, ifname); 17 + if (name) 18 + printf("%16s: ", name); 19 + 20 + if (q->_len.kind) { 21 + printf("%s ", q->kind); 22 + 23 + if (q->options._present.fq_codel) { 24 + struct tc_fq_codel_attrs *fq_codel; 25 + struct tc_fq_codel_xstats *stats; 26 + 27 + fq_codel = &q->options.fq_codel; 28 + stats = q->stats2.app.fq_codel; 29 + 30 + if (fq_codel->_present.limit) 31 + printf("limit: %dp ", fq_codel->limit); 32 + if (fq_codel->_present.target) 33 + printf("target: %dms ", 34 + (fq_codel->target + 500) / 1000); 35 + if (q->stats2.app._len.fq_codel) 36 + printf("new_flow_cnt: %d ", 37 + stats->qdisc_stats.new_flow_count); 38 + } 39 + } 40 + 41 + printf("\n"); 42 + } 43 + 44 + int main(int argc, char **argv) 45 + { 46 + struct tc_getqdisc_req_dump *req; 47 + struct tc_getqdisc_list *rsp; 48 + struct ynl_error yerr; 49 + struct ynl_sock *ys; 50 + 51 + ys = ynl_sock_create(&ynl_tc_family, &yerr); 52 + if (!ys) { 53 + fprintf(stderr, "YNL: %s\n", yerr.msg); 54 + return 1; 55 + } 56 + 57 + req = tc_getqdisc_req_dump_alloc(); 58 + if (!req) 59 + goto err_destroy; 60 + 61 + rsp = tc_getqdisc_dump(ys, req); 62 + tc_getqdisc_req_dump_free(req); 63 + if (!rsp) 64 + goto err_close; 65 + 66 + if (ynl_dump_empty(rsp)) 67 + fprintf(stderr, "Error: no addresses reported\n"); 68 + ynl_dump_foreach(rsp, qdisc) 69 + tc_qdisc_print(qdisc); 70 + tc_getqdisc_list_free(rsp); 71 + 72 + ynl_sock_destroy(ys); 73 + return 0; 74 + 75 + err_close: 76 + fprintf(stderr, "YNL: %s\n", ys->err.msg); 77 + err_destroy: 78 + ynl_sock_destroy(ys); 79 + return 2; 80 + }