[net-next,v2,2/8] net: microchip: sparx5: Ensure VCAP last_used_addr is set back to default
Message ID | 20221117213114.699375-3-steen.hegelund@microchip.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp636625wrr; Thu, 17 Nov 2022 13:43:53 -0800 (PST) X-Google-Smtp-Source: AA0mqf5vMpmk0VQrguClY7vnvwnHBHhAwPALMmsI4bskKUhNbIMOpL3z22+K28l4B8THviAKBYmo X-Received: by 2002:a63:180c:0:b0:476:848f:1ecd with SMTP id y12-20020a63180c000000b00476848f1ecdmr3766188pgl.589.1668721433337; Thu, 17 Nov 2022 13:43:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668721433; cv=none; d=google.com; s=arc-20160816; b=CfLpzxSWI0VF6n2j934iq4c0iofCcF0VCDY9SWv6wydB9z0USJxqtnxTH8nW0obdmX sofN1XtO7uwkJM404pOUsenP6dn+A+CbLHxbwrEpiNVxyrlw+wkE39KVuYjYCdvrHmSm RwZ9YVB8+OQ5bJzSExyi/nfeAp/2BiNJdfs75LaNrcdy1aky3tPn8+9IrTSx0whFJgLL qcfr3+rvetnmK4fMbcamN0Q4foFwFmZZ4doO1RZRuwIjX5+LYwjPHiwq6MkoquS1aZ3e Y8k+OXvoWH0mE/pW+n5BjLTzT33TVH7C/5kS/MsLt3GPRtG56plzunVR19SL1A/CcIuH pP0w== 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=UHQVU/MqXyWhX8mmD59GXbHebwKW4Xw+7xb/FTsfX+0=; b=ZXdcSHHHY3CCBJlbtGg+z4J1/YnXpn13eep1TfoU36HTZBb2ySM7CcslJ/ApR68NRh y7QcEfIJcJWNo5rP2xsXbL68g1ZZIK95famDAK8X+41y043XALDUk8al/i2GhV1PDUBG Oa/AIEfGDi4UlJnoiW0uU4NVfDHXy/45QJFQKXbiNGg7JPZk+w7rKS+baRfx8Ikk4yMy Yr8DfVq33wdykONbSmUmyU4K3oUBk2ZXJtqG1EdRMUFYlOA2z3von4jcKaxYpjCa5fmy 6+PzVK7ZSGfXEmjZLk4WTobB1+8UnxETV/1kIeM8DDIltrRuilDXFGF6lX85d/dB/Tap j8LA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=GZxGkBz+; 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 d13-20020a63fd0d000000b0045af77fa685si2144307pgh.235.2022.11.17.13.43.39; Thu, 17 Nov 2022 13:43:53 -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=GZxGkBz+; 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 S240840AbiKQVcJ (ORCPT <rfc822;a1648639935@gmail.com> + 99 others); Thu, 17 Nov 2022 16:32:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240897AbiKQVbj (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 17 Nov 2022 16:31:39 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 938A95B5BD; Thu, 17 Nov 2022 13:31:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1668720695; x=1700256695; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ZUP1oTqr+Bkok+eF/MjSkDF7g/U71BEDzdPwqzWGbIA=; b=GZxGkBz+mzHuY7fGQYszL72EJkqSKxpwUt0bWQfo3BKapdopZ/7DpyFD nRmOF0/2ZIS9bMYmDW3o90HvqD3x9G+gcaTIMCI6b0ZUv/7b5pOWXQbRh xpA5YCIKQoi/U6qplwgjBZykzcWQtH8LGJK8DZKoaDtLztTDUcHC4lzfq TfC8I3CrFpCWiBTaZMZDbhM3OCgRAY+sWohuTGqFZDT0N+cxIC/AvkBAq OAPfWIAVy0/9+IW4Lk6+RvWxNhr4ag6E+meTcbYfO2pKvYfPqwbXauz9d 0AM3oZ1zTJONWj7DIrErMGYK//J5Ydp+Xmk8NDqP9Tz1gIzv6A/REvkp8 Q==; X-IronPort-AV: E=Sophos;i="5.96,172,1665471600"; d="scan'208";a="187539404" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 17 Nov 2022 14:31:31 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) 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.12; Thu, 17 Nov 2022 14:31:29 -0700 Received: from den-dk-m31857.microchip.com (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2507.12 via Frontend Transport; Thu, 17 Nov 2022 14:31:25 -0700 From: Steen Hegelund <steen.hegelund@microchip.com> To: "David S . Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com> CC: Steen Hegelund <steen.hegelund@microchip.com>, <UNGLinuxDriver@microchip.com>, Randy Dunlap <rdunlap@infradead.org>, "Casper Andersson" <casper.casan@gmail.com>, Russell King <rmk+kernel@armlinux.org.uk>, Wan Jiabing <wanjiabing@vivo.com>, "Nathan Huckleberry" <nhuck@google.com>, <linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>, <linux-arm-kernel@lists.infradead.org>, "Steen Hegelund" <Steen.Hegelund@microchip.com>, Daniel Machon <daniel.machon@microchip.com>, Horatiu Vultur <horatiu.vultur@microchip.com>, Lars Povlsen <lars.povlsen@microchip.com> Subject: [PATCH net-next v2 2/8] net: microchip: sparx5: Ensure VCAP last_used_addr is set back to default Date: Thu, 17 Nov 2022 22:31:08 +0100 Message-ID: <20221117213114.699375-3-steen.hegelund@microchip.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221117213114.699375-1-steen.hegelund@microchip.com> References: <20221117213114.699375-1-steen.hegelund@microchip.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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, SPF_HELO_PASS,SPF_PASS 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749781245610096573?= X-GMAIL-MSGID: =?utf-8?q?1749781245610096573?= |
Series |
Add support for VCAP debugFS in Sparx5
|
|
Commit Message
Steen Hegelund
Nov. 17, 2022, 9:31 p.m. UTC
This ensures that the last_used_addr in a VCAP instance is returned to the
default value when all rules have been deleted.
Signed-off-by: Steen Hegelund <steen.hegelund@microchip.com>
---
drivers/net/ethernet/microchip/vcap/vcap_api.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/microchip/vcap/vcap_api.c b/drivers/net/ethernet/microchip/vcap/vcap_api.c index d12c8ec40fe2..24f4ea1eacb3 100644 --- a/drivers/net/ethernet/microchip/vcap/vcap_api.c +++ b/drivers/net/ethernet/microchip/vcap/vcap_api.c @@ -1249,9 +1249,9 @@ int vcap_del_rule(struct vcap_control *vctrl, struct net_device *ndev, u32 id) vctrl->ops->init(ndev, admin, admin->last_used_addr, ri->size + gap); kfree(ri); - /* Update the last used address */ + /* Update the last used address, set to default when no rules */ if (list_empty(&admin->rules)) { - admin->last_used_addr = admin->last_valid_addr; + admin->last_used_addr = admin->last_valid_addr + 1; } else { elem = list_last_entry(&admin->rules, struct vcap_rule_internal, list);