Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp568117pxb; Tue, 9 Feb 2021 07:22:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJx2rEiqUnIGe/p505a0hZkCjhENscwVhQNgrJdX727eGIKEWxQ9gOPl4lgqJ89KXda1Focq X-Received: by 2002:a1c:b386:: with SMTP id c128mr4030621wmf.48.1612884176141; Tue, 09 Feb 2021 07:22:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612884176; cv=none; d=google.com; s=arc-20160816; b=h+kBSb5ewAJsw5ufjI87h6HZ3GyiUpwDsngCrYHQfaXnKrMyRdg0YBSBGD1MPHVep/ 5Z+9fsXQp1eS+tFGlPi6XM3Um3+jrirAQV4KlRHeaoc3QlCbp/v5jFIeIF0gFVQ+GH/d K0PXDt8z9xLUaZAbl5oHThVnV8bIG5Cl2w/wigkPz5yz1jsfSJHUnCy4Si2y6EvDXQ0m ZWMHAQAPGlN0zE19mo/W/cekCRTSRG1VaPt7NmoSxtrXIglzRnb096MTF4bqqCY6hh7w 5kh4jxt16tMePSUqedD0HvVdVwnYzjdyG8pkFAPV52YB3ZEojIFtY8AdQsea+1riinA7 Vs/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=bwgXqY0XDEsxT+Wb2PB7ggubcv5eW1qCZaQuhAzCet0=; b=x1QDVahj8NjeKzejb5cXe4qo+RuNo3ioFDFjtkweDZCbaF2LA8bI5uukLYu+7zupeU 2TAsXrR00p16RKpXwF8qtBcR6ACrHBGY95vgofRfThOJ2VF01mJNpsmTrFJTGHfF3rmv rk0gDWbXXkBNwXou0aIabZ5tcb2GeuRVaKbp3bQQXV0QFPSTMuwzIp9wCURNRbxiKNpL wbilJaJMv5V/EWIXOwF8OullLfCtRMn8QQaEr2lkIWGiNf94+/gM1B37G4gV0a4RzCJt Z6te2l/GhI8fasw2sso+0+AQNSX40vvKl8Blre7gEYg5VL7sQPT3uWpetwtjS57vPlNG r3Tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Lnq5R+2e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l13si13171463ejx.754.2021.02.09.07.22.31; Tue, 09 Feb 2021 07:22:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Lnq5R+2e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232457AbhBIPUf (ORCPT + 99 others); Tue, 9 Feb 2021 10:20:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232417AbhBIPUa (ORCPT ); Tue, 9 Feb 2021 10:20:30 -0500 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05DD3C061788; Tue, 9 Feb 2021 07:19:50 -0800 (PST) Received: by mail-ej1-x62b.google.com with SMTP id a9so32215951ejr.2; Tue, 09 Feb 2021 07:19:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bwgXqY0XDEsxT+Wb2PB7ggubcv5eW1qCZaQuhAzCet0=; b=Lnq5R+2ebs1S1UA2zeORqeXUdTiH+iufe97sflMTO5vUxPY06aU0JrJCCSl5qcsoe4 eAmwzCtIq8NcqaiU1ENrqON/pAuX++PkitbtQ/iKJpf7KJAhd7CV2JxISv/ph1lO/0ZR A4CyBVHlU0KdigtUpGrsSBWide9xltxp2Ujqrt2w9FjHvpInISoTCi+0lLXrn5ZnqQ6r n10mvGvoICfKO7w416/Ar+IfU/GxpxCyy8cYi9pkP4omBYTpKDhoL4jyIJtyF95doGXm anca0G7FOfZNTSxOsLBjunK83kdGV3xPDWvqXEhXbGQvQdG10cOHUJrkz+SyQjd6axMx X56w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bwgXqY0XDEsxT+Wb2PB7ggubcv5eW1qCZaQuhAzCet0=; b=uRcQ05tvzU9ds9z8ILc1RghbEulSPtUsBxJl1VptCD3WuR0kHODNKSk6+7jNAUh5x/ y8MhLMoZpIq69Yam6gqgBGE9yxMaodp5MyKD9Qj+jcco+ASCgOVDfzeNfmc0pJp8QheA PEmbapwSqwBmVEU+2PKzx/DIDkBvMIbO77y1i5NWF1O0VA8sjqqN3GkpGXeD/HRFZjze yY89IhNn8qTK3bZGkFRlpoA4LLcS9L0DRDIgiDg478d4xzzk3O0Kk2ijcm9XGNGpPqwH NdjY4woSAuHVQ8fkT5IJ4jfN5bGqyAlat/kGL3huls0TaB34XG9R/DCpnDI6qsOWfORC giPQ== X-Gm-Message-State: AOAM53301HUSfFxmaDViHVRzvRA5CUIy24vvHWT9fjLGa1PQ+i2pGaH2 s7rH9xR47VMqGV2LVrC6IPM= X-Received: by 2002:a17:906:2bc2:: with SMTP id n2mr22110414ejg.381.1612883988768; Tue, 09 Feb 2021 07:19:48 -0800 (PST) Received: from localhost.localdomain (5-12-227-87.residential.rdsnet.ro. [5.12.227.87]) by smtp.gmail.com with ESMTPSA id q2sm11686108edv.93.2021.02.09.07.19.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Feb 2021 07:19:47 -0800 (PST) From: Vladimir Oltean To: Jakub Kicinski , "David S. Miller" Cc: Andrew Lunn , Vivien Didelot , Florian Fainelli , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bridge@lists.linux-foundation.org, Roopa Prabhu , Nikolay Aleksandrov , Jiri Pirko , Ido Schimmel , Claudiu Manoil , Alexandre Belloni , UNGLinuxDriver@microchip.com, Vadym Kochan , Taras Chornyi , Grygorii Strashko , Ioana Ciornei , Ivan Vecera , linux-omap@vger.kernel.org Subject: [PATCH v2 net-next 01/11] net: switchdev: propagate extack to port attributes Date: Tue, 9 Feb 2021 17:19:26 +0200 Message-Id: <20210209151936.97382-2-olteanv@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210209151936.97382-1-olteanv@gmail.com> References: <20210209151936.97382-1-olteanv@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vladimir Oltean When a struct switchdev_attr is notified through switchdev, there is no way to report informational messages, unlike for struct switchdev_obj. Signed-off-by: Vladimir Oltean --- Changes in v2: Patch is new. .../ethernet/marvell/prestera/prestera_switchdev.c | 3 ++- .../net/ethernet/mellanox/mlxsw/spectrum_switchdev.c | 3 ++- drivers/net/ethernet/mscc/ocelot_net.c | 3 ++- drivers/net/ethernet/ti/cpsw_switchdev.c | 3 ++- include/net/switchdev.h | 6 ++++-- net/dsa/slave.c | 3 ++- net/switchdev/switchdev.c | 11 ++++++++--- 7 files changed, 22 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/marvell/prestera/prestera_switchdev.c b/drivers/net/ethernet/marvell/prestera/prestera_switchdev.c index 8c2b03151736..2c1619715a4b 100644 --- a/drivers/net/ethernet/marvell/prestera/prestera_switchdev.c +++ b/drivers/net/ethernet/marvell/prestera/prestera_switchdev.c @@ -695,7 +695,8 @@ static int prestera_port_attr_stp_state_set(struct prestera_port *port, } static int prestera_port_obj_attr_set(struct net_device *dev, - const struct switchdev_attr *attr) + const struct switchdev_attr *attr, + struct netlink_ext_ack *extack) { struct prestera_port *port = netdev_priv(dev); int err = 0; diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c index 20c4f3c2cf23..18e4f1cd5587 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c @@ -887,7 +887,8 @@ mlxsw_sp_port_attr_br_mrouter_set(struct mlxsw_sp_port *mlxsw_sp_port, } static int mlxsw_sp_port_attr_set(struct net_device *dev, - const struct switchdev_attr *attr) + const struct switchdev_attr *attr, + struct netlink_ext_ack *extack) { struct mlxsw_sp_port *mlxsw_sp_port = netdev_priv(dev); int err; diff --git a/drivers/net/ethernet/mscc/ocelot_net.c b/drivers/net/ethernet/mscc/ocelot_net.c index 8f12fa45b1b5..f9da4aa39444 100644 --- a/drivers/net/ethernet/mscc/ocelot_net.c +++ b/drivers/net/ethernet/mscc/ocelot_net.c @@ -1005,7 +1005,8 @@ static void ocelot_port_attr_mc_set(struct ocelot *ocelot, int port, bool mc) } static int ocelot_port_attr_set(struct net_device *dev, - const struct switchdev_attr *attr) + const struct switchdev_attr *attr, + struct netlink_ext_ack *extack) { struct ocelot_port_private *priv = netdev_priv(dev); struct ocelot *ocelot = priv->port.ocelot; diff --git a/drivers/net/ethernet/ti/cpsw_switchdev.c b/drivers/net/ethernet/ti/cpsw_switchdev.c index 9967cf985728..13524cbaa8b6 100644 --- a/drivers/net/ethernet/ti/cpsw_switchdev.c +++ b/drivers/net/ethernet/ti/cpsw_switchdev.c @@ -83,7 +83,8 @@ static int cpsw_port_attr_br_flags_pre_set(struct net_device *netdev, } static int cpsw_port_attr_set(struct net_device *ndev, - const struct switchdev_attr *attr) + const struct switchdev_attr *attr, + struct netlink_ext_ack *extack) { struct cpsw_priv *priv = netdev_priv(ndev); int ret; diff --git a/include/net/switchdev.h b/include/net/switchdev.h index 88fcac140966..84c765312001 100644 --- a/include/net/switchdev.h +++ b/include/net/switchdev.h @@ -283,7 +283,8 @@ int switchdev_handle_port_attr_set(struct net_device *dev, struct switchdev_notifier_port_attr_info *port_attr_info, bool (*check_cb)(const struct net_device *dev), int (*set_cb)(struct net_device *dev, - const struct switchdev_attr *attr)); + const struct switchdev_attr *attr, + struct netlink_ext_ack *extack)); #else static inline void switchdev_deferred_process(void) @@ -374,7 +375,8 @@ switchdev_handle_port_attr_set(struct net_device *dev, struct switchdev_notifier_port_attr_info *port_attr_info, bool (*check_cb)(const struct net_device *dev), int (*set_cb)(struct net_device *dev, - const struct switchdev_attr *attr)) + const struct switchdev_attr *attr, + struct netlink_ext_ack *extack)) { return 0; } diff --git a/net/dsa/slave.c b/net/dsa/slave.c index 431bdbdd8473..8f4c7c232e2c 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c @@ -271,7 +271,8 @@ static int dsa_slave_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) } static int dsa_slave_port_attr_set(struct net_device *dev, - const struct switchdev_attr *attr) + const struct switchdev_attr *attr, + struct netlink_ext_ack *extack) { struct dsa_port *dp = dsa_slave_to_port(dev); int ret; diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c index 94113ca29dcf..0b84f076591e 100644 --- a/net/switchdev/switchdev.c +++ b/net/switchdev/switchdev.c @@ -488,14 +488,18 @@ static int __switchdev_handle_port_attr_set(struct net_device *dev, struct switchdev_notifier_port_attr_info *port_attr_info, bool (*check_cb)(const struct net_device *dev), int (*set_cb)(struct net_device *dev, - const struct switchdev_attr *attr)) + const struct switchdev_attr *attr, + struct netlink_ext_ack *extack)) { + struct netlink_ext_ack *extack; struct net_device *lower_dev; struct list_head *iter; int err = -EOPNOTSUPP; + extack = switchdev_notifier_info_to_extack(&port_attr_info->info); + if (check_cb(dev)) { - err = set_cb(dev, port_attr_info->attr); + err = set_cb(dev, port_attr_info->attr, extack); if (err != -EOPNOTSUPP) port_attr_info->handled = true; return err; @@ -525,7 +529,8 @@ int switchdev_handle_port_attr_set(struct net_device *dev, struct switchdev_notifier_port_attr_info *port_attr_info, bool (*check_cb)(const struct net_device *dev), int (*set_cb)(struct net_device *dev, - const struct switchdev_attr *attr)) + const struct switchdev_attr *attr, + struct netlink_ext_ack *extack)) { int err; -- 2.25.1