Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752525AbdI2TYt (ORCPT ); Fri, 29 Sep 2017 15:24:49 -0400 Received: from mail-qt0-f196.google.com ([209.85.216.196]:56546 "EHLO mail-qt0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752338AbdI2TYr (ORCPT ); Fri, 29 Sep 2017 15:24:47 -0400 X-Google-Smtp-Source: AOwi7QC8yC1DdJkVDhmHpnbLRFnuz8YWswzPdHwxQqw3oHM3XJBsVxevmpcJrw8XYLElt5dr1iIa5g== Subject: Re: [PATCH net-next 5/8] net: dsa: add tagging ops to port To: Vivien Didelot , netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel@savoirfairelinux.com, "David S. Miller" , Andrew Lunn References: <20170929183635.8122-1-vivien.didelot@savoirfairelinux.com> <20170929183635.8122-6-vivien.didelot@savoirfairelinux.com> From: Florian Fainelli Message-ID: <642468a1-2083-3b00-63ab-934e54499e4c@gmail.com> Date: Fri, 29 Sep 2017 12:24:42 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170929183635.8122-6-vivien.didelot@savoirfairelinux.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1361 Lines: 37 On 09/29/2017 11:36 AM, Vivien Didelot wrote: > The DSA tagging protocol operations are specific to each CPU port, > thus the dsa_device_ops pointer belongs to the dsa_port structure. > > From now on assign a slave's xmit copy from its CPU port tagging > operations. This will ease the future support for multiple CPU ports. > > Signed-off-by: Vivien Didelot > --- > include/net/dsa.h | 3 +++ > net/dsa/dsa2.c | 1 + > net/dsa/dsa_priv.h | 2 +- > net/dsa/legacy.c | 1 + > net/dsa/slave.c | 3 +-- > 5 files changed, 7 insertions(+), 3 deletions(-) > > diff --git a/include/net/dsa.h b/include/net/dsa.h > index 8dee216a5a9b..6cd36dcb65e1 100644 > --- a/include/net/dsa.h > +++ b/include/net/dsa.h > @@ -189,6 +189,9 @@ struct dsa_port { > * Original copy of the master netdev ethtool_ops > */ > const struct ethtool_ops *orig_ethtool_ops; > + > + /* CPU port tagging operations used by master or slave devices */ > + const struct dsa_device_ops *tag_ops; You might actually want to move this up in the dsa_port structure in order to keep being in the first cacheline (you can use pahole -C dsa_port vmlinux). dsa_switch_tree is currently a 56 bytes structure, thus fitting in a 64b cache line, but dsa_port is 80bytes, and the hot-path are in the second cacheline, so less efficient. -- Florian