Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp1192660rdb; Fri, 1 Dec 2023 09:12:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IHWm09kBZZlsErTYR2782G/w24UT4jSEJskfQygeczK3y9tZVGlsQ6vlBmr6971oonyPk79 X-Received: by 2002:a05:6a20:5484:b0:18b:e692:4314 with SMTP id i4-20020a056a20548400b0018be6924314mr28826745pzk.56.1701450778032; Fri, 01 Dec 2023 09:12:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701450778; cv=none; d=google.com; s=arc-20160816; b=rp0AJckQCGPnb2bzVmGkrjXMu/QDhKWV3Tr61hB4vggT1lU8xzVmBPbatF+8tvkiv3 7c+Chtrkqj1rACh2dJ42i0v1eYH0rJMyILQRtC6u03ynFQhRgc0CuuqaRfwM9JPZj+U7 WIJA10GCz+3wPf7WKjYU/lFaM3HyTosuYb4X7R/VxXBBlraQP8WAzyrE3dl2Y1VqtR+T 7Zwcls49f6QKkr0/s8TYtOSTdyYfLJzC2RCOwsGPC95IACwg/uVnd8OikTAJ7Mt5O8Ai fkr0aDss6oGhJxE2izvUDf+6fxBVjS64sCao3ZZG8/6onB/RCnVCYZS9+FMNGcGyB07M kv1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=lwpjtsb4vZRwM2eK/2Qxes8YTGtiPBW1F4mvBxoQ974=; fh=/uDJtwnpikhDHchW+BU5DaWKtgJ2QqyhTe++6ujbTY0=; b=FTpWwGiSMCBPrgm4/VDQkMRwpuiDth6D4LMFKhA0bOrehKxH7rVBQetOrTpQyZw5pX 06aLN4/I69CKP7rAPW0x8GO6KFxqEWUcEievikgtRF6SZMDXRLp04U921pZpc8sk2mYe crOqJU2XmCDuChTZYvyo++ijVdm/vEEA1+f9cWsNLFgI+Xy6G7If12d1OANHY38Om1hu W/d14YFETXHrjec1NG0KkmdTyqYjBBdEXS9acQVPBPW0M/DjEtBc1E4ih70wcQR6tzQE lXU97LzL4Z6mZQsfk6UKbmTg9+XBxbQvGOM+gAycQGO5Z9Jou0LSQadQRBhYq5oReXuN Qezg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="bJSI6nE/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id 33-20020a631061000000b0059c0f9ef964si3512556pgq.635.2023.12.01.09.12.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 09:12:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="bJSI6nE/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 565FE8115441; Fri, 1 Dec 2023 09:12:42 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378858AbjLARL4 (ORCPT + 99 others); Fri, 1 Dec 2023 12:11:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229900AbjLARLh (ORCPT ); Fri, 1 Dec 2023 12:11:37 -0500 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EBC30131; Fri, 1 Dec 2023 09:11:42 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id E10C9240007; Fri, 1 Dec 2023 17:11:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1701450701; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lwpjtsb4vZRwM2eK/2Qxes8YTGtiPBW1F4mvBxoQ974=; b=bJSI6nE/WN/p9onyAoGJxA9IgpJ/ir9a+vhgPSqSwgCEOH36CNdeS+ghoo4PKkp+cg4toI 180lv6wqy4m9TAsnz/DMs51NCv3Rk/kmwwo5Fu91Bbe2F1VpOtxY6SWoco/3dEKjjDBNvU 2zYx/Yt87QMy0YIx6zKRv4y00B3QcHD1mM2lqcyhWRBkJvaw1LTKOo7CFS5UmIQj6v+Jou ap+c7GvyYzEY3wDuRr2ZehZJJm4hF/xXLKwfAQgwY4P6mXZ7SsbNukPqTvm/aW1n3o8UJG tJekVAzU7EZjdHtTezmJiBmD3PhhkIhWh2b5cUu+HkKaAnzGC7ipHbsMhyRjjg== From: Kory Maincent Date: Fri, 01 Dec 2023 18:10:28 +0100 Subject: [PATCH net-next v2 6/8] netlink: specs: Expand the pse netlink command with PoE interface MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20231201-feature_poe-v2-6-56d8cac607fa@bootlin.com> References: <20231201-feature_poe-v2-0-56d8cac607fa@bootlin.com> In-Reply-To: <20231201-feature_poe-v2-0-56d8cac607fa@bootlin.com> To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jonathan Corbet , Luis Chamberlain , Russ Weight , Greg Kroah-Hartman , "Rafael J. Wysocki" , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Oleksij Rempel Cc: Thomas Petazzoni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, devicetree@vger.kernel.org, Dent Project , Kory Maincent X-Mailer: b4 0.12.4 X-GND-Sasl: kory.maincent@bootlin.com X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Fri, 01 Dec 2023 09:12:42 -0800 (PST) Add the PoE pse attributes prefix to be able to use PoE interface. Example usage: ./ynl/cli.py --spec netlink/specs/ethtool.yaml --no-schema --do pse-get \ --json '{"header":{"dev-name":"eth0"}}' {'header': {'dev-index': 4, 'dev-name': 'eth0'}, 'c33-pse-admin-state': 3, 'c33-pse-pw-d-status': 4} ./ynl/cli.py --spec netlink/specs/ethtool.yaml --no-schema --do pse-set \ --json '{"header":{"dev-name":"eth0"}, "c33-pse-admin-control":3}' Update the ethtool generated code accordingly. Sponsored-by: Dent Project Signed-off-by: Kory Maincent --- Changes in v2: - Follow the "c33" PoE prefix naming change. - Add the ethtool auto generated code. --- Documentation/netlink/specs/ethtool.yaml | 15 +++++++++++++++ tools/net/ynl/generated/ethtool-user.c | 24 +++++++++++++++++++++++ tools/net/ynl/generated/ethtool-user.h | 33 ++++++++++++++++++++++++++++++++ 3 files changed, 72 insertions(+) diff --git a/Documentation/netlink/specs/ethtool.yaml b/Documentation/netlink/specs/ethtool.yaml index e1bf75099264..6870106bf50c 100644 --- a/Documentation/netlink/specs/ethtool.yaml +++ b/Documentation/netlink/specs/ethtool.yaml @@ -889,6 +889,18 @@ attribute-sets: name: podl-pse-pw-d-status type: u32 name-prefix: ethtool-a- + - + name: c33-pse-admin-state + type: u32 + name-prefix: ethtool-a- + - + name: c33-pse-admin-control + type: u32 + name-prefix: ethtool-a- + - + name: c33-pse-pw-d-status + type: u32 + name-prefix: ethtool-a- - name: rss attributes: @@ -1571,6 +1583,9 @@ operations: - podl-pse-admin-state - podl-pse-admin-control - podl-pse-pw-d-status + - c33-pse-admin-state + - c33-pse-admin-control + - c33-pse-pw-d-status dump: *pse-get-op - name: pse-set diff --git a/tools/net/ynl/generated/ethtool-user.c b/tools/net/ynl/generated/ethtool-user.c index 922bbd07ee95..bcf97b46ed6a 100644 --- a/tools/net/ynl/generated/ethtool-user.c +++ b/tools/net/ynl/generated/ethtool-user.c @@ -610,6 +610,9 @@ struct ynl_policy_attr ethtool_pse_policy[ETHTOOL_A_PSE_MAX + 1] = { [ETHTOOL_A_PODL_PSE_ADMIN_STATE] = { .name = "podl-pse-admin-state", .type = YNL_PT_U32, }, [ETHTOOL_A_PODL_PSE_ADMIN_CONTROL] = { .name = "podl-pse-admin-control", .type = YNL_PT_U32, }, [ETHTOOL_A_PODL_PSE_PW_D_STATUS] = { .name = "podl-pse-pw-d-status", .type = YNL_PT_U32, }, + [ETHTOOL_A_C33_PSE_ADMIN_STATE] = { .name = "c33-pse-admin-state", .type = YNL_PT_U32, }, + [ETHTOOL_A_C33_PSE_ADMIN_CONTROL] = { .name = "c33-pse-admin-control", .type = YNL_PT_U32, }, + [ETHTOOL_A_C33_PSE_PW_D_STATUS] = { .name = "c33-pse-pw-d-status", .type = YNL_PT_U32, }, }; struct ynl_policy_nest ethtool_pse_nest = { @@ -5320,6 +5323,21 @@ int ethtool_pse_get_rsp_parse(const struct nlmsghdr *nlh, void *data) return MNL_CB_ERROR; dst->_present.podl_pse_pw_d_status = 1; dst->podl_pse_pw_d_status = mnl_attr_get_u32(attr); + } else if (type == ETHTOOL_A_C33_PSE_ADMIN_STATE) { + if (ynl_attr_validate(yarg, attr)) + return MNL_CB_ERROR; + dst->_present.c33_pse_admin_state = 1; + dst->c33_pse_admin_state = mnl_attr_get_u32(attr); + } else if (type == ETHTOOL_A_C33_PSE_ADMIN_CONTROL) { + if (ynl_attr_validate(yarg, attr)) + return MNL_CB_ERROR; + dst->_present.c33_pse_admin_control = 1; + dst->c33_pse_admin_control = mnl_attr_get_u32(attr); + } else if (type == ETHTOOL_A_C33_PSE_PW_D_STATUS) { + if (ynl_attr_validate(yarg, attr)) + return MNL_CB_ERROR; + dst->_present.c33_pse_pw_d_status = 1; + dst->c33_pse_pw_d_status = mnl_attr_get_u32(attr); } } @@ -5426,6 +5444,12 @@ int ethtool_pse_set(struct ynl_sock *ys, struct ethtool_pse_set_req *req) mnl_attr_put_u32(nlh, ETHTOOL_A_PODL_PSE_ADMIN_CONTROL, req->podl_pse_admin_control); if (req->_present.podl_pse_pw_d_status) mnl_attr_put_u32(nlh, ETHTOOL_A_PODL_PSE_PW_D_STATUS, req->podl_pse_pw_d_status); + if (req->_present.c33_pse_admin_state) + mnl_attr_put_u32(nlh, ETHTOOL_A_C33_PSE_ADMIN_STATE, req->c33_pse_admin_state); + if (req->_present.c33_pse_admin_control) + mnl_attr_put_u32(nlh, ETHTOOL_A_C33_PSE_ADMIN_CONTROL, req->c33_pse_admin_control); + if (req->_present.c33_pse_pw_d_status) + mnl_attr_put_u32(nlh, ETHTOOL_A_C33_PSE_PW_D_STATUS, req->c33_pse_pw_d_status); err = ynl_exec(ys, nlh, &yrs); if (err < 0) diff --git a/tools/net/ynl/generated/ethtool-user.h b/tools/net/ynl/generated/ethtool-user.h index a2c69264c021..5bcb9d5f5c89 100644 --- a/tools/net/ynl/generated/ethtool-user.h +++ b/tools/net/ynl/generated/ethtool-user.h @@ -4593,12 +4593,18 @@ struct ethtool_pse_get_rsp { __u32 podl_pse_admin_state:1; __u32 podl_pse_admin_control:1; __u32 podl_pse_pw_d_status:1; + __u32 c33_pse_admin_state:1; + __u32 c33_pse_admin_control:1; + __u32 c33_pse_pw_d_status:1; } _present; struct ethtool_header header; __u32 podl_pse_admin_state; __u32 podl_pse_admin_control; __u32 podl_pse_pw_d_status; + __u32 c33_pse_admin_state; + __u32 c33_pse_admin_control; + __u32 c33_pse_pw_d_status; }; void ethtool_pse_get_rsp_free(struct ethtool_pse_get_rsp *rsp); @@ -4670,12 +4676,18 @@ struct ethtool_pse_set_req { __u32 podl_pse_admin_state:1; __u32 podl_pse_admin_control:1; __u32 podl_pse_pw_d_status:1; + __u32 c33_pse_admin_state:1; + __u32 c33_pse_admin_control:1; + __u32 c33_pse_pw_d_status:1; } _present; struct ethtool_header header; __u32 podl_pse_admin_state; __u32 podl_pse_admin_control; __u32 podl_pse_pw_d_status; + __u32 c33_pse_admin_state; + __u32 c33_pse_admin_control; + __u32 c33_pse_pw_d_status; }; static inline struct ethtool_pse_set_req *ethtool_pse_set_req_alloc(void) @@ -4731,6 +4743,27 @@ ethtool_pse_set_req_set_podl_pse_pw_d_status(struct ethtool_pse_set_req *req, req->_present.podl_pse_pw_d_status = 1; req->podl_pse_pw_d_status = podl_pse_pw_d_status; } +static inline void +ethtool_pse_set_req_set_c33_pse_admin_state(struct ethtool_pse_set_req *req, + __u32 c33_pse_admin_state) +{ + req->_present.c33_pse_admin_state = 1; + req->c33_pse_admin_state = c33_pse_admin_state; +} +static inline void +ethtool_pse_set_req_set_c33_pse_admin_control(struct ethtool_pse_set_req *req, + __u32 c33_pse_admin_control) +{ + req->_present.c33_pse_admin_control = 1; + req->c33_pse_admin_control = c33_pse_admin_control; +} +static inline void +ethtool_pse_set_req_set_c33_pse_pw_d_status(struct ethtool_pse_set_req *req, + __u32 c33_pse_pw_d_status) +{ + req->_present.c33_pse_pw_d_status = 1; + req->c33_pse_pw_d_status = c33_pse_pw_d_status; +} /* * Set Power Sourcing Equipment params. -- 2.25.1