Received: by 2002:ac0:8c8e:0:0:0:0:0 with SMTP id r14csp897853ima; Wed, 6 Feb 2019 10:06:13 -0800 (PST) X-Google-Smtp-Source: AHgI3IYKemfiCOP6VFM6x2GFJBsCx+7MLzb/2pGh9H4Oc8L8JZ5Ovyun+npw3ovt7vvysnRkKaq3 X-Received: by 2002:a17:902:298a:: with SMTP id h10mr12053077plb.312.1549476373741; Wed, 06 Feb 2019 10:06:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549476373; cv=none; d=google.com; s=arc-20160816; b=a4mbxAGUwHOgUutkjcwM/1JrzcduUdq6RvZYdImSP1qk6utX53iLRVYvtpk0AWa/Of 3cPwL6s1EWdnxFVy2I/jh0wFxUlkJzGHj2cD07+1Q/Kc2rNX0uCY4VXk6Dh541OyXKeW e89HhZO91QRSJkp6Xv5aF8uh1n7arr761BM4Xpw4d1JyEb5FJlFAxBcZ4qflfzSzPiAB id6jSOZg6tzU39QTkoOixsw6pwiLj2f0UlB2llHyzhafHVJ/GbzABIRnfOmt8owA1A2D UNnNy4DhMivB5zrxwd6grsiljXE9FQFo8jFyouezJZgPB0p7zPc2pVRE7DBCYww/MGq9 b1Nw== 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=FtkP+LHS9beMQbwAZ2URo6E44LQ0Jw0xcba93MNhkCA=; b=QB6OsEJRllQrV0dJoaFBnuwTt3g/pKJCmbcZwlZHYOvBRh8BtZ8V/cQXZ+nkQ4Payq pPUmA0xuoxczDz2gALjHNXzSudjf0SuMLAxG+ylEHlPbvsicFZPWngc8HfNbqvjWTJEd LMQ9EmybR+GunDMKxSzz7gZZtWwNDFenuhqH4t1z6D+ZPU4oE5yHd+CdkRB5/9tN//kh BcalglF/e65Zk2Xk7/fawwBUARcYkwib6DaZJe95idj+l4NDV+hx1UZZ6ggkEkapYQeH ai7/jXe+g3TbO8OGYzkRunb6mMYMwF+cJZPf9c/Yf2mEeUwO3rqerZTDJRExEmVtk6gh yuEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=nj4KEp7H; 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 d16si6684934pfn.169.2019.02.06.10.05.52; Wed, 06 Feb 2019 10:06:13 -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=nj4KEp7H; 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 S1730755AbfBFRqo (ORCPT + 99 others); Wed, 6 Feb 2019 12:46:44 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:46670 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730640AbfBFRqW (ORCPT ); Wed, 6 Feb 2019 12:46:22 -0500 Received: by mail-pf1-f194.google.com with SMTP id c73so3392631pfe.13; Wed, 06 Feb 2019 09:46:22 -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=FtkP+LHS9beMQbwAZ2URo6E44LQ0Jw0xcba93MNhkCA=; b=nj4KEp7Hvlm4gcYRmpV0S0CtNHo1iW521AHYiHGE4FzK+ksWVB5LmN6pqk5uHBXbkp xCwdezFfxLrf6bD0o0pugwvQWF/gHc90GLth8JABSbKLdgGjLMKNjYl/uZ2cxsF9sZ40 scxeeMtZaAasZbiolhuZiS6/PXJWeQpLk5UTXVIAeH9Ov4bvgMhUaYoa6Ou3j+9USeOn x/gQMsPHOE/eA0Zp3+UL/f8KsMpQQJQOwaRVYohnC7iMMuCSaY6ANQMH7IhDe4Imcjqn RKTDMN3536QcF0oweIoRQRRWzO7EAhuCEvdXjuEQwVTPIqbVva3cOFU6wAOUxb2sYTAx BCHg== 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=FtkP+LHS9beMQbwAZ2URo6E44LQ0Jw0xcba93MNhkCA=; b=MLRmLUdYMnNS3/eCm65i2aRZdEaTmvK5/nUKGpa3oulFYqLuz+Es3LbXvRVdVhS7v7 XFArpBne/BLQfrNrmH6n83NEJVX6P7ecz6OqD6gMa10O75PdsoIp4/BOKAL+Rxm83MvM bgSBxklmv3+TxHdv6iVitQEZw5qF4VUEXIBP/1oevzzGw271mdIXZeWY5aLLgr7kdBTF Qe1ABG/y5ROlIIx3ufmi4ufi3kYsqIHSA+27JSV5zmbrMP+FHL4Iu8dQKdvA/pRZr56C fvP5BrJ1Ri/ZDv7dwJ0vpFN4HEU+OKgLu4RTYnRm/VsuBx8YPlTkRhqhZGFuotIBrila 9O0A== X-Gm-Message-State: AHQUAuah7HvnbWyjkpereMMKeTRAyMj2lUAmeLnZwO9aCOWhdtLEbUxe WRlyAGxEfPfWbwd2wLC6htnefafS X-Received: by 2002:a63:e447:: with SMTP id i7mr886657pgk.273.1549475181636; Wed, 06 Feb 2019 09:46:21 -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.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Feb 2019 09:46:20 -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 10/12] staging: fsl-dpaa2: ethsw: Implement ndo_get_port_parent_id() Date: Wed, 6 Feb 2019 09:45:44 -0800 Message-Id: <20190206174546.23597-11-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 ethsw 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/staging/fsl-dpaa2/ethsw/ethsw.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/staging/fsl-dpaa2/ethsw/ethsw.c b/drivers/staging/fsl-dpaa2/ethsw/ethsw.c index daabaceeea52..e559f4c25cf7 100644 --- a/drivers/staging/fsl-dpaa2/ethsw/ethsw.c +++ b/drivers/staging/fsl-dpaa2/ethsw/ethsw.c @@ -505,6 +505,17 @@ static netdev_tx_t port_dropframe(struct sk_buff *skb, return NETDEV_TX_OK; } +static int swdev_get_port_parent_id(struct net_device *dev, + struct netdev_phys_item_id *ppid) +{ + struct ethsw_port_priv *port_priv = netdev_priv(dev); + + ppid->id_len = 1; + ppid->id[0] = port_priv->ethsw_data->dev_id; + + return 0; +} + static const struct net_device_ops ethsw_port_ops = { .ndo_open = port_open, .ndo_stop = port_stop, @@ -515,6 +526,7 @@ static const struct net_device_ops ethsw_port_ops = { .ndo_get_offload_stats = port_get_offload_stats, .ndo_start_xmit = port_dropframe, + .ndo_get_port_parent_id = swdev_get_port_parent_id, }; static void ethsw_links_state_update(struct ethsw_core *ethsw) @@ -634,10 +646,6 @@ static int swdev_port_attr_get(struct net_device *netdev, struct ethsw_port_priv *port_priv = netdev_priv(netdev); switch (attr->id) { - case SWITCHDEV_ATTR_ID_PORT_PARENT_ID: - attr->u.ppid.id_len = 1; - attr->u.ppid.id[0] = port_priv->ethsw_data->dev_id; - break; case SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS: attr->u.brport_flags = (port_priv->ethsw_data->learning ? BR_LEARNING : 0) | -- 2.17.1