Received: by 2002:ac0:8c8e:0:0:0:0:0 with SMTP id r14csp576426ima; Wed, 6 Feb 2019 05:07:07 -0800 (PST) X-Google-Smtp-Source: AHgI3IarST9NQG2LmVfR0gOWjJTnJO+taH3Zh1volSa4Y1LLrb4jAX2p73e1AqrOZyQXvPKZPZ/J X-Received: by 2002:aa7:838b:: with SMTP id u11mr3171940pfm.254.1549458427147; Wed, 06 Feb 2019 05:07:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549458427; cv=none; d=google.com; s=arc-20160816; b=I59fmdEPs5UpeTRt317mEyhVF9kHDoXprdMX8ZVEYRP3ei3bW9kViVze+56Prg/OwG mOPz8611QGpHX7yhfZA09dmseU5fCJ83+APyMxtixWeZLrfSiqMNgm0UOcpXSpju4Rh7 6DE7EGUy0Ng0Sk8YmsuBLy1ewvgGxkxAGTQC5E68hEL88PysaINUYwCfP9dEDyatzKGC tFQfAi5EtdmwYoEmPm3oBQ9IJFh2++a+V0pLmOVuQbaPQ6STmJfTMLV4OrYQ6eN8mh3e bDsqg0fqolwG/l7OYaQNIP0NtIo3MqidMgBNk+3zHME9VNPQsmrbq4I/RxcycBD7K83k cmnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=QyI8Y4yCJ6naNkvbWvQPQL8YrSWH9uhMAEnZaRLwPbg=; b=ReLqkc3ukN5PqgXOKXCOghVn0SFTMFqbrjwYqMsUwvzIyF84BPlB9bOQYm3Ou1cmjt J+ybieLWsJG3HWRbIx2/HK/7Z17gT4oSZA9mdCfkzDYQp5KZq1963D8kqp10+jBawUpn XH+3lYsVvIjxDLp2cW0sRTVjhbKWp9vTHckuHK0VvioqJo6QwzI10kdDg4q1YwwjFHyP oGzLu2n8DigtB4igJke4pVJpi4RYNyE8J+YRtXlZ/lmyCNwdVOF4HZn9/FZs2pBlwmKK RZWwX2tJh8EgoSRxDUkaOAhR62bdDfDjwCtM4roFsaba6bXeir5/i8zq376wN9sXhmat N5TQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@resnulli-us.20150623.gappssmtp.com header.s=20150623 header.b=BIrBRhjt; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 64si6386729pld.436.2019.02.06.05.06.51; Wed, 06 Feb 2019 05:07:07 -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=@resnulli-us.20150623.gappssmtp.com header.s=20150623 header.b=BIrBRhjt; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730191AbfBFNEG (ORCPT + 99 others); Wed, 6 Feb 2019 08:04:06 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:43935 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729989AbfBFNED (ORCPT ); Wed, 6 Feb 2019 08:04:03 -0500 Received: by mail-wr1-f68.google.com with SMTP id r2so7419296wrv.10 for ; Wed, 06 Feb 2019 05:04:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=QyI8Y4yCJ6naNkvbWvQPQL8YrSWH9uhMAEnZaRLwPbg=; b=BIrBRhjtqcr5L5Fie75HAiTfAwTlFDLKLFwRhnUizEi0jR2XJTnHAUywngVDjjF4Pm xzpXKQisyRWdG2p7aGHVx0kNK6EDZ94JB0GBGLTjumJCVYpWdJMvL2lhOQh2nsLP0L5m r7z85hpxKeuuKjDcKOJmDg4hXL4SN8iNRH98/+J33Wh6WfUExEyvUYHE9R+TR0q9NfsL 5okPNCJYAjF/3Nk0/RpijyINXfh9P12LVINMn9di/c9oa0xdStqHyD36a7tz6KsOKr9b mF2ifOEVQFhVs6a9Ploz0hoLSePO04su/BrKVQDqMxbCf55i++9UJUOuKcpljvKD9ZD0 0+eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=QyI8Y4yCJ6naNkvbWvQPQL8YrSWH9uhMAEnZaRLwPbg=; b=qrCPXOmRcWx4PVVf04F/psk0uGYibhclLhzGN6C65QiuPhUG+t5cu8kYCij4ik9s+W iUPOBX6nQqumTqq7d8wmEcQbtxzaKEdqIOliFragslqHKxygZCOPLfSmL8n4hU8z0oXE GsNsZNPNsCl0f+Sf1Wd992fkeF22DvlpD5IjTs+bi9/wcSfm9XdqpRCRc/N0NprZOD8Y oUXEEBy8lxAFn3HoMP4Ee25/ele/MkajNpy4LLsjpkjqgeGrv1kBPOPGyKt/UKmUTglh IJjAF9bIDVUAeise5ieAs4kkkVJSuu+VAtprZU6zpDUdrMD8heU0KnQv9zi0EZQz7RYN +BtQ== X-Gm-Message-State: AHQUAuYfVB9eeiS2sBZ9kOE/RXSm6vEDfQS2+nAI/qtGi2pWyaIvUSl5 8ceDi4xY8UgE4CUtKFZgfGvFKw== X-Received: by 2002:adf:f8c1:: with SMTP id f1mr7722383wrq.31.1549458242045; Wed, 06 Feb 2019 05:04:02 -0800 (PST) Received: from localhost (mail.chocen-mesto.cz. [85.163.43.2]) by smtp.gmail.com with ESMTPSA id y25sm4213525wma.6.2019.02.06.05.04.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 Feb 2019 05:04:01 -0800 (PST) Date: Wed, 6 Feb 2019 13:54:50 +0100 From: Jiri Pirko To: Florian Fainelli Cc: netdev@vger.kernel.org, "David S. Miller" , Ido Schimmel , open list , "open list:MELLANOX MLX5 core VPI driver" , "open list:NETRONOME ETHERNET DRIVERS" , "open list:STAGING SUBSYSTEM" , "moderated list:ETHERNET BRIDGE" Subject: Re: [PATCH net-next v3 01/12] net: Introduce ndo_get_port_parent_id() Message-ID: <20190206125450.GB2189@nanopsycho> References: <20190205235326.14600-1-f.fainelli@gmail.com> <20190205235326.14600-2-f.fainelli@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190205235326.14600-2-f.fainelli@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Wed, Feb 06, 2019 at 12:53:15AM CET, f.fainelli@gmail.com wrote: >In preparation for getting rid of switchdev_ops, create a dedicated NDO >operation for getting the port's parent identifier. There are >essentially two classes of drivers that need to implement getting the >port's parent ID which are VF/PF drivers with a built-in switch, and >pure switchdev drivers such as mlxsw, ocelot, dsa etc. > >We introduce a helper function: dev_get_port_parent_id() which supports >recursing into the lower devices to obtain the first port's parent ID. > >Convert the bridge, core and ipv4 multicast routing code to check for >such ndo_get_port_parent_id() and call the helper functino when valid s/functino/function/ >before falling back to switchdev_port_attr_get(). This will allow us to >convert all relevant drivers in one go instead of having to implement >both switchdev_port_attr_get() and ndo_get_port_parent_id() operations, >then get rid of switchdev_port_attr_get(). [...] >@@ -3651,6 +3657,9 @@ int dev_get_phys_port_id(struct net_device *dev, > struct netdev_phys_item_id *ppid); > int dev_get_phys_port_name(struct net_device *dev, > char *name, size_t len); >+int dev_get_port_parent_id(struct net_device *dev, >+ struct netdev_phys_item_id *ppid, bool recurse); >+bool netdev_port_same_parent_id(struct net_device *a, struct net_device *b); One is "dev_" and the second is "netdev_". I see there is this disconnect all over the code, but I wonder if we should not be consistent for new things. But I don't insist. I see why both are named differently (netdev_phys_item_id_same()) Acked-by: Jiri Pirko