From patchwork Wed Dec 13 22:41:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 13491999 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="jFeMBhUp" Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F4791984; Wed, 13 Dec 2023 14:42:02 -0800 (PST) Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-40c2718a768so73409655e9.0; Wed, 13 Dec 2023 14:42:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702507319; x=1703112119; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BbhqH38QY9mINP6O9YwXefvYMAhzZwOMci15LQjG1rg=; b=jFeMBhUpIXMQlmoP9xU+y9V3zefTsvfAMBD7gCzcN/+dT8QTmiroRh6eDDVsbF7OFd tznAdywQLFpJe2F4rpk5SEeF7T2t7lbvIJsD8OqmSwiM7sEq/sEn8Nr2/uZtWe+VjLQR 89w13VXbeXfwlBilQNQsY8uRWeBc99A6URtLpHXltZ7hTD2dD6r2ASQ0OZPMD0f/T6oi adjbbvuzVVS2AT+WesLsC5Ol2tJrrFZm6lMReQ6BECTIpQtr/42Vwmil+mK1ppV1lHFY jI1P3Uosbifr3U24P4hJHUVrVO7jdQ1yZFJuJ6ggBDmRpgJC/Y3RB6m3YxDZngE3V+qL zwzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702507319; x=1703112119; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BbhqH38QY9mINP6O9YwXefvYMAhzZwOMci15LQjG1rg=; b=DC8JRm3hDvk7WGmnCHayREUZd29Ph2BtbEQwgdejt4qW7NU9TTUQSeCHmiX5B6miV2 QAYeTdP42iSWu6y+Jyhri6n53oYZfChMlpuUkiuQ/m21uvytd3iySgt78/gh65hOccTM jt9Y7kTN5hx/8a4bgSH7bVnU1TqDwmQdqZRnCOZwiOZgO6eLjng/ZqllX98856yD/Ir5 2uCbuhwVmXX1uhOb40JzbScZDvHqMi9dVJfEPZgE2N/uUAbq8lCwxMLwGSj3l1gPhflz WMQBE7QBzko5/T1qqNJjxtVQTWuPdF3Rh98D1nfstXYmVGPGhp142VfZDVCWd/RzVA1U lu4w== X-Gm-Message-State: AOJu0YzHCZMfj+Mk/WVv6I64aYLjF27ealMDtAUhfYFCH4OUVzdhHNuL lP7pS58dwmK12w0W8hDPm3BoJyZvbXmfvQ== X-Google-Smtp-Source: AGHT+IF6qv3lCeRwjzVciuUD0gtgZgqGF2O+++su3zaBSt6Wx9ZUXhBc54aE9pefbYnRgu7o5OfzwQ== X-Received: by 2002:a05:600c:4e4a:b0:40c:3555:e22c with SMTP id e10-20020a05600c4e4a00b0040c3555e22cmr5029199wmq.23.1702507318908; Wed, 13 Dec 2023 14:41:58 -0800 (PST) Received: from imac.fritz.box ([2a02:8010:60a0:0:7840:ddbd:bbf:1e8f]) by smtp.gmail.com with ESMTPSA id c12-20020a5d4f0c000000b00336442b3e80sm998562wru.78.2023.12.13.14.41.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 14:41:57 -0800 (PST) From: Donald Hunter To: netdev@vger.kernel.org, Jakub Kicinski , "David S. Miller" , Eric Dumazet , Paolo Abeni , Jonathan Corbet , linux-doc@vger.kernel.org, Jacob Keller , Breno Leitao Cc: donald.hunter@redhat.com, Donald Hunter Subject: [PATCH net-next v4 01/13] tools/net/ynl: Use consistent array index expression formatting Date: Wed, 13 Dec 2023 22:41:34 +0000 Message-ID: <20231213224146.94560-2-donald.hunter@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231213224146.94560-1-donald.hunter@gmail.com> References: <20231213224146.94560-1-donald.hunter@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Use expression formatting that conforms to the python style guide. Signed-off-by: Donald Hunter Reviewed-by: Jakub Kicinski --- tools/net/ynl/lib/ynl.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/net/ynl/lib/ynl.py b/tools/net/ynl/lib/ynl.py index 92995bca14e1..5c48f0c9713c 100644 --- a/tools/net/ynl/lib/ynl.py +++ b/tools/net/ynl/lib/ynl.py @@ -98,12 +98,12 @@ class NlAttr: } def __init__(self, raw, offset): - self._len, self._type = struct.unpack("HH", raw[offset:offset + 4]) + self._len, self._type = struct.unpack("HH", raw[offset : offset + 4]) self.type = self._type & ~Netlink.NLA_TYPE_MASK self.is_nest = self._type & Netlink.NLA_F_NESTED self.payload_len = self._len self.full_len = (self.payload_len + 3) & ~3 - self.raw = raw[offset + 4:offset + self.payload_len] + self.raw = raw[offset + 4 : offset + self.payload_len] @classmethod def get_format(cls, attr_type, byte_order=None): @@ -154,7 +154,7 @@ class NlAttr: for m in members: # TODO: handle non-scalar members if m.type == 'binary': - decoded = self.raw[offset:offset+m['len']] + decoded = self.raw[offset : offset + m['len']] offset += m['len'] elif m.type in NlAttr.type_formats: format = self.get_format(m.type, m.byte_order) @@ -193,12 +193,12 @@ class NlAttrs: class NlMsg: def __init__(self, msg, offset, attr_space=None): - self.hdr = msg[offset:offset + 16] + self.hdr = msg[offset : offset + 16] self.nl_len, self.nl_type, self.nl_flags, self.nl_seq, self.nl_portid = \ struct.unpack("IHHII", self.hdr) - self.raw = msg[offset + 16:offset + self.nl_len] + self.raw = msg[offset + 16 : offset + self.nl_len] self.error = 0 self.done = 0 From patchwork Wed Dec 13 22:41:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 13491997 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="eiXRw7tT" Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D1C8199F; Wed, 13 Dec 2023 14:42:03 -0800 (PST) Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-333536432e0so6797099f8f.3; Wed, 13 Dec 2023 14:42:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702507321; x=1703112121; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=27uWkbmkyJPi62oM04ESj5+OaIZhxLf9WPx67Wq2coQ=; b=eiXRw7tTzpcPD8f6+cDyLoAkAXuqGeFcg7bP5i/FMlxFgXfze1SNDi3HfC9FqnE+gs D7veXfb2M4eyvSfv4pUuZmBc0Rd3k51JiMRvKApNTIULtEMN7cLFKbHRdI0AlKL2m5cE ucmxjra1r1/H9mgKEZtD24Xyg3P5hn4nxRHXsq/kSlfCel2KzvSNVSvLIHnQmv/1H6AU LyH8bRc345hUHb/JmLg2o0ec/mSBU6SaUqidiEbTWts2x1qpnSnbhYoWHmTGY0PvtXX/ wWuGgFK9LOwbMDmoifagXLgD7q4uZolsia4qtiENBd0jEoasJ/vXNYS0D6b1+O79epDB OQxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702507321; x=1703112121; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=27uWkbmkyJPi62oM04ESj5+OaIZhxLf9WPx67Wq2coQ=; b=rzJfQVRaG1k8lg4ozNuGfk8Ci+7J5pIOPcxcfn5KrFtBQc1QF1VCTAPduKnRM5THHK ymLJR8iK2h3EaqWqBYnzmZZai3WPOORFXo1IuXZPCm5bvGHJgRpZCmg1iE8UG0KF6xXp 8mwTDPKaPoXxEWAywD0y4zE6ealXccnPvKqDEmOae3/JOxc2MmkgwZ1HA3Gdswq2CNfA fyJvRUeSjZTC9YbSoh23IL02yJxvt/5wLqyFzvWZtzv7qsUAVTErxP4s2G/mRtGQ18tk Wx2Q2RB6g2PNX7m4c83kn8SaWCc8ioUbM3Ci7zyUTTHeXDIqBUw/AjcfNO46xW6fhU7X TlVA== X-Gm-Message-State: AOJu0YwgkCwwnuE3mWWkeCCc0e/NlCWv8LHd6u5dhrxVmyn1TvOeW04F MRllAGR8i0EWzQPoerUVYNMWjPOtqgwOuw== X-Google-Smtp-Source: AGHT+IGY1Vlcty4Ay/49KKrxDFuCm+CtG/P8pthWINp6Wb4PAeP7N0CJDspISkVwBErjOgCVf92lnA== X-Received: by 2002:a5d:6208:0:b0:333:2fd2:6f54 with SMTP id y8-20020a5d6208000000b003332fd26f54mr4118385wru.94.1702507320762; Wed, 13 Dec 2023 14:42:00 -0800 (PST) Received: from imac.fritz.box ([2a02:8010:60a0:0:7840:ddbd:bbf:1e8f]) by smtp.gmail.com with ESMTPSA id c12-20020a5d4f0c000000b00336442b3e80sm998562wru.78.2023.12.13.14.41.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 14:41:59 -0800 (PST) From: Donald Hunter To: netdev@vger.kernel.org, Jakub Kicinski , "David S. Miller" , Eric Dumazet , Paolo Abeni , Jonathan Corbet , linux-doc@vger.kernel.org, Jacob Keller , Breno Leitao Cc: donald.hunter@redhat.com, Donald Hunter Subject: [PATCH net-next v4 02/13] doc/netlink: Add sub-message support to netlink-raw Date: Wed, 13 Dec 2023 22:41:35 +0000 Message-ID: <20231213224146.94560-3-donald.hunter@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231213224146.94560-1-donald.hunter@gmail.com> References: <20231213224146.94560-1-donald.hunter@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Add a 'sub-message' attribute type with a selector that supports polymorphic attribute formats for raw netlink families like tc. A sub-message attribute uses the value of another attribute as a selector key to choose the right sub-message format. For example if the following attribute has already been decoded: { "kind": "gre" } and we encounter the following attribute spec: - name: data type: sub-message sub-message: linkinfo-data-msg selector: kind Then we look for a sub-message definition called 'linkinfo-data-msg' and use the value of the 'kind' attribute i.e. 'gre' as the key to choose the correct format for the sub-message: sub-messages: name: linkinfo-data-msg formats: - value: bridge attribute-set: linkinfo-bridge-attrs - value: gre attribute-set: linkinfo-gre-attrs - value: geneve attribute-set: linkinfo-geneve-attrs This would decode the attribute value as a sub-message with the attribute-set called 'linkinfo-gre-attrs' as the attribute space. A sub-message can have an optional 'fixed-header' followed by zero or more attributes from an attribute-set. For example the following 'tc-options-msg' sub-message defines message formats that use a mixture of fixed-header, attribute-set or both together: sub-messages: - name: tc-options-msg formats: - value: bfifo fixed-header: tc-fifo-qopt - value: cake attribute-set: tc-cake-attrs - value: netem fixed-header: tc-netem-qopt attribute-set: tc-netem-attrs Signed-off-by: Donald Hunter Reviewed-by: Jakub Kicinski --- Documentation/netlink/netlink-raw.yaml | 65 ++++++++++++++++++++++++-- 1 file changed, 62 insertions(+), 3 deletions(-) diff --git a/Documentation/netlink/netlink-raw.yaml b/Documentation/netlink/netlink-raw.yaml index ad5395040765..04b92f1a5cd6 100644 --- a/Documentation/netlink/netlink-raw.yaml +++ b/Documentation/netlink/netlink-raw.yaml @@ -126,8 +126,10 @@ properties: name: type: string type: - description: The netlink attribute type - enum: [ u8, u16, u32, u64, s8, s16, s32, s64, string, binary ] + description: | + The netlink attribute type. Members of type 'binary' or 'pad' + must also have the 'len' property set. + enum: [ u8, u16, u32, u64, s8, s16, s32, s64, string, binary, pad ] len: $ref: '#/$defs/len-or-define' byte-order: @@ -150,6 +152,14 @@ properties: the right formatting mechanism when displaying values of this type. enum: [ hex, mac, fddi, ipv4, ipv6, uuid ] + if: + properties: + type: + oneOf: + - const: binary + - const: pad + then: + required: [ len ] # End genetlink-legacy attribute-sets: @@ -202,7 +212,8 @@ properties: description: The netlink attribute type enum: [ unused, pad, flag, binary, bitfield32, u8, u16, u32, u64, s8, s16, s32, s64, - string, nest, array-nest, nest-type-value ] + string, nest, array-nest, nest-type-value, + sub-message ] doc: description: Documentation of the attribute. type: string @@ -261,6 +272,17 @@ properties: description: Name of the struct type used for the attribute. type: string # End genetlink-legacy + # Start netlink-raw + sub-message: + description: | + Name of the sub-message definition to use for the attribute. + type: string + selector: + description: | + Name of the attribute to use for dynamic selection of sub-message + format specifier. + type: string + # End netlink-raw # Make sure name-prefix does not appear in subsets (subsets inherit naming) dependencies: @@ -283,6 +305,43 @@ properties: items: required: [ type ] + # Start netlink-raw + sub-messages: + description: Definition of sub message attributes + type: array + items: + type: object + additionalProperties: False + required: [ name, formats ] + properties: + name: + description: Name of the sub-message definition + type: string + formats: + description: Dynamically selected format specifiers + type: array + items: + type: object + additionalProperties: False + required: [ value ] + properties: + value: + description: | + Value to match for dynamic selection of sub-message format + specifier. + type: string + fixed-header: + description: | + Name of the struct definition to use as the fixed header + for the sub message. + type: string + attribute-set: + description: | + Name of the attribute space from which to resolve attributes + in the sub message. + type: string + # End netlink-raw + operations: description: Operations supported by the protocol. type: object From patchwork Wed Dec 13 22:41:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 13491989 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MdAQS0cw" Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A2F719AF; Wed, 13 Dec 2023 14:42:05 -0800 (PST) Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-336420a244dso733848f8f.0; Wed, 13 Dec 2023 14:42:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702507322; x=1703112122; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ippq1dNaZAqHOjJJsClArBZB/4VVzURJxqB5Fea8pY0=; b=MdAQS0cwkNkV8h6mOzZ/yVtpn9ytaTfGM6edaY774pbo+7fVQOMPknXoBH6lsf0fGj DRlepBR7b7mx/p+usi2VXHNFeTpMlQ8Tq1F5slRVYwIsgucdgmEcTB9E2aWtJPtTlxLE MnYKvZAdUI5R9QpbKxBAjLtnx0k8Vue4Q8DgbcJclvvDPqJDMzPnXc1E7g/sqSqU0CpH JbV3uPD6SIaflCnXyShg58jgjNkpQ4tqezTl2wSVMJUc+UqDKUBiNFY4IV8OEW4j5vCO Tukl57U9YTGtXaN85ympNpI3vGy3uhqUnO9p2gWn02J0q3prrtjFvIhC7IFxulj+jt9i MGzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702507322; x=1703112122; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ippq1dNaZAqHOjJJsClArBZB/4VVzURJxqB5Fea8pY0=; b=KwnBz1etpXGmJHCXaTA+wSOWirHZpkpEtKE2QYX9HaRnRDo6t3qxLRSuifHNBjgLdf pd7DX1NGc5LYGCxXxKUrtNKsBmRLiUc2hV0Qwj1mHInzJmj++WpvM7SzgecM017hbR16 BEfgz6aVZ68Iu6elNcNFkssJccIWQkgmd7gtkztRWH3J94uF051kClzKuVnOjEnLkcrD wyLqSRuwFLRHUPXPr988dWmMze+CVV9l3gjH3vjbw3P2FpH2KdDJNnWFM6os3kvV8/k2 ccbPIBFh9/dm/xdr23j9n3j/U+ZvXz8TUxXxhfPNNTanX811mY8ETZANSrNmgiVN6CKA Rvaw== X-Gm-Message-State: AOJu0YwZTku/U7cdBauhBsRlJW0nMY85J7+32O2fkGSjlLuqH/9gp3XO kUwMyjFazip+F/vrdn5Dez6aezcDWC05Vw== X-Google-Smtp-Source: AGHT+IGTTEUY/pykFmRDd/FBn8yYOcFxnI/k75CyZMa1Gh4WG1XUfZEJwecLfwxe+Gb+k5YdcjU8cw== X-Received: by 2002:adf:db4e:0:b0:336:4476:ee57 with SMTP id f14-20020adfdb4e000000b003364476ee57mr268749wrj.112.1702507322392; Wed, 13 Dec 2023 14:42:02 -0800 (PST) Received: from imac.fritz.box ([2a02:8010:60a0:0:7840:ddbd:bbf:1e8f]) by smtp.gmail.com with ESMTPSA id c12-20020a5d4f0c000000b00336442b3e80sm998562wru.78.2023.12.13.14.42.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 14:42:01 -0800 (PST) From: Donald Hunter To: netdev@vger.kernel.org, Jakub Kicinski , "David S. Miller" , Eric Dumazet , Paolo Abeni , Jonathan Corbet , linux-doc@vger.kernel.org, Jacob Keller , Breno Leitao Cc: donald.hunter@redhat.com, Donald Hunter Subject: [PATCH net-next v4 03/13] doc/netlink: Document the sub-message format for netlink-raw Date: Wed, 13 Dec 2023 22:41:36 +0000 Message-ID: <20231213224146.94560-4-donald.hunter@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231213224146.94560-1-donald.hunter@gmail.com> References: <20231213224146.94560-1-donald.hunter@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Document the spec format used by netlink-raw families like rt and tc. Signed-off-by: Donald Hunter Reviewed-by: Jakub Kicinski --- .../userspace-api/netlink/netlink-raw.rst | 96 ++++++++++++++++++- 1 file changed, 95 insertions(+), 1 deletion(-) diff --git a/Documentation/userspace-api/netlink/netlink-raw.rst b/Documentation/userspace-api/netlink/netlink-raw.rst index f07fb9b9c101..1e14f5f22b8e 100644 --- a/Documentation/userspace-api/netlink/netlink-raw.rst +++ b/Documentation/userspace-api/netlink/netlink-raw.rst @@ -14,7 +14,8 @@ Specification The netlink-raw schema extends the :doc:`genetlink-legacy ` schema with properties that are needed to specify the protocol numbers and multicast IDs used by raw netlink families. See :ref:`classic_netlink` for more -information. +information. The raw netlink families also make use of type-specific +sub-messages. Globals ------- @@ -56,3 +57,96 @@ group registration. - name: rtnlgrp-mctp-ifaddr value: 34 + +Sub-messages +------------ + +Several raw netlink families such as +:doc:`rt_link<../../networking/netlink_spec/rt_link>` and +:doc:`tc<../../networking/netlink_spec/tc>` use attribute nesting as an +abstraction to carry module specific information. + +Conceptually it looks as follows:: + + [OUTER NEST OR MESSAGE LEVEL] + [GENERIC ATTR 1] + [GENERIC ATTR 2] + [GENERIC ATTR 3] + [GENERIC ATTR - wrapper] + [MODULE SPECIFIC ATTR 1] + [MODULE SPECIFIC ATTR 2] + +The ``GENERIC ATTRs`` at the outer level are defined in the core (or rt_link or +core TC), while specific drivers, TC classifiers, qdiscs etc. can carry their +own information wrapped in the ``GENERIC ATTR - wrapper``. Even though the +example above shows attributes nesting inside the wrapper, the modules generally +have full freedom to define the format of the nest. In practice the payload of +the wrapper attr has very similar characteristics to a netlink message. It may +contain a fixed header / structure, netlink attributes, or both. Because of +those shared characteristics we refer to the payload of the wrapper attribute as +a sub-message. + +A sub-message attribute uses the value of another attribute as a selector key to +choose the right sub-message format. For example if the following attribute has +already been decoded: + +.. code-block:: json + + { "kind": "gre" } + +and we encounter the following attribute spec: + +.. code-block:: yaml + + - + name: data + type: sub-message + sub-message: linkinfo-data-msg + selector: kind + +Then we look for a sub-message definition called ``linkinfo-data-msg`` and use +the value of the ``kind`` attribute i.e. ``gre`` as the key to choose the +correct format for the sub-message: + +.. code-block:: yaml + + sub-messages: + name: linkinfo-data-msg + formats: + - + value: bridge + attribute-set: linkinfo-bridge-attrs + - + value: gre + attribute-set: linkinfo-gre-attrs + - + value: geneve + attribute-set: linkinfo-geneve-attrs + +This would decode the attribute value as a sub-message with the attribute-set +called ``linkinfo-gre-attrs`` as the attribute space. + +A sub-message can have an optional ``fixed-header`` followed by zero or more +attributes from an ``attribute-set``. For example the following +``tc-options-msg`` sub-message defines message formats that use a mixture of +``fixed-header``, ``attribute-set`` or both together: + +.. code-block:: yaml + + sub-messages: + - + name: tc-options-msg + formats: + - + value: bfifo + fixed-header: tc-fifo-qopt + - + value: cake + attribute-set: tc-cake-attrs + - + value: netem + fixed-header: tc-netem-qopt + attribute-set: tc-netem-attrs + +Note that a selector attribute must appear in a netlink message before any +sub-message attributes that depend on it. From patchwork Wed Dec 13 22:41:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 13491992 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Kkjb+wHy" Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF8B711A; Wed, 13 Dec 2023 14:42:07 -0800 (PST) Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-336353782efso1672343f8f.0; Wed, 13 Dec 2023 14:42:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702507324; x=1703112124; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=eXgKA8gwtJKvKZlcvRxqLAZNlEcXvz1ltdQN8JnvyAs=; b=Kkjb+wHy9bitSFE4Tmml0Z+YJBVlLgX2NVn0XHbgoIGcXv2q0ZVNKfyTwPucOchQRY 2FpQGDWPLA6t5YZ8uOY/dH1nfHIO2/b2HcaDajndjJTrHuewuFmejfNxJM5oERrqVThX 4Fxq99uVFVKLH3f3KpgVH9b4b49LUbi9I+ea4MK2DVkH2rVvQPDs+oMUdFsGXHHrBZ1+ sgrOq2NnAKEBDtmji8/xfCzjXdrCtIGD8lHVz9TYZyBpiil9W6ns4OfW1xb2aNnty7ZO oG9UcvDt+9iTFfk8YANWuXQTFaRK+xbMNm6vlsFwvOPvOlFMLML2Spgau8hScGm7w1vt 2yRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702507324; x=1703112124; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eXgKA8gwtJKvKZlcvRxqLAZNlEcXvz1ltdQN8JnvyAs=; b=tgMTTbxaDyeyK8Mvg3hkIrmE1YEbvc7hyKEITgI1II1aGd2iPEf4kmzx2e7qoTtvQw 2lTVlaG8ck/bv3r1DV4JgDI5yU/Hc1nMaelDzwWlG2yoUzkl+OKUPZAr29RYfOS8htEk Q0tkZDEbJsfqQHXwR6fM0+SS+K/TJS43Eeg4k5wf/58xMuaM/oSfqMpqbtRimDRxPtRQ AfEijyKHDwl2UMa+GhKwHTtj9Jw9g9G9qOyN1Y33DdWIudp18UEiDQAgRfK5epNRHIFz iFD1Dd74g01euTPI9LwBB088i5ob2El0b+F92TPU7A/YHESj6V4n8NwG4vC0SwpoNXwl zXqA== X-Gm-Message-State: AOJu0YwHsBycVFcMg0Zt9lsPPpBUIVCy/MsgMgg44ulEaKNgsbuJratp Dmr+KhxuFVWhaDQ0/eB6xcWGq8rmvg6P5w== X-Google-Smtp-Source: AGHT+IGV8ppU2ujWkuODCQRtNhyZtSSrES026oTOFGx2KV6pnT94LiLoixpYC3eGputqEvxEwmnQdQ== X-Received: by 2002:a5d:65cf:0:b0:333:2fd2:5207 with SMTP id e15-20020a5d65cf000000b003332fd25207mr4813389wrw.128.1702507324110; Wed, 13 Dec 2023 14:42:04 -0800 (PST) Received: from imac.fritz.box ([2a02:8010:60a0:0:7840:ddbd:bbf:1e8f]) by smtp.gmail.com with ESMTPSA id c12-20020a5d4f0c000000b00336442b3e80sm998562wru.78.2023.12.13.14.42.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 14:42:03 -0800 (PST) From: Donald Hunter To: netdev@vger.kernel.org, Jakub Kicinski , "David S. Miller" , Eric Dumazet , Paolo Abeni , Jonathan Corbet , linux-doc@vger.kernel.org, Jacob Keller , Breno Leitao Cc: donald.hunter@redhat.com, Donald Hunter Subject: [PATCH net-next v4 04/13] tools/net/ynl: Add 'sub-message' attribute decoding to ynl Date: Wed, 13 Dec 2023 22:41:37 +0000 Message-ID: <20231213224146.94560-5-donald.hunter@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231213224146.94560-1-donald.hunter@gmail.com> References: <20231213224146.94560-1-donald.hunter@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Implement the 'sub-message' attribute type in ynl. Encode support is not yet implemented. Support for sub-message selectors at a different nest level from the key attribute is not yet supported. Signed-off-by: Donald Hunter Reviewed-by: Jakub Kicinski --- tools/net/ynl/lib/nlspec.py | 55 +++++++++++++++++++++++++++++++++++++ tools/net/ynl/lib/ynl.py | 48 ++++++++++++++++++++++++++------ 2 files changed, 95 insertions(+), 8 deletions(-) diff --git a/tools/net/ynl/lib/nlspec.py b/tools/net/ynl/lib/nlspec.py index 92889298b197..44f13e383e8a 100644 --- a/tools/net/ynl/lib/nlspec.py +++ b/tools/net/ynl/lib/nlspec.py @@ -158,6 +158,9 @@ class SpecAttr(SpecElement): len integer, optional byte length of binary types display_hint string, hint to help choose format specifier when displaying the value + sub_message string, name of sub message type + selector string, name of attribute used to select + sub-message type is_auto_scalar bool, attr is a variable-size scalar """ @@ -173,6 +176,8 @@ class SpecAttr(SpecElement): self.byte_order = yaml.get('byte-order') self.len = yaml.get('len') self.display_hint = yaml.get('display-hint') + self.sub_message = yaml.get('sub-message') + self.selector = yaml.get('selector') self.is_auto_scalar = self.type == "sint" or self.type == "uint" @@ -278,6 +283,47 @@ class SpecStruct(SpecElement): return self.members.items() +class SpecSubMessage(SpecElement): + """ Netlink sub-message definition + + Represents a set of sub-message formats for polymorphic nlattrs + that contain type-specific sub messages. + + Attributes: + name string, name of sub-message definition + formats dict of sub-message formats indexed by match value + """ + def __init__(self, family, yaml): + super().__init__(family, yaml) + + self.formats = collections.OrderedDict() + for elem in self.yaml['formats']: + format = self.new_format(family, elem) + self.formats[format.value] = format + + def new_format(self, family, format): + return SpecSubMessageFormat(family, format) + + +class SpecSubMessageFormat(SpecElement): + """ Netlink sub-message definition + + Represents a set of sub-message formats for polymorphic nlattrs + that contain type-specific sub messages. + + Attributes: + value attribute value to match against type selector + fixed_header string, name of fixed header, or None + attr_set string, name of attribute set, or None + """ + def __init__(self, family, yaml): + super().__init__(family, yaml) + + self.value = yaml.get('value') + self.fixed_header = yaml.get('fixed-header') + self.attr_set = yaml.get('attribute-set') + + class SpecOperation(SpecElement): """Netlink Operation @@ -365,6 +411,7 @@ class SpecFamily(SpecElement): attr_sets dict of attribute sets msgs dict of all messages (index by name) + sub_msgs dict of all sub messages (index by name) ops dict of all valid requests / responses ntfs dict of all async events consts dict of all constants/enums @@ -405,6 +452,7 @@ class SpecFamily(SpecElement): jsonschema.validate(self.yaml, schema) self.attr_sets = collections.OrderedDict() + self.sub_msgs = collections.OrderedDict() self.msgs = collections.OrderedDict() self.req_by_value = collections.OrderedDict() self.rsp_by_value = collections.OrderedDict() @@ -441,6 +489,9 @@ class SpecFamily(SpecElement): def new_struct(self, elem): return SpecStruct(self, elem) + def new_sub_message(self, elem): + return SpecSubMessage(self, elem); + def new_operation(self, elem, req_val, rsp_val): return SpecOperation(self, elem, req_val, rsp_val) @@ -529,6 +580,10 @@ class SpecFamily(SpecElement): attr_set = self.new_attr_set(elem) self.attr_sets[elem['name']] = attr_set + for elem in self.yaml.get('sub-messages', []): + sub_message = self.new_sub_message(elem) + self.sub_msgs[sub_message.name] = sub_message + if self.msg_id_model == 'unified': self._dictify_ops_unified() elif self.msg_id_model == 'directional': diff --git a/tools/net/ynl/lib/ynl.py b/tools/net/ynl/lib/ynl.py index 5c48f0c9713c..a69fb0c9f728 100644 --- a/tools/net/ynl/lib/ynl.py +++ b/tools/net/ynl/lib/ynl.py @@ -170,10 +170,9 @@ class NlAttr: class NlAttrs: - def __init__(self, msg): + def __init__(self, msg, offset=0): self.attrs = [] - offset = 0 while offset < len(msg): attr = NlAttr(msg, offset) offset += attr.full_len @@ -371,8 +370,8 @@ class NetlinkProtocol: fixed_header_size = 0 if ynl: op = ynl.rsp_by_value[msg.cmd()] - fixed_header_size = ynl._fixed_header_size(op) - msg.raw_attrs = NlAttrs(msg.raw[fixed_header_size:]) + fixed_header_size = ynl._fixed_header_size(op.fixed_header) + msg.raw_attrs = NlAttrs(msg.raw, fixed_header_size) return msg def get_mcast_id(self, mcast_name, mcast_groups): @@ -549,6 +548,37 @@ class YnlFamily(SpecFamily): else: rsp[name] = [decoded] + def _resolve_selector(self, attr_spec, vals): + sub_msg = attr_spec.sub_message + if sub_msg not in self.sub_msgs: + raise Exception(f"No sub-message spec named {sub_msg} for {attr_spec.name}") + sub_msg_spec = self.sub_msgs[sub_msg] + + selector = attr_spec.selector + if selector not in vals: + raise Exception(f"There is no value for {selector} to resolve '{attr_spec.name}'") + value = vals[selector] + if value not in sub_msg_spec.formats: + raise Exception(f"No message format for '{value}' in sub-message spec '{sub_msg}'") + + spec = sub_msg_spec.formats[value] + return spec + + def _decode_sub_msg(self, attr, attr_spec, rsp): + msg_format = self._resolve_selector(attr_spec, rsp) + decoded = {} + offset = 0 + if msg_format.fixed_header: + decoded.update(self._decode_fixed_header(attr, msg_format.fixed_header)); + offset = self._fixed_header_size(msg_format.fixed_header) + if msg_format.attr_set: + if msg_format.attr_set in self.attr_sets: + subdict = self._decode(NlAttrs(attr.raw, offset), msg_format.attr_set) + decoded.update(subdict) + else: + raise Exception(f"Unknown attribute-set '{attr_space}' when decoding '{attr_spec.name}'") + return decoded + def _decode(self, attrs, space): if space: attr_space = self.attr_sets[space] @@ -586,6 +616,8 @@ class YnlFamily(SpecFamily): value = self._decode_enum(value, attr_spec) selector = self._decode_enum(selector, attr_spec) decoded = {"value": value, "selector": selector} + elif attr_spec["type"] == 'sub-message': + decoded = self._decode_sub_msg(attr, attr_spec, rsp) else: if not self.process_unknown: raise Exception(f'Unknown {attr_spec["type"]} with name {attr_spec["name"]}') @@ -626,16 +658,16 @@ class YnlFamily(SpecFamily): return msg = self.nlproto.decode(self, NlMsg(request, 0, op.attr_set)) - offset = 20 + self._fixed_header_size(op) + offset = 20 + self._fixed_header_size(op.fixed_header) path = self._decode_extack_path(msg.raw_attrs, op.attr_set, offset, extack['bad-attr-offs']) if path: del extack['bad-attr-offs'] extack['bad-attr'] = path - def _fixed_header_size(self, op): - if op.fixed_header: - fixed_header_members = self.consts[op.fixed_header].members + def _fixed_header_size(self, name): + if name: + fixed_header_members = self.consts[name].members size = 0 for m in fixed_header_members: format = NlAttr.get_format(m.type, m.byte_order) From patchwork Wed Dec 13 22:41:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 13491990 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="JZNdPXJT" Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66DF918D; Wed, 13 Dec 2023 14:42:08 -0800 (PST) Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-3333b46f26aso6703951f8f.1; Wed, 13 Dec 2023 14:42:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702507326; x=1703112126; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5uDEek6+Jtpacg00rqhgwzK/qMhvND186I0lm7RnUWw=; b=JZNdPXJT2g6gACWQku60AFJlaaKigqpOuN/puo3kF/aDXIgKXvRdErdLPhOu3Z1KgC pKv+GUTWNHF4TexHcXFmrR+Kn1+h7/iDUnD2hKYxwz7kDFyU2r4id/nnospo/RXb+umq Ii90C9azGh+iJ++0CcyFuLj2w7MFKlEyKC1KlCq/c+nZCR1G6L9lEQFriv29ud6F+n/1 s7fbTEAGVK34R81pUyUsbIe5k1c3P9m8hR4PDIqYVaTrE/h2U9ykQG+cDfGzjGRgiASN zxrF5WAoCk6pUge21R+Xhbs1jneE7DP8Sd/3Av30yPNKjPcesD3ly+CQ3erfXQEPmbum Mgyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702507326; x=1703112126; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5uDEek6+Jtpacg00rqhgwzK/qMhvND186I0lm7RnUWw=; b=dwe6aWbETmvdrmhwar/ig81y6m+HEEpNv4sRMELzWKtBJLToHuTEm5+P0S3dC+Cv4R NHDXzrs79GDue42lVM1lBgfk6guBwR7fXDRtdDm6BXnQF8L3I492NMTuLyqgA1avqzkb Js1Lc/mzCReC4qYtU5p2I4RGvfHi3Fq3+lSKeFrLKudvPSh5JSvx2GRePtApjf69hbMS YegaQlVaPG4EIATjI1/JSUF0M4Bn+D+kXjIUBtF16jzz5HNTND3LqmcIt5bKXbcOQAHI qJj519cOyDOu0kPDhsoS3pGWtkkjdzRYnQZj39b4Ckfg2A+mFY+fUdoHMWHq2RtNY0kl Vnmw== X-Gm-Message-State: AOJu0Yxq5qhHazLvaP56tRAtHJwptrace9PuParOPk7ekvrVUDs6Vzpf olrZdOPIg62DiM5DcaFEBBU7+fEcEgYubA== X-Google-Smtp-Source: AGHT+IEBEmWzC8X4b7L02+NO3WoNfTyzBoy8jXzSLF4I282U9edUETIl+MHS28CVftLDThg3kvdzWg== X-Received: by 2002:a5d:4701:0:b0:336:3fd4:2585 with SMTP id y1-20020a5d4701000000b003363fd42585mr785386wrq.110.1702507326035; Wed, 13 Dec 2023 14:42:06 -0800 (PST) Received: from imac.fritz.box ([2a02:8010:60a0:0:7840:ddbd:bbf:1e8f]) by smtp.gmail.com with ESMTPSA id c12-20020a5d4f0c000000b00336442b3e80sm998562wru.78.2023.12.13.14.42.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 14:42:04 -0800 (PST) From: Donald Hunter To: netdev@vger.kernel.org, Jakub Kicinski , "David S. Miller" , Eric Dumazet , Paolo Abeni , Jonathan Corbet , linux-doc@vger.kernel.org, Jacob Keller , Breno Leitao Cc: donald.hunter@redhat.com, Donald Hunter Subject: [PATCH net-next v4 05/13] tools/net/ynl: Add binary and pad support to structs for tc Date: Wed, 13 Dec 2023 22:41:38 +0000 Message-ID: <20231213224146.94560-6-donald.hunter@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231213224146.94560-1-donald.hunter@gmail.com> References: <20231213224146.94560-1-donald.hunter@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org The tc netlink-raw family needs binary and pad types for several qopt C structs. Add support for them to ynl. Signed-off-by: Donald Hunter Reviewed-by: Jakub Kicinski --- tools/net/ynl/lib/ynl.py | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/tools/net/ynl/lib/ynl.py b/tools/net/ynl/lib/ynl.py index a69fb0c9f728..61d672c57fb0 100644 --- a/tools/net/ynl/lib/ynl.py +++ b/tools/net/ynl/lib/ynl.py @@ -670,8 +670,11 @@ class YnlFamily(SpecFamily): fixed_header_members = self.consts[name].members size = 0 for m in fixed_header_members: - format = NlAttr.get_format(m.type, m.byte_order) - size += format.size + if m.type in ['pad', 'binary']: + size += m.len + else: + format = NlAttr.get_format(m.type, m.byte_order) + size += format.size return size else: return 0 @@ -681,12 +684,20 @@ class YnlFamily(SpecFamily): fixed_header_attrs = dict() offset = 0 for m in fixed_header_members: - format = NlAttr.get_format(m.type, m.byte_order) - [ value ] = format.unpack_from(msg.raw, offset) - offset += format.size - if m.enum: - value = self._decode_enum(value, m) - fixed_header_attrs[m.name] = value + value = None + if m.type == 'pad': + offset += m.len + elif m.type == 'binary': + value = msg.raw[offset : offset + m.len] + offset += m.len + else: + format = NlAttr.get_format(m.type, m.byte_order) + [ value ] = format.unpack_from(msg.raw, offset) + offset += format.size + if value is not None: + if m.enum: + value = self._decode_enum(value, m) + fixed_header_attrs[m.name] = value return fixed_header_attrs def handle_ntf(self, decoded): @@ -753,8 +764,13 @@ class YnlFamily(SpecFamily): fixed_header_members = self.consts[op.fixed_header].members for m in fixed_header_members: value = vals.pop(m.name) if m.name in vals else 0 - format = NlAttr.get_format(m.type, m.byte_order) - msg += format.pack(value) + if m.type == 'pad': + msg += bytearray(m.len) + elif m.type == 'binary': + msg += bytes.fromhex(value) + else: + format = NlAttr.get_format(m.type, m.byte_order) + msg += format.pack(value) for name, value in vals.items(): msg += self._add_attr(op.attr_set.name, name, value) msg = _genl_msg_finalize(msg) From patchwork Wed Dec 13 22:41:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 13491996 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="b+XUWI5z" Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F4BB1BC1; Wed, 13 Dec 2023 14:42:10 -0800 (PST) Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-3364514fe31so214634f8f.1; Wed, 13 Dec 2023 14:42:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702507328; x=1703112128; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xu7zuUOhyRqM3tfmUwz0DGtPsLVtk8tuiEIzfS/Rvv4=; b=b+XUWI5zY4imRfuOIsDJsu1tlb4JQBHQjIxPKkTOn3lCZxoDgHIA0VZh4XI53H53N4 UYP+iRajLmL1F0mcNYd+u5q1//hDOCwcpYiYt0RYnil3EDNFDos0FUhdzP5JTvI9OcZ7 GrLFrgxChEfLk3ExBce4NqnQPMEiVHAgiQrwDOFHG6m7/iOaztwlf0LwrUBy8opzt1cU xFjPk8mH1BS3RRd5ThOW4X24xyG/4pyTBe5S4eq/ATBPHNhxBzCPxj2MkUoE31E7SHe4 C+os2IYTa5PfLaB8fRc6Patks3sMSz2McDfOiba/FEbCT1Et2N0SnwZWOi0Z7VAIBsaW WtXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702507328; x=1703112128; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xu7zuUOhyRqM3tfmUwz0DGtPsLVtk8tuiEIzfS/Rvv4=; b=WJMx68ieym6B66j9W5TfOMstZLDIvicEhlSSrqc1qO/NX9YG1fL2W569uEvDbvJVms nyCXk84u4XOSk1Byjel+1Iiz4mhcwOA4QgqRG0gietZRuJ5CPaCp1pTWHYjFCR5sqfwE ZseHeDiGENZyjRufcwXckMRS2EJ7BCh3LtGihwq5HAydaJITMRJvT6IdjomjtyftbdbJ T2lMoCN2GGpLrpT4EC7D9WvP9aDmHzd/hx2crxQngn/tJHBTOiz7P9O2KWRdRWG77aMS RkjsrG0H3+/lvxOWWS6yTMKDW/v/3n7c3Sa39lKa+vnek4jeR7ZSkqgvFhVrvUwFO1P5 4zPw== X-Gm-Message-State: AOJu0YzAgOQ+It5vP5ZoPk99aiNLhK8TySVmHivq1fGvdMhFOhHCRSg/ Xd8U5iPNR1IptfCFi+JrV9Eo31L/0OfWIw== X-Google-Smtp-Source: AGHT+IGR2vzF1fcQaycD1QRHLRxQxUZRiUuIkG9NRo3YBVevmNUKI1ZEf0oUDKKw6OFs6yyDzakzpg== X-Received: by 2002:adf:a1db:0:b0:336:4725:b5d2 with SMTP id v27-20020adfa1db000000b003364725b5d2mr11685wrv.41.1702507327626; Wed, 13 Dec 2023 14:42:07 -0800 (PST) Received: from imac.fritz.box ([2a02:8010:60a0:0:7840:ddbd:bbf:1e8f]) by smtp.gmail.com with ESMTPSA id c12-20020a5d4f0c000000b00336442b3e80sm998562wru.78.2023.12.13.14.42.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 14:42:06 -0800 (PST) From: Donald Hunter To: netdev@vger.kernel.org, Jakub Kicinski , "David S. Miller" , Eric Dumazet , Paolo Abeni , Jonathan Corbet , linux-doc@vger.kernel.org, Jacob Keller , Breno Leitao Cc: donald.hunter@redhat.com, Donald Hunter Subject: [PATCH net-next v4 06/13] doc/netlink/specs: Add sub-message type to rt_link family Date: Wed, 13 Dec 2023 22:41:39 +0000 Message-ID: <20231213224146.94560-7-donald.hunter@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231213224146.94560-1-donald.hunter@gmail.com> References: <20231213224146.94560-1-donald.hunter@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Start using sub-message selectors in the rt_link spec for the link-specific 'data' and 'slave-data' attributes. Signed-off-by: Donald Hunter --- Documentation/netlink/specs/rt_link.yaml | 436 ++++++++++++++++++++++- 1 file changed, 432 insertions(+), 4 deletions(-) diff --git a/Documentation/netlink/specs/rt_link.yaml b/Documentation/netlink/specs/rt_link.yaml index d86a68f8475c..ea6a6157d718 100644 --- a/Documentation/netlink/specs/rt_link.yaml +++ b/Documentation/netlink/specs/rt_link.yaml @@ -82,6 +82,18 @@ definitions: - name: ifi-change type: u32 + - + name: ifla-bridge-id + type: struct + members: + - + name: prio + type: u16 + - + name: addr + type: binary + len: 6 + display-hint: mac - name: ifla-cacheinfo type: struct @@ -966,8 +978,9 @@ attribute-sets: type: string - name: data - type: binary - # kind specific nest, e.g. linkinfo-bridge-attrs + type: sub-message + sub-message: linkinfo-data-msg + selector: kind - name: xstats type: binary @@ -976,10 +989,12 @@ attribute-sets: type: string - name: slave-data - type: binary - # kind specific nest + type: sub-message + sub-message: linkinfo-member-data-msg + selector: slave-kind - name: linkinfo-bridge-attrs + name-prefix: ifla-br- attributes: - name: forward-delay @@ -1011,9 +1026,11 @@ attribute-sets: - name: root-id type: binary + struct: ifla-bridge-id - name: bridge-id type: binary + struct: ifla-bridge-id - name: root-port type: u16 @@ -1041,6 +1058,7 @@ attribute-sets: - name: group-addr type: binary + display-hint: mac - name: fdb-flush type: binary @@ -1123,6 +1141,376 @@ attribute-sets: - name: mcast-querier-state type: binary + - + name: linkinfo-brport-attrs + name-prefix: ifla-brport- + attributes: + - + name: state + type: u8 + - + name: priority + type: u16 + - + name: cost + type: u32 + - + name: mode + type: flag + - + name: guard + type: flag + - + name: protect + type: flag + - + name: fast-leave + type: flag + - + name: learning + type: flag + - + name: unicast-flood + type: flag + - + name: proxyarp + type: flag + - + name: learning-sync + type: flag + - + name: proxyarp-wifi + type: flag + - + name: root-id + type: binary + struct: ifla-bridge-id + - + name: bridge-id + type: binary + struct: ifla-bridge-id + - + name: designated-port + type: u16 + - + name: designated-cost + type: u16 + - + name: id + type: u16 + - + name: "no" + type: u16 + - + name: topology-change-ack + type: u8 + - + name: config-pending + type: u8 + - + name: message-age-timer + type: u64 + - + name: forward-delay-timer + type: u64 + - + name: hold-timer + type: u64 + - + name: flush + type: flag + - + name: multicast-router + type: u8 + - + name: pad + type: pad + - + name: mcast-flood + type: flag + - + name: mcast-to-ucast + type: flag + - + name: vlan-tunnel + type: flag + - + name: bcast-flood + type: flag + - + name: group-fwd-mask + type: u16 + - + name: neigh-suppress + type: flag + - + name: isolated + type: flag + - + name: backup-port + type: u32 + - + name: mrp-ring-open + type: flag + - + name: mrp-in-open + type: flag + - + name: mcast-eht-hosts-limit + type: u32 + - + name: mcast-eht-hosts-cnt + type: u32 + - + name: locked + type: flag + - + name: mab + type: flag + - + name: mcast-n-groups + type: u32 + - + name: mcast-max-groups + type: u32 + - + name: neigh-vlan-suppress + type: flag + - + name: backup-nhid + type: u32 + - + name: linkinfo-gre-attrs + name-prefix: ifla-gre- + attributes: + - + name: link + type: u32 + - + name: iflags + type: u16 + - + name: oflags + type: u16 + - + name: ikey + type: u32 + - + name: okey + type: u32 + - + name: local + type: binary + display-hint: ipv4 + - + name: remote + type: binary + display-hint: ipv4 + - + name: ttl + type: u8 + - + name: tos + type: u8 + - + name: pmtudisc + type: u8 + - + name: encap-limit + type: u32 + - + name: flowinfo + type: u32 + - + name: flags + type: u32 + - + name: encap-type + type: u16 + - + name: encap-flags + type: u16 + - + name: encap-sport + type: u16 + - + name: encap-dport + type: u16 + - + name: collect-metadata + type: flag + - + name: ignore-df + type: u8 + - + name: fwmark + type: u32 + - + name: erspan-index + type: u32 + - + name: erspan-ver + type: u8 + - + name: erspan-dir + type: u8 + - + name: erspan-hwid + type: u16 + - + name: linkinfo-geneve-attrs + name-prefix: ifla-geneve- + attributes: + - + name: id + type: u32 + - + name: remote + type: binary + display-hint: ipv4 + - + name: ttl + type: u8 + - + name: tos + type: u8 + - + name: port + type: u16 + - + name: collect-metadata + type: flag + - + name: remote6 + type: binary + display-hint: ipv6 + - + name: udp-csum + type: u8 + - + name: udp-zero-csum6-tx + type: u8 + - + name: udp-zero-csum6-rx + type: u8 + - + name: label + type: u32 + - + name: ttl-inherit + type: u8 + - + name: df + type: u8 + - + name: inner-proto-inherit + type: flag + - + name: linkinfo-iptun-attrs + name-prefix: ifla-iptun- + attributes: + - + name: link + type: u32 + - + name: local + type: binary + display-hint: ipv4 + - + name: remote + type: binary + display-hint: ipv4 + - + name: ttl + type: u8 + - + name: tos + type: u8 + - + name: encap-limit + type: u8 + - + name: flowinfo + type: u32 + - + name: flags + type: u16 + - + name: proto + type: u8 + - + name: pmtudisc + type: u8 + - + name: 6rd-prefix + type: binary + display-hint: ipv6 + - + name: 6rd-relay-prefix + type: binary + display-hint: ipv4 + - + name: 6rd-prefixlen + type: u16 + - + name: 6rd-relay-prefixlen + type: u16 + - + name: encap-type + type: u16 + - + name: encap-flags + type: u16 + - + name: encap-sport + type: u16 + - + name: encap-dport + type: u16 + - + name: collect-metadata + type: flag + - + name: fwmark + type: u32 + - + name: linkinfo-tun-attrs + name-prefix: ifla-tun- + attributes: + - + name: owner + type: u32 + - + name: group + type: u32 + - + name: type + type: u8 + - + name: pi + type: u8 + - + name: vnet-hdr + type: u8 + - + name: persist + type: u8 + - + name: multi-queue + type: u8 + - + name: num-queues + type: u32 + - + name: num-disabled-queues + type: u32 + - + name: linkinfo-vrf-attrs + name-prefix: ifla-vrf- + attributes: + - + name: table + type: u32 - name: xdp-attrs attributes: @@ -1241,6 +1629,46 @@ attribute-sets: name: used type: u8 +sub-messages: + - + name: linkinfo-data-msg + formats: + - + value: bridge + attribute-set: linkinfo-bridge-attrs + - + value: erspan + attribute-set: linkinfo-gre-attrs + - + value: gre + attribute-set: linkinfo-gre-attrs + - + value: gretap + attribute-set: linkinfo-gre-attrs + - + value: geneve + attribute-set: linkinfo-geneve-attrs + - + value: ipip + attribute-set: linkinfo-iptun-attrs + - + value: sit + attribute-set: linkinfo-iptun-attrs + - + value: tun + attribute-set: linkinfo-tun-attrs + - + value: vrf + attribute-set: linkinfo-vrf-attrs + - + name: linkinfo-member-data-msg + formats: + - + value: bridge + attribute-set: linkinfo-brport-attrs + - + value: bond + operations: enum-model: directional list: From patchwork Wed Dec 13 22:41:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 13492001 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Vyp9KlOl" Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A41181BCC; Wed, 13 Dec 2023 14:42:12 -0800 (PST) Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-336445a2749so355985f8f.0; Wed, 13 Dec 2023 14:42:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702507329; x=1703112129; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=a3JY0Tl5uBoHE8m/ovbgncHc7wHlXG+lWF7d67MSbyU=; b=Vyp9KlOlSifYiLlkftXwKQCs5uwtFm25TPUf2EGBasPC0tCZ2CD7yKisozqYWlRH+j YhXB2fp/IuhYeh5ZotnEyLxHYUWIsOa1UBf42Y/j4NrUJiK2aD88Hb3JNmqte5rp3Yyb tKFn3C5ihJnN9HkVNIWeqx3PPQ+AvN3vEHspqCi/R/6PIc2MzyACpQH7e5uOlK8A0UzD ILiIxeengvXwJZU3zQ1L2Rx+UwuzRSCKSmNWBRgXHhKqTa9i0QPqAgpZDAVvvoh3QW1k A4CxeWiZuXD8f56+cmUemr1VY4beNfeeTCc76sK8ZyIw5wFnK+LYNlUbu+5FcRGx5u9z oQvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702507329; x=1703112129; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=a3JY0Tl5uBoHE8m/ovbgncHc7wHlXG+lWF7d67MSbyU=; b=RvL66vkqKloCDWRK8TYwACi5gaK4bVjxd7puIowa80xCCynfljnCoJi6uDkxkR6eRW G+d5fnLI0tLmt4CHItzVquqBjEC+j5tBW0KJa5syxr3LuBRSZ60q50BSG7rgZuhLqIbY RHE2rw/eYJfRhAiFak/dHYVWzE3iGkLrmek0m1hrfI0wCk0SS8kqkqupTBRQWFdi5nty HbLnT/JEyeBeW95N47Gm4xGZ8IwOw5EnLIhu+9CJZm8ieIaqGSXoFJ+EH+QU8ftPXMQ2 6pr1cVv47hmVm4GG/JdTSRf0/gUEGHNCM1u3YuQWThy0/WpSVlKDftCMiMbrnTzqcjVq gcIg== X-Gm-Message-State: AOJu0YxYa/1Jvu8udXM4jUHibcf8iqAbaz2dig5QPz7tg5XxgYg9mROB nCN30DTccgrCLqnmvNadcoKtGaykLrvnYA== X-Google-Smtp-Source: AGHT+IE7R1lEYc2Ylhz1odvk1h5dIilWAzLIsZYplmnPbbFi8zIIWk7XSDauaVp561tM5YYaQDW7wQ== X-Received: by 2002:adf:e94a:0:b0:336:3510:61fb with SMTP id m10-20020adfe94a000000b00336351061fbmr1729503wrn.55.1702507329302; Wed, 13 Dec 2023 14:42:09 -0800 (PST) Received: from imac.fritz.box ([2a02:8010:60a0:0:7840:ddbd:bbf:1e8f]) by smtp.gmail.com with ESMTPSA id c12-20020a5d4f0c000000b00336442b3e80sm998562wru.78.2023.12.13.14.42.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 14:42:08 -0800 (PST) From: Donald Hunter To: netdev@vger.kernel.org, Jakub Kicinski , "David S. Miller" , Eric Dumazet , Paolo Abeni , Jonathan Corbet , linux-doc@vger.kernel.org, Jacob Keller , Breno Leitao Cc: donald.hunter@redhat.com, Donald Hunter Subject: [PATCH net-next v4 07/13] doc/netlink/specs: use pad in structs in rt_link Date: Wed, 13 Dec 2023 22:41:40 +0000 Message-ID: <20231213224146.94560-8-donald.hunter@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231213224146.94560-1-donald.hunter@gmail.com> References: <20231213224146.94560-1-donald.hunter@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org The rt_link spec was using pad1, pad2 attributes in structs which appears in the ynl output. Replace this with the 'pad' type which doesn't pollute the output. Signed-off-by: Donald Hunter --- Documentation/netlink/specs/rt_link.yaml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Documentation/netlink/specs/rt_link.yaml b/Documentation/netlink/specs/rt_link.yaml index ea6a6157d718..1ad01d52a863 100644 --- a/Documentation/netlink/specs/rt_link.yaml +++ b/Documentation/netlink/specs/rt_link.yaml @@ -66,8 +66,9 @@ definitions: name: ifi-family type: u8 - - name: padding - type: u8 + name: pad + type: pad + len: 1 - name: ifi-type type: u16 @@ -719,11 +720,9 @@ definitions: name: family type: u8 - - name: pad1 - type: u8 - - - name: pad2 - type: u16 + name: pad + type: pad + len: 3 - name: ifindex type: u32 From patchwork Wed Dec 13 22:41:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 13491998 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FkZsBb5b" Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0C901BEE; Wed, 13 Dec 2023 14:42:15 -0800 (PST) Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-3360ae2392eso5208882f8f.2; Wed, 13 Dec 2023 14:42:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702507331; x=1703112131; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=I+0fdttzHCNQOm7CvOl30hmbQOQPNsJezGPiwOFCytM=; b=FkZsBb5bpIvg0DZhGxwq6ljFYT4zTWd3HPN8q7pclx9X1QVv0q7AalWyOFtFziYL8v +RiWkKLO5n4PCPyekHqWXbimBiNH40Gn2aIh4fSbSptvcphAZsUGO5SXKzLQYRV34nlo IQXwCaoKOBQ3h69xObeVbU5JPdXJ8qlTJAxdOmAzbDLqiZzXS4WmLOnWyPOTa+aHzc29 F6GOodZxqPRe0PIDW1scw2h+7kG80DrtuefFDqwbXWsnBgQJLqMuQA5lQWDmxPBcVt/l /iVlDVG45KObV7nZ4h5eLJ7HzVO6Acxc+gcuTnSuqzhKY5sdderRilsdbof8K2VX+wfE dTnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702507331; x=1703112131; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=I+0fdttzHCNQOm7CvOl30hmbQOQPNsJezGPiwOFCytM=; b=q0atPKWK+YX1OrOggcDLD9KRKIkhuHlpWNvZ+kMzC8JPbwSr8Db+o4DCoUaqTXdYyb amSrRY0AcLQt9BHYOgtMGJWD0669AQkXRBptOyVey4GrPp7HfIt+UBVxutwuFfb6ZMpS 75pzRfmghUX17B9obkNQHKXMIRr/GRaYGtcMppJ0wkDhZxHnhGkluvR/OUBiWSE4hbLu PnIjadfU17pKOzRG1YkPde8lgDE81G29fkbqR3LVMKSZpWuDiuohaQv42jFH+NERfhLS e8+CyYOa2UZlic0MByUQ8Uzr+HwRfWGlLF9R3QbKKW+n7dE8ZP0eAIPvfG/VgNaNOTSx M47Q== X-Gm-Message-State: AOJu0Ywk4KIvR3/knsik7RHRc2ry+nnLCPCVTW9tpV5GO54vtiKERAOo qSNOakyN37fMli+Qdb9LcrHivI4WeCShsw== X-Google-Smtp-Source: AGHT+IGOJzwv4J5J7AI6fqBosPaj2T6pT/WvJJWtuSAQZfSlepIq+Go5qW6iNlL4JxLG1mWL1vOAuA== X-Received: by 2002:adf:f58b:0:b0:336:3d06:e6f5 with SMTP id f11-20020adff58b000000b003363d06e6f5mr937959wro.89.1702507330884; Wed, 13 Dec 2023 14:42:10 -0800 (PST) Received: from imac.fritz.box ([2a02:8010:60a0:0:7840:ddbd:bbf:1e8f]) by smtp.gmail.com with ESMTPSA id c12-20020a5d4f0c000000b00336442b3e80sm998562wru.78.2023.12.13.14.42.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 14:42:10 -0800 (PST) From: Donald Hunter To: netdev@vger.kernel.org, Jakub Kicinski , "David S. Miller" , Eric Dumazet , Paolo Abeni , Jonathan Corbet , linux-doc@vger.kernel.org, Jacob Keller , Breno Leitao Cc: donald.hunter@redhat.com, Donald Hunter Subject: [PATCH net-next v4 08/13] doc/netlink/specs: Add a spec for tc Date: Wed, 13 Dec 2023 22:41:41 +0000 Message-ID: <20231213224146.94560-9-donald.hunter@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231213224146.94560-1-donald.hunter@gmail.com> References: <20231213224146.94560-1-donald.hunter@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org This is a work-in-progress spec for tc that covers: - most of the qdiscs - the flower classifier - new, del, get for qdisc, chain, class and filter Notable omissions: - most of the stats attrs are left as binary blobs - notifications are not yet implemented Signed-off-by: Donald Hunter --- Documentation/netlink/specs/tc.yaml | 2037 +++++++++++++++++++++++++++ 1 file changed, 2037 insertions(+) create mode 100644 Documentation/netlink/specs/tc.yaml diff --git a/Documentation/netlink/specs/tc.yaml b/Documentation/netlink/specs/tc.yaml new file mode 100644 index 000000000000..898a1e1be6cf --- /dev/null +++ b/Documentation/netlink/specs/tc.yaml @@ -0,0 +1,2037 @@ +# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) + +name: tc +protocol: netlink-raw +protonum: 0 + +doc: + Netlink raw family for tc qdisc, chain, class and filter configuration + over rtnetlink. + +definitions: + - + name: tcmsg + type: struct + members: + - + name: family + type: u8 + - + name: pad + type: pad + len: 3 + - + name: ifindex + type: s32 + - + name: handle + type: u32 + - + name: parent + type: u32 + - + name: info + type: u32 + - + name: tc-cls-flags + type: flags + entries: + - skip-hw + - skip-sw + - in-hw + - not-in-nw + - verbose + - + name: tc-stats + type: struct + members: + - + name: bytes + type: u64 + - + name: packets + type: u32 + - + name: drops + type: u32 + - + name: overlimits + type: u32 + - + name: bps + type: u32 + - + name: pps + type: u32 + - + name: qlen + type: u32 + - + name: backlog + type: u32 + - + name: tc-cbs-qopt + type: struct + members: + - + name: offload + type: u8 + - + name: pad + type: pad + len: 3 + - + name: hicredit + type: s32 + - + name: locredit + type: s32 + - + name: idleslope + type: s32 + - + name: sendslope + type: s32 + - + name: tc-etf-qopt + type: struct + members: + - + name: delta + type: s32 + - + name: clockid + type: s32 + - + name: flags + type: s32 + - + name: tc-fifo-qopt + type: struct + members: + - + name: limit + type: u32 + - + name: tc-htb-opt + type: struct + members: + - + name: rate + type: binary + len: 12 + - + name: ceil + type: binary + len: 12 + - + name: buffer + type: u32 + - + name: cbuffer + type: u32 + - + name: quantum + type: u32 + - + name: level + type: u32 + - + name: prio + type: u32 + - + name: tc-htb-glob + type: struct + members: + - + name: version + type: u32 + - + name: rate2quantum + type: u32 + - + name: defcls + type: u32 + - + name: debug + type: u32 + - + name: direct-pkts + type: u32 + - + name: tc-gred-qopt + type: struct + members: + - + name: limit + type: u32 + - + name: qth-min + type: u32 + - + name: qth-max + type: u32 + - + name: DP + type: u32 + - + name: backlog + type: u32 + - + name: qave + type: u32 + - + name: forced + type: u32 + - + name: early + type: u32 + - + name: other + type: u32 + - + name: pdrop + type: u32 + - + name: Wlog + type: u8 + - + name: Plog + type: u8 + - + name: Scell_log + type: u8 + - + name: prio + type: u8 + - + name: packets + type: u32 + - + name: bytesin + type: u32 + - + name: tc-gred-sopt + type: struct + members: + - + name: DPs + type: u32 + - + name: def_DP + type: u32 + - + name: grio + type: u8 + - + name: flags + type: u8 + - + name: pad + type: pad + len: 2 + - + name: tc-hfsc-qopt + type: struct + members: + - + name: defcls + type: u16 + - + name: tc-mqprio-qopt + type: struct + members: + - + name: num-tc + type: u8 + - + name: prio-tc-map + type: binary + len: 16 + - + name: hw + type: u8 + - + name: count + type: binary + len: 32 + - + name: offset + type: binary + len: 32 + - + name: tc-multiq-qopt + type: struct + members: + - + name: bands + type: u16 + - + name: max-bands + type: u16 + - + name: tc-netem-qopt + type: struct + members: + - + name: latency + type: u32 + - + name: limit + type: u32 + - + name: loss + type: u32 + - + name: gap + type: u32 + - + name: duplicate + type: u32 + - + name: jitter + type: u32 + - + name: tc-plug-qopt + type: struct + members: + - + name: action + type: s32 + - + name: limit + type: u32 + - + name: tc-prio-qopt + type: struct + members: + - + name: bands + type: u16 + - + name: priomap + type: binary + len: 16 + - + name: tc-red-qopt + type: struct + members: + - + name: limit + type: u32 + - + name: qth-min + type: u32 + - + name: qth-max + type: u32 + - + name: Wlog + type: u8 + - + name: Plog + type: u8 + - + name: Scell-log + type: u8 + - + name: flags + type: u8 + - + name: tc-sfb-qopt + type: struct + members: + - + name: rehash-interval + type: u32 + - + name: warmup-time + type: u32 + - + name: max + type: u32 + - + name: bin-size + type: u32 + - + name: increment + type: u32 + - + name: decrement + type: u32 + - + name: limit + type: u32 + - + name: penalty-rate + type: u32 + - + name: penalty-burst + type: u32 + - + name: tc-sfq-qopt-v1 # TODO nested structs + type: struct + members: + - + name: quantum + type: u32 + - + name: perturb-period + type: s32 + - + name: limit + type: u32 + - + name: divisor + type: u32 + - + name: flows + type: u32 + - + name: depth + type: u32 + - + name: headdrop + type: u32 + - + name: limit + type: u32 + - + name: qth-min + type: u32 + - + name: qth-mac + type: u32 + - + name: Wlog + type: u8 + - + name: Plog + type: u8 + - + name: Scell-log + type: u8 + - + name: flags + type: u8 + - + name: max-P + type: u32 + - + name: prob-drop + type: u32 + - + name: forced-drop + type: u32 + - + name: prob-mark + type: u32 + - + name: forced-mark + type: u32 + - + name: prob-mark-head + type: u32 + - + name: forced-mark-head + type: u32 + - + name: tc-tbf-qopt + type: struct + members: + - + name: rate + type: binary # TODO nested struct tc_ratespec + len: 12 + - + name: peakrate + type: binary # TODO nested struct tc_ratespec + len: 12 + - + name: limit + type: u32 + - + name: buffer + type: u32 + - + name: mtu + type: u32 + - + name: tc-sizespec + type: struct + members: + - + name: cell-log + type: u8 + - + name: size-log + type: u8 + - + name: cell-align + type: s16 + - + name: overhead + type: s32 + - + name: linklayer + type: u32 + - + name: mpu + type: u32 + - + name: mtu + type: u32 + - + name: tsize + type: u32 + - + name: gnet-estimator + type: struct + members: + - + name: interval + type: s8 + - + name: ewma-log + type: u8 +attribute-sets: + - + name: tc-attrs + attributes: + - + name: kind + type: string + - + name: options + type: sub-message + sub-message: tc-options-msg + selector: kind + - + name: stats + type: binary + struct: tc-stats + - + name: xstats + type: binary + - + name: rate + type: binary + struct: gnet-estimator + - + name: fcnt + type: u32 + - + name: stats2 + type: nest + nested-attributes: tca-stats-attrs + - + name: stab + type: nest + nested-attributes: tca-stab-attrs + - + name: pad + type: pad + - + name: dump-invisible + type: flag + - + name: chain + type: u32 + - + name: hw-offload + type: u8 + - + name: ingress-block + type: u32 + - + name: egress-block + type: u32 + - + name: dump-flags + type: bitfield32 + - + name: ext-warn-msg + type: string + - + name: tc-cake-attrs + attributes: + - + name: pad + type: pad + - + name: base-rate64 + type: u64 + - + name: diffserv-mode + type: u32 + - + name: atm + type: u32 + - + name: flow-mode + type: u32 + - + name: overhead + type: u32 + - + name: rtt + type: u32 + - + name: target + type: u32 + - + name: autorate + type: u32 + - + name: memory + type: u32 + - + name: nat + type: u32 + - + name: raw + type: u32 + - + name: wash + type: u32 + - + name: mpu + type: u32 + - + name: ingress + type: u32 + - + name: ack-filter + type: u32 + - + name: split-gso + type: u32 + - + name: fwmark + type: u32 + - + name: tc-cake-stats-attrs + attributes: + - + name: pad + type: pad + - + name: capacity-estimate64 + type: u64 + - + name: memory-limit + type: u32 + - + name: memory-used + type: u32 + - + name: avg-netoff + type: u32 + - + name: min-netlen + type: u32 + - + name: max-netlen + type: u32 + - + name: min-adjlen + type: u32 + - + name: max-adjlen + type: u32 + - + name: tin-stats + type: binary + - + name: deficit + type: s32 + - + name: cobalt-count + type: u32 + - + name: dropping + type: u32 + - + name: drop-next-us + type: s32 + - + name: p-drop + type: u32 + - + name: blue-timer-us + type: s32 + - + name: tc-cbs-attrs + attributes: + - + name: parms + type: binary + struct: tc-cbs-qopt + - + name: tc-choke-attrs + attributes: + - + name: parms + type: binary + struct: tc-red-qopt + - + name: stab + type: binary + - + name: max-p + type: u32 + - + name: tc-codel-attrs + attributes: + - + name: target + type: u32 + - + name: limit + type: u32 + - + name: interval + type: u32 + - + name: ecn + type: u32 + - + name: ce-threshold + type: u32 + - + name: tc-drr-attrs + attributes: + - + name: quantum + type: u32 + - + name: tc-flower-attrs + attributes: + - + name: classid + type: u32 + - + name: indev + type: string + - + name: act + type: array-nest + nested-attributes: tc-act-attrs + - + name: key-eth-dst + type: binary + display-hint: mac + - + name: key-eth-dst-mask + type: binary + display-hint: mac + - + name: key-eth-src + type: binary + display-hint: mac + - + name: key-eth-src-mask + type: binary + display-hint: mac + - + name: key-eth-type + type: u16 + byte-order: big-endian + - + name: key-ip-proto + type: u8 + - + name: key-ipv4-src + type: u32 + byte-order: big-endian + display-hint: ipv4 + - + name: key-ipv4-src-mask + type: u32 + byte-order: big-endian + display-hint: ipv4 + - + name: key-ipv4-dst + type: u32 + byte-order: big-endian + display-hint: ipv4 + - + name: key-ipv4-dst-mask + type: u32 + byte-order: big-endian + display-hint: ipv4 + - + name: key-ipv6-src + type: binary + display-hint: ipv6 + - + name: key-ipv6-src-mask + type: binary + display-hint: ipv6 + - + name: key-ipv6-dst + type: binary + display-hint: ipv6 + - + name: key-ipv6-dst-mask + type: binary + display-hint: ipv6 + - + name: key-tcp-src + type: u16 + byte-order: big-endian + - + name: key-tcp-dst + type: u16 + byte-order: big-endian + - + name: key-udp-src + type: u16 + byte-order: big-endian + - + name: key-udp-dst + type: u16 + byte-order: big-endian + - + name: flags + type: u32 + enum: tc-cls-flags + enum-as-flags: true + - + name: key-vlan-id + type: u16 + byte-order: big-endian + - + name: key-vlan-prio + type: u8 + - + name: key-vlan-eth-type + type: u16 + byte-order: big-endian + - + name: key-enc-key-id + type: u32 + byte-order: big-endian + - + name: key-enc-ipv4-src + type: u32 + byte-order: big-endian + display-hint: ipv4 + - + name: key-enc-ipv4-src-mask + type: u32 + byte-order: big-endian + display-hint: ipv4 + - + name: key-enc-ipv4-dst + type: u32 + byte-order: big-endian + display-hint: ipv4 + - + name: key-enc-ipv4-dst-mask + type: u32 + byte-order: big-endian + display-hint: ipv4 + - + name: key-enc-ipv6-src + type: binary + display-hint: ipv6 + - + name: key-enc-ipv6-src-mask + type: binary + display-hint: ipv6 + - + name: key-enc-ipv6-dst + type: binary + display-hint: ipv6 + - + name: key-enc-ipv6-dst-mask + type: binary + display-hint: ipv6 + - + name: key-tcp-src-mask + type: u16 + byte-order: big-endian + - + name: key-tcp-dst-mask + type: u16 + byte-order: big-endian + - + name: key-udp-src-mask + type: u16 + byte-order: big-endian + - + name: key-udp-dst-mask + type: u16 + byte-order: big-endian + - + name: key-sctp-src-mask + type: u16 + byte-order: big-endian + - + name: key-sctp-dst-mask + type: u16 + byte-order: big-endian + - + name: key-sctp-src + type: u16 + byte-order: big-endian + - + name: key-sctp-dst + type: u16 + byte-order: big-endian + - + name: key-enc-udp-src-port + type: u16 + byte-order: big-endian + - + name: key-enc-udp-src-port-mask + type: u16 + byte-order: big-endian + - + name: key-enc-udp-dst-port + type: u16 + byte-order: big-endian + - + name: key-enc-udp-dst-port-mask + type: u16 + byte-order: big-endian + - + name: key-flags + type: u32 + byte-order: big-endian + - + name: key-flags-mask + type: u32 + byte-order: big-endian + - + name: key-icmpv4-code + type: u8 + - + name: key-icmpv4-code-mask + type: u8 + - + name: key-icmpv4-type + type: u8 + - + name: key-icmpv4-type-mask + type: u8 + - + name: key-icmpv6-code + type: u8 + - + name: key-icmpv6-code-mask + type: u8 + - + name: key-icmpv6-type + type: u8 + - + name: key-icmpv6-type-mask + type: u8 + - + name: key-arp-sip + type: u32 + byte-order: big-endian + - + name: key-arp-sip-mask + type: u32 + byte-order: big-endian + - + name: key-arp-tip + type: u32 + byte-order: big-endian + - + name: key-arp-tip-mask + type: u32 + byte-order: big-endian + - + name: key-arp-op + type: u8 + - + name: key-arp-op-mask + type: u8 + - + name: key-arp-sha + type: binary + - + name: key-arp-sha-mask + type: binary + - + name: key-arp-tha + type: binary + - + name: key-arp-tha-mask + type: binary + - + name: key-mpls-ttl + type: u8 + - + name: key-mpls-bos + type: u8 + - + name: key-mpls-tc + type: u8 + - + name: key-mpls-label + type: u32 + byte-order: big-endian + - + name: key-tcp-flags + type: u16 + byte-order: big-endian + - + name: key-tcp-flags-mask + type: u16 + byte-order: big-endian + - + name: key-ip-tos + type: u8 + - + name: key-ip-tos-mask + type: u8 + - + name: key-ip-ttl + type: u8 + - + name: key-ip-ttl-mask + type: u8 + - + name: key-cvlan-id + type: u16 + byte-order: big-endian + - + name: key-cvlan-prio + type: u8 + - + name: key-cvlan-eth-type + type: u16 + byte-order: big-endian + - + name: key-enc-ip-tos + type: u8 + - + name: key-enc-ip-tos-mask + type: u8 + - + name: key-enc-ip-ttl + type: u8 + - + name: key-enc-ip-ttl-mask + type: u8 + - + name: key-enc-opts + type: binary + - + name: key-enc-opts-mask + type: binary + - + name: in-hw-count + type: u32 + - + name: key-port-src-min + type: u16 + byte-order: big-endian + - + name: key-port-src-max + type: u16 + byte-order: big-endian + - + name: key-port-dst-min + type: u16 + byte-order: big-endian + - + name: key-port-dst-max + type: u16 + byte-order: big-endian + - + name: key-ct-state + type: u16 + - + name: key-ct-state-mask + type: u16 + - + name: key-ct-zone + type: u16 + - + name: key-ct-zone-mask + type: u16 + - + name: key-ct-mark + type: u32 + - + name: key-ct-mark-mask + type: u32 + - + name: key-ct-labels + type: binary + - + name: key-ct-labels-mask + type: binary + - + name: key-mpls-opts + type: binary + - + name: key-hash + type: u32 + - + name: key-hash-mask + type: u32 + - + name: key-num-of-vlans + type: u8 + - + name: key-pppoe-sid + type: u16 + byte-order: big-endian + - + name: key-ppp-proto + type: u16 + byte-order: big-endian + - + name: key-l2-tpv3-sid + type: u32 + byte-order: big-endian + - + name: tc-gred-attrs + attributes: + - + name: parms + type: binary # array of struct: tc-gred-qopt + - + name: stab + type: binary + sub-type: u8 + - + name: dps + type: binary + struct: tc-gred-sopt + - + name: max-p + type: binary + sub-type: u32 + - + name: limit + type: u32 + - + name: vq-list + type: nest + nested-attributes: tca-gred-vq-list-attrs + - + name: tca-gred-vq-list-attrs + attributes: + - + name: entry + type: nest + nested-attributes: tca-gred-vq-entry-attrs + multi-attr: true + - + name: tca-gred-vq-entry-attrs + attributes: + - + name: pad + type: pad + - + name: dp + type: u32 + - + name: stat-bytes + type: u32 + - + name: stat-packets + type: u32 + - + name: stat-backlog + type: u32 + - + name: stat-prob-drop + type: u32 + - + name: stat-prob-mark + type: u32 + - + name: stat-forced-drop + type: u32 + - + name: stat-forced-mark + type: u32 + - + name: stat-pdrop + type: u32 + - + name: stat-other + type: u32 + - + name: flags + type: u32 + - + name: tc-hfsc-attrs + attributes: + - + name: rsc + type: binary + - + name: fsc + type: binary + - + name: usc + type: binary + - + name: tc-hhf-attrs + attributes: + - + name: backlog-limit + type: u32 + - + name: quantum + type: u32 + - + name: hh-flows-limit + type: u32 + - + name: reset-timeout + type: u32 + - + name: admit-bytes + type: u32 + - + name: evict-timeout + type: u32 + - + name: non-hh-weight + type: u32 + - + name: tc-htb-attrs + attributes: + - + name: parms + type: binary + struct: tc-htb-opt + - + name: init + type: binary + struct: tc-htb-glob + - + name: ctab + type: binary + - + name: rtab + type: binary + - + name: direct-qlen + type: u32 + - + name: rate64 + type: u64 + - + name: ceil64 + type: u64 + - + name: pad + type: pad + - + name: offload + type: flag + - + name: tc-act-attrs + attributes: + - + name: kind + type: string + - + name: options + type: sub-message + sub-message: tc-act-options-msg + selector: kind + - + name: index + type: u32 + - + name: stats + type: binary + - + name: pad + type: pad + - + name: cookie + type: binary + - + name: flags + type: bitfield32 + - + name: hw-stats + type: bitfield32 + - + name: used-hw-stats + type: bitfield32 + - + name: in-hw-count + type: u32 + - + name: tc-etf-attrs + attributes: + - + name: parms + type: binary + struct: tc-etf-qopt + - + name: tc-ets-attrs + attributes: + - + name: nbands + type: u8 + - + name: nstrict + type: u8 + - + name: quanta + type: nest + nested-attributes: tc-ets-attrs + - + name: quanta-band + type: u32 + multi-attr: true + - + name: priomap + type: nest + nested-attributes: tc-ets-attrs + - + name: priomap-band + type: u8 + multi-attr: true + - + name: tc-fq-attrs + attributes: + - + name: plimit + type: u32 + - + name: flow-plimit + type: u32 + - + name: quantum + type: u32 + - + name: initial-quantum + type: u32 + - + name: rate-enable + type: u32 + - + name: flow-default-rate + type: u32 + - + name: flow-max-rate + type: u32 + - + name: buckets-log + type: u32 + - + name: flow-refill-delay + type: u32 + - + name: orphan-mask + type: u32 + - + name: low-rate-threshold + type: u32 + - + name: ce-threshold + type: u32 + - + name: timer-slack + type: u32 + - + name: horizon + type: u32 + - + name: horizon-drop + type: u8 + - + name: tc-fq-codel-attrs + attributes: + - + name: target + type: u32 + - + name: limit + type: u32 + - + name: interval + type: u32 + - + name: ecn + type: u32 + - + name: flows + type: u32 + - + name: quantum + type: u32 + - + name: ce-threshold + type: u32 + - + name: drop-batch-size + type: u32 + - + name: memory-limit + type: u32 + - + name: ce-threshold-selector + type: u8 + - + name: ce-threshold-mask + type: u8 + - + name: tc-fq-pie-attrs + attributes: + - + name: limit + type: u32 + - + name: flows + type: u32 + - + name: target + type: u32 + - + name: tupdate + type: u32 + - + name: alpha + type: u32 + - + name: beta + type: u32 + - + name: quantum + type: u32 + - + name: memory-limit + type: u32 + - + name: ecn-prob + type: u32 + - + name: ecn + type: u32 + - + name: bytemode + type: u32 + - + name: dq-rate-estimator + type: u32 + - + name: tc-netem-attrs + attributes: + - + name: corr + type: binary + - + name: delay-dist + type: binary + sub-type: s16 + - + name: reorder + type: binary + - + name: corrupt + type: binary + - + name: loss + type: binary + - + name: rate + type: binary + - + name: ecn + type: u32 + - + name: rate64 + type: u64 + - + name: pad + type: u32 + - + name: latency64 + type: s64 + - + name: jitter64 + type: s64 + - + name: slot + type: binary + - + name: slot-dist + type: binary + sub-type: s16 + - + name: tc-pie-attrs + attributes: + - + name: target + type: u32 + - + name: limit + type: u32 + - + name: tupdate + type: u32 + - + name: alpha + type: u32 + - + name: beta + type: u32 + - + name: ecn + type: u32 + - + name: bytemode + type: u32 + - + name: dq-rate-estimator + type: u32 + - + name: tc-qfq-attrs + attributes: + - + name: weight + type: u32 + - + name: lmax + type: u32 + - + name: tc-red-attrs + attributes: + - + name: parms + type: binary + struct: tc-red-qopt + - + name: stab + type: binary + - + name: max-p + type: u32 + - + name: flags + type: binary + - + name: early-drop-block + type: u32 + - + name: mark-block + type: u32 + - + name: tc-taprio-attrs + attributes: + - + name: priomap + type: binary + struct: tc-mqprio-qopt + - + name: sched-entry-list + type: nest + nested-attributes: tc-taprio-sched-entry-list + - + name: sched-base-time + type: s64 + - + name: sched-single-entry + type: nest + nested-attributes: tc-taprio-sched-entry + - + name: sched-clockid + type: s32 + - + name: pad + type: pad + - + name: admin-sched + type: binary + - + name: sched-cycle-time + type: s64 + - + name: sched-cycle-time-extension + type: s64 + - + name: flags + type: u32 + - + name: txtime-delay + type: u32 + - + name: tc-entry + type: nest + nested-attributes: tc-taprio-tc-entry-attrs + - + name: tc-taprio-sched-entry-list + attributes: + - + name: entry + type: nest + nested-attributes: tc-taprio-sched-entry + - + name: tc-taprio-sched-entry + attributes: + - + name: index + type: u32 + - + name: cmd + type: u8 + - + name: gate-mask + type: u32 + - + name: interval + type: u32 + - + name: tc-taprio-tc-entry-attrs + attributes: + - + name: index + type: u32 + - + name: max-sdu + type: u32 + - + name: fp + type: u32 + - + name: tc-tbf-attrs + attributes: + - + name: parms + type: binary + struct: tc-tbf-qopt + - + name: rtab + type: binary + - + name: ptab + type: binary + - + name: rate64 + type: u64 + - + name: prate4 + type: u64 + - + name: burst + type: u32 + - + name: pburst + type: u32 + - + name: pad + type: pad + - + name: tca-gact-attrs + attributes: + - + name: tm + type: binary + - + name: parms + type: binary + - + name: prob + type: binary + - + name: pad + type: pad + - + name: tca-stab-attrs + attributes: + - + name: base + type: binary + struct: tc-sizespec + - + name: data + type: binary + - + name: tca-stats-attrs + attributes: + - + name: basic + type: binary + - + name: rate-est + type: binary + - + name: queue + type: binary + - + name: app + type: binary # TODO sub-message needs 2+ level deep lookup + sub-message: tca-stats-app-msg + selector: kind + - + name: rate-est64 + type: binary + - + name: pad + type: pad + - + name: basic-hw + type: binary + - + name: pkt64 + type: binary + +sub-messages: + - + name: tc-options-msg + formats: + - + value: bfifo + fixed-header: tc-fifo-qopt + - + value: cake + attribute-set: tc-cake-attrs + - + value: cbs + attribute-set: tc-cbs-attrs + - + value: choke + attribute-set: tc-choke-attrs + - + value: clsact # no content + - + value: codel + attribute-set: tc-codel-attrs + - + value: drr + attribute-set: tc-drr-attrs + - + value: etf + attribute-set: tc-etf-attrs + - + value: ets + attribute-set: tc-ets-attrs + - + value: fq + attribute-set: tc-fq-attrs + - + value: fq_codel + attribute-set: tc-fq-codel-attrs + - + value: fq_pie + attribute-set: tc-fq-pie-attrs + - + value: flower + attribute-set: tc-flower-attrs + - + value: gred + attribute-set: tc-gred-attrs + - + value: hfsc + fixed-header: tc-hfsc-qopt + - + value: hhf + attribute-set: tc-hhf-attrs + - + value: htb + attribute-set: tc-htb-attrs + - + value: ingress # no content + - + value: mq # no content + - + value: mqprio + fixed-header: tc-mqprio-qopt + - + value: multiq + fixed-header: tc-multiq-qopt + - + value: netem + fixed-header: tc-netem-qopt + attribute-set: tc-netem-attrs + - + value: pfifo + fixed-header: tc-fifo-qopt + - + value: pfifo_fast + fixed-header: tc-prio-qopt + - + value: pfifo_head_drop + fixed-header: tc-fifo-qopt + - + value: pie + attribute-set: tc-pie-attrs + - + value: plug + fixed-header: tc-plug-qopt + - + value: prio + fixed-header: tc-prio-qopt + - + value: qfq + attribute-set: tc-qfq-attrs + - + value: red + attribute-set: tc-red-attrs + - + value: sfb + fixed-header: tc-sfb-qopt + - + value: sfq + fixed-header: tc-sfq-qopt-v1 + - + value: taprio + attribute-set: tc-taprio-attrs + - + value: tbf + attribute-set: tc-tbf-attrs + - + name: tc-act-options-msg + formats: + - + value: gact + attribute-set: tca-gact-attrs + - + name: tca-stats-app-msg + formats: + - + value: bfifo + - + value: blackhole + - + value: cake + attribute-set: tc-cake-stats-attrs + - + value: cbs + - + value: choke + - + value: clsact + - + value: codel + - + value: drr + - + value: etf + - + value: ets + - + value: fq + - + value: fq_codel + - + value: fq_pie + - + value: flower + - + value: gred + - + value: hfsc + - + value: hhf + - + value: htb + - + value: ingress + - + value: mq + - + value: mqprio + - + value: multiq + - + value: netem + - + value: noqueue + - + value: pfifo + - + value: pfifo_fast + - + value: pfifo_head_drop + - + value: pie + - + value: plug + - + value: prio + - + value: qfq + - + value: red + - + value: sfb + - + value: sfq + - + value: taprio + - + value: tbf + +operations: + enum-model: directional + list: + - + name: newqdisc + doc: Create new tc qdisc. + attribute-set: tc-attrs + fixed-header: tcmsg + do: + request: + value: 36 + attributes: &create-params + - tcm-family + - tcm-ifindex + - tcm-handle + - tcm-parent + - tca-kind + - tca-options + - tca-rate + - tca-stab + - tca-chain + - tca-ingress-block + - tca-egress-block + - + name: delqdisc + doc: Delete existing tc qdisc. + attribute-set: tc-attrs + fixed-header: tcmsg + do: + request: + value: 37 + attributes: &lookup-params + - tcm-family + - tcm-ifindex + - tcm-handle + - tcm-parent + - + name: getqdisc + doc: Get / dump tc qdisc information. + attribute-set: tc-attrs + fixed-header: tcmsg + do: + request: + value: 38 + attributes: + - tcm-family + - tcm-ifindex + - tcm-handle + - tcm-parent + - tca-dump-invisible + - tca-dump-flags + reply: + value: 36 + attributes: &tc-all + - tcm-family + - tcm-ifindex + - tcm-handle + - tcm-parent + - tca-kind + - tca-options + - tca-stats + - tca-xstats + - tca-rate + - tca-fcnt + - tca-stats2 + - tca-stab + - tca-chain + - tca-ingress-block + - tca-egress-block + - + name: newtclass + doc: Get / dump tc traffic class information. + attribute-set: tc-attrs + fixed-header: tcmsg + do: + request: + value: 40 + attributes: *create-params + - + name: deltclass + doc: Get / dump tc traffic class information. + attribute-set: tc-attrs + fixed-header: tcmsg + do: + request: + value: 41 + attributes: *lookup-params + - + name: gettclass + doc: Get / dump tc traffic class information. + attribute-set: tc-attrs + fixed-header: tcmsg + do: + request: + value: 42 + attributes: *lookup-params + reply: + value: 40 + attributes: *tc-all + - + name: newtfilter + doc: Get / dump tc filter information. + attribute-set: tc-attrs + fixed-header: tcmsg + do: + request: + value: 44 + attributes: *create-params + - + name: deltfilter + doc: Get / dump tc filter information. + attribute-set: tc-attrs + fixed-header: tcmsg + do: + request: + value: 45 + attributes: *lookup-params + - + name: gettfilter + doc: Get / dump tc filter information. + attribute-set: tc-attrs + fixed-header: tcmsg + do: + request: + value: 46 + attributes: *lookup-params + reply: + value: 44 + attributes: *tc-all + - + name: newchain + doc: Get / dump tc chain information. + attribute-set: tc-attrs + fixed-header: tcmsg + do: + request: + value: 100 + attributes: *create-params + - + name: delchain + doc: Get / dump tc chain information. + attribute-set: tc-attrs + fixed-header: tcmsg + do: + request: + value: 101 + attributes: *lookup-params + - + name: getchain + doc: Get / dump tc chain information. + attribute-set: tc-attrs + fixed-header: tcmsg + do: + request: + value: 102 + attributes: *lookup-params + reply: + value: 100 + attributes: *tc-all + +mcast-groups: + list: + - + name: rtnlgrp-tc + value: 4 From patchwork Wed Dec 13 22:41:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 13492002 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="c4u1tjSv" Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7E8818A; Wed, 13 Dec 2023 14:42:21 -0800 (PST) Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-33638e7f71aso12592f8f.1; Wed, 13 Dec 2023 14:42:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702507332; x=1703112132; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=VLA+yZoLDjFMN/O1juANGCrbT+QdJr4gSE0ytCTmmgg=; b=c4u1tjSvxiVgT/Q6VzPGaTXFxfehipPkK1FS1FGq5QcXkrPDcpW6mtHhxb9bf5E85a DR4+sdXHaRLMsk3YvR9PJSs0ZYBACdP2elvxKXGTuSCK0QD8x0yA4hRBQtGe/8IxfIoy ruj4WhXe/jgXgJZPVE5BR8c3enHnNgTO6ljQtcdlk5rD2dZN/g5Y9qu8pl6yVKVrisE6 CbzF6tEwP9VyzNg5aam58bmj9qLfRJ15IPXcHBb0QXfJGrlf56SPE6pGo+swmwpYEkVw Fq1j7DpP5O/xwzZ2kHrKBdIM6m2wZxny4avMqFcLoRptwkUh7YnyirU/oaExzex1X3DW BuRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702507332; x=1703112132; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VLA+yZoLDjFMN/O1juANGCrbT+QdJr4gSE0ytCTmmgg=; b=K+WloECAXWodkmsUmm4MsyIC4LfqgRHHPj1/eIaNe2mM9cIenLFDbPgSlYFQWZbNsZ xbiGN7ttTYFyK/OAUwkKl+d7Dzpnbj5ePNlVFuisw5mJhRZLryurgm6y3HkguN5mUi14 Aa56wKw7QD4ymB2/IxjKnJQj+vYcrMqdGHmxDLwHkHzU6AjnYFVpOgquvALLbBze2gGn 1n5QohI0f/bNj5py5qDZBDEHnK+B3Ah1O4SaV2m5TyXZMsXWpUG4Xwma8hYkGfAq7YTP yEeTh4ueDgKWmDgf9yKkTnveKGbhI8tVzY5Pn4M8Ne+YQrzyXPsO8yVHN5XWbBhppKnx ebIQ== X-Gm-Message-State: AOJu0Yw2Q1k+noBT1oTxuAnhb6sX6TXc7uX9DDQXU/uZQtGCrp5d7lnN sEzUptxT5DSS7zhtrKQzZECa141NQa+2pQ== X-Google-Smtp-Source: AGHT+IHwwRdiOM6SzNxTg3j+mxfZCkh/ui5oZxQYO7Sxu6FeJbfuyRxNTm9STeKXI+YfvUkXXIFcsw== X-Received: by 2002:a05:6000:8c:b0:333:2fd7:95fd with SMTP id m12-20020a056000008c00b003332fd795fdmr4797055wrx.56.1702507332471; Wed, 13 Dec 2023 14:42:12 -0800 (PST) Received: from imac.fritz.box ([2a02:8010:60a0:0:7840:ddbd:bbf:1e8f]) by smtp.gmail.com with ESMTPSA id c12-20020a5d4f0c000000b00336442b3e80sm998562wru.78.2023.12.13.14.42.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 14:42:11 -0800 (PST) From: Donald Hunter To: netdev@vger.kernel.org, Jakub Kicinski , "David S. Miller" , Eric Dumazet , Paolo Abeni , Jonathan Corbet , linux-doc@vger.kernel.org, Jacob Keller , Breno Leitao Cc: donald.hunter@redhat.com, Donald Hunter Subject: [PATCH net-next v4 09/13] doc/netlink: Regenerate netlink .rst files if ynl-gen-rst changes Date: Wed, 13 Dec 2023 22:41:42 +0000 Message-ID: <20231213224146.94560-10-donald.hunter@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231213224146.94560-1-donald.hunter@gmail.com> References: <20231213224146.94560-1-donald.hunter@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Add ynl-gen-rst.py to the dependencies for the netlink .rst files in the doc Makefile so that the docs get regenerated if the ynl-gen-rst.py script is modified. Use $(Q) to honour V=1 in the rules that run ynl-gen-rst.py Signed-off-by: Donald Hunter Reviewed-by: Jakub Kicinski Reviewed-by: Breno Leitao --- Documentation/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/Makefile b/Documentation/Makefile index 5c156fbb6cdf..3885bbe260eb 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -106,10 +106,10 @@ YNL_RST_FILES_TMP := $(patsubst %.yaml,%.rst,$(wildcard $(YNL_YAML_DIR)/*.yaml)) YNL_RST_FILES := $(patsubst $(YNL_YAML_DIR)%,$(YNL_RST_DIR)%, $(YNL_RST_FILES_TMP)) $(YNL_INDEX): $(YNL_RST_FILES) - @$(YNL_TOOL) -o $@ -x + $(Q)$(YNL_TOOL) -o $@ -x -$(YNL_RST_DIR)/%.rst: $(YNL_YAML_DIR)/%.yaml - @$(YNL_TOOL) -i $< -o $@ +$(YNL_RST_DIR)/%.rst: $(YNL_YAML_DIR)/%.yaml $(YNL_TOOL) + $(Q)$(YNL_TOOL) -i $< -o $@ htmldocs: $(YNL_INDEX) @$(srctree)/scripts/sphinx-pre-install --version-check From patchwork Wed Dec 13 22:41:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 13491994 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FvovFUr8" Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C04052100; Wed, 13 Dec 2023 14:42:21 -0800 (PST) Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-336447f240cso280482f8f.3; Wed, 13 Dec 2023 14:42:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702507334; x=1703112134; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=kHxjA/PI+QAMG6yG9cC6vwGS4SQuFy0Xe9c6W4xTqrU=; b=FvovFUr8+5Aw/FRG+Xl69tY1wVwyKCG71oIyTyzNi4jisGlkJSdt65HPOwMbQdB5Pu KT0Y9/c1h/neQTmdtyG3mhI2tAseJzcxx7+W3a71WxcLAY98zPcgb2Cc312WbFDs8uZo FRByVFB1o3D3867HXmTTlUy5yUY8Oot8K6YVGogtEYqqiMOcdhQMwSiNbKSKn6xmoQSe wwn90XeAeLIX+7IST/GnqOzyMfipAND479C4yjAYHp7SnSqVd9Fp6UeRRjXTqaPrHtOi nbxIm1nVKad3Fs3KFQgpYfu2glfikBxlB2QUrWPrxXiSJvvvWdvb3uwRsNIYBwThl0Uu 4DGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702507334; x=1703112134; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kHxjA/PI+QAMG6yG9cC6vwGS4SQuFy0Xe9c6W4xTqrU=; b=lxoXEh83rnxvtbhOYV+P6kyxbUnQNF1JTHF9DeTU7aBvs1rtQdzB6s49/Ll65mMVzj 5WiaHgENK9Rt9vupa1QsJqpmuhNu0+ol/2UZTJlJwYyNeJO8sqvU8pPbZAsE5jlVahh0 hCVIzH/IWHGESLFs5UpyhK+x2ITn7/hGRIYikxjzL5oKqaP2xnYeo0ir41/Ya/iO+07S OQTAGgsLltufPN9Yz1mhH7x4SpKI6pcrOQ9v2VLZfL7trTu2TDFySmQBkEggYAWT+DhQ N2H9F2x4kuWLY+Y4J01mGnWDQAHqflsOLA3gmbfOJqTLRXGwuhZzyN6AyXZHx0pbYqgD v5+w== X-Gm-Message-State: AOJu0Ywq4FVjrwZ8aXB08gUM+R1Z3glBKB+QASk799LLTKsl0dKqh681 7KE6QjafhjicMvDgMVyzFA3pqnbGXkKyqw== X-Google-Smtp-Source: AGHT+IEg0WtTu4qjzMSrMijZ6fI204HwGzosDV0CpG8WD+3/4kZpxrJ+LzBdVQOSrYPBzdxdTlAFiA== X-Received: by 2002:a5d:58c9:0:b0:336:363e:fa7f with SMTP id o9-20020a5d58c9000000b00336363efa7fmr1496907wrf.140.1702507334118; Wed, 13 Dec 2023 14:42:14 -0800 (PST) Received: from imac.fritz.box ([2a02:8010:60a0:0:7840:ddbd:bbf:1e8f]) by smtp.gmail.com with ESMTPSA id c12-20020a5d4f0c000000b00336442b3e80sm998562wru.78.2023.12.13.14.42.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 14:42:13 -0800 (PST) From: Donald Hunter To: netdev@vger.kernel.org, Jakub Kicinski , "David S. Miller" , Eric Dumazet , Paolo Abeni , Jonathan Corbet , linux-doc@vger.kernel.org, Jacob Keller , Breno Leitao Cc: donald.hunter@redhat.com, Donald Hunter Subject: [PATCH net-next v4 10/13] tools/net/ynl-gen-rst: Add sub-messages to generated docs Date: Wed, 13 Dec 2023 22:41:43 +0000 Message-ID: <20231213224146.94560-11-donald.hunter@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231213224146.94560-1-donald.hunter@gmail.com> References: <20231213224146.94560-1-donald.hunter@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Add a section for sub-messages to the generated .rst files. Signed-off-by: Donald Hunter Reviewed-by: Breno Leitao --- tools/net/ynl/ynl-gen-rst.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tools/net/ynl/ynl-gen-rst.py b/tools/net/ynl/ynl-gen-rst.py index b6292109e236..19e5b34554a1 100755 --- a/tools/net/ynl/ynl-gen-rst.py +++ b/tools/net/ynl/ynl-gen-rst.py @@ -251,6 +251,24 @@ def parse_attr_sets(entries: List[Dict[str, Any]]) -> str: return "\n".join(lines) +def parse_sub_messages(entries: List[Dict[str, Any]]) -> str: + """Parse sub-message definitions""" + lines = [] + + for entry in entries: + lines.append(rst_section(entry["name"])) + for fmt in entry["formats"]: + value = fmt["value"] + + lines.append(rst_bullet(bold(value))) + for attr in ['fixed-header', 'attribute-set']: + if attr in fmt: + lines.append(rst_fields(attr, fmt[attr], 2)) + lines.append("\n") + + return "\n".join(lines) + + def parse_yaml(obj: Dict[str, Any]) -> str: """Format the whole YAML into a RST string""" lines = [] @@ -287,6 +305,11 @@ def parse_yaml(obj: Dict[str, Any]) -> str: lines.append(rst_subtitle("Attribute sets")) lines.append(parse_attr_sets(obj["attribute-sets"])) + # Sub-messages + if "sub-messages" in obj: + lines.append(rst_subtitle("Sub-messages")) + lines.append(parse_sub_messages(obj["sub-messages"])) + return "\n".join(lines) From patchwork Wed Dec 13 22:41:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 13491995 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PtJ6y0Xj" Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 861A2D46; Wed, 13 Dec 2023 14:42:23 -0800 (PST) Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-336417c565eso825342f8f.3; Wed, 13 Dec 2023 14:42:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702507336; x=1703112136; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=uj94wzE87RLEym7VefjYamBPKqN2ktHl1CeOxhfULeA=; b=PtJ6y0XjA99fFGsP8c3sqcqlQoO7vgVqLSne2f5XoUPlbSHCWThlUOaduyU65Tlxtd KFHXp7xF2LHfl/IQ0yHpbWMFClvFPH6zb1lKLMLDiaFV7ZBgjW/yg1rkL85G/x3FEfCL /ul+eCc5kd7aRzTlGstv51vnnkpXcZ/eZ3sS5l0vArAbvThgh5HTehxtgg8vL1grOYoE 6IKiVXoliXXYKp/gZ7Tn41zkXKk8i2/oeC1CQMlrVjGI7YyFS5Qsf4W05zR4Qkb6irko 0uaS1zuf1vKEXgTvCu8YCrtr6mpijHRKwcJDf2qyjY+MfxICK5uyeAKUK23yVA6gOnmJ 790Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702507336; x=1703112136; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uj94wzE87RLEym7VefjYamBPKqN2ktHl1CeOxhfULeA=; b=HH6xuX/ifVkZdmq74iDT2itUpkL3dX3wTKrojGtx6nQwfg9iSLwDvySHJQmFELjIfR iI2PfquwgGFq+0Z1SLn7gVp4j4TYIGdqmKqZKeO3NSSV5Eq9M1rWJeD5u2TX7Yke4Zo9 oZd6DLy1itr7gC6mwO9pNa6nsn6in0R1OGq7H+aS0t08VnXAQ2ct57FBZv3E0pCl7+b8 qsuAwwKr2h8l1g3L7G9Xb3TlJ2BG7/QnHvvuzkQhRQSZvxpvcPKeGR0lPsO1CJj6U1fW 7ActbehfdFYkOLbRKLD/pls9rIF7Cno6aipxx4L4de0SqvReg7G7d88Um1FoWal5Cty5 F0Kg== X-Gm-Message-State: AOJu0YyxsKTvbtzc5Fd0NhtbDSYURGCV900Mb1OOFlT5JlY96uUl0Rv2 FNg2jFDWoEkML+jghxaNwiS9xZz+XgfgBw== X-Google-Smtp-Source: AGHT+IFKAWeGIvpyQ01t5wZdlrjaHPGt+VQIM92P6srZCK0gKoTeZzZDpaFTyKFUS/kNqSgKhyBQ/A== X-Received: by 2002:adf:ff8d:0:b0:336:462a:dc16 with SMTP id j13-20020adfff8d000000b00336462adc16mr74936wrr.166.1702507335913; Wed, 13 Dec 2023 14:42:15 -0800 (PST) Received: from imac.fritz.box ([2a02:8010:60a0:0:7840:ddbd:bbf:1e8f]) by smtp.gmail.com with ESMTPSA id c12-20020a5d4f0c000000b00336442b3e80sm998562wru.78.2023.12.13.14.42.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 14:42:14 -0800 (PST) From: Donald Hunter To: netdev@vger.kernel.org, Jakub Kicinski , "David S. Miller" , Eric Dumazet , Paolo Abeni , Jonathan Corbet , linux-doc@vger.kernel.org, Jacob Keller , Breno Leitao Cc: donald.hunter@redhat.com, Donald Hunter Subject: [PATCH net-next v4 11/13] tools/net/ynl-gen-rst: Sort the index of generated netlink specs Date: Wed, 13 Dec 2023 22:41:44 +0000 Message-ID: <20231213224146.94560-12-donald.hunter@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231213224146.94560-1-donald.hunter@gmail.com> References: <20231213224146.94560-1-donald.hunter@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org The index of netlink specs was being generated unsorted. Sort the output before generating the index entries. Signed-off-by: Donald Hunter Reviewed-by: Jakub Kicinski Reviewed-by: Breno Leitao --- tools/net/ynl/ynl-gen-rst.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/net/ynl/ynl-gen-rst.py b/tools/net/ynl/ynl-gen-rst.py index 19e5b34554a1..6b7afaa56e22 100755 --- a/tools/net/ynl/ynl-gen-rst.py +++ b/tools/net/ynl/ynl-gen-rst.py @@ -377,7 +377,7 @@ def generate_main_index_rst(output: str) -> None: index_dir = os.path.dirname(output) logging.debug("Looking for .rst files in %s", index_dir) - for filename in os.listdir(index_dir): + for filename in sorted(os.listdir(index_dir)): if not filename.endswith(".rst") or filename == "index.rst": continue lines.append(f" {filename.replace('.rst', '')}\n") From patchwork Wed Dec 13 22:41:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 13491993 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="N3DQmMhN" Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96885D56; Wed, 13 Dec 2023 14:42:24 -0800 (PST) Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-3363ebb277bso770150f8f.2; Wed, 13 Dec 2023 14:42:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702507337; x=1703112137; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=v1Cw3Yu6aGvXs5Wx/DiJERo5X0a59a10/3prA+sLwwY=; b=N3DQmMhN7DBdil13H9In7xS0S2I0rKO47Ny3RLnTgGvjYA9cvhqeC5ym89GQKW/7QN nCcjWuwcTMRYSldTA7tY15nKnveXV8yP/4/OeEnvQUpCSrNifBDd0PJNANXsPKvH0DuQ s0RtZTQuZtqeSJlFzbANkvv7z+o1IVo8gbj5JyRDJeqCAMn9RMdnyoXcWWagK9Awgte/ n3sVZfzzSeAzBo1cettoTder+kMri8ZhOocZrgd3QtlmXSzknBR0MDjYUQD9OxP5R3mD nADT5QctBVyLCQTrsh2IBfBrfE6hjdvtbipUkVvtYxwmhWi2haHl0/YU5vRAAzo16v+4 n31Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702507337; x=1703112137; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=v1Cw3Yu6aGvXs5Wx/DiJERo5X0a59a10/3prA+sLwwY=; b=mbAwTK2HGOaymA2xwae13NGsTjjGdge0yfP/c3LX14Nz3V/3fHu3boo9pq+yHvDK33 ez1hIUFZTfyHI8aBrWR4lxlKyeKHfcKqMSvEUyr1Pf+Gs7pbYdSH5JCsF/lEqeGXifSR qqrhO8oVq8T6vCWOcYsfCYr+eTmpRVje22elDgbOhNnPVAVK9kfi5uieHmV0RCuHpHPR EZnR5L3yYif/fkEVsfKO1nvUlPKCPch/XiuejomYCUzAza5guoYIHy8hCntW5T6bJinT Vrgn6WAatObPRx62Ul9oQqQyTKZ+bnGvdVemoXzI6Uox+pG/X+xRju1QQiJnOBBC5vCO qmvQ== X-Gm-Message-State: AOJu0YybEjzOTTSAvMec+b4EhnZYaF89DM0ED+qDz22+wYjaAagCJerv ZMu1HB/5xJZvBv1vVybSVbi67GAMM+7aHg== X-Google-Smtp-Source: AGHT+IGtD5sKA1ffZFl9OEdPFfBz1HeouPmCI0fY4okQtoN3SlcC/c9tgFRH5eWIySS6OCHsAW04Ow== X-Received: by 2002:adf:a4d2:0:b0:333:3e32:8201 with SMTP id h18-20020adfa4d2000000b003333e328201mr3449999wrb.123.1702507337322; Wed, 13 Dec 2023 14:42:17 -0800 (PST) Received: from imac.fritz.box ([2a02:8010:60a0:0:7840:ddbd:bbf:1e8f]) by smtp.gmail.com with ESMTPSA id c12-20020a5d4f0c000000b00336442b3e80sm998562wru.78.2023.12.13.14.42.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 14:42:16 -0800 (PST) From: Donald Hunter To: netdev@vger.kernel.org, Jakub Kicinski , "David S. Miller" , Eric Dumazet , Paolo Abeni , Jonathan Corbet , linux-doc@vger.kernel.org, Jacob Keller , Breno Leitao Cc: donald.hunter@redhat.com, Donald Hunter Subject: [PATCH net-next v4 12/13] tools/net/ynl-gen-rst: Remove bold from attribute-set headings Date: Wed, 13 Dec 2023 22:41:45 +0000 Message-ID: <20231213224146.94560-13-donald.hunter@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231213224146.94560-1-donald.hunter@gmail.com> References: <20231213224146.94560-1-donald.hunter@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org The generated .rst for attribute-sets currently uses a sub-sub-heading for each attribute, with the attribute name in bold. This makes attributes stand out more than the attribute-set sub-headings they are part of. Remove the bold markup from attribute sub-sub-headings. Signed-off-by: Donald Hunter --- tools/net/ynl/ynl-gen-rst.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/net/ynl/ynl-gen-rst.py b/tools/net/ynl/ynl-gen-rst.py index 6b7afaa56e22..675ae8357d5e 100755 --- a/tools/net/ynl/ynl-gen-rst.py +++ b/tools/net/ynl/ynl-gen-rst.py @@ -235,7 +235,7 @@ def parse_attr_sets(entries: List[Dict[str, Any]]) -> str: lines.append(rst_section(entry["name"])) for attr in entry["attributes"]: type_ = attr.get("type") - attr_line = bold(attr["name"]) + attr_line = attr["name"] if type_: # Add the attribute type in the same line attr_line += f" ({inline(type_)})" From patchwork Wed Dec 13 22:41:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 13492000 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="aADOw+bT" Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09E52D5D; Wed, 13 Dec 2023 14:42:24 -0800 (PST) Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-40c236624edso74223725e9.1; Wed, 13 Dec 2023 14:42:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702507339; x=1703112139; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7r+VY7IUuzfIu//kONAqQEZqy6Nlng4O5ksundjjdjw=; b=aADOw+bTaVn+zJPFw3T6UKRucKbZzdeDwWi5k2mfxENBO8+39EAlvV9pCVRNce/xKh b2WkLyYpEqBnqffWbmIQuDtwgnKT0Rgm9kqC3+HyeztdBJKBDrM1HOodIY4eKD9vbFJ5 KUM4WDEmV36/gFERAfs797pBeemiiZP1uKhO7a0MAWQ1sK12cCQksusQZO304MDXXShk 8yYXlJRJQJ9i5GQTRs3JgfGF85EzUED/sQqdiZyEmK0MPfI6yJZXPHjX6Tx/pQfqdOwR 8RyK6u1gh4TIkF0J0oFjVOZKEOAdujIOP0K0BQ342/VND/cROqgRHLNuRTdfHPzB7zLi TQIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702507339; x=1703112139; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7r+VY7IUuzfIu//kONAqQEZqy6Nlng4O5ksundjjdjw=; b=aN8yfFMd3/hhFia04cpKQkstPrwi7Bm65PqJJbf3EK0SydMUdF58ZzeyVxRazjUUhM kxPU2XDX/msItTygLCQ63aC+XnpyD1EQD5nqcZpQgDZm8n/H+wzDukeL7gildYwg3VVX tefVNjIySL7CYipMclJuq7TCw63kAeXwDffCpQ27ylkxWJSlTDoFsbxlfx8AqRNQMcHN Fu+Y2bcHALbsVvRlKiqsrc01/LW1/Lxy7jQ72Z/PD23dvTkyzg7pGSn7TdwSMVk+5UwM tJ9fw1P5BdcLiPiEkPXuRJY0NniTbg9yzuitW4IrMIONSI/lfS/JU/fHGEt2W2mfTNlK b0Jw== X-Gm-Message-State: AOJu0YzzHBDYmaS2tFNItFPavUVqphhCdVwuGJh4Zgx+gUBY0OdAuPmN UG35OO0orf7wYV20jNWDbHCjGwpiZFOLOQ== X-Google-Smtp-Source: AGHT+IGHVhJIpAv0lGWB+wjeqbGWoqwX0Z5gxyrV3lt0zggyaHuhUWfwuIFbew11ron5fFYcwXlyKQ== X-Received: by 2002:a05:600c:2d4c:b0:40b:5e1e:b3ae with SMTP id a12-20020a05600c2d4c00b0040b5e1eb3aemr4255056wmg.44.1702507338865; Wed, 13 Dec 2023 14:42:18 -0800 (PST) Received: from imac.fritz.box ([2a02:8010:60a0:0:7840:ddbd:bbf:1e8f]) by smtp.gmail.com with ESMTPSA id c12-20020a5d4f0c000000b00336442b3e80sm998562wru.78.2023.12.13.14.42.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 14:42:17 -0800 (PST) From: Donald Hunter To: netdev@vger.kernel.org, Jakub Kicinski , "David S. Miller" , Eric Dumazet , Paolo Abeni , Jonathan Corbet , linux-doc@vger.kernel.org, Jacob Keller , Breno Leitao Cc: donald.hunter@redhat.com, Donald Hunter Subject: [PATCH net-next v4 13/13] tools/net/ynl-gen-rst: Remove extra indentation from generated docs Date: Wed, 13 Dec 2023 22:41:46 +0000 Message-ID: <20231213224146.94560-14-donald.hunter@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231213224146.94560-1-donald.hunter@gmail.com> References: <20231213224146.94560-1-donald.hunter@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org The output from ynl-gen-rst.py has extra indentation that causes extra
elements to be generated in the HTML output. Reduce the indentation so that sphinx doesn't generate unnecessary
elements. Signed-off-by: Donald Hunter Reviewed-by: Breno Leitao --- tools/net/ynl/ynl-gen-rst.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/net/ynl/ynl-gen-rst.py b/tools/net/ynl/ynl-gen-rst.py index 675ae8357d5e..f7d5bf96736f 100755 --- a/tools/net/ynl/ynl-gen-rst.py +++ b/tools/net/ynl/ynl-gen-rst.py @@ -69,7 +69,7 @@ def rst_paragraph(paragraph: str, level: int = 0) -> str: def rst_bullet(item: str, level: int = 0) -> str: """Return a formatted a bullet""" - return headroom(level) + f" - {item}" + return headroom(level) + f"- {item}" def rst_subsection(title: str) -> str: @@ -245,7 +245,7 @@ def parse_attr_sets(entries: List[Dict[str, Any]]) -> str: for k in attr.keys(): if k in preprocessed + ignored: continue - lines.append(rst_fields(k, sanitize(attr[k]), 2)) + lines.append(rst_fields(k, sanitize(attr[k]), 0)) lines.append("\n") return "\n".join(lines) @@ -263,7 +263,7 @@ def parse_sub_messages(entries: List[Dict[str, Any]]) -> str: lines.append(rst_bullet(bold(value))) for attr in ['fixed-header', 'attribute-set']: if attr in fmt: - lines.append(rst_fields(attr, fmt[attr], 2)) + lines.append(rst_fields(attr, fmt[attr], 1)) lines.append("\n") return "\n".join(lines)