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: 65520 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp2448971wrd; Tue, 7 Mar 2023 06:07:45 -0800 (PST) X-Google-Smtp-Source: AK7set/KzCX4ANaOkL3931OXiXkQ+AbBKc4KknqM6rjwiB7FSqF8jS/sL9/EnepNeB3yG5jMEwjv X-Received: by 2002:a05:6a21:9998:b0:cc:d514:62ce with SMTP id ve24-20020a056a21999800b000ccd51462cemr18125833pzb.44.1678198065040; Tue, 07 Mar 2023 06:07:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678198065; cv=none; d=google.com; s=arc-20160816; b=u0t0JsqRU+ZE0NMcLXC83buoE+UaZhaZnbIhju/Jcu5sewgVVEQHtHcjjBLnX2f4O1 Zf12TBCV6M0M4BQu+bLa//xXJMGul3SD/EiSE2hvIjRcioOO8BcggNk3MgvYWTNzQBVL TnEXhHAb4kpba9L+ci1aoSEfXm/M9KrQ/9DeOJmCOzh7AjHcRP9WjjQOuSvQ6A09pwX3 BJ05beb6jGfPSl+B3nvkaceS8dLiRldB4AFeUevztcFtiH2kdaLtV4ypiR/y4Tuz3Pdi wic2giYadTGM00Xv6i2TqEfJlzkzUYJIgBVmC3ySwvvrrTjGTgAqje35i9WXS7iz0RO6 nN9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=udVrtwpDgQidsraWkiTU3sYon+gPZjGt3QM9xlpO0rM=; b=tQFNc1AwmTOpDkcPU6hjH29XKvkh96QgySDX/Y/KNSbXstHMFdnu1YNeZdsIsHzsJI 8PY5Th5w1TXHouxGIRx1yMZG/KY2TNsGtKFyLOsgqhua9l1oTOKDLdhu9QCUjthedHdi ZAXcKKiK2977S/azU5C4j/X3piJEIWCdQrxW3bq7pP0vF/0NJZjKSyw4OknKO1aO7bO/ mjr7jymvfFkPqqon9NWel4J0ZJLbRuFyEjCkiZBnVxDVjElaw6gJQLxBo6+iUO7pDAVT cqFBGM5T0yfjo2j1RZerjOmYB14uvpcb0TkGSSFdOMNDUw0wgXV0Ns2ors2KRV1yWuj2 avTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=RL+ABgQx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u186-20020a6385c3000000b004dab94e3f03si11823943pgd.758.2023.03.07.06.07.32; Tue, 07 Mar 2023 06:07:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=RL+ABgQx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230147AbjCGNmZ (ORCPT + 99 others); Tue, 7 Mar 2023 08:42:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229733AbjCGNl6 (ORCPT ); Tue, 7 Mar 2023 08:41:58 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C603C84F60; Tue, 7 Mar 2023 05:41:28 -0800 (PST) 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-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759718214042756000?= X-GMAIL-MSGID: =?utf-8?q?1759718214042756000?= 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 {