Article View: linux.kernel.netdev
Article #16563[PATCH net-next v8 2/3] netlink: specs: add ovs datapath and vport set operations
From: Minxi Hou
Date: Sun, 15 Nov 2026 07:26
Date: Sun, 15 Nov 2026 07:26
196 lines
17165 bytes
17165 bytes
Both families register a SET command that the spec never described, so a
YNL client could not change an existing datapath or vport. The datapath
NEW command also gains the masks cache size, the per-cpu upcall pids and
the ifindex, which its handler reads. new, del and set take
CAP_NET_ADMIN, which is GENL_UNS_ADMIN_PERM in the kernel.
The datapath SET command changes the user features, the masks cache size
and the per-cpu upcall pids. A request that leaves out user-features is
read as zero, which clears the features set earlier. per-cpu-pids takes
effect only when the same request sets OVS_DP_F_DISPATCH_UPCALL_PER_CPU
in user-features; without that bit the pids are dropped and the request
still succeeds.
The vport SET command changes the upcall pid. It finds the vport by name,
or by port number when the request carries no name. An ifindex or options
are rejected with -EOPNOTSUPP, and a type that differs from the vport's
type with -EINVAL. The type only has to match. The vport NEW request list
gains the port number, which its handler reads.
The ifindex attribute is signed in both policies, which read it with
nla_get_s32_default() and reject anything below zero, so declare it as
s32 to match them rather than leaving it u32. The field in the generated
reply struct becomes __s32 with it. The reply itself does not change:
ovs_vport_cmd_fill_info() still puts the value as u32, and the two types
have the same width.
The ops in both families skip strict and dump validation in the kernel,
so the spec says so for get, new, del and set.
Both SET commands also send the updated object to the family's multicast
group, and to the requester when the request sets NLM_F_ECHO, which the
new op docs say.
Signed-off-by: Minxi Hou <houminxi@gmail.com>
---
Documentation/netlink/specs/ovs_datapath.yaml | 37 ++++++++++++++++++-
Documentation/netlink/specs/ovs_vport.yaml | 31 +++++++++++++++-
2 files changed, 65 insertions(+), 3 deletions(-)
diff --git a/Documentation/netlink/specs/ovs_datapath.yaml b/Documentation/netlink/specs/ovs_datapath.yaml
index f7b3671991e6..6232760224dc 100644
--- a/Documentation/netlink/specs/ovs_datapath.yaml
+++ b/Documentation/netlink/specs/ovs_datapath.yaml
@@ -108,7 +108,9 @@ attribute-sets:
sub-type: u32
-
name: ifindex
- type: u32
+ type: s32
+ checks:
+ min: 0
operations:
fixed-header: ovs-header
@@ -119,6 +121,7 @@ operations:
doc: Get / dump OVS data path configuration and state
value: 3
attribute-set: datapath
+ dont-validate: [strict, dump]
do: &dp-get-op
request:
attributes:
@@ -135,24 +138,54 @@ operations:
dump: *dp-get-op
-
name: new
- doc: Create new OVS data path
+ doc: |
+ Create new OVS data path. per-cpu-pids takes effect only when the
+ same request sets OVS_DP_F_DISPATCH_UPCALL_PER_CPU in user-features.
value: 1
attribute-set: datapath
+ dont-validate: [strict, dump]
+ flags: [uns-admin-perm]
do:
request:
attributes:
- name
- upcall-pid
- user-features
+ - masks-cache-size
+ - per-cpu-pids
+ - ifindex
-
name: del
doc: Delete existing OVS data path
value: 2
attribute-set: datapath
+ dont-validate: [strict, dump]
+ flags: [uns-admin-perm]
+ do:
+ request:
+ attributes:
+ - name
+ -
+ name: set
+ doc: |
+ Modify an existing OVS data path. The kernel treats a missing
+ user-features attribute as zero and clears the previously set
+ features. per-cpu-pids takes effect only when the same request
+ sets OVS_DP_F_DISPATCH_UPCALL_PER_CPU in user-features. A
+ successful set also sends the updated data path to the
+ family's multicast group, and to the requester when the
+ request sets NLM_F_ECHO.
+ value: 4
+ attribute-set: datapath
+ dont-validate: [strict, dump]
+ flags: [uns-admin-perm]
do:
request:
attributes:
- name
+ - user-features
+ - masks-cache-size
+ - per-cpu-pids
mcast-groups:
list:
diff --git a/Documentation/netlink/specs/ovs_vport.yaml b/Documentation/netlink/specs/ovs_vport.yaml
index fa975f8821b6..af7ee56f5f90 100644
--- a/Documentation/netlink/specs/ovs_vport.yaml
+++ b/Documentation/netlink/specs/ovs_vport.yaml
@@ -111,7 +111,9 @@ attribute-sets:
type: unused
-
name: ifindex
- type: u32
+ type: s32
+ checks:
+ min: 0
-
name: netnsid
type: u32
@@ -128,18 +130,23 @@ operations:
name: new
doc: Create a new OVS vport
attribute-set: vport
+ dont-validate: [strict, dump]
+ flags: [uns-admin-perm]
do:
request:
attributes:
- name
- type
- upcall-pid
+ - port-no
- ifindex
- options
-
name: del
doc: Delete existing OVS vport from a data path
attribute-set: vport
+ dont-validate: [strict, dump]
+ flags: [uns-admin-perm]
do:
request:
attributes:
@@ -150,6 +157,7 @@ operations:
name: get
doc: Get / dump OVS vport configuration and state
attribute-set: vport
+ dont-validate: [strict, dump]
do: &vport-get-op
request:
attributes:
@@ -165,6 +173,27 @@ operations:
- netnsid
- upcall-stats
dump: *vport-get-op
+ -
+ name: set
+ doc: |
+ Modify an existing OVS vport. The vport is picked by name, or by
+ port number when the request carries no name. An ifindex or options
+ are rejected with -EOPNOTSUPP, and a type that differs from the
+ vport's type with -EINVAL. The type only has to match; the one
+ attribute that changes state is upcall-pid. A successful set
+ also sends the updated vport to the family's multicast group,
+ and to the requester when the request sets NLM_F_ECHO.
+ value: 4
+ attribute-set: vport
+ dont-validate: [strict, dump]
+ flags: [uns-admin-perm]
+ do:
+ request:
+ attributes:
+ - name
+ - type
+ - upcall-pid
+ - port-no
mcast-groups:
list:
--
2.56.0
Technical Details
Message-ID:
<20261115072638.3163018-3-houminxi@gmail.com>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!2.eu.feeder.erje.net!feeder.erje.net!feeder3.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-363594-linux-kernel-netdev=dewy.ruReferences:
<20261115072638.3163018-1-houminxi@gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!2.eu.feeder.erje.net!feeder.erje.net!feeder3.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-363594-linux-kernel-netdev=dewy.ru From: houminxi@gmail.com (Minxi Hou) Newsgroups: linux.kernel.netdev Subject: [PATCH net-next v8 2/3] netlink: specs: add ovs datapath and vport set operations Date: Sun, 15 Nov 2026 02:26:37 -0500 Organization: Usenet Network Message-ID: <20261115072638.3163018-3-houminxi@gmail.com> References: <20261115072638.3163018-1-houminxi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="1747948"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:fVoSSbK+bjVPr9UDEZYLc2KfHAM= sha256:W6UXZF0F5p97eLmmQ5FdTh+HI5afpb8kQDWXf3Gtny4= sha1:QcsCAS3zkbasm7aQFQBV/SRUOVQ= sha256:wC/XtISovud4+XDbmrWpjWoV0htI+7hGco0Snyz11Lw= 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 1657B11602A; Sun, 15 Nov 2026 10:27:16 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.049 X-Spam-Status: No, score=-3.049 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, 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=gmail.com 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 bok5RAmErrMr; Sun, 15 Nov 2026 10:27:12 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-363594-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id 9405811495B; Sun, 15 Nov 2026 10:27:04 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id E790C3A9C3; Sun, 15 Nov 2026 07:27:02 +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=1794727622; b=cEUp6lfhuyW02RZIfeoeyx1TvBPTEmHjVWF98OoR4aRstN81x3nFNkHSc6eFDF4WIMu3 8io0HBOtH69Hv8Ax0soW9izLOdcE9ejIO/GHICuGiFuNlPb2vEFV1mijp6oYYSogKCoW7 evR1Ht1xxb4gGPpE36+Cy79HOMjRmlWcKQeyNcB63PQlry4bnynwcC3nHmJbKnItu6LCl 9H1OpUI+uq1NvCSEgwzLBrKy0Kmo1kpbKqzd1ANUrjD73fAhuh8uEw9mTf8c7cfZ3iRYT oUFoCjRQfwHK76NIxjoBcRoDOefvug9hsEveU909BGC7ljH1PLGNlKgSZHhPgmpqoNA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794727622; h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature: X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received: Received: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=JUvotkktEds6gRJwB702NqNzkgXlw2/4WsAAh7Vg0es=; b=q1TKON4P2SC2CN6L2PlV5tVROjX7W9DDHL0ukZ0NRUbqXpq3ZvBmAVgNX6l832bsTmbb 6saiI2QhXrtN3HvrCpgcULuLdE+W399rVC4b9gR3PiPYbC2/+y89GrtKxk/r8KEGVe4sj Fi7/UbfP/8YVKzmvzEUL9srMfQoGHUezzfBIZC9c93CsRSbAmmfh+U6uGAuOyanGxc62X pDNDwgcr3xZEtSJSbdhK9NLerD1pgYhvHpGq5f4YGnegGwC9yoUg1zygRSWrGTi2L5kmI d5oYHlqVDGBOsFtpCZpzJhdBBwk6KDOm4/eknJwPjgCoRtEqGLO7vzLmoIv8yfP8f/Q== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=GMfVr6J6; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; 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 69532606A32C; Sun, 15 Nov 2026 07:27:02 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=GMfVr6J6 X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.177 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794727621; b=0VLP8b8g2qwnmwLYx33UdwZcbZLdZPry/NsieIRkb5k3STnuIhgImuSPi3LNdO8fJHy3 RthAgjxbgxcJ1jIevEJl1/FNI5YRdwmuj79dI9FNJBOAcwDi4iZSxhHSQoV/244alF9df kyDZfoejzaM6KfsXSQEWYLdntf4wapfkcwdNFtgZJs4w2xH8Q8PlL0zVMPcl2gq2k+R5Y 80h9luwHoOFbB04cQfCWsqtZifYTJMxFQMqYIkQJgJThmYhq6Ml1GCa1bKDBmUGmsh2rT 5xI9sNrYP7XTXE0rMSOEfuPw1xKS58XmsqwRaG0baujcP4jINz6CcnXc/Ju7/E8RzIg== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794727621; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Cc:Subject: Date:Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; bh=JUvotkktEds6gRJwB702NqNzkgXlw2/4WsAAh7Vg0es=; b=Ww+mhAUpd2OVX1PpG2wilCxgHD1hDiaMlC2Mfaq/Kd2kFe8RxIAjxxMKh0a39G0u1tD7 Ifry+gS8xPaaEiVLc34t3tLQvWXVY6sDN7IKoU/i4xKlscNevGj5/UovtuE4GvxKE/q4k 6biUXZuSfiAlBkWLag85fwjSZRrux6YUaHC6HgNs96z48xLCJ9G6CGO336ZarYq35zOm1 KMOprsCBE1ZxEB/wwPrVG4iV9OEoqGkPEv55tAfuGJgjVIzQovJuU8ORcUmYzv84fXmmt a8ZVyhxRb7s2+RQXrdV9k+vkvTFoeaS7dpUk9YwPChgXOd6QhPUrhIEAtU+uoP0iUZA== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=GMfVr6J6; arc=none smtp.remote-ip=74.125.82.177 X-Received: from mail-dy1-f177.google.com (mail-dy1-f177.google.com [74.125.82.177]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3167B606A31D for <netdev@vger.kernel.org>; Sun, 15 Nov 2026 07:27:01 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 3167B606A31D X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com X-Received: by mail-dy1-f177.google.com with SMTP id 5a478bee46e88-3704d30b84fso2939419eec.1 for <netdev@vger.kernel.org>; Sat, 14 Nov 2026 23:27:01 -0800 (PST) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1794727620; x=1795332420; 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:content-type; bh=JUvotkktEds6gRJwB702NqNzkgXlw2/4WsAAh7Vg0es=; b=GMfVr6J6eNBbqO9kJa2sDR0nx+yJNVWNC3KmLF/3cMgTHI6+TP+H9bBSZ5nsogX/gL u0FMOVCq9qwHRXRdC990QP4DHrvCN0Ji9wrHKzX4VtPqb6FHGIUhfuACv+K536cORkd0 y0AIUypEwcbO7srqU3ZC+7Sur3z3fb2YX3pHRadjeLPrWcY3mcsEhtBRED0RZKZ58aJD AgxY7YasWkjTY8yNNp7TNax92LdaPRHgbg/DNIfGZSTqicHEDv6Y5TnXTQ9JCDVrDoVV Oi/+FH/8G7X4q3+/GX0/GNmVHOHsVwQv2xfGrJ16BTUrOU2+x7Cgbcr2GqWV9dUultnZ U1EQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794727620; x=1795332420; 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:content-type; bh=JUvotkktEds6gRJwB702NqNzkgXlw2/4WsAAh7Vg0es=; b=NahPbEDdQnhx8znP4nBfRUHbAru7Xx4Bcsi5r/DP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002:a05:7300:d40b:b0:376:b957:c08 with SMTP id 5a478bee46e88-37966c489d6mr7931449eec.9.1794727620159; Sat, 14 Nov 2026 23:27:00 -0800 (PST) X-Received: from houminxi ([61.170.225.237]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3795378d7e5sm22411234eec.3.2026.11.14.23.26.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Nov 2026 23:26:59 -0800 (PST) X-Cc: "David S . Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@kernel.org>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>, Donald Hunter <donald.hunter@gmail.com>, Aaron Conole <aconole@redhat.com>, Eelco Chaudron <echaudro@redhat.com>, Ilya Maximets <i.maximets@ovn.org> X-Mailer: git-send-email 2.56.0 X-In-Reply-To: <20261115072638.3163018-1-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