From: Jakub Kicinski <kuba@kernel.org>
To: houminxi@gmail.com
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
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 [thread overview]
Message-ID: <20261020202440.1012706-1-kuba@kernel.org> (raw)
In-Reply-To: <20261015024132.698658-2-houminxi@gmail.com>
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
next prev parent reply other threads:[~2026-10-20 20:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-15 2:41 [PATCH net-next v3 0/2] netlink: specs: fill in the missing ovs operations Minxi Hou
2026-10-15 2:41 ` [PATCH net-next v3 1/2] netlink: specs: add ovs_flow del and set operations Minxi Hou
2026-10-20 20:24 ` Jakub Kicinski [this message]
2026-10-15 2:41 ` [PATCH net-next v3 2/2] netlink: specs: add ovs datapath and vport " Minxi Hou
2026-10-20 20:24 ` Jakub Kicinski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261020202440.1012706-1-kuba@kernel.org \
--to=kuba@kernel.org \
--cc=davem@davemloft.net \
--cc=donald.hunter@gmail.com \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=houminxi@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox