Received: by 2002:ac0:8c8e:0:0:0:0:0 with SMTP id r14csp897378ima; Wed, 6 Feb 2019 10:05:52 -0800 (PST) X-Google-Smtp-Source: AHgI3IYE1dS2+gJmIPzvH/Itwgkmo8UnAWPCLWpkBLHaQddgGqXmKgFl8p7sey3k8MXky0oOXoBl X-Received: by 2002:a63:1665:: with SMTP id 37mr10713051pgw.76.1549476352749; Wed, 06 Feb 2019 10:05:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549476352; cv=none; d=google.com; s=arc-20160816; b=dn6QxT1pIsYxxuuJ0yhiDsIyfsBPbGmRITE7rHTG7WDGPmFLa4gjaf9KGWA0vWLZ77 T7204c3uyhdbgk+7QqsLDlThwOxpMEEvRWNzhb8b1zl1qEl5lwvRKGN6qQkWGLksO3KX ZvqWryXA6GvozNEGHYnkGNcA7gMCOGQrF3ovVu/XznPJh32s3985ZZM5rzV4VZqJd5OF jbH1ckWs+bYK2z25YIr70cB5zcsY/q2beZhSJqkZzGQtxix0kLOUVylbyQdka+Vad4QT gTI4eNIHNPUBt4CCTIHKmTqN2BY4pCa2AQQJv3EeaQ3oNjnqN0ttSWasiL82/FIadFam CONw== 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=unVY6jzXSwf6Z3BXuXwH1dAfhkC5gzzltRG8BJVomGo=; b=XkI3EFhX74z9+H4uX5OvtgUkQxMYPAcxaWxaGDRlZ2cRfdVXEqpkFbj+UaTOstj1hZ uDjNJnu6F7GaCa/Lq4W7ZgNOPQuqAJhD+bZLzCEMO8zD5hr4OwClP2FTsVbS3UUWNji4 gjjgE/sXoQSmKLSVSEG5ro9FYkJj1R92Q1QArnYn+KtorPAWInUch36UMM+nFOT1jJG+ CNpJjVwUzR+i0jpJzVlTQiHIgKNoS2U61BjMBC8XYVu0KyFaz/S6QAxah4OavPxilMGV +5Rl/mOoO1BBEvY5I1ZOZ6maI8Z080E6PHtqNfZGNNNXYGOj8bn8ZBVsYD60QDiaMZDY YTDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JUK7Xrzu; 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 k33si6862839pld.374.2019.02.06.10.05.27; Wed, 06 Feb 2019 10:05:52 -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=JUK7Xrzu; 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 S1730338AbfBFRrE (ORCPT + 99 others); Wed, 6 Feb 2019 12:47:04 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:40875 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730619AbfBFRqS (ORCPT ); Wed, 6 Feb 2019 12:46:18 -0500 Received: by mail-pl1-f193.google.com with SMTP id u18so3413100plq.7; Wed, 06 Feb 2019 09:46:18 -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=unVY6jzXSwf6Z3BXuXwH1dAfhkC5gzzltRG8BJVomGo=; b=JUK7XrzuUcBq0D1LE7KfCL/jHkJVKOJn0MZvWp4rhf8JcrcbxJKHESlhKww02n5s4c fBfmuZwbNaS55nLzVfxEQ0o2cRbZkL/9ijQrrur455hXjDXVYjQCWPTgdjNhM1dEvr/5 n8XREN7oypSZDqD6a07lDt0rcPSfKpXtNm9NT44vC5uc8tELulpgRJLC1cJz0v8aD2Pi 9ENtn3f790UbcX1vxKB9KkKl2w4asYlqJtBERt3pWC7TU9WQkGWtVozohV87+nkgCf8X XS15xWbCg92WNdVo2u54E57V+SGvNdPGz4DWPl4amOpWZ7mszcJAE5lz3eerODKD6pEt vhLQ== 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=unVY6jzXSwf6Z3BXuXwH1dAfhkC5gzzltRG8BJVomGo=; b=bezTgliAXnPiZmeGf4mLNywa1kSzUa8cftyNnjuf9o713dBYOFQXrYJ/ECFaTTtf7+ rME/NJeTPZ13hpXlnajL56xJl+fzozd6wGUc7sPVrsvnQpjoR1pbcAyyaXnPYzHROsGJ j6JlG/uD0YP/nXi6dtkw7pCN08jyOVsZvYpSitMxX9ExtHlz+R5s3ZCdVk2uk1EN3oQK bInTTlb3DuSein5GWEDNzcqwHXExq/S878F6ggS5HS3r9uVxoyShoel5plVkfJN7isTC s2vqfr1s+zobw9Gmw6ELJ3UcQnOZm7pPZ8sMrij7EQXlxGiSlxBqNpeUBtBfwBtqkX46 5aVQ== X-Gm-Message-State: AHQUAuZ6g5SGUUAXmXivPBuLJkDD3YssZOO24q+cPQAoB4h172lbSrsW U4gnwbSw4RwoXBWb3UqiBwCMA0CG X-Received: by 2002:a17:902:1101:: with SMTP id d1mr11816746pla.136.1549475177546; Wed, 06 Feb 2019 09:46:17 -0800 (PST) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.250]) by smtp.gmail.com with ESMTPSA id 15sm10435313pfr.55.2019.02.06.09.46.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Feb 2019 09:46:16 -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), 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), bridge@lists.linux-foundation.org (moderated list:ETHERNET BRIDGE) Subject: [PATCH net-next v4 08/12] rocker: Implement ndo_get_port_parent_id() Date: Wed, 6 Feb 2019 09:45:42 -0800 Message-Id: <20190206174546.23597-9-f.fainelli@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190206174546.23597-1-f.fainelli@gmail.com> References: <20190206174546.23597-1-f.fainelli@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org mlxsw implements SWITCHDEV_ATTR_ID_PORT_PARENT_ID and we want to get rid of switchdev_ops eventually, ease that migration by implementing a ndo_get_port_parent_id() function which returns what switchdev_port_attr_get() would do. Acked-by: Jiri Pirko Signed-off-by: Florian Fainelli --- drivers/net/ethernet/rocker/rocker_main.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/rocker/rocker_main.c b/drivers/net/ethernet/rocker/rocker_main.c index 62a205eba9f7..596f44dbfae1 100644 --- a/drivers/net/ethernet/rocker/rocker_main.c +++ b/drivers/net/ethernet/rocker/rocker_main.c @@ -2026,6 +2026,18 @@ static void rocker_port_neigh_destroy(struct net_device *dev, err); } +static int rocker_port_get_port_parent_id(struct net_device *dev, + struct netdev_phys_item_id *ppid) +{ + const struct rocker_port *rocker_port = netdev_priv(dev); + const struct rocker *rocker = rocker_port->rocker; + + ppid->id_len = sizeof(rocker->hw.id); + memcpy(&ppid->id, &rocker->hw.id, ppid->id_len); + + return 0; +} + static const struct net_device_ops rocker_port_netdev_ops = { .ndo_open = rocker_port_open, .ndo_stop = rocker_port_stop, @@ -2035,6 +2047,7 @@ static const struct net_device_ops rocker_port_netdev_ops = { .ndo_get_phys_port_name = rocker_port_get_phys_port_name, .ndo_change_proto_down = rocker_port_change_proto_down, .ndo_neigh_destroy = rocker_port_neigh_destroy, + .ndo_get_port_parent_id = rocker_port_get_port_parent_id, }; /******************** @@ -2049,10 +2062,6 @@ static int rocker_port_attr_get(struct net_device *dev, int err = 0; switch (attr->id) { - case SWITCHDEV_ATTR_ID_PORT_PARENT_ID: - attr->u.ppid.id_len = sizeof(rocker->hw.id); - memcpy(&attr->u.ppid.id, &rocker->hw.id, attr->u.ppid.id_len); - break; case SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS: err = rocker_world_port_attr_bridge_flags_get(rocker_port, &attr->u.brport_flags); -- 2.17.1