Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1770446imj; Sun, 10 Feb 2019 09:55:05 -0800 (PST) X-Google-Smtp-Source: AHgI3Ib7KwftihawvgMTknnWo25hQEiJ08M5WUle35cHYPoc89DS77bP4A7WKjNkmXI83BS9yU76 X-Received: by 2002:a62:2c4d:: with SMTP id s74mr32681083pfs.6.1549821305497; Sun, 10 Feb 2019 09:55:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549821305; cv=none; d=google.com; s=arc-20160816; b=a5IXLFQimfsSfpVlHgEZzB7ukiN//upFRaDOrSSjy/HA6My40Yk8+m9YipkrLPy5l3 NRoGqxUA4ZUqV4DeFBx/5VVTP5c87vmdoyoWjCQ7GjP1UWAE4gxIQoTbMArUSM5bPZcx Y+1wpuz/1qolvq31wklS7CbssmBcVxdBb7lXYMhQgup0iQjeSC84sTlDfcjy4w1JZe8i SwkLqQJyRcDuoLe3epA7NkSvgDfL55NpOV7iSVIaPePwPmy1uPSO/RY1yZiLEtuDTwAR YzXuIdDhFpK90WiHaVh8bn/vsWOtCqw3enOnrxBpE02QnaWYfWU4Xj8cTbJPusjGj5av huuQ== 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=4HuMzAPZm6+87r82yhdOiGKCalKhABoswLiokllJuxQ=; b=VHHeYEpHuUV/zWQhIwzFfit9+of1z3Ig32a5sduLMry3xxik5rjRh3HxMhh8Wy0j+V K2DrbnUZERVHrFzwb31Xq/JiKoYgKwu5VGZIY9V68Stp8APIcgXBo1mH7oSIoyTgCqO8 tINmk1dbHtNrjL+oxehbIzP+taIHrXirqOBEagj0JnDCgExb5S5r+sS0CEP3sEw2r5Fr WTuNPeBmkbkCYhUPvN2zoOwfwadCRO+2oXSd9FAvodbLhfcm/YkaN+NH6N1D9AgGt3xv iMk3ir7meqdHDEe6/RtlnC0UdtZ7chaFErA/PZX4JuLWxrl7oC0zd9znvKKPwNVlkLb1 9q5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FAKdtfqk; 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 f7si5561619pga.87.2019.02.10.09.54.49; Sun, 10 Feb 2019 09:55:05 -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=FAKdtfqk; 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 S1727135AbfBJRxo (ORCPT + 99 others); Sun, 10 Feb 2019 12:53:44 -0500 Received: from mail-ot1-f65.google.com ([209.85.210.65]:39784 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727097AbfBJRxk (ORCPT ); Sun, 10 Feb 2019 12:53:40 -0500 Received: by mail-ot1-f65.google.com with SMTP id n8so13893754otl.6; Sun, 10 Feb 2019 09:53:39 -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=4HuMzAPZm6+87r82yhdOiGKCalKhABoswLiokllJuxQ=; b=FAKdtfqkzU6mcofBLDh/nrL7z0qgbYcuIx8tRoRxa3ramBXLMo73cuNaalSbYcBRcL MAiwUxIgr4LWhjJr5M+TX8dm6T+z8p4nCv4JwUgq6CmelZzqCACO+ToN0oR+YsqmD2MJ J+BO3C/loMWgryavP/TiEfRYdD6Ne8uVn0mO8ylOJx/erZIdAKmgMuFmcruAcBBuJJja mcARog7bNWQJY6SwRwurYweE3UeMjDBOobTkZQ9D2DOA/zraifN2Sbato6iB3Ro/n7AU r3Lg6IszkrmXuvNbLlLMOVqaMXNEbOrRgC49CvGcrxiMXCaP6WgMv7zbX+79sVqX7tby vgpA== 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=4HuMzAPZm6+87r82yhdOiGKCalKhABoswLiokllJuxQ=; b=noRuWhS67SZFl0E2Q9gW/eSb9UGrDZaIO4gUa1zkMr46k+v7AD3Cd4ZbjWP1Utmmb1 UkzUBmhTHsahGeQkCqre6XbEdSrVaVJUpjgIR7hllzAKPnOuIV/kxAvoAen1P23VI7jT IUvNFMlYimfqagTVbCpiHY3L26sKk7iIFNdmqc7xKfsCftNb2H9tCZImf1glWGLnTJRI uE6Dqv2JuUG97TwVpCWzsks+SQucQg/CtAMrL95jU7diqb9YlvyQV/C9SsV+bvXaH0di NcJXGNEcOGHlO00gvCicNLTJm6kSSJkT0Zb17ozuAYMYK4QhQksLQMKvbRIlW6K4C1bH lmTA== X-Gm-Message-State: AHQUAuappIKHHK9MITRqW/jvbxwGMMJP11/GonumcKqB05rquUZ7jwaj pmbWSFJCGkBV+BbOX6gkbbPb5UV+ X-Received: by 2002:a9d:491e:: with SMTP id e30mr24800038otf.131.1549821219165; Sun, 10 Feb 2019 09:53:39 -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.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 10 Feb 2019 09:53:38 -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 13/16] net: mscc: ocelot: Handle SWITCHDEV_PORT_ATTR_SET Date: Sun, 10 Feb 2019 09:51:02 -0800 Message-Id: <20190210175105.31629-14-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 ocelot to support receiving notifier events targeting SWITCHDEV_PORT_ATTR_SET and simply translate that into the existing ocelot_port_attr_set() call. Signed-off-by: Florian Fainelli --- drivers/net/ethernet/mscc/ocelot.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/net/ethernet/mscc/ocelot.c b/drivers/net/ethernet/mscc/ocelot.c index 195306d05bcd..1dda4dd4c073 100644 --- a/drivers/net/ethernet/mscc/ocelot.c +++ b/drivers/net/ethernet/mscc/ocelot.c @@ -1582,6 +1582,20 @@ struct notifier_block ocelot_netdevice_nb __read_mostly = { }; EXPORT_SYMBOL(ocelot_netdevice_nb); +static int +ocelot_switchdev_port_attr_set_event(unsigned long event, + struct net_device *netdev, + struct switchdev_notifier_port_attr_info *port_attr_info) +{ + int err; + + err = ocelot_port_attr_set(netdev, port_attr_info->attr, + port_attr_info->trans); + + port_attr_info->handled = true; + return notifier_from_errno(err); +} + static int ocelot_switchdev_blocking_event(struct notifier_block *unused, unsigned long event, void *ptr) { @@ -1600,6 +1614,8 @@ static int ocelot_switchdev_blocking_event(struct notifier_block *unused, ocelot_netdevice_dev_check, ocelot_port_obj_del); return notifier_from_errno(err); + case SWITCHDEV_PORT_ATTR_SET: + return ocelot_switchdev_port_attr_set_event(event, dev, ptr); } return NOTIFY_DONE; -- 2.19.1