From patchwork Fri Sep 29 21:19:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivien Didelot X-Patchwork-Id: 820080 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3y3l2T0C3gz9t6B for ; Sat, 30 Sep 2017 07:25:05 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752614AbdI2VXb (ORCPT ); Fri, 29 Sep 2017 17:23:31 -0400 Received: from mail.savoirfairelinux.com ([208.88.110.44]:40246 "EHLO mail.savoirfairelinux.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752208AbdI2VX3 (ORCPT ); Fri, 29 Sep 2017 17:23:29 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 4FDE59C2DF3; Fri, 29 Sep 2017 17:23:29 -0400 (EDT) Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id Z1o8rvPDffRt; Fri, 29 Sep 2017 17:23:28 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id A397D9C2DF2; Fri, 29 Sep 2017 17:23:28 -0400 (EDT) X-Virus-Scanned: amavisd-new at mail.savoirfairelinux.com Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id mkpwvVWAZ9XU; Fri, 29 Sep 2017 17:23:28 -0400 (EDT) Received: from weeman.mtl.sfl (unknown [192.168.49.104]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id 70FCB9C2C4C; Fri, 29 Sep 2017 17:23:28 -0400 (EDT) From: Vivien Didelot To: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel@savoirfairelinux.com, "David S. Miller" , Florian Fainelli , Andrew Lunn , Vivien Didelot Subject: [PATCH net-next v2 0/7] net: dsa: change dsa_ptr for a dsa_port Date: Fri, 29 Sep 2017 17:19:14 -0400 Message-Id: <20170929211921.5571-1-vivien.didelot@savoirfairelinux.com> X-Mailer: git-send-email 2.14.1 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org With DSA, a master net_device is physically wired to a dedicated CPU switch port. For interaction with the DSA layer, the struct net_device contains a dsa_ptr, which currently points to a dsa_switch_tree object. This is only valid for a switch fabric with a single CPU port. In order to support switch fabrics with multiple CPU ports, we first need to change the type of dsa_ptr to what it really is: a dsa_port object. This is what this patchset does. The first patches adds a dsa_master_get_slave helper and cleans up portions of DSA core to make the next patches more readable. These next patches prepare the xmit and receive hot paths and finally change dsa_ptr. Changes in v2: - introduce dsa_master_get_slave helper to simplify patch 6 - keep hot path data at beginning of dsa_port for cacheline 1 Vivien Didelot (7): net: dsa: add master helper to look up slaves net: dsa: use cpu_dp in master code net: dsa: use temporary dsa_device_ops variable net: dsa: add tagging ops to port net: dsa: prepare master receive hot path net: dsa: change dsa_ptr for a dsa_port net: dsa: remove tag ops from the switch tree include/linux/netdevice.h | 4 ++-- include/net/dsa.h | 19 ++++++++----------- net/dsa/dsa.c | 6 +++--- net/dsa/dsa2.c | 15 ++++++++++----- net/dsa/dsa_priv.h | 27 +++++++++++++++++++++------ net/dsa/legacy.c | 15 ++++++++++----- net/dsa/master.c | 47 ++++++++++++++++++++++------------------------- net/dsa/slave.c | 3 +-- net/dsa/tag_brcm.c | 9 ++------- net/dsa/tag_dsa.c | 18 ++---------------- net/dsa/tag_edsa.c | 18 ++---------------- net/dsa/tag_ksz.c | 9 +++------ net/dsa/tag_lan9303.c | 20 ++------------------ net/dsa/tag_mtk.c | 16 +++------------- net/dsa/tag_qca.c | 17 +++-------------- net/dsa/tag_trailer.c | 9 +++------ 16 files changed, 97 insertions(+), 155 deletions(-)