From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oi1-f175.google.com (mail-oi1-f175.google.com [209.85.167.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DFA3936AF6 for ; Sun, 17 May 2026 08:34:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779006863; cv=none; b=KNE634iTUhckSXabvZluVSq92raCmGkInUNvV19kQQA3w1dbbYw3boQ+VBCX431gCtIjdh/uYRUslEzaCOH5a7YeKxp1QVzcCNjFh8xcIigZGX3Qz/K5lkcur1/gedQFEJgKPbswqEWD3jBBCDfm1iJU8E5mqH1k38nJ+8Awck0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779006863; c=relaxed/simple; bh=feLLfQFvpoIClWFfZ2Qy7Vj9jKgNx4+zS4dEVQfjxm4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UvelTknAZkVV+DvK/N9HIu4REu/H8t4xT9cZco/GD36U1q6AcwinDJ4m3EVRtXGhBxat5OSunpXAivHtSB5/jOcEmGyW3dxb2IAhsHdIK6BqOn64ahsq78HylRWeKNMmFC7+ebNttBrm0gslYvsx1WlBQn9GbwJKMQefaYGwlgY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=cytnjjUS; arc=none smtp.client-ip=209.85.167.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="cytnjjUS" Received: by mail-oi1-f175.google.com with SMTP id 5614622812f47-47c35be02fdso406555b6e.3 for ; Sun, 17 May 2026 01:34:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779006861; x=1779611661; 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=SeQkqDrAPMYn0zYuhzYdu377fHXEuEM6zjwZuagDHgQ=; b=cytnjjUSyuvVimvJfns9Vm9BOHOOdLMU7BAQ2VPWiQhlVatdZVbfO7y+9KVaefuykJ Wg1xGjeUvazdQiEmNUohd/i3mUwxLkPYTtUcZuTK0I1oUqoBMOjEm6GD5n0Tjymm7IC6 rMpH5DuLTd4Q49TVZKNWzR6o7hlucv1nzc+Be6KdIQoUvnTDt2Fah5Om00vnFd3fE0j0 eS7JjVLmsNMU9lvItA2ffVXmHwrrWn6zmn7hC0E+78TUhxIdVnOEgf8polOXCGue1NxR Z9BP4hsNw+ZQgfSqZsdXJg6vvYaEfuHXiQ4T/Tx0uigA3IdBzhPB79gtpgipKscyv0HL 30Bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779006861; x=1779611661; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=SeQkqDrAPMYn0zYuhzYdu377fHXEuEM6zjwZuagDHgQ=; b=qg5SQvj9OLsQ/vidvX5M6+uItlr9rSqQTDDJfTyfyhk9gyLzV7nKjWIann20/1xSmb R8G3XjXp7Ku/WmI4DbN4wu3gK2AyF1eEQYdsHrzxxSQKiLnpf6PVBgT3/SugzefnXzti EmgwrrGzEmDwM8IivnzBeTMGrEiPM4S4ZXanOjAuSz9TP/gMNTmLaU5eeFdwDDeeC6zt 0e451ujmQqY6TPWikHN7PbZp+JXjCku/1+ez67YjHDSL6zCoI6SZyR/dWLAVfgdUNEO3 cQitOEGBjQOnvLph9/kAXLU0KuIeUy3JEiUPhWZ/xTZMyBTu8wpiPc9UhzEOBnyvwspF sayg== X-Forwarded-Encrypted: i=1; AFNElJ/Twprw7k3k+3DPOwEHObbTsC8seDVW5z9xinMtAf4MDz+WAUhGZwoICXEv1eCQF9T9jinza5iLt6exsyo=@vger.kernel.org X-Gm-Message-State: AOJu0YybeSeusDCh63pdU079ERcVbDnPSpT/+qw3509wxTE6eu+zQ/SJ 3n405SuvsYOemhW5ElvbgalCOCtMumfLt6oQFxZLA5Zq99mfFlwLCUJj X-Gm-Gg: Acq92OHedLgHSVQhm1jPQiHORtMcdCNZswT4m70eOH3ETga/BFWUMJvbMCGqa0jebz3 Gm8N61IeNRDSxPyRJBc7+T8zWTR1ZsJJv6bIPRFIN/hu1HIEhwPQ7OWGXyDW5dBrQ6WREiQUrD8 qmZqBqH8qCc7xNYcSuL15K3JXOPVkRpCHsSTE7r+/XhEsu2Mm4g4usmLKi/3uUwSXV3ivP9GEUd FBHeM4u+ICeUnosb+BfL+fyyv0Y1FGuxL78iy1WbCY+e0e3mnzgNjXujdf54abZFACyhRk7phjW qc2K6mmKenogb2Zbzrkgy96OIyHlshhOyoKPcrQ2+gBklokKokwSTMCFVEWGZqDEyc+WgGBRZ+l gpvFBeMe/lGaQJln1R0a8GK+GudnNA+Bdg3SHj9IqPWnqgoZkzT3umZybY1USBlKDC7HCArEkLh vGIyXgbC1iU3jw9jo= X-Received: by 2002:a05:6808:e412:b0:467:ee:7a2f with SMTP id 5614622812f47-482e577d4f5mr5216362b6e.28.1779006860619; Sun, 17 May 2026 01:34:20 -0700 (PDT) Received: from houminxi ([72.244.37.221]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7e55bbd0bd6sm5345191a34.13.2026.05.17.01.34.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 May 2026 01:34:19 -0700 (PDT) From: Minxi Hou To: netdev@vger.kernel.org Cc: Donald Hunter , Jakub Kicinski , "David S . Miller" , Eric Dumazet , Paolo Abeni , Simon Horman , Aaron Conole , linux-kernel@vger.kernel.org, Minxi Hou Subject: [PATCH 1/2] netlink: specs: add OVS packet family specification Date: Sun, 17 May 2026 16:33:57 +0800 Message-ID: <20260517083358.2088599-2-houminxi@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260517083358.2088599-1-houminxi@gmail.com> References: <20260517083358.2088599-1-houminxi@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Add YAML netlink spec for the OVS_PACKET_FAMILY (ovs_packet). This completes the set of OVS genetlink family specs (ovs_datapath, ovs_flow, ovs_vport already exist). The spec defines three operations: MISS (event), ACTION (event), and EXECUTE (do). MISS and ACTION are kernel-to-userspace upcalls sent via genlmsg_unicast(); EXECUTE is the only registered genl operation. Key, actions, and egress-tun-key attributes are typed as binary rather than nest because the nested attribute definitions belong to the ovs_flow spec and cross-spec references are not supported by the YNL framework. Signed-off-by: Minxi Hou --- Documentation/netlink/specs/ovs_packet.yaml | 138 ++++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 Documentation/netlink/specs/ovs_packet.yaml diff --git a/Documentation/netlink/specs/ovs_packet.yaml b/Documentation/netlink/specs/ovs_packet.yaml new file mode 100644 index 000000000000..7ef14b68df4e --- /dev/null +++ b/Documentation/netlink/specs/ovs_packet.yaml @@ -0,0 +1,138 @@ +# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) + +name: ovs_packet +version: 1 +protocol: genetlink-legacy +uapi-header: linux/openvswitch.h + +doc: | + OVS packet execution over generic netlink. + + Only OVS_PACKET_CMD_EXECUTE is exposed as a genl operation. + OVS_PACKET_CMD_MISS and OVS_PACKET_CMD_ACTION are kernel-to-userspace + upcalls sent via genlmsg_unicast() to the vport's upcall_pid and have + no associated genl_ops or multicast group. + + Several attributes in the attribute set (userdata, egress-tun-key, len) + exist for the upcall path and are not used by the EXECUTE operation. + For EXECUTE, packet, key, and actions are mandatory (kernel returns + -EINVAL without them). + +definitions: + - + name: ovs-header + type: struct + members: + - + name: dp-ifindex + type: u32 + +attribute-sets: + - + name: packet + name-prefix: ovs-packet-attr- + enum-name: ovs-packet-attrs + attributes: + - + name: packet + type: binary + doc: Packet data, from the start of the Ethernet header. + checks: + min-len: 14 + - + name: key + type: binary + doc: | + Nested OVS_KEY_ATTR_* attributes, extracted flow key. + Defined as binary because the key attribute-set belongs to the + ovs_flow family spec; cross-spec references are not supported. + - + name: actions + type: binary + doc: | + Nested OVS_ACTION_ATTR_* attributes. + Defined as binary for the same reason as key. + - + name: userdata + type: binary + doc: Opaque userspace cookie from OVS_USERSPACE_ATTR_USERDATA. + - + name: egress-tun-key + type: binary + doc: Nested OVS_TUNNEL_KEY_ATTR_* for output tunnel metadata. + - + name: unused1 + type: unused + - + name: unused2 + type: unused + - + name: probe + type: flag + doc: Packet operation is a feature probe, error logging suppressed. + - + name: mru + type: u16 + doc: Maximum received IP fragment size. + - + name: len + type: u32 + doc: Packet size before truncation. + - + name: hash + type: u64 + doc: Packet hash, low 32 bits are skb hash, upper bits are flags. + - + name: upcall-pid + type: u32 + doc: Netlink PID to use for upcalls during EXECUTE processing. + +operations: + fixed-header: ovs-header + name-prefix: ovs-packet-cmd- + list: + - + name: miss + doc: Notify userspace of a flow table miss for a received packet. + value: 1 + attribute-set: packet + event: + attributes: + - packet + - key + - userdata + - actions + - egress-tun-key + - mru + - len + - hash + - + name: action + doc: Notify userspace as requested by an OVS_ACTION_ATTR_USERSPACE action. + value: 2 + attribute-set: packet + event: + attributes: + - packet + - key + - userdata + - actions + - egress-tun-key + - mru + - len + - hash + - + name: execute + doc: Apply actions to a packet. + value: 3 + attribute-set: packet + do: + request: + attributes: + - packet + - key + - actions + - probe + - mru + - hash + - upcall-pid -- 2.53.0