From patchwork Mon Apr 1 03:10:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hangbin Liu X-Patchwork-Id: 13612501 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (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 B2EF44A34 for ; Mon, 1 Apr 2024 03:10:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711941024; cv=none; b=S/AMNxU0vVpsYIw42OsFSRUqzXrtFdeDEGbcnSP3Zll36B+ws3Vw9J0m6vqO1F8bZFZb52yb94eC2I+XmnCzLVdkWjwdDfZTa4IZh7KE64ZpiB/th1+PEy8MVaR9cgAMY3SWE2JxpCbhIeICigN8OplalqBzZRIy6auZesxjndQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711941024; c=relaxed/simple; bh=YzFy0WxSKBWnCtCuqwHinhbRaBurdvJJ+1ZApk8hcaE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=O1o7JyBVvqpLCQ+7iU140fpsyHQGNbZL7TCH4pvrejlR8pLQhFAuJKi9PWyzh9EckxahTmPiWZD9qkx9Vj/zztK/BmGxmdZjUNKvuMBx2YUqGPwe7yYBrJ3+8vMTBthvdOti4Ed1CGdPyNN+pJidTJ1W0VeEPvBHru/f0BZLQjs= 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=Fbp4dqPb; arc=none smtp.client-ip=209.85.214.180 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="Fbp4dqPb" Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-1e0edd0340fso32694955ad.2 for ; Sun, 31 Mar 2024 20:10:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711941022; x=1712545822; 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=PCSmwUzUoPdqW7SzyEGrV4qg5YuSJ5jQ2xH4BhW4fu8=; b=Fbp4dqPbjte55aam1WH4YkuyedqDFieWHpp8T3S3lPEA33mdUfmND/Be4u3od3y2Ys PgswMZlOz296re8FtlV0zZin2jDgiba/ePXwW8L+jdXtxlqyGdD2PJM7I8IrgyJxLGOI GQA8xWXEgKbNyIFpdwsjsRi7idBdcjrfLzDaG0Yu7Goxwd30JPP4sx/mqxHSjkvFw2D9 CeGk1W8DZ8zOokgjmKArIozCcV7IoAafJc9RS1CoaNxI6z6ykf4cWm8kyn1xSHUEv7UC TRnmNcXfDr/VmnKhQstEt4h6Sdq/CJBImHn9sL10zl0HnbBqAcWGwcrGBGSytouJHGIF HY7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711941022; x=1712545822; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PCSmwUzUoPdqW7SzyEGrV4qg5YuSJ5jQ2xH4BhW4fu8=; b=QxQmn02iLQ7gGpFOHMStjmjPdot3zhjeINdPxEnA+IEsu4vpkHLn/4Z0Ec6f02+wdo WGJ//2vi/XP3igCU9GzNC/rSEJqfIABd/wAue2kkKIR2q4nfVqiibvQK0iYqfo7l6qUD e5/Fa+69TDqf/zfo/W4yFYl1UrlXzk62dGpCAO/VjN1Z0RRNHn2Zmz85yrm8w7rhj87i yJWiKbQuccptkp1TsCDaqDObyfnJSVqt7z3v7RyWTBHjH/SoQJhAbWKKqOuGQLzK/J19 VazewuaS33vmcDkQYUd/dQt6vC1GEi0qgwCdWc+VKL4yvkZmBIlKaHQpKJEBF/9MPktR 46bw== X-Gm-Message-State: AOJu0YwKiiCRijFSO8E/kDp1UiqxwZWdanThgASGGD5+gaUmpmbO4xD4 YMPveUXx17g9YFVc0egfQ3DYHmQMExy5XNsebXwLe7d5MmCdms4Y93bBDVJ93RYllw== X-Google-Smtp-Source: AGHT+IFjDd2aKkuv6JXiTBCti0S3Lwp/Z0kocwV7ZqUA6UT/crrPXh6+d8xy7ekSNrIuYoOACY/z9g== X-Received: by 2002:a17:903:184:b0:1dd:7df8:9ed7 with SMTP id z4-20020a170903018400b001dd7df89ed7mr12005448plg.15.1711941021671; Sun, 31 Mar 2024 20:10:21 -0700 (PDT) Received: from Laptop-X1.redhat.com ([43.228.180.230]) by smtp.gmail.com with ESMTPSA id b14-20020a170902650e00b001e00ae60396sm7807464plk.91.2024.03.31.20.10.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 Mar 2024 20:10:21 -0700 (PDT) From: Hangbin Liu To: netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Donald Hunter , Jiri Pirko , Jacob Keller , Stanislav Fomichev , Hangbin Liu Subject: [PATCHv4 net-next 1/4] Documentation: netlink: add a YAML spec for team Date: Mon, 1 Apr 2024 11:10:01 +0800 Message-ID: <20240401031004.1159713-2-liuhangbin@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240401031004.1159713-1-liuhangbin@gmail.com> References: <20240401031004.1159713-1-liuhangbin@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Add a YAML specification for team. Signed-off-by: Hangbin Liu Reviewed-by: Jiri Pirko --- Documentation/netlink/specs/team.yaml | 204 ++++++++++++++++++++++++++ MAINTAINERS | 1 + 2 files changed, 205 insertions(+) create mode 100644 Documentation/netlink/specs/team.yaml diff --git a/Documentation/netlink/specs/team.yaml b/Documentation/netlink/specs/team.yaml new file mode 100644 index 000000000000..c13529e011c9 --- /dev/null +++ b/Documentation/netlink/specs/team.yaml @@ -0,0 +1,204 @@ +# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) + +name: team + +protocol: genetlink-legacy + +doc: | + Network team device driver. + +c-family-name: team-genl-name +c-version-name: team-genl-version +kernel-policy: global +uapi-header: linux/if_team.h + +definitions: + - + name: string-max-len + type: const + value: 32 + - + name: genl-change-event-mc-grp-name + type: const + value: change_event + +attribute-sets: + - + name: team + doc: + The team nested layout of get/set msg looks like + [TEAM_ATTR_LIST_OPTION] + [TEAM_ATTR_ITEM_OPTION] + [TEAM_ATTR_OPTION_*], ... + [TEAM_ATTR_ITEM_OPTION] + [TEAM_ATTR_OPTION_*], ... + ... + [TEAM_ATTR_LIST_PORT] + [TEAM_ATTR_ITEM_PORT] + [TEAM_ATTR_PORT_*], ... + [TEAM_ATTR_ITEM_PORT] + [TEAM_ATTR_PORT_*], ... + ... + name-prefix: team-attr- + attributes: + - + name: unspec + type: unused + value: 0 + - + name: team-ifindex + type: u32 + - + name: list-option + type: nest + nested-attributes: item-option + - + name: list-port + type: nest + nested-attributes: item-port + - + name: item-option + name-prefix: team-attr-item- + attr-cnt-name: __team-attr-item-option-max + attr-max-name: team-attr-item-option-max + attributes: + - + name: option-unspec + type: unused + value: 0 + - + name: option + type: nest + nested-attributes: attr-option + - + name: attr-option + name-prefix: team-attr-option- + attributes: + - + name: unspec + type: unused + value: 0 + - + name: name + type: string + checks: + max-len: string-max-len + unterminated-ok: true + - + name: changed + type: flag + - + name: type + type: u8 + - + name: data + type: binary + - + name: removed + type: flag + - + name: port-ifindex + type: u32 + doc: for per-port options + - + name: array-index + type: u32 + doc: for array options + - + name: item-port + name-prefix: team-attr-item- + attr-cnt-name: __team-attr-item-port-max + attr-max-name: team-attr-item-port-max + attributes: + - + name: port-unspec + type: unused + value: 0 + - + name: port + type: nest + nested-attributes: attr-port + - + name: attr-port + name-prefix: team-attr-port- + attributes: + - + name: unspec + type: unused + value: 0 + - + name: ifindex + type: u32 + - + name: changed + type: flag + - + name: linkup + type: flag + - + name: speed + type: u32 + - + name: duplex + type: u8 + - + name: removed + type: flag + +operations: + list: + - + name: noop + doc: No operation + value: 0 + attribute-set: team + dont-validate: [ strict ] + + do: + # Actually it only reply the team netlink family + reply: + attributes: + - team-ifindex + + - + name: options-set + doc: Set team options + attribute-set: team + dont-validate: [ strict ] + flags: [ admin-perm ] + + do: + request: &option_attrs + attributes: + - team-ifindex + - list-option + reply: *option_attrs + + - + name: options-get + doc: Get team options info + attribute-set: team + dont-validate: [ strict ] + flags: [ admin-perm ] + + do: + request: + attributes: + - team-ifindex + reply: *option_attrs + + - + name: port-list-get + doc: Get team ports info + attribute-set: team + dont-validate: [ strict ] + flags: [ admin-perm ] + + do: + request: + attributes: + - team-ifindex + reply: &port_attrs + attributes: + - team-ifindex + - list-port diff --git a/MAINTAINERS b/MAINTAINERS index 6a233e1a3cf2..909c2c531d8e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -21665,6 +21665,7 @@ TEAM DRIVER M: Jiri Pirko L: netdev@vger.kernel.org S: Supported +F: Documentation/netlink/specs/team.yaml F: drivers/net/team/ F: include/linux/if_team.h F: include/uapi/linux/if_team.h From patchwork Mon Apr 1 03:10:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hangbin Liu X-Patchwork-Id: 13612502 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (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 C50B46ABA for ; Mon, 1 Apr 2024 03:10:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711941027; cv=none; b=By4EUbMNlp8svjYZb73YbMbZbF7Frnrjx39GfzMSizGJIZC7QltXFj0RKbVffsROPRvhfhFHHGjZQWoBktUfv4ngDXg7J8D1VC5/HZgH+mey4kylqU2TW/kvR0a/baPiNnwz0xetnQlwhGwDPB6AFNiTHlwVGMYkQUtg2NxeZl4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711941027; c=relaxed/simple; bh=GO9Bi1wFuxZ0JKZOfZEoYVEb2v5ZwyPeqUxWOY9JwwI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dQXrLSjOnH0LUwWvMY0jrvypuom9+gs69moGy+pIGSWGP5ewdZsmf1i/AON2Ocp0Xg+4T80hXVjaruUK/hBKN0FfugPj7Wzppzdw3CeEk7l6C0/fd/PSNRPws1R2FGuo/rLaBEFeyaQoualmdSr9H1R6vFNi8Bbt3IAs42EvMkQ= 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=PuOYfZse; arc=none smtp.client-ip=209.85.214.177 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="PuOYfZse" Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-1e244c7cbf8so6704445ad.0 for ; Sun, 31 Mar 2024 20:10:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711941025; x=1712545825; 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=ta6lFKix1FeG0oCBnTR9Exq62WqMGnwL+ghoDg1tdM8=; b=PuOYfZseQBcRiZhq7YwfbyIpCOw4upNxnS7ie/fcv9zcUEm1lib2RjwY4D+Z3ePijV dl/NyZCTLYKC0mMzE2WZv6bvG5U1+ucoYwJHKJeGZwmrM7eYfWP1HR3SomWoCLevdESZ jCt01DQek/5Gx2cVYXXP5TO7UBBM8qKRdW+ttDV7C8a49U4HI8TgE8yyGAHNYIWxAKhs jvaV7Hqe6MM67M9RFfORAYZl+5arpzGdesR8CcF9um1xWbsK7spQTCp4vi9+he6pkS0+ nb6NzLG5aZgJd+Y3Fgk7zJr04jzzeyrbjYqWVNwka3hsdT0ew/2VS/Og2J1huspDXHAf NPog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711941025; x=1712545825; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ta6lFKix1FeG0oCBnTR9Exq62WqMGnwL+ghoDg1tdM8=; b=arawwqNIbT4gClcqRF+UXFD/I2IpHOHs+9NPK7Xp2OIc1SA/k0l5j1KmbtCdbb12Ns sboBG6bMzxb9/L597q1BHKXT2P7V+uh3Vm1PfSFwExGCJimu5wQwfpepHnkukkiAfKpc sXsqQuRnsU3CxWsWUxdmLo6ev33nyk4y6PkrgS6HAmzBE/iK9UKtujN2kIefYVXKNkUU 3gHat+9x3wKfbYLZoXC4xyg0hbtWPTtP7Ihojd4wjMtQ1r2KHEMAvHa7FzZ+kw0vyeZx GbtyUVxOM0M2dfQm1keKw0loZscmvlz7HHIxjPCOV3EaqrhyH2xsl82M/GmZW98MnBw9 6Weg== X-Gm-Message-State: AOJu0Yz4lUJZWgfRt2octZeTmbLcjlYWhy04VvH+mtWnOTZXbBXObiOv k6bMx45h7hHrFGbGMUxzOpvDluLyzEdqwWEywJrR34cZUNPptWbmlEDmDp8HDUrrjg== X-Google-Smtp-Source: AGHT+IHohQvKnjAhnqVtxoklxZ8D0DT5fXe72oZIxsl8ulCF1O+O4McRmJMJJSct+lr+wjviEtl3pQ== X-Received: by 2002:a17:903:181:b0:1e0:c91d:448e with SMTP id z1-20020a170903018100b001e0c91d448emr8160013plg.65.1711941024729; Sun, 31 Mar 2024 20:10:24 -0700 (PDT) Received: from Laptop-X1.redhat.com ([43.228.180.230]) by smtp.gmail.com with ESMTPSA id b14-20020a170902650e00b001e00ae60396sm7807464plk.91.2024.03.31.20.10.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 Mar 2024 20:10:24 -0700 (PDT) From: Hangbin Liu To: netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Donald Hunter , Jiri Pirko , Jacob Keller , Stanislav Fomichev , Hangbin Liu Subject: [PATCHv4 net-next 2/4] net: team: rename team to team_core for linking Date: Mon, 1 Apr 2024 11:10:02 +0800 Message-ID: <20240401031004.1159713-3-liuhangbin@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240401031004.1159713-1-liuhangbin@gmail.com> References: <20240401031004.1159713-1-liuhangbin@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Similar with commit 08d323234d10 ("net: fou: rename the source for linking"), We'll need to link two objects together to form the team module. This means the source can't be called team, the build system expects team.o to be the combined object. Signed-off-by: Hangbin Liu Reviewed-by: Jiri Pirko --- drivers/net/team/Makefile | 1 + drivers/net/team/{team.c => team_core.c} | 0 2 files changed, 1 insertion(+) rename drivers/net/team/{team.c => team_core.c} (100%) diff --git a/drivers/net/team/Makefile b/drivers/net/team/Makefile index f582d81a5091..244db32c1060 100644 --- a/drivers/net/team/Makefile +++ b/drivers/net/team/Makefile @@ -3,6 +3,7 @@ # Makefile for the network team driver # +team-y:= team_core.o obj-$(CONFIG_NET_TEAM) += team.o obj-$(CONFIG_NET_TEAM_MODE_BROADCAST) += team_mode_broadcast.o obj-$(CONFIG_NET_TEAM_MODE_ROUNDROBIN) += team_mode_roundrobin.o diff --git a/drivers/net/team/team.c b/drivers/net/team/team_core.c similarity index 100% rename from drivers/net/team/team.c rename to drivers/net/team/team_core.c From patchwork Mon Apr 1 03:10:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hangbin Liu X-Patchwork-Id: 13612503 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) (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 42E8C79DD for ; Mon, 1 Apr 2024 03:10:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711941030; cv=none; b=f4dNwsOGXbwKtN+wsTqqIvuedz6baMdFmcfrUgghnP9iOUFl8AxMRPJJtorv2duZrDdQlsgLbVMln3KMgoR14YKsd0H9QpFUf3Q4wcgOObUtNpCCRkmzbp7D93L5/KI60HKlFvkj4owwJIxU6ngtBuxTW1bKaLzPX0pBIyYQwu0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711941030; c=relaxed/simple; bh=ayuNtYmOonxJJhCSFnbY4iMnsMPNOYu4/QaCZ83whmU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uHmQyBNAGlNHj7ydDqmK8lOyb4i46tYwpt4lYwr2zYfJSLa9bcrbwl2LSsjYDOzlpkrMB2mPZIVGzCShaiiytHVzCzS9RSqhZtzPVhfIHNlMBGIyzmIQmKNpi2e0vvLGN/6i63JeSDhYYkrC1HhlzM3ZeFo7zKBoQSwjjpBB1mg= 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=g8iJNtvb; arc=none smtp.client-ip=209.85.214.171 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="g8iJNtvb" Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-1e00d1e13a2so23225625ad.0 for ; Sun, 31 Mar 2024 20:10:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711941028; x=1712545828; 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=b7wUQzch9TpmqK/jHmUx1ulUaYYDSMvEbaUArRlwZbg=; b=g8iJNtvbGJHdDPW2yIANCxExCsjgMr3J+m+pu1LY6KkHnGLb10ZiRrZPgQOsVQ0+TC C3xuUzxRjDXZvbhzuX3l5Et/ArZT/T2exkkMUbbm+5ghKa0p906DX84nDoi0I0kt8Y1Z wPb1lIM7y5w6pX6Dpq9rXt+QK/NaXkPxxvmX5RZpx0sjTOsxeZeLUt8xyh1IZQziOVgA HKmi9zBdJvfsjxsW7CLhNTLr+J0YiRIq8BAoNE5o9s31YQ+AroLosT6Za94ay5F4w8th d8DuGbUc8md9oEvA8KtaFYP5uAb6rZnsDW1JxHT6aoG0+3bPDKTLneUMccGohJJ9zJ22 q+wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711941028; x=1712545828; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=b7wUQzch9TpmqK/jHmUx1ulUaYYDSMvEbaUArRlwZbg=; b=u2/3BiYmvl/jYcjXeyPxGbQn6yYm4JyzT4sF4tdmlNQqVdO3RN/WzEwBpRUS8R9lrR 5EEC+nM610npiV4ho67ZijxWUjK/r8jiefuxbdv3kAkMsZy/nGrS5kIBlNXRpMkPtoh/ jshSaGUqUvpue8KOEpMFPHl8StwJARNaKPmvYeycBTFa1qwqjbysqXLdRWAuc0hPXjGd A1deqKmS7KYMZb/OKX8/EHgdkm9jwLsNy6srDiGSnlxW9iqERjeIEI1t4v2d3Vdz5bqV AZeslJep/wjRSwk3m4oBiFZpJHLzn/1tUsAzF303I48dIzhBCCEsG32UVXOaw43E1yih gsqQ== X-Gm-Message-State: AOJu0YwNqT0zKwX6UCMmSw8OU2NcXDedZE3TdwQJDPegFqLTjeL3+iEU oD83xqoJ0HPR6BhwzeZPlr39PatV7G99uQxfcVXrVUcp+OU4o/rbfM1mG16fYHsfpg== X-Google-Smtp-Source: AGHT+IERd5+Qyww4TvOrKOggMHiX+ax0J5quIKv/lQpm/p5X4LgwR4EbeDHDAO+HBojmxv3A2HNFlw== X-Received: by 2002:a17:902:b942:b0:1e0:a7c5:b5a5 with SMTP id h2-20020a170902b94200b001e0a7c5b5a5mr6300131pls.37.1711941027866; Sun, 31 Mar 2024 20:10:27 -0700 (PDT) Received: from Laptop-X1.redhat.com ([43.228.180.230]) by smtp.gmail.com with ESMTPSA id b14-20020a170902650e00b001e00ae60396sm7807464plk.91.2024.03.31.20.10.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 Mar 2024 20:10:27 -0700 (PDT) From: Hangbin Liu To: netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Donald Hunter , Jiri Pirko , Jacob Keller , Stanislav Fomichev , Hangbin Liu Subject: [PATCHv4 net-next 3/4] net: team: use policy generated by YAML spec Date: Mon, 1 Apr 2024 11:10:03 +0800 Message-ID: <20240401031004.1159713-4-liuhangbin@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240401031004.1159713-1-liuhangbin@gmail.com> References: <20240401031004.1159713-1-liuhangbin@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org generated with: $ ./tools/net/ynl/ynl-gen-c.py --mode kernel \ > --spec Documentation/netlink/specs/team.yaml --source \ > -o drivers/net/team/team_nl.c $ ./tools/net/ynl/ynl-gen-c.py --mode kernel \ > --spec Documentation/netlink/specs/team.yaml --header \ > -o drivers/net/team/team_nl.h The TEAM_ATTR_LIST_PORT in team_nl_policy is removed as it is only in the port list reply attributes. Signed-off-by: Hangbin Liu Reviewed-by: Jiri Pirko --- drivers/net/team/Makefile | 2 +- drivers/net/team/team_core.c | 63 ++++++------------------------------ drivers/net/team/team_nl.c | 59 +++++++++++++++++++++++++++++++++ drivers/net/team/team_nl.h | 29 +++++++++++++++++ 4 files changed, 98 insertions(+), 55 deletions(-) create mode 100644 drivers/net/team/team_nl.c create mode 100644 drivers/net/team/team_nl.h diff --git a/drivers/net/team/Makefile b/drivers/net/team/Makefile index 244db32c1060..7a5aa20d286b 100644 --- a/drivers/net/team/Makefile +++ b/drivers/net/team/Makefile @@ -3,7 +3,7 @@ # Makefile for the network team driver # -team-y:= team_core.o +team-y:= team_core.o team_nl.o obj-$(CONFIG_NET_TEAM) += team.o obj-$(CONFIG_NET_TEAM_MODE_BROADCAST) += team_mode_broadcast.o obj-$(CONFIG_NET_TEAM_MODE_ROUNDROBIN) += team_mode_roundrobin.o diff --git a/drivers/net/team/team_core.c b/drivers/net/team/team_core.c index 0a44bbdcfb7b..4e3c8d404957 100644 --- a/drivers/net/team/team_core.c +++ b/drivers/net/team/team_core.c @@ -27,6 +27,8 @@ #include #include +#include "team_nl.h" + #define DRV_NAME "team" @@ -2254,28 +2256,7 @@ static struct rtnl_link_ops team_link_ops __read_mostly = { static struct genl_family team_nl_family; -static const struct nla_policy team_nl_policy[TEAM_ATTR_MAX + 1] = { - [TEAM_ATTR_UNSPEC] = { .type = NLA_UNSPEC, }, - [TEAM_ATTR_TEAM_IFINDEX] = { .type = NLA_U32 }, - [TEAM_ATTR_LIST_OPTION] = { .type = NLA_NESTED }, - [TEAM_ATTR_LIST_PORT] = { .type = NLA_NESTED }, -}; - -static const struct nla_policy -team_nl_option_policy[TEAM_ATTR_OPTION_MAX + 1] = { - [TEAM_ATTR_OPTION_UNSPEC] = { .type = NLA_UNSPEC, }, - [TEAM_ATTR_OPTION_NAME] = { - .type = NLA_STRING, - .len = TEAM_STRING_MAX_LEN, - }, - [TEAM_ATTR_OPTION_CHANGED] = { .type = NLA_FLAG }, - [TEAM_ATTR_OPTION_TYPE] = { .type = NLA_U8 }, - [TEAM_ATTR_OPTION_DATA] = { .type = NLA_BINARY }, - [TEAM_ATTR_OPTION_PORT_IFINDEX] = { .type = NLA_U32 }, - [TEAM_ATTR_OPTION_ARRAY_INDEX] = { .type = NLA_U32 }, -}; - -static int team_nl_cmd_noop(struct sk_buff *skb, struct genl_info *info) +int team_nl_noop_doit(struct sk_buff *skb, struct genl_info *info) { struct sk_buff *msg; void *hdr; @@ -2513,7 +2494,7 @@ static int team_nl_send_options_get(struct team *team, u32 portid, u32 seq, return err; } -static int team_nl_cmd_options_get(struct sk_buff *skb, struct genl_info *info) +int team_nl_options_get_doit(struct sk_buff *skb, struct genl_info *info) { struct team *team; struct team_option_inst *opt_inst; @@ -2538,7 +2519,7 @@ static int team_nl_cmd_options_get(struct sk_buff *skb, struct genl_info *info) static int team_nl_send_event_options_get(struct team *team, struct list_head *sel_opt_inst_list); -static int team_nl_cmd_options_set(struct sk_buff *skb, struct genl_info *info) +int team_nl_options_set_doit(struct sk_buff *skb, struct genl_info *info) { struct team *team; int err = 0; @@ -2579,7 +2560,7 @@ static int team_nl_cmd_options_set(struct sk_buff *skb, struct genl_info *info) err = nla_parse_nested_deprecated(opt_attrs, TEAM_ATTR_OPTION_MAX, nl_option, - team_nl_option_policy, + team_attr_option_nl_policy, info->extack); if (err) goto team_put; @@ -2802,8 +2783,8 @@ static int team_nl_send_port_list_get(struct team *team, u32 portid, u32 seq, return err; } -static int team_nl_cmd_port_list_get(struct sk_buff *skb, - struct genl_info *info) +int team_nl_port_list_get_doit(struct sk_buff *skb, + struct genl_info *info) { struct team *team; int err; @@ -2820,32 +2801,6 @@ static int team_nl_cmd_port_list_get(struct sk_buff *skb, return err; } -static const struct genl_small_ops team_nl_ops[] = { - { - .cmd = TEAM_CMD_NOOP, - .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, - .doit = team_nl_cmd_noop, - }, - { - .cmd = TEAM_CMD_OPTIONS_SET, - .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, - .doit = team_nl_cmd_options_set, - .flags = GENL_ADMIN_PERM, - }, - { - .cmd = TEAM_CMD_OPTIONS_GET, - .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, - .doit = team_nl_cmd_options_get, - .flags = GENL_ADMIN_PERM, - }, - { - .cmd = TEAM_CMD_PORT_LIST_GET, - .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, - .doit = team_nl_cmd_port_list_get, - .flags = GENL_ADMIN_PERM, - }, -}; - static const struct genl_multicast_group team_nl_mcgrps[] = { { .name = TEAM_GENL_CHANGE_EVENT_MC_GRP_NAME, }, }; @@ -2853,7 +2808,7 @@ static const struct genl_multicast_group team_nl_mcgrps[] = { static struct genl_family team_nl_family __ro_after_init = { .name = TEAM_GENL_NAME, .version = TEAM_GENL_VERSION, - .maxattr = TEAM_ATTR_MAX, + .maxattr = ARRAY_SIZE(team_nl_policy), .policy = team_nl_policy, .netnsok = true, .module = THIS_MODULE, diff --git a/drivers/net/team/team_nl.c b/drivers/net/team/team_nl.c new file mode 100644 index 000000000000..208424ab78f5 --- /dev/null +++ b/drivers/net/team/team_nl.c @@ -0,0 +1,59 @@ +// SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) +/* Do not edit directly, auto-generated from: */ +/* Documentation/netlink/specs/team.yaml */ +/* YNL-GEN kernel source */ + +#include +#include + +#include "team_nl.h" + +#include + +/* Common nested types */ +const struct nla_policy team_attr_option_nl_policy[TEAM_ATTR_OPTION_ARRAY_INDEX + 1] = { + [TEAM_ATTR_OPTION_NAME] = { .type = NLA_STRING, .len = TEAM_STRING_MAX_LEN, }, + [TEAM_ATTR_OPTION_CHANGED] = { .type = NLA_FLAG, }, + [TEAM_ATTR_OPTION_TYPE] = { .type = NLA_U8, }, + [TEAM_ATTR_OPTION_DATA] = { .type = NLA_BINARY, }, + [TEAM_ATTR_OPTION_REMOVED] = { .type = NLA_FLAG, }, + [TEAM_ATTR_OPTION_PORT_IFINDEX] = { .type = NLA_U32, }, + [TEAM_ATTR_OPTION_ARRAY_INDEX] = { .type = NLA_U32, }, +}; + +const struct nla_policy team_item_option_nl_policy[TEAM_ATTR_ITEM_OPTION + 1] = { + [TEAM_ATTR_ITEM_OPTION] = NLA_POLICY_NESTED(team_attr_option_nl_policy), +}; + +/* Global operation policy for team */ +const struct nla_policy team_nl_policy[TEAM_ATTR_LIST_OPTION + 1] = { + [TEAM_ATTR_TEAM_IFINDEX] = { .type = NLA_U32, }, + [TEAM_ATTR_LIST_OPTION] = NLA_POLICY_NESTED(team_item_option_nl_policy), +}; + +/* Ops table for team */ +const struct genl_small_ops team_nl_ops[4] = { + { + .cmd = TEAM_CMD_NOOP, + .validate = GENL_DONT_VALIDATE_STRICT, + .doit = team_nl_noop_doit, + }, + { + .cmd = TEAM_CMD_OPTIONS_SET, + .validate = GENL_DONT_VALIDATE_STRICT, + .doit = team_nl_options_set_doit, + .flags = GENL_ADMIN_PERM, + }, + { + .cmd = TEAM_CMD_OPTIONS_GET, + .validate = GENL_DONT_VALIDATE_STRICT, + .doit = team_nl_options_get_doit, + .flags = GENL_ADMIN_PERM, + }, + { + .cmd = TEAM_CMD_PORT_LIST_GET, + .validate = GENL_DONT_VALIDATE_STRICT, + .doit = team_nl_port_list_get_doit, + .flags = GENL_ADMIN_PERM, + }, +}; diff --git a/drivers/net/team/team_nl.h b/drivers/net/team/team_nl.h new file mode 100644 index 000000000000..c9ec1b22ac4d --- /dev/null +++ b/drivers/net/team/team_nl.h @@ -0,0 +1,29 @@ +/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */ +/* Do not edit directly, auto-generated from: */ +/* Documentation/netlink/specs/team.yaml */ +/* YNL-GEN kernel header */ + +#ifndef _LINUX_TEAM_GEN_H +#define _LINUX_TEAM_GEN_H + +#include +#include + +#include + +/* Common nested types */ +extern const struct nla_policy team_attr_option_nl_policy[TEAM_ATTR_OPTION_ARRAY_INDEX + 1]; +extern const struct nla_policy team_item_option_nl_policy[TEAM_ATTR_ITEM_OPTION + 1]; + +/* Global operation policy for team */ +extern const struct nla_policy team_nl_policy[TEAM_ATTR_LIST_OPTION + 1]; + +/* Ops table for team */ +extern const struct genl_small_ops team_nl_ops[4]; + +int team_nl_noop_doit(struct sk_buff *skb, struct genl_info *info); +int team_nl_options_set_doit(struct sk_buff *skb, struct genl_info *info); +int team_nl_options_get_doit(struct sk_buff *skb, struct genl_info *info); +int team_nl_port_list_get_doit(struct sk_buff *skb, struct genl_info *info); + +#endif /* _LINUX_TEAM_GEN_H */ From patchwork Mon Apr 1 03:10:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hangbin Liu X-Patchwork-Id: 13612504 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) (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 D41EC8BE7 for ; Mon, 1 Apr 2024 03:10:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711941033; cv=none; b=J5VOtj4QW7cU6+qvPnPo1wSxYcgK86ccXjF6ZhmZbRLmzUyNQEJ/Cq4Hk7PHUpMrxngTcMhnCw5L+AVZD42F0YUlI+ATqQAsbgoRl9pItk2iOZdy/bMPtKjlc0p1X8mvh5qra+PJ22c9AGe5KRyhcGd0lO26yP9BWSeEfkRlPQ0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711941033; c=relaxed/simple; bh=ku8YzMn9QMy7xB2oEL6yj+qh7mh+oEzbTYBRUdDchNQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Pk7gcnhlDlZb1xnXSf7UbVOyCpvP35c2vQFe8D2xjlj/SFw63g7GiDdFlrTF/1LdXm7oxAKw5UHik43pVP/q8/1yBJRm2EhBqlW0UafD+cRupG8Q0owArzEcnXK7meb8EDHc2z4z/Mcytw67Mnntuf3yDmAbRu6HWCmfhEGaHls= 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=dLtVAtij; arc=none smtp.client-ip=209.85.214.172 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="dLtVAtij" Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-1e243ccbffbso7032265ad.3 for ; Sun, 31 Mar 2024 20:10:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711941031; x=1712545831; 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=rXt+e70s18vvmZvnfHoG/leNZ6ipUAeaM1qUbwNwWzI=; b=dLtVAtijqSmTw08t5WInB/jio1gQrTzZthtaRLEEKUaxYhBb4GcQTiBetj82Ar9AvU uWyfWldntP/dzC2aY77eXkrHcqZC376ixkFqNOhgIwsWKV98+NArnkmuu4rkieuS84NX oZrYolZRHsStghCTtWxAMGUbBlaFv9L+WAf52RqGK72LHPwgd0gbwtA9lRhgTftazHI/ 3tzY2TZxLXzBLBXjJujY+H5SRyTWLQFeL9Z/AKUp0Ad5nyEH1JF6XeSX2bDe3YTBpuRp IdjSjeL4mKLDVUjC1P2mxZ9+PeqIDqL4tSx1rn7xDLj7WVGq3EypjUu8HATKXMAMyDFe zawg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711941031; x=1712545831; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rXt+e70s18vvmZvnfHoG/leNZ6ipUAeaM1qUbwNwWzI=; b=AYFBctdoDyewMtVsWrm58RrV+y8vztkQWAKtqBPuCv+3xQZ5GfiPaFOxK2FOdpQAJ1 5MCR6WAkGrG+PmavFR7wJHt0vfYJbDVimB4uwwGrsu7qPbG5KXa08Kr+pGNk5mf8KF6E xNt3BuSy8AGGiGu5SyrOoLoVjKkInMNiWynOMg+fVzyGybYlgeqJtBJfIxyGn5yLTqeK sfCq/qrWfbz8Qbj/8TKe+OFNV2b6dCxvlB4hLbK9vPoK1HmSQ94TPnwUk6ZIdd1VlW2I vT4buN1Azl8EvjoDAynhOyOBCy9KczlHGCBFJVDtws+y6oihkmj0Y2cosH1P2POpR7+8 Og7Q== X-Gm-Message-State: AOJu0YysBO/lagnACU6g6Bj38fbvoJhgeRv+R5B1nA0TqYM6RCHiq3dy WlCalqa3L7PLL8GKzzbaXgU45TDx7qYxRUG8a2clUeAwmcBgg+7uB5XnytsxxlpJdA== X-Google-Smtp-Source: AGHT+IEXS137BcaOTa/vlLvaLkGUV11vzKhxJNFv9g/uPYTSxF4b5VR8M6Horum+L6QEo6rFTvdRMA== X-Received: by 2002:a17:902:c084:b0:1e2:3cc0:f4bc with SMTP id j4-20020a170902c08400b001e23cc0f4bcmr5493412pld.27.1711941031001; Sun, 31 Mar 2024 20:10:31 -0700 (PDT) Received: from Laptop-X1.redhat.com ([43.228.180.230]) by smtp.gmail.com with ESMTPSA id b14-20020a170902650e00b001e00ae60396sm7807464plk.91.2024.03.31.20.10.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 Mar 2024 20:10:30 -0700 (PDT) From: Hangbin Liu To: netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Donald Hunter , Jiri Pirko , Jacob Keller , Stanislav Fomichev , Hangbin Liu Subject: [PATCHv4 net-next 4/4] uapi: team: use header file generated from YAML spec Date: Mon, 1 Apr 2024 11:10:04 +0800 Message-ID: <20240401031004.1159713-5-liuhangbin@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240401031004.1159713-1-liuhangbin@gmail.com> References: <20240401031004.1159713-1-liuhangbin@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org generated with: $ ./tools/net/ynl/ynl-gen-c.py --mode uapi \ > --spec Documentation/netlink/specs/team.yaml \ > --header -o include/uapi/linux/if_team.h Signed-off-by: Hangbin Liu Reviewed-by: Jiri Pirko --- include/uapi/linux/if_team.h | 116 +++++++++++++---------------------- 1 file changed, 43 insertions(+), 73 deletions(-) diff --git a/include/uapi/linux/if_team.h b/include/uapi/linux/if_team.h index 13c61fecb78b..a5c06243a435 100644 --- a/include/uapi/linux/if_team.h +++ b/include/uapi/linux/if_team.h @@ -1,108 +1,78 @@ -/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */ -/* - * include/linux/if_team.h - Network team device driver header - * Copyright (c) 2011 Jiri Pirko - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - */ +/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */ +/* Do not edit directly, auto-generated from: */ +/* Documentation/netlink/specs/team.yaml */ +/* YNL-GEN uapi header */ -#ifndef _UAPI_LINUX_IF_TEAM_H_ -#define _UAPI_LINUX_IF_TEAM_H_ +#ifndef _UAPI_LINUX_IF_TEAM_H +#define _UAPI_LINUX_IF_TEAM_H +#define TEAM_GENL_NAME "team" +#define TEAM_GENL_VERSION 1 -#define TEAM_STRING_MAX_LEN 32 - -/********************************** - * NETLINK_GENERIC netlink family. - **********************************/ - -enum { - TEAM_CMD_NOOP, - TEAM_CMD_OPTIONS_SET, - TEAM_CMD_OPTIONS_GET, - TEAM_CMD_PORT_LIST_GET, - - __TEAM_CMD_MAX, - TEAM_CMD_MAX = (__TEAM_CMD_MAX - 1), -}; +#define TEAM_STRING_MAX_LEN 32 +#define TEAM_GENL_CHANGE_EVENT_MC_GRP_NAME "change_event" enum { TEAM_ATTR_UNSPEC, - TEAM_ATTR_TEAM_IFINDEX, /* u32 */ - TEAM_ATTR_LIST_OPTION, /* nest */ - TEAM_ATTR_LIST_PORT, /* nest */ + TEAM_ATTR_TEAM_IFINDEX, + TEAM_ATTR_LIST_OPTION, + TEAM_ATTR_LIST_PORT, __TEAM_ATTR_MAX, - TEAM_ATTR_MAX = __TEAM_ATTR_MAX - 1, + TEAM_ATTR_MAX = (__TEAM_ATTR_MAX - 1) }; -/* Nested layout of get/set msg: - * - * [TEAM_ATTR_LIST_OPTION] - * [TEAM_ATTR_ITEM_OPTION] - * [TEAM_ATTR_OPTION_*], ... - * [TEAM_ATTR_ITEM_OPTION] - * [TEAM_ATTR_OPTION_*], ... - * ... - * [TEAM_ATTR_LIST_PORT] - * [TEAM_ATTR_ITEM_PORT] - * [TEAM_ATTR_PORT_*], ... - * [TEAM_ATTR_ITEM_PORT] - * [TEAM_ATTR_PORT_*], ... - * ... - */ - enum { TEAM_ATTR_ITEM_OPTION_UNSPEC, - TEAM_ATTR_ITEM_OPTION, /* nest */ + TEAM_ATTR_ITEM_OPTION, __TEAM_ATTR_ITEM_OPTION_MAX, - TEAM_ATTR_ITEM_OPTION_MAX = __TEAM_ATTR_ITEM_OPTION_MAX - 1, + TEAM_ATTR_ITEM_OPTION_MAX = (__TEAM_ATTR_ITEM_OPTION_MAX - 1) }; enum { TEAM_ATTR_OPTION_UNSPEC, - TEAM_ATTR_OPTION_NAME, /* string */ - TEAM_ATTR_OPTION_CHANGED, /* flag */ - TEAM_ATTR_OPTION_TYPE, /* u8 */ - TEAM_ATTR_OPTION_DATA, /* dynamic */ - TEAM_ATTR_OPTION_REMOVED, /* flag */ - TEAM_ATTR_OPTION_PORT_IFINDEX, /* u32 */ /* for per-port options */ - TEAM_ATTR_OPTION_ARRAY_INDEX, /* u32 */ /* for array options */ + TEAM_ATTR_OPTION_NAME, + TEAM_ATTR_OPTION_CHANGED, + TEAM_ATTR_OPTION_TYPE, + TEAM_ATTR_OPTION_DATA, + TEAM_ATTR_OPTION_REMOVED, + TEAM_ATTR_OPTION_PORT_IFINDEX, + TEAM_ATTR_OPTION_ARRAY_INDEX, __TEAM_ATTR_OPTION_MAX, - TEAM_ATTR_OPTION_MAX = __TEAM_ATTR_OPTION_MAX - 1, + TEAM_ATTR_OPTION_MAX = (__TEAM_ATTR_OPTION_MAX - 1) }; enum { TEAM_ATTR_ITEM_PORT_UNSPEC, - TEAM_ATTR_ITEM_PORT, /* nest */ + TEAM_ATTR_ITEM_PORT, __TEAM_ATTR_ITEM_PORT_MAX, - TEAM_ATTR_ITEM_PORT_MAX = __TEAM_ATTR_ITEM_PORT_MAX - 1, + TEAM_ATTR_ITEM_PORT_MAX = (__TEAM_ATTR_ITEM_PORT_MAX - 1) }; enum { TEAM_ATTR_PORT_UNSPEC, - TEAM_ATTR_PORT_IFINDEX, /* u32 */ - TEAM_ATTR_PORT_CHANGED, /* flag */ - TEAM_ATTR_PORT_LINKUP, /* flag */ - TEAM_ATTR_PORT_SPEED, /* u32 */ - TEAM_ATTR_PORT_DUPLEX, /* u8 */ - TEAM_ATTR_PORT_REMOVED, /* flag */ + TEAM_ATTR_PORT_IFINDEX, + TEAM_ATTR_PORT_CHANGED, + TEAM_ATTR_PORT_LINKUP, + TEAM_ATTR_PORT_SPEED, + TEAM_ATTR_PORT_DUPLEX, + TEAM_ATTR_PORT_REMOVED, __TEAM_ATTR_PORT_MAX, - TEAM_ATTR_PORT_MAX = __TEAM_ATTR_PORT_MAX - 1, + TEAM_ATTR_PORT_MAX = (__TEAM_ATTR_PORT_MAX - 1) }; -/* - * NETLINK_GENERIC related info - */ -#define TEAM_GENL_NAME "team" -#define TEAM_GENL_VERSION 0x1 -#define TEAM_GENL_CHANGE_EVENT_MC_GRP_NAME "change_event" +enum { + TEAM_CMD_NOOP, + TEAM_CMD_OPTIONS_SET, + TEAM_CMD_OPTIONS_GET, + TEAM_CMD_PORT_LIST_GET, + + __TEAM_CMD_MAX, + TEAM_CMD_MAX = (__TEAM_CMD_MAX - 1) +}; -#endif /* _UAPI_LINUX_IF_TEAM_H_ */ +#endif /* _UAPI_LINUX_IF_TEAM_H */