Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1770499imj; Sun, 10 Feb 2019 09:55:09 -0800 (PST) X-Google-Smtp-Source: AHgI3IZoPz82L0yNppwxxYSc2nuuHueoEV4raw8TAhKLer0LJDXO2l68bMX58fTPq5PFeleIau5/ X-Received: by 2002:a65:534b:: with SMTP id w11mr30302546pgr.125.1549821309753; Sun, 10 Feb 2019 09:55:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549821309; cv=none; d=google.com; s=arc-20160816; b=ZbuVCgeNQDj7IMVFD1W6oPli1NrpJTuIP2Hs+yvqGfnXf/VvNIOL7NkbgrE9U3IMFK +/A1v0LvRpbeI6eB4qdVwOEiuGYVA0XKqRF1Gu+P0MAh61RlkkCRajNmXjeq/f7ZL0gF zQOif/VdQuZ9UL2mf6zMJWCkucWniYmpHo48fSstaDVbtJCpbLBzFZZ7acPfI/86v334 DdePT5ctzvgM6l3uBZnzUr0orc2ZufeQ3goCLDT+h1ZBw8IPcdPtHfj3QNkNXfN02qL4 vSE29fuRNOfUKmeUPegjpfgC0Gl43rb+gtlsgMf4yugHWGm26lBbuzgU2WknQBjcjEio pDmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=xHCeq/zNU8Vz6vIUbaa4+CfDxZLSbpk+FdXHMruBdy8=; b=nkQmBMCfNv3bIxsJoeiZjxOSB3haBqY1Y4uzgMS/XueLkbCEEm3wAS9LYrtPrNmoiC qRR8ddjmudMLBJrd+U2xgim76Httn4IAbk4/Q+roAkvwflqgyHOz8g39hvCgmnbeFeMD nFgth128xN+05UYLqkStobHjAKh1t2LHCYuQ3d5slFSCmRjdlourX3jy/ieuzThYz4/j vBi+XciKCXUFq6GjMajOtIpqLwEgHGcFv0HzUNnoVNUOObVFDQM9lQNCdqQa80TX4Q1v Lwlv7Iir10rEWa6AYnNQqrZvvmoQrrFEtnK7+C2Z+Srx5KA5MwpkcDie5pWLV2iKqM8P GOnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Ji9es3ng; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id u77si753676pfj.139.2019.02.10.09.54.54; Sun, 10 Feb 2019 09:55:09 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Ji9es3ng; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1727280AbfBJRyV (ORCPT + 99 others); Sun, 10 Feb 2019 12:54:21 -0500 Received: from mail-ot1-f66.google.com ([209.85.210.66]:41872 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727067AbfBJRxg (ORCPT ); Sun, 10 Feb 2019 12:53:36 -0500 Received: by mail-ot1-f66.google.com with SMTP id u16so13892949otk.8; Sun, 10 Feb 2019 09:53:36 -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=xHCeq/zNU8Vz6vIUbaa4+CfDxZLSbpk+FdXHMruBdy8=; b=Ji9es3ngnoEFQk/V5XYuhKH9kud+ZWCCSh07BAcEfY67Vo1fFDHdSCxhdN9kuKQzcx osggmOvP6UvQggn1eoLoZ+oZQC383AkZ2aVEUdP2PelBIa1urYS1PJfpElQ4I/m00Gra zRZwLNb2BBH9Y/LnjI6fKANk0V7Us3W9tBfuDrkYBlgZ8Qo0vjGYYZnjsw5wkRIgrWQE GzCPDYth2p+viqkGcSg6vhyfERlcIqxXht/ge0Yt2IJ2u5/GawUKI7NjPiIq12lT8fnw Pfv5vl+ju5BEW0H+vLeohmFOrHrFiRBmlSsVBRZ1KJlf3Q9KotnNbwkUzcA+tMIH+V7h 3WvA== 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=xHCeq/zNU8Vz6vIUbaa4+CfDxZLSbpk+FdXHMruBdy8=; b=HErbSNq4cJV7W+I8ay89ZFHUiIKS1hupltAjDomJvPxgcjGbgHxJ81Rszzl+XnQsid SH8iCIHguqDKrmWh5FN/Ic6FimNMZAIRNuiTJRudYTlk5iwN+NkUD88h/1cq28dH687h 3RKgivTRbsSYLphHcPN/uPUfFNp+Ue4CV8egIBi37HG1RS/Anw+9TDY+SOILJDu23Me4 xqUwBbQsy/jsZx1WyDw5MtIVz2Yorgqm1IcHO6F0GaGfCbn83UE5bvJ+GAIDB5isjCt7 RQZ4ydhDACfO2NvwssGE5MQhFoYFzZ1iD6m+D+vr/Pyg3RnslT6lKM5E6ZKRJGe09HA5 FwTw== X-Gm-Message-State: AHQUAua1E0xfy0IIkQCbyaG13OILcWZb2LoYzjg/qfWnyMk2ww+ac92J LGttrYJqVfQFmoI7HKm14CVcWdwi X-Received: by 2002:a9d:6143:: with SMTP id c3mr24707297otk.227.1549821215346; Sun, 10 Feb 2019 09:53:35 -0800 (PST) Received: from localhost.localdomain (ip68-228-73-187.oc.oc.cox.net. [68.228.73.187]) by smtp.gmail.com with ESMTPSA id n9sm3156425otq.14.2019.02.10.09.53.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 10 Feb 2019 09:53:34 -0800 (PST) From: Florian Fainelli To: netdev@vger.kernel.org Cc: Florian Fainelli , idosch@mellanox.com, linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org, bridge@lists.linux-foundation.org, jiri@mellanox.com, andrew@lunn.ch, vivien.didelot@gmail.com Subject: [PATCH net-next v2 11/16] net: dsa: Handle SWITCHDEV_PORT_ATTR_SET Date: Sun, 10 Feb 2019 09:51:00 -0800 Message-Id: <20190210175105.31629-12-f.fainelli@gmail.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190210175105.31629-1-f.fainelli@gmail.com> References: <20190210175105.31629-1-f.fainelli@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Following patches will change the way we communicate getting or setting a port's attribute and use a blocking notifier to perform those tasks. Prepare DSA to support receiving notifier events targeting SWITCHDEV_PORT_ATTR_SET and simply translate that into the existing dsa_slave_port_attr_set() call. Signed-off-by: Florian Fainelli --- net/dsa/slave.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/net/dsa/slave.c b/net/dsa/slave.c index d8eb33979368..ee4b94c5e68e 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c @@ -1547,6 +1547,20 @@ dsa_slave_switchdev_port_obj_event(unsigned long event, return notifier_from_errno(err); } +static int +dsa_slave_switchdev_port_attr_set_event(unsigned long event, + struct net_device *netdev, + struct switchdev_notifier_port_attr_info *port_attr_info) +{ + int err; + + err = dsa_slave_port_attr_set(netdev, port_attr_info->attr, + port_attr_info->trans); + + port_attr_info->handled = true; + return notifier_from_errno(err); +} + static int dsa_slave_switchdev_blocking_event(struct notifier_block *unused, unsigned long event, void *ptr) { @@ -1559,6 +1573,8 @@ static int dsa_slave_switchdev_blocking_event(struct notifier_block *unused, case SWITCHDEV_PORT_OBJ_ADD: /* fall through */ case SWITCHDEV_PORT_OBJ_DEL: return dsa_slave_switchdev_port_obj_event(event, dev, ptr); + case SWITCHDEV_PORT_ATTR_SET: + return dsa_slave_switchdev_port_attr_set_event(event, dev, ptr); } return NOTIFY_DONE; -- 2.19.1