🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #5695

Re: [PATCH net-next v3 1/2] netlink: specs: add ovs_flow del and set operations

#5695
From: Jakub Kicinski
Date: Tue, 20 Oct 2026 20:24
109 lines
11558 bytes
This is an AI-generated review of your patch. The human sending this
email has considered the AI review valid, or at least plausible.
---
netlink: specs: add ovs_flow del and set operations

This patch adds the del and set operations to the ovs_flow YNL spec. It
marks new, del and set as needing admin permission and lists the
attributes each command reads. It also changes probe from binary to flag
to match the kernel policy, and rewrites the doc for the key attribute.

> diff --git a/Documentation/netlink/specs/ovs_flow.yaml b/Documentation/netlink/specs/ovs_flow.yaml
> index 951837b72e1d..e5e110b6ccc8 100644
> --- a/Documentation/netlink/specs/ovs_flow.yaml
> +++ b/Documentation/netlink/specs/ovs_flow.yaml
> @@ -384,7 +384,9 @@ attribute-sets:
>          nested-attributes: key-attrs
>          doc: |
>            Nested attributes specifying the flow key. Always present in
> -          notifications. Required for all requests (except dumps).
> +          notifications. A request may carry a ufid instead, except for a
> +          new flow, which needs a key. A set that replaces the actions
> +          needs a key too.

[Severity: Low]
Should include/uapi/linux/openvswitch.h get the same update? The
kernel-doc for enum ovs_flow_attr still says:

 * @OVS_FLOW_ATTR_KEY: Nested %OVS_KEY_ATTR_* attributes specifying the flow
 * key.  Always present in notifications.  Required for all requests (except
 * dumps).

The spec text was first copied from that header. After this patch the two
in-tree descriptions of this attribute disagree, and the header still
describes a rule the kernel does not enforce.

ovs_flow_cmd_set() only rejects the request when both the key and the ufid
are missing:

	if (!a[OVS_FLOW_ATTR_KEY] && !ufid_present) {
		OVS_NLERR(log,
			  "Flow set message rejected, Key attribute missing.");
		return -EINVAL;
	}

ovs_flow_cmd_get() does the same:

	} else if (!ufid_present) {
		OVS_NLERR(log,
			  "Flow get message rejected, Key attribute missing.");
		err = -EINVAL;
	}

The new wording also drops the "except dumps" exception. "A request may
carry a ufid instead" suggests that every request other than new needs
either a key or a ufid. But ovs_flow_cmd_dump() reads neither, and a del
that carries neither is a valid flush of the data path.

Could the doc mention those two cases as well?

[Severity: Low]
This is a pre-existing issue, not one this patch introduced, but is
"Always present in notifications" accurate? This patch keeps the sentence
in the paragraph it rewrites, and the same text is in
include/uapi/linux/openvswitch.h.

ovs_flow_cmd_fill_info() calls ovs_nla_put_identifier(). For a
ufid-identified flow, that emits OVS_FLOW_ATTR_UFID instead of the key:

	if (ovs_identifier_is_ufid(&flow->id))
		return nla_put(skb, OVS_FLOW_ATTR_UFID, flow->id.ufid_len,
			       flow->id.ufid);

The key is then added only if should_fill_key() returns true:

	return ovs_identifier_is_ufid(sfid) &&
	       !(ufid_flags & OVS_UFID_F_OMIT_KEY);

So when the flow is ufid-identified and the request sets
OVS_UFID_F_OMIT_KEY in ufid-flags, the reply or notification has no key.

[ ... ]

> @@ -438,7 +440,7 @@ attribute-sets:
>            are exact match bits.
>        -
>          name: probe
> -        type: binary
> +        type: flag

[Severity: Low]
This corrects an existing mismatch with the kernel policy in flow_policy:

	[OVS_FLOW_ATTR_PROBE] = { .type = NLA_FLAG },

The binary type came in with the commit that added ovs_flow.yaml. Should
this change carry a tag like:

Fixes: 93b230b549bc ("netlink: specs: add ynl spec for ovs_flow")

Could it also go in a separate patch, so it can be picked up or backported
apart from the new del and set operations?

>          doc: |
>            Flow operation is a feature probe, error logging should be suppressed.

[ ... ]
-- 
pw-bot: cr
Technical Details
Message-ID: <20261020202440.1012706-1-kuba@kernel.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-349550-linux-kernel-netdev=dewy.ru
References: <20261015024132.698658-2-houminxi@gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-349550-linux-kernel-netdev=dewy.ru
From: kuba@kernel.org (Jakub Kicinski)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v3 1/2] netlink: specs: add ovs_flow del and set operations
Date: Tue, 20 Oct 2026 13:24:40 -0700
Organization: Usenet Network
Message-ID: <20261020202440.1012706-1-kuba@kernel.org>
References: <20261015024132.698658-2-houminxi@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="3951484"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:d4vAf8/OCnd678cOyZUL/GPsXoc= sha256:H4Xdlbgrq5i0ru3eG+ZLRL/w1gkoTxiXcxBm1IAzCpw=
	sha1:UcyoTyDsFKZRSwglT9kt4WSfvpI= sha256:gYvV6W1UoN0fBfjGHgaTc8Ef4WIgsFJBXsMbPKoBZiI=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id C3F49110E33; Tue, 20 Oct 2026 23:30:28 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.729
X-Spam-Status: No, score=-3.729 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.329, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id 9ROsZH7t7vhN;
	Tue, 20 Oct 2026 23:30:26 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-349550-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id C135B110E30; Tue, 20 Oct 2026 23:30:16 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 268D92BDA0; Tue, 20 Oct 2026 20:24:44 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1792527884;
	b=woZWjtvJoNyXM15PCcs6C5E7U54mr/AFwGHukA0/2PntqAQ7ZnygZUpLRla59tRBCFU8
	 GYOWmEvuzThbVH+QrIeOruIjfXWqt/PHHyWTfF2mz0A2cHNtlBerNM0gXhjw7fLt1Tmbc
	 nEpWSOv+fbt8xVVeashxDmT7mEbCFPOz6FuootGcorHdBHOAqh8461wiGeBAeBDEJ77AR
	 S2Cfp0IpsVjjwKgiDuS+Ai0k2/gnq5NBrEG2rjF8OWllSTfl3orzp83/WMToMlA8Sbjgy
	 ayFRI9Rc3PuPOFSo5XnBgKt6xm7NwhP6jYPIg9SNoJgLrFKAnmoA4/aK3oZ9Fa22HLQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792527884;
	h=X-Original-To:Received:Received:DKIM-Signature:From:To:Cc:Subject:
	 Date:Message-ID:X-Mailer:In-Reply-To:References:X-Mailing-List:
	 List-Id:List-Post:List-Help:List-Subscribe:List-Unsubscribe:
	 List-Owner:Precedence:MIME-Version:Content-Transfer-Encoding;
	bh=+uAvWuSQaoAF+FL2ygKeLUjGdfuQVNcj/nsVPiMmrTg=;
	b=WiJzCg3s2+DRRPk7zsQXbUseYebFH8cgmxVkFiiT1tNTW6UWNMzxSEcvCkw0MbKOrJPN
	 m8b2LcZXO2YyV/hyPheQT8zm8czefT54HbzGWNc+RXaCc82lUZpNx/0ZeqYecyjw1rdfX
	 2xsiGtE5nfBDJCCiBQkbX6WGAUl2VfQyhH4JcKq/BuSloYTkywM3CFFJys69wF2X+5oCe
	 QiBNy9JTkwlxgoS6OMEnQhyOX5r80QZfYhcg0Eo1Bko+qJuepjSKKAUhXGptA2UVa8tX4
	 hVpaOJh6u0rQrJngdQMLQq5iRuF8DGOYEmUosKJ4Oa+5ynimx9mnBO2qYc1jSSxOfiQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=evojr3Nr;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id EB4AE606A31F;
	Tue, 20 Oct 2026 20:24:43 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=evojr3Nr
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1792527883;
	b=2NQe3CuAmb5REONC6RJAdxVQGifS1t+Ka9c7aEMk2cKZ/GljwzkqfxWCpqUUzVCSY95B
	 7DBpqOmsiI+8cUI/UwwAjl/yb/nuwbaetPCZSDgGGtjHwVOq6u+4VkEcDC9ZZvt8920zQ
	 85SJQ73WTcDLrpLWvAHZxv1g+DMDiKtoxDd/oemDlxovYM24S2czBAe2nGRXfbRctbXQF
	 W4eEXf9pcYerzgo2SjOFgmn/QvqZhGQ+plMSJWvmTqTcKagjufMs5pGTa+y0kjqmWq7Ho
	 lAIErqWx0+0hlihGQlj6GDXOlubne4rQVIB8SAwV+t3q1Ad92EhlZUUfRp/F9mwjI8w==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792527883;
	h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer:
	 In-Reply-To:References:MIME-Version:Content-Transfer-Encoding;
	bh=+uAvWuSQaoAF+FL2ygKeLUjGdfuQVNcj/nsVPiMmrTg=;
	b=B2mNKegKkNU2H7l9i/ohv65/9f87uZk1Mw/8ZRkvd5BPEiE9FSFYey6HRzorvfK9tbK8
	 20OsupBc41413tNMCL5rsa5jCnHoe/plPWdYW4q0dSN03gvKLk8KurjABX9+0sTCI4Jb+
	 gzzX8hFoPs63adtNa4mNHKZqOFIvRzb2hpaa1QJHeo3Gouko6NOY9ZWriyiMyBWEfFH6g
	 N7f481lyFhoXLYt91qVGb5fHBmo4EStMSSbWcNt1v6Ifvw8cSxgCuoB8/u+lUIecq1lCS
	 eCppnfBKvHP0uLet9C+gdi4X/9ea2j0DpTPaPbELNrb2JIKfbeq/+I6VvSWxyBbEzkw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=evojr3Nr;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id CA171606A319
	for <netdev@vger.kernel.org>; Tue, 20 Oct 2026 20:24:42 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 221D91F000C9;
	Tue, 20 Oct 2026 20:24:42 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1792527882;
	bh=+uAvWuSQaoAF+FL2ygKeLUjGdfuQVNcj/nsVPiMmrTg=;
	h=From:To:Cc:Subject:Date:In-Reply-To:References;
	b=evojr3NrU7BPrLWqGboCXuHjN5MWWl5YmljM6A1qR+bCLN0bAd1DNQQrRej6Mf4v5
	 TXA/egKLLigYZuu9UiQPyv3zIK1lrcD5TtxaOi0YftCGBXAmUksO77zJcnbqttiv08
	 tN8o+Pr/N4nC0iq0d89scdLfz9u1H/7dwxHqx3YgI+CxKnhT/r4es/AEpeg5sRXo1f
	 oMogsYLcCE+TylLUS0nelA0QYC0QliBxPVbtXCIvTIrS1JEHgEikvxWXEnP/CIYKZ0
	 P8lFFW1YUjJ6vxNadD3fhk7OsgA/Nhpb5gXNeGjL5aYvBNVqHouC8TDoolDVSyqe9w
	 vVBb+srTOT3tg==
X-Cc: Jakub Kicinski <kuba@kernel.org>,
	netdev@vger.kernel.org,
	donald.hunter@gmail.com,
	davem@davemloft.net,
	edumazet@google.com,
	pabeni@redhat.com,
	horms@kernel.org
X-Mailer: git-send-email 2.56.0
X-In-Reply-To: <20261015024132.698658-2-houminxi@gmail.com>
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list