Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp979627ima; Fri, 1 Feb 2019 14:12:23 -0800 (PST) X-Google-Smtp-Source: ALg8bN61WvEnrINrn6dEyFjIUz9Z3JC2JfLPawHojQTIMaC7/ENGAklVDFjiDt2E78t7IyB2TJKU X-Received: by 2002:a17:902:6f09:: with SMTP id w9mr42416779plk.309.1549059143876; Fri, 01 Feb 2019 14:12:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549059143; cv=none; d=google.com; s=arc-20160816; b=spL7y8hwi1PXk5zuPVFPYJtKjMidNOpTbaymaZEZ6DE3zv7gB3qLowN5Y3z12UeEUd MwIIUOV7uLAN39CMzVe7tbvPD2uV9Dl31MWoF8/tSrUpFVQ41XxNe3xfK45HMvTr9HmE xFQNgO0QLH/LGy0FnSjvQ4thn8+Bm7/PoMZxtjgU4lkAYvde86eHRdc2VFNPBuWSmkAO Iv2aWBhNmExqk6Pq7LQnRhc5fPwUVgMDC+vl6MIz2WZ3jjlZMX8ZJ/NgVuDwUzHZl/yY XJnxSTs8Ftrq62RBup+9Acr6N/u0qSXVLvkkoE7L8/ultkahQh4jp5bZ3CJ0fZEs1qHW aiXQ== 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=+1Zk2PiDZisJMq0/a8SJAvhMJmNAIi6Lssg2ko3q5F4=; b=HzCLmtXz4BSKWghDqDAobi4Ec5xKV4fpQrFA5OM31sl4B6pNokBFkBVMF0z/WQ9rTt 4K9hk3dLgr3Ha+KzUW18V4PmNKIJitLI66nPvjqS9BpKVzNnundjqm7YEkdT8T29UHIz bcvIfyHR34BKcvwFnO9YehfRtVi42HL+mRIMFBioCk5xRIx40/8mnc7csKZzwJLI0JoC BYnlzBW0Ftelbs6b0FzWhQRIorDeBJkvACukxmyiT7+lKKL2pU0tuiuffABnuq70bugO X2zPN4mSuYTABQHDRf5T0x36tPx24LmEiNDpIsTrfvG5qF7fqFyhRJXYcATWOzzipyQv 3L9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BpiVXYoV; 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 p189si8846915pfb.0.2019.02.01.14.12.08; Fri, 01 Feb 2019 14:12:23 -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=BpiVXYoV; 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 S1727397AbfBAWKJ (ORCPT + 99 others); Fri, 1 Feb 2019 17:10:09 -0500 Received: from mail-pf1-f195.google.com ([209.85.210.195]:41390 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726905AbfBAWIG (ORCPT ); Fri, 1 Feb 2019 17:08:06 -0500 Received: by mail-pf1-f195.google.com with SMTP id b7so3874858pfi.8; Fri, 01 Feb 2019 14:08:05 -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=+1Zk2PiDZisJMq0/a8SJAvhMJmNAIi6Lssg2ko3q5F4=; b=BpiVXYoVfsUFnaMTdAP8HoVRfeWlLCkzeuE8KdONfzWzAUjGopUS7k7B2ZFf7c6bxW s7cmqNwWRpysApa4ITRHqtaPZYfMKEny9yxTne/IPfbZjSw4Xgu+hTlx8otTMT3Px7+x YrGL8Pqcpy0p7kg6fEghIxblZ0j90LurVnxMAZsS/kOFeDuoU/SX135NK12ThWvls80z uJ2v9QvJ2YWnbvfvell9Zo1f8kF4Mj1q7yxo3RPnFb6mu0Q4dep7rFn0rS9Mioit3gTl m5woJg9qRKue+j2dpos0engiTinnTuiaGH2HpG+LXqa7wc5Fzn5+QR8AivXkD1LcrwEw d4hw== 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=+1Zk2PiDZisJMq0/a8SJAvhMJmNAIi6Lssg2ko3q5F4=; b=qs77w/hZEAhSOmK590oJQB3K96NMFY1F7jHhXevZJ2Cj7l0Qony+DKkyEFKc2C//2l v/FY3AomK89nIkV1vSNidgIukCbXSmCqumMoZwP3uoRUSXPS/Xtl9t+dMXjs/oPBbsFb PC67eum7tUy3junM7B04Dk2/lam+SDusggHmX828DawCBhFxi52mQPvaabGGtuQxRJKh vj3ja6OQ7TEzoVBDIxm+1tBFvoYUYQ0exRsTYbZFbXRPw5j+3mo1dN/qy5GUPKhu8vLQ vZSyRZ7mOyGQIBucnkd3+REvRx35FjgL95s0KUIEGSRUHXQFCfP2IbkBFp+T5mmLPzR/ IW9A== X-Gm-Message-State: AHQUAuakqQr9nHLD13FLI7s8mU2LdctHXIyF3PgRyvOIx8cCMx/8hASD aMuAaqufPR9bgfelAyGTzPj8UoLy X-Received: by 2002:a63:1c09:: with SMTP id c9mr1457569pgc.200.1549058884839; Fri, 01 Feb 2019 14:08:04 -0800 (PST) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.250]) by smtp.gmail.com with ESMTPSA id 78sm11142208pft.184.2019.02.01.14.08.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Feb 2019 14:08:04 -0800 (PST) From: Florian Fainelli To: netdev@vger.kernel.org Cc: Florian Fainelli , Michael Chan , "David S. Miller" , Derek Chickles , Satanand Burla , Felix Manlunas , Saeed Mahameed , Leon Romanovsky , Jiri Pirko , Ido Schimmel , Alexandre Belloni , Microchip Linux Driver Support , Jakub Kicinski , Ioana Radulescu , Ioana Ciornei , Greg Kroah-Hartman , Ivan Vecera , Andrew Lunn , Vivien Didelot , Dirk van der Merwe , "Francois H. Theron" , Simon Horman , Quentin Monnet , Daniel Borkmann , Eric Dumazet , John Hurley , Edwin Peer , linux-kernel@vger.kernel.org (open list), linux-rdma@vger.kernel.org (open list:MELLANOX MLX5 core VPI driver), oss-drivers@netronome.com (open list:NETRONOME ETHERNET DRIVERS), devel@driverdev.osuosl.org (open list:STAGING SUBSYSTEM) Subject: [RFC net-next 02/13] rocker: Handle SWITCHDEV_PORT_ATTR_GET/SET Date: Fri, 1 Feb 2019 14:06:46 -0800 Message-Id: <20190201220657.30170-3-f.fainelli@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190201220657.30170-1-f.fainelli@gmail.com> References: <20190201220657.30170-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 getting or setting a port's attribute and use a blocking notifier to perform those tasks. Prepare rocker to support receiving notifier events targeting SWITCHDEV_PORT_ATTR_GET/SET and simply translate that into the existing rocker_port_attr_{set,get} calls. Signed-off-by: Florian Fainelli --- drivers/net/ethernet/rocker/rocker_main.c | 24 +++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/drivers/net/ethernet/rocker/rocker_main.c b/drivers/net/ethernet/rocker/rocker_main.c index 62a205eba9f7..f25f7b4345b8 100644 --- a/drivers/net/ethernet/rocker/rocker_main.c +++ b/drivers/net/ethernet/rocker/rocker_main.c @@ -2827,6 +2827,27 @@ rocker_switchdev_port_obj_event(unsigned long event, struct net_device *netdev, return notifier_from_errno(err); } +static int +rocker_switchdev_port_attr_event(unsigned long event, struct net_device *netdev, + struct switchdev_notifier_port_attr_info + *port_attr_info) +{ + int err = -EOPNOTSUPP; + + switch (event) { + case SWITCHDEV_PORT_ATTR_SET: + err = rocker_port_attr_set(netdev, port_attr_info->attr, + port_attr_info->trans); + break; + case SWITCHDEV_PORT_ATTR_GET: + err = rocker_port_attr_get(netdev, port_attr_info->attr); + break; + } + + port_attr_info->handled = true; + return notifier_from_errno(err); +} + static int rocker_switchdev_blocking_event(struct notifier_block *unused, unsigned long event, void *ptr) { @@ -2839,6 +2860,9 @@ 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: + case SWITCHDEV_PORT_ATTR_GET: + return rocker_switchdev_port_attr_event(event, dev, ptr); } return NOTIFY_DONE; -- 2.17.1