Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp5651982ima; Tue, 5 Feb 2019 15:58:47 -0800 (PST) X-Google-Smtp-Source: AHgI3IbBPAgizJjnTJU9oeox0wlqg6KQJj2n5tft8DzAWIMRT1WYyc/hNf5hUDJG8kaZesWEM7Bz X-Received: by 2002:a17:902:6949:: with SMTP id k9mr7772888plt.85.1549411127737; Tue, 05 Feb 2019 15:58:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549411127; cv=none; d=google.com; s=arc-20160816; b=qhgDfalyRjDQ8qIe5dC5ALtUOlxZdojGc+rjM/Ntf4Ge29lzZbTSlCHPASZLOvfOO3 mM784TBuxITmitMYBmXjen25l/FILve8us8WAPYRUyl+XVQD3noUIV0oEtaJOY+i88TC ULTAv/9s5uN1lYIR7g+yglZp8kR5md485gKAKwnWLISoDjaS7UKanGUeer6roehD3z4t c3fxBEny1w/kVzxGVxLI1mu2pL+zhvzsFpK/bEfu1TioEcZTmxSJetZRXextAorV2B/7 mlVQe3PGnd7v/3bFUbmvABb+Y8emWIyVJ9Bs0K+wtbqZur95slJZ/sQVvaJnRg1gcq11 baxw== 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=I7rRGkpXq7CkNzOX7vahMr99VKUy5W50XI5Z7ov8fk4=; b=PjbzOVmfal/EIX3l1YSvin+Ajgc0ax3p0OpDI/75LGhH9aC0s3RATE1gmr6KDiqrfM ZxKfm3R/605Imqx21K1oznl5bM1+fvWHnbuYyceutBTxc2teYqF8arZlWj8wRu1j9DC4 cAGTcUlARFp/FgGCfu37hXHk7/HaCOR09q96Zy10owdyWKbpm2vsrJlTcDeSp3wL6Hc2 BJ7Ad61Qhf/45DBGIgy1h38bZxQ1JwanAsySmaKwqJBb0TYhbGhw1k10WvEU6kvhNviu h/OBCh6X6hqJX7G28+1Y140eZPQBo/7rpwdR3FW/ltRY4VEyTqxZjihIBEMVoKhbRGsz gj6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jkn8gYv3; 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 r28si3671162pgm.317.2019.02.05.15.58.32; Tue, 05 Feb 2019 15:58:47 -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=jkn8gYv3; 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 S1729194AbfBEX4j (ORCPT + 99 others); Tue, 5 Feb 2019 18:56:39 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:43139 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728510AbfBEXzy (ORCPT ); Tue, 5 Feb 2019 18:55:54 -0500 Received: by mail-pl1-f195.google.com with SMTP id gn14so2249411plb.10; Tue, 05 Feb 2019 15:55: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=I7rRGkpXq7CkNzOX7vahMr99VKUy5W50XI5Z7ov8fk4=; b=jkn8gYv3qkiSn5JABAd6ykI/Gl94wgE8ZlnfErhQWQV6GuVK9FAz2wZCYYWoAU456D GPr3lq1Z/7v040rTPlIEFaJAjmpKfDLcZxDtT8h2vUxRoFARj3ZgTzAFIB0x+KH5TuRG flT5ZNGOsvdOsYfK4B15CdeLYflN+cwlA0NLdgOQAC5pSIwvn0qVChR1AKIe6AdcDT22 pszfJ2bcie1LGQ+pNxpIR8/36NefiqRKJXTcg3Wkqf6joMr6J/SrbPUM6xGYczX6KcaC 0Aj+aGpasuR70xGaUYEZ7NO0rPH0YFbQzd7XOsWuLzlvH0on01PhP+lTf/V97GmIvNDn FJSA== 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=I7rRGkpXq7CkNzOX7vahMr99VKUy5W50XI5Z7ov8fk4=; b=PRL+xeCp1i26wi0b5vqMJS6bf1wEGscFQ5tY1LRYuaySJva976QNl3aM7ort1DfLq8 +LS3owcSd7WLp4VcYbTR6f+RYCQ0HwRbDR8qEdKfWYIkqxCXPwEgH28xhuTCBiveex0z 1UjhBX3ey8WsuFuwmmYqwS4uwKVh9tJEk/kzeFPo952E8Gcin2ShKz/ILe5h1cWnxdnu F2sP4qB1nCxSfdeeOhu9hDR2Yfvjqf9P3t6gWYZLfbC8T/0DP0x4M/b5ZiOO3ssS4i4s pPzylYOJYfPwqpS4RVYTzU7JMGCWRkXUOhWZQbWbSuS1FpyaeeFsGcn5CxDdEWWW5ipK YqcA== X-Gm-Message-State: AHQUAuY03gWJveA/Q9QmHDozSDR8MqLcZKHE4LV/l8OdxtpqzzDzthq0 wwGxJb9aojkbiFs0Z351N2NLoyeH X-Received: by 2002:a17:902:282a:: with SMTP id e39mr7817727plb.26.1549410953379; Tue, 05 Feb 2019 15:55:53 -0800 (PST) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.250]) by smtp.gmail.com with ESMTPSA id v184sm6770197pfb.182.2019.02.05.15.55.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Feb 2019 15:55:52 -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 v3 08/12] rocker: Implement ndo_get_port_parent_id() Date: Tue, 5 Feb 2019 15:53:22 -0800 Message-Id: <20190205235326.14600-9-f.fainelli@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190205235326.14600-1-f.fainelli@gmail.com> References: <20190205235326.14600-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. 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