From patchwork Tue Mar 7 13:41:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steen Hegelund X-Patchwork-Id: 13163580 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 69ADAC678D5 for ; Tue, 7 Mar 2023 13:53:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=T8FM/OG8foLKVKZXg1JlQenlll1KJQ3t0Ef50tcaPus=; b=v202nKSKyF0tjy rlP2esF0HPlUpCvpa6qUAIsuMgHkCxUnc5B6NP6Zy5T0Xjew59wSOmOZkSrCkPuUUKiXEkNe8Lq5V Jwx02mbF4SyUDJvnwd2I2FfoAKRGkiQ1NRCnud5S10WC5V9tUnwLPUSp4Xv2uis3VF4X5pz0bJE38 uOSyS5vDEKvl0fJcpNJIze7pnN0Fj+vu7ywSuE228DGmkuU7pUXt2yQICntlvt8aqkk/1zIV3w/KA SCIc5io2sS73FU02wgahvYsPWajPo2i8MnB0weJwFMPZ//q7FUscfStywGj9Oxeyok8nzrJq+skOy 2iZ3B7vTWcbqAGgpCitA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pZXje-000XDe-0U; Tue, 07 Mar 2023 13:52:10 +0000 Received: from esa.microchip.iphmx.com ([68.232.154.123]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pZXZI-000Sv9-Qr for linux-arm-kernel@lists.infradead.org; Tue, 07 Mar 2023 13:41:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1678196489; x=1709732489; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=PUBammHDKP0GgvUkYvFBhMxkRR+HIg6jyMG8E73e+pA=; b=RL+ABgQx7W/tnX3wunnMcZZhdmpWQdRVQmefEq+hoPbWRcVd4ko1OS2i 5omxQnZpicwAx/xBUT2YYEecCTir2e/4xqcdMGQMcYoXnOuaEk81d+hD3 T1MBqL++QZCBUGzw9lqaqrqW57i3+GFkOTnCtr3RKyNWjuj3xstewRJxv ZjlC4iGk32lc+lOyYrohtQVOFqlX7SO5nikDpzc0Mh/DTYZf7Kv1m/73S Mt2kVHvszRqhSGUFsSTAbnKj5dP/tq6FGMprjhU9pyBdf0ytWJPtiWg9G hjOXMKiPkb/LSGnHNq3HTdl1KgRZKedf67Z/WJ4kA2WLInvGMElNWpzhf g==; X-IronPort-AV: E=Sophos;i="5.98,241,1673938800"; d="scan'208";a="200373254" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 07 Mar 2023 06:41:28 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Tue, 7 Mar 2023 06:41:27 -0700 Received: from den-dk-m31857.microchip.com (10.10.115.15) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2507.16 via Frontend Transport; Tue, 7 Mar 2023 06:41:23 -0700 From: Steen Hegelund To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni CC: Steen Hegelund , , , , , "Steen Hegelund" , Daniel Machon , Horatiu Vultur , Lars Povlsen , Russell King , Randy Dunlap , "Casper Andersson" , Nathan Huckleberry , Dan Carpenter , Michael Walle , "Wan Jiabing" , Qiheng Lin , "Shang XiaoJing" , Simon Horman Subject: [PATCH net-next 3/5] net: microchip: sparx5: Add TC template list to a port Date: Tue, 7 Mar 2023 14:41:01 +0100 Message-ID: <20230307134103.2042975-4-steen.hegelund@microchip.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230307134103.2042975-1-steen.hegelund@microchip.com> References: <20230307134103.2042975-1-steen.hegelund@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230307_054128_992275_6DD7B44A X-CRM114-Status: GOOD ( 12.66 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This adds a list that is used to collect the templates that are active on a port. This allows the template creation to change the port configuration and the template destruction to change it back. Signed-off-by: Steen Hegelund --- drivers/net/ethernet/microchip/sparx5/sparx5_main.c | 1 + drivers/net/ethernet/microchip/sparx5/sparx5_main.h | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_main.c b/drivers/net/ethernet/microchip/sparx5/sparx5_main.c index 42b77ba9b572..a7edf524eedb 100644 --- a/drivers/net/ethernet/microchip/sparx5/sparx5_main.c +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_main.c @@ -282,6 +282,7 @@ static int sparx5_create_port(struct sparx5 *sparx5, spx5_port->phylink_pcs.poll = true; spx5_port->phylink_pcs.ops = &sparx5_phylink_pcs_ops; spx5_port->is_mrouter = false; + INIT_LIST_HEAD(&spx5_port->tc_templates); sparx5->ports[config->portno] = spx5_port; err = sparx5_port_init(sparx5, spx5_port, &config->conf); diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_main.h b/drivers/net/ethernet/microchip/sparx5/sparx5_main.h index 72e7928912eb..62c85463b634 100644 --- a/drivers/net/ethernet/microchip/sparx5/sparx5_main.h +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_main.h @@ -192,6 +192,7 @@ struct sparx5_port { u16 ts_id; struct sk_buff_head tx_skbs; bool is_mrouter; + struct list_head tc_templates; /* list of TC templates on this port */ }; enum sparx5_core_clockfreq {