From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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=IMuInuNuhaKwQCdz4TCP3q6TDWOHc2cQyv/xBrmgGRc=; b=HEkUb4J731FIHv+tebyVRFRcvobI4zxTsbF6okSWcP8C7uYQkH2o9CBC0WDiBAoYAv 5dD1qwrOF34d0Y/pnaeL72pqljsHM2XOomnp/e/Ovv45/hEPy1C37gIx/yckYkGXGYAj Fhv6qhifZIwhodx5a/kbubj1NTBBzOYq9VEWm+LpCcaKQxR+UvoEzZk1fFBVHHdL75vl MarGBSNvxY9/abjSNW4dQPZniMF7tYukADIfl5hs16kKIJOYvgvEA1VAbql26labOeWA EOQn2ZjEJftO4gg1mW2h6U/fLT+FNqkQXV+rt/YU0OO1spMaD3CiNvlWsZdjOsDSfAO8 yMbA== From: Florian Fainelli Date: Mon, 4 Feb 2019 15:36:31 -0800 Message-Id: <20190204233633.20421-11-f.fainelli@gmail.com> In-Reply-To: <20190204233633.20421-1-f.fainelli@gmail.com> References: <20190204233633.20421-1-f.fainelli@gmail.com> Subject: [Bridge] [PATCH 10/12] staging: fsl-dpaa2: ethsw: Implement ndo_get_port_parent_id() List-Id: Linux Ethernet Bridging List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: netdev@vger.kernel.org Cc: Andrew Lunn , Alexandre Belloni , Jakub Kicinski , John Hurley , "open list:NETRONOME ETHERNET DRIVERS" , Eric Dumazet , Ioana Ciornei , Tyler Hicks , Ivan Vecera , Florian Fainelli , Ioana Radulescu , "open list:MELLANOX MLX5 core VPI driver" , "moderated list:ETHERNET BRIDGE" , Amritha Nambiar , Saeed Mahameed , Dirk van der Merwe , Alexey Kuznetsov , Vivien Didelot , Alexander Duyck , "open list:STAGING SUBSYSTEM" , Daniel Borkmann , Nikolay Aleksandrov , Simon Horman , Roopa Prabhu , Satanand Burla , Ido Schimmel , Jiri Pirko , Kirill Tkhai , Edwin Peer , Michael Chan , Christian Brauner , Felix Manlunas , Leon Romanovsky , Nic Viljoen , Hideaki YOSHIFUJI , Greg Kroah-Hartman , Dmitry Torokhov , open list , Microchip Linux Driver Support , David Ahern , Joe Perches , Derek Chickles , "David S. Miller" 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 | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/drivers/staging/fsl-dpaa2/ethsw/ethsw.c b/drivers/staging/fsl-dpaa2/ethsw/ethsw.c index daabaceeea52..622f32377b91 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) | @@ -1434,7 +1442,6 @@ static int ethsw_probe_port(struct ethsw_core *ethsw, u16 port_idx) SET_NETDEV_DEV(port_netdev, dev); port_netdev->netdev_ops = ðsw_port_ops; port_netdev->ethtool_ops = ðsw_port_ethtool_ops; - port_netdev->switchdev_ops = ðsw_port_switchdev_ops; /* Set MTU limits */ port_netdev->min_mtu = ETH_MIN_MTU; -- 2.17.1