Received: by 2002:ac0:b08d:0:0:0:0:0 with SMTP id l13csp2016802imc; Fri, 22 Feb 2019 16:02:32 -0800 (PST) X-Google-Smtp-Source: AHgI3Ia/xwE4qNEh7FNtDT6XXwtJ/4SLp+Zy7erJ/MHUAdZjci8NIkQmByTpA2dEuUeYmbuVNZ2i X-Received: by 2002:a63:854a:: with SMTP id u71mr2505990pgd.141.1550880152818; Fri, 22 Feb 2019 16:02:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550880152; cv=none; d=google.com; s=arc-20160816; b=u/Wi3BjhPRmL8hkr/RRoJK0AtNLLXroVJIAml1R2NZ2Vxl5txYty6vxzR3ty/Q06/J IGXLzbZ0yifMbnbqWJU4ZHWpNLxS2H9Mlo4qlYy56XkbBZecfOo462hEroLIRwIPSB5Q SDZxIszBIMLAd71Cb9ocCv0NdB13voh6rrX/vihy4F6Rmrw817BFfy6dDiAB9rSEd76V XD2Vo8+81seHASXiAhpj6RX47oeTPfM7cXt39g2DPTX3ByVdO21VfOaHn3L/PbLwvRgE IYQyz6X+Zh/iRoSb/R0KyXGWTm5wrYfns6pNAxwJyJWyXJh1UkCfrXolS53U1rlriomj JLKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=3n08U17XQLLrwYLiDWOdzsQAwXWMIAMlVMMr8OAosZo=; b=fT4tLZM1xrocf6WEHBBX2tfrreGn//7AAnxaYr55IbwFDITP30OVoDHubfQMcCgVDL 9Qy6+zlWNp9lyAOAq5Nsx3/OtKyiHmcmVC1bEWGF3YU2tGDJpH/6nMavY0ncKu4S6+9B N8/odJYwtxTSD69qINGPRiwng7F0aIiBCT+gvlipWpoxm2ulTfYR7Yv8Erfcn6lfjhgs 6lyzuHgGJfEvT6dnOs4C7e5PyvgbWQR9sEtbXINcutNjv6gXi/qwAnzMVxQ3gZ1SHGx0 c0JchsSUpUHnYBi+ySC1Uhb34tt82mJ6L7c2hr0UvsWzVOYbgvqPtnZlXnewxko5N/db c5yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="T/xvMrPI"; 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 g98si2724104plb.99.2019.02.22.16.02.17; Fri, 22 Feb 2019 16:02:32 -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="T/xvMrPI"; 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 S1727629AbfBWAAf (ORCPT + 99 others); Fri, 22 Feb 2019 19:00:35 -0500 Received: from mail-pf1-f195.google.com ([209.85.210.195]:45945 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726847AbfBWAAd (ORCPT ); Fri, 22 Feb 2019 19:00:33 -0500 Received: by mail-pf1-f195.google.com with SMTP id v21so1777664pfm.12; Fri, 22 Feb 2019 16:00:32 -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; bh=3n08U17XQLLrwYLiDWOdzsQAwXWMIAMlVMMr8OAosZo=; b=T/xvMrPInTZVV/RHVi8N8KxnUG7NjDH+YfgFoDOKRiGaKyS/4sT4EDJImoiES+CsQd 5ivaOfbp1nDZag60HJZUpPbSPI+NGjgZhXkj431ib8u6/yeS4UiVZB/DNZAO8rrOPWOr 8fCj9pOt3YNDes3iWBUuKDbD4EhGsbXB/sBiJlpYQN9SQv3hH+REW9SyMWzMTlQS/r7F SH+4tEFbZAOSTDXEOI+dKro11nvDv0nhwWSJaA+1v397Z9MzFxxmWPxpQZqHOXSiGBAq QACCYECyiD6kLFc9Lv6W25DCoKH4E7dZ9kyVvxMpRF/IxEl7JtqtKuc4NDsk1KuzYRo/ qxYQ== 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; bh=3n08U17XQLLrwYLiDWOdzsQAwXWMIAMlVMMr8OAosZo=; b=OTQrvBJrV9pRIDvtRVUWSPksf0cUSRxS0xVNtrxKwannWIJnsWtFgCoE5/oV4jAGc+ mO6i+s98lpNGTvaenatxMRcZBHK9ypJCiPKpYPt46UXXxACKc92Mg0qpc3WTm4JVXEBC LAeqJeiaBfPtKPv1rXGFF1uOzGFsZXb3mHnsbliISpsYuqGIeZ8D0qGyBI5fDxVVTazn nvsOVhcGC/Qn0rXI0VMVDFbaIubilmXxCcp+56Co1O0QBjZII7TeHJ/Pm8Rbawl/XeIb /2xg/eitD/jSQ53MNCEltysp3cyeJ1jXb3fkJdDv37JYgf22Z716S3wJ4HM9CCurXDtL bSDg== X-Gm-Message-State: AHQUAuYYSFKBc3hXb3nrvRMa8+dUFV84CluR07/NDCggztW8BBGMTQ4H mL067DrxEuHL4j4HghOZaalpxVe6 X-Received: by 2002:aa7:90c7:: with SMTP id k7mr6528326pfk.186.1550880032077; Fri, 22 Feb 2019 16:00:32 -0800 (PST) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.250]) by smtp.gmail.com with ESMTPSA id z12sm3327872pgv.0.2019.02.22.16.00.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Feb 2019 16:00:31 -0800 (PST) From: Florian Fainelli To: netdev@vger.kernel.org Cc: Florian Fainelli , "David S. Miller" , Ido Schimmel , linux-kernel@vger.kernel.org (open list), devel@driverdev.osuosl.org (open list:STAGING SUBSYSTEM), bridge@lists.linux-foundation.org (moderated list:ETHERNET BRIDGE), jiri@mellanox.com, andrew@lunn.ch, vivien.didelot@gmail.com Subject: [PATCH net-next 2/8] rocker: Handle SWITCHDEV_PORT_ATTR_SET Date: Fri, 22 Feb 2019 15:59:20 -0800 Message-Id: <20190222235927.10295-3-f.fainelli@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190222235927.10295-1-f.fainelli@gmail.com> References: <20190222235927.10295-1-f.fainelli@gmail.com> 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 setting a port's attribute and use notifiers towards that goal. Prepare rocker to support receiving notifier events targeting SWITCHDEV_PORT_ATTR_SET from both atomic and process context and use a small helper to translate the event notifier into something that rocker_port_attr_set() can process. Signed-off-by: Florian Fainelli --- drivers/net/ethernet/rocker/rocker_main.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/net/ethernet/rocker/rocker_main.c b/drivers/net/ethernet/rocker/rocker_main.c index 309a6bf9130c..fc772cf079cc 100644 --- a/drivers/net/ethernet/rocker/rocker_main.c +++ b/drivers/net/ethernet/rocker/rocker_main.c @@ -2710,6 +2710,19 @@ static bool rocker_port_dev_check(const struct net_device *dev) return dev->netdev_ops == &rocker_port_netdev_ops; } +static int +rocker_switchdev_port_attr_set_event(struct net_device *netdev, + struct switchdev_notifier_port_attr_info *port_attr_info) +{ + int err; + + err = rocker_port_attr_set(netdev, port_attr_info->attr, + port_attr_info->trans); + + port_attr_info->handled = true; + return notifier_from_errno(err); +} + struct rocker_switchdev_event_work { struct work_struct work; struct switchdev_notifier_fdb_info fdb_info; @@ -2779,6 +2792,9 @@ static int rocker_switchdev_event(struct notifier_block *unused, if (!rocker_port_dev_check(dev)) return NOTIFY_DONE; + if (event == SWITCHDEV_PORT_ATTR_SET) + return rocker_switchdev_port_attr_set_event(dev, ptr); + rocker_port = netdev_priv(dev); switchdev_work = kzalloc(sizeof(*switchdev_work), GFP_ATOMIC); if (WARN_ON(!switchdev_work)) @@ -2841,6 +2857,8 @@ static int rocker_switchdev_blocking_event(struct notifier_block *unused, case SWITCHDEV_PORT_OBJ_ADD: case SWITCHDEV_PORT_OBJ_DEL: return rocker_switchdev_port_obj_event(event, dev, ptr); + case SWITCHDEV_PORT_ATTR_SET: + return rocker_switchdev_port_attr_set_event(dev, ptr); } return NOTIFY_DONE; -- 2.17.1