Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp1235662img; Tue, 26 Feb 2019 17:15:53 -0800 (PST) X-Google-Smtp-Source: AHgI3IaG40WnkpdYYrabPuHgpSUKE2zhsjh2SHe2fprUaDKwnggWYdlNvUQo/67OXNp2sp8oMYxt X-Received: by 2002:a62:fb10:: with SMTP id x16mr29273151pfm.5.1551230153054; Tue, 26 Feb 2019 17:15:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551230153; cv=none; d=google.com; s=arc-20160816; b=rnNg5OK1CMdHw/GoPlgEMFt5fPVvXNJoADmHS5qca9/j+jBD4kUSrbS534CBkVYUHs hQS1Qk27hoSUlkSyR+TBrhY6R2XyktZmrxLIyFpCkAGLLr5GaGfzGkqZirdFGlxqb54Y qH2R6JtMmyFPc2/brRPh9oBnsCIHV8w59geQ2UXB5xYMVZ2fMFAyIOMi5jgfG4KPNxCG 2x+c0bcRcZL1Yklk1w/T84sMmzr1wRoGW2ZO+DyVFYxiiPAkfeT576o3VLJyTGL0/XMV fzodjo6lI5KlOUsP9CKxmhBYj3whDdSoXAaH6BO31lyXJD7ocZDQ6Z5iXThUkcf6dvJ7 iGvw== 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=PQg9HVQIYqiPsBwNT6JyGAohQPDs6z9iGbY5s51mdrw=; b=YWde+eByI2CT/h4Y0Fru1vjZIP+75QKai6L9QzBbTU9jn2sLaFiJQQkeC/6v5IgKex NWnZBDCMua6waWlVpC6w37oIMaB73v6MS1wXPXVmpAXx3kfZQsiGvstidJVNa4n2rSWp wQlfXXTzr8GgdLl1VmZKawprWGbSSgMvYER+k9k3SV2X55l35BgLZwqbuA1fX25RuZDZ EJlqJ3Q15SAItdXxy4vAIXnoniwJLw6cdAz92yN8abtVeROAFqBfYdOO1gGk6uXniGWf ViAQDU0rLb4Vw7VS9lnuwB84dEZVcGc5QpC4C4147sLhdixnJTw9mKj72B5w0qDYiwI1 t56A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="ZwS5j/uZ"; 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 w16si10564585pgj.217.2019.02.26.17.15.38; Tue, 26 Feb 2019 17:15:53 -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="ZwS5j/uZ"; 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 S1729655AbfB0BO5 (ORCPT + 99 others); Tue, 26 Feb 2019 20:14:57 -0500 Received: from mail-pg1-f196.google.com ([209.85.215.196]:42220 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727998AbfB0BOz (ORCPT ); Tue, 26 Feb 2019 20:14:55 -0500 Received: by mail-pg1-f196.google.com with SMTP id b2so7063327pgl.9; Tue, 26 Feb 2019 17:14:54 -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=PQg9HVQIYqiPsBwNT6JyGAohQPDs6z9iGbY5s51mdrw=; b=ZwS5j/uZEMcNgCdr8yv+ssv1acxc44jSUPbaB6Q91l1WV9isJ9z5InSfE3H+wLUA41 j5s3vsO4dpBviOR+nqGoDneWW5nrrZDXjv/psPVGfeM9V3pLLeAPzEb+gs7Pzga/+ZUj 8xKNsKElta/VzPA1L2wp45Gp+LdElW7aRYeK6S1jJbd2XWyJRzlA22aSroU4w1y+NfLp xa6keB/3cr1cTxnRCUSKxPEIuYbMiyez+c8ynjXdqbJyzoRXdCkf4DU+aJbiaEnm9owq iHUxyigI1HfVBLZeYd5kQrMjZRhbA44YoUme2C1J/74rpCAknfeEBTDrnr4DbAfQL+qg drCg== 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=PQg9HVQIYqiPsBwNT6JyGAohQPDs6z9iGbY5s51mdrw=; b=CmVpJ8KJj3/9JS95qWcRjGvgHKlCNw0Y8JzjBN5A/4xrkFE6Vz7hTPXtSQivKpWB/V CjSPdyZd+XscunCzKZTlpKi9M2vUMPZ1bH/Sk/+G+rqyVe8joR4O+fDeJc3vAEw9h3nX MQ5x/oqpoRpW9q/cRdt0CuP5n1rr7ehhgTWmeH7yTtEqlTtSPNMsC5YnJTf9076sOIxD onrKaFQjeHfZc9CU0xTG6xy6uzfSk2z+IivXV7bmgpAohj3f7bcXoBWCTiClzN8XC+WR FGU4hY+9wVCk15X1ltJCfHd4+jd+qQLvs/ZC67l5ui/7pNJ3KRiXPKVEfa9q9T0DpgaE QXUQ== X-Gm-Message-State: AHQUAuaxxFgWQ4q2/P+duvaSZBWrSJv+oyj7jZhg79i5yOyhucDVBZ23 mt7syppWbI5lehmOGr0yJSsiaEoF X-Received: by 2002:aa7:9289:: with SMTP id j9mr29315661pfa.130.1551230093913; Tue, 26 Feb 2019 17:14:53 -0800 (PST) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.250]) by smtp.gmail.com with ESMTPSA id q28sm21885221pgl.35.2019.02.26.17.14.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Feb 2019 17:14:53 -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 v2 4/8] mlxsw: spectrum_switchdev: Handle SWITCHDEV_PORT_ATTR_SET Date: Tue, 26 Feb 2019 17:14:23 -0800 Message-Id: <20190227011427.16487-5-f.fainelli@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190227011427.16487-1-f.fainelli@gmail.com> References: <20190227011427.16487-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 a notifier to perform those tasks. Prepare mlxsw to support receiving notifier events targeting SWITCHDEV_PORT_ATTR_SET and utilize the switchdev_handle_port_attr_set() to handle stacking of devices. Signed-off-by: Florian Fainelli --- .../net/ethernet/mellanox/mlxsw/spectrum_switchdev.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c index 766f5b5f1cf5..c1aedfea3a31 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c @@ -3123,6 +3123,13 @@ static int mlxsw_sp_switchdev_event(struct notifier_block *unused, struct net_device *br_dev; int err; + if (event == SWITCHDEV_PORT_ATTR_SET) { + err = switchdev_handle_port_attr_set(dev, ptr, + mlxsw_sp_port_dev_check, + mlxsw_sp_port_attr_set); + return notifier_from_errno(err); + } + /* Tunnel devices are not our uppers, so check their master instead */ br_dev = netdev_master_upper_dev_get_rcu(dev); if (!br_dev) @@ -3446,6 +3453,11 @@ static int mlxsw_sp_switchdev_blocking_event(struct notifier_block *unused, mlxsw_sp_port_dev_check, mlxsw_sp_port_obj_del); return notifier_from_errno(err); + case SWITCHDEV_PORT_ATTR_SET: + err = switchdev_handle_port_attr_set(dev, ptr, + mlxsw_sp_port_dev_check, + mlxsw_sp_port_attr_set); + return notifier_from_errno(err); } return NOTIFY_DONE; -- 2.17.1