Both families register a SET command that the spec never described, so a YNL client could not modify an existing datapath or vport. The kernel handlers take CAP_NET_ADMIN through 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. The vport SET command changes the upcall pid. The kernel rejects an ifindex before it looks at the type or the options, rejects a type change, and rejects options. Signed-off-by: Minxi Hou --- Documentation/netlink/specs/ovs_datapath.yaml | 21 +++++++++++++++++++ Documentation/netlink/specs/ovs_vport.yaml | 21 +++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/Documentation/netlink/specs/ovs_datapath.yaml b/Documentation/netlink/specs/ovs_datapath.yaml index f7b3671991e6..83f6b060ed75 100644 --- a/Documentation/netlink/specs/ovs_datapath.yaml +++ b/Documentation/netlink/specs/ovs_datapath.yaml @@ -138,21 +138,42 @@ operations: doc: Create new OVS data path value: 1 attribute-set: datapath + 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 + 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. + value: 4 + attribute-set: datapath + 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..189cb5b99aee 100644 --- a/Documentation/netlink/specs/ovs_vport.yaml +++ b/Documentation/netlink/specs/ovs_vport.yaml @@ -128,6 +128,7 @@ operations: name: new doc: Create a new OVS vport attribute-set: vport + flags: [uns-admin-perm] do: request: attributes: @@ -140,6 +141,7 @@ operations: name: del doc: Delete existing OVS vport from a data path attribute-set: vport + flags: [uns-admin-perm] do: request: attributes: @@ -165,6 +167,25 @@ operations: - netnsid - upcall-stats dump: *vport-get-op + - + name: set + doc: | + Modify an existing OVS vport. The kernel rejects an ifindex with + -EOPNOTSUPP, before it looks at the type or the options. It rejects + options with -EOPNOTSUPP, and rejects a type that differs from the + vport's type with -EINVAL. + value: 4 + attribute-set: vport + flags: [uns-admin-perm] + do: + request: + attributes: + - name + - type + - options + - upcall-pid + - port-no + - ifindex mcast-groups: list: -- 2.56.0