From patchwork Fri Jan 6 08:53:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steen Hegelund X-Patchwork-Id: 13091115 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 5AE07C3DA7A for ; Fri, 6 Jan 2023 08:54:39 +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=fFbk1vy9UjKuDkwyggQWd87Q0zbueDrYS2lIT8P7NBM=; b=TYYHNo95l7cfWz Lol5D4DBzl5ybughInWO7qrY34VVNRyLCtXiVR/IyzEb8YEyNvrInqX6LBn2nFn0h9kxrNfCHmz0C OoNlP+67jSKBwpP1UpVjlCpqJ7qDpsN7rJPyygzR3TmFAHGUIHj8WYFuOU1M7vn4pXvHWO1qM/doE /IaHPSMZHDpAj3Co6W/l/1zusXy7C+pO+M4wSMx92kcKhI53Z27+nMuFFtUkY1bFbOuPozNYCGT3q LjoZytK5w3kSfIg8HeOTWRPRmcF0D+QRRjJPZuIHbDQGE71Q7X4LrzKHG1WEW0IEz8cL1NkwiZE6X o2iQax1uircv+Vc8/2DQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pDiU1-006mOY-BQ; Fri, 06 Jan 2023 08:53:49 +0000 Received: from esa.microchip.iphmx.com ([68.232.153.233]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pDiTo-006mHP-Nr for linux-arm-kernel@lists.infradead.org; Fri, 06 Jan 2023 08:53:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1672995217; x=1704531217; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=CSSQa3dD4gybR3nOez6pDisJkzG2bVCeG3CLX4+Xp4Q=; b=AUM/GzYND9kyQKdh/fJS9u+flXtHUazVE2USdO/hRfmqbeW/9Uk5pu+x 5y/89v1yhYiG/8O1jwmbeGUXON16VQJF+YCLGocy52jkcU3ma+TOo47D9 L3onG9a9b/GrlDWh3RKPDr1DTQ11oTOmmCaIBzZIwX5nEdJKweedq5CVf 3K1SJekEj6qPHfULqdZbWXFJ1g+/GK0oB6rWoqUjdplvj3wf4L7A/qxpQ DiQWqWa/u8Ar6oj/bWlshcEabUqNWs24JGAkX1QBIbMgPhNqIrq0gpqFV GZJoBxX+FI6kGf1LJjRxz0+VwtTaoSeFMpWl/9fR4kjl3y87BRQpE46yL g==; X-IronPort-AV: E=Sophos;i="5.96,304,1665471600"; d="scan'208";a="195665969" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 06 Jan 2023 01:53:33 -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.16; Fri, 6 Jan 2023 01:53:31 -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.16 via Frontend Transport; Fri, 6 Jan 2023 01:53:28 -0700 From: Steen Hegelund To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni CC: Steen Hegelund , , Randy Dunlap , "Casper Andersson" , Russell King , Wan Jiabing , "Nathan Huckleberry" , , , , "Steen Hegelund" , Daniel Machon , Horatiu Vultur , Lars Povlsen , Dan Carpenter , Michael Walle Subject: [PATCH net-next v2 1/8] net: microchip: vcap api: Erase VCAP cache before encoding rule Date: Fri, 6 Jan 2023 09:53:10 +0100 Message-ID: <20230106085317.1720282-2-steen.hegelund@microchip.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230106085317.1720282-1-steen.hegelund@microchip.com> References: <20230106085317.1720282-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-20230106_005336_806324_96C7E946 X-CRM114-Status: GOOD ( 11.17 ) 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 For consistency the VCAP cache area is erased just before the new rule is being encoded. Signed-off-by: Steen Hegelund --- drivers/net/ethernet/microchip/vcap/vcap_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/microchip/vcap/vcap_api.c b/drivers/net/ethernet/microchip/vcap/vcap_api.c index 664aae3e2acd..b9b6432f4094 100644 --- a/drivers/net/ethernet/microchip/vcap/vcap_api.c +++ b/drivers/net/ethernet/microchip/vcap/vcap_api.c @@ -1823,6 +1823,7 @@ int vcap_add_rule(struct vcap_rule *rule) } if (move.count > 0) vcap_move_rules(ri, &move); + vcap_erase_cache(ri); ret = vcap_encode_rule(ri); if (ret) { pr_err("%s:%d: rule encoding error: %d\n", __func__, __LINE__, ret); @@ -1885,7 +1886,6 @@ struct vcap_rule *vcap_alloc_rule(struct vcap_control *vctrl, ri->vctrl = vctrl; /* refer to the client */ if (vcap_set_rule_id(ri) == 0) goto out_free; - vcap_erase_cache(ri); return (struct vcap_rule *)ri; out_free: