From patchwork Fri Jan 13 08:14:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steen Hegelund X-Patchwork-Id: 43062 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp147950wrt; Fri, 13 Jan 2023 00:16:59 -0800 (PST) X-Google-Smtp-Source: AMrXdXvc54jq8qMEn9rJ3YI1D5jcAici41FwU4xOexqV8uoR3w/lyV6tCtEThLNV/Eku47K0VRNC X-Received: by 2002:a17:90a:6344:b0:225:ce95:dc15 with SMTP id v4-20020a17090a634400b00225ce95dc15mr69237179pjs.29.1673597819566; Fri, 13 Jan 2023 00:16:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673597819; cv=none; d=google.com; s=arc-20160816; b=gw2pAyDSI+o+M7d3WQkNoID71G8wc31GBv4qX+XKGoG4xf/W+5+t6iNBfubuwvBTXH i7LukIwI9OqJibgFTFIrRS0nXuu2/sMVSmLnNa6mk7quJm0LNnwrUmGH7+vZMjRGYpAA baJBlSuNsIy0fnfSaoOSZ+daw0g+GfbXai3B/so710QKpVXYPObopzMcSIcP0+9F39g3 bRTZ+wUeP9wFgt22UKreB4fJ2qt74JMyVx2fkETIl4USGVGLAYwVinPLQ2sG7q3T+fE6 AbLsmQwWyo9KusqMC4nbhOyrGhbEUNv/QSuzVhblT/XnzD1KRJz5paHIPETudOXVb1oM jpKw== 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=zFPW+/Nha/JjDHUcOojstXkToOObmc/0pCMOybzhjho=; b=o7XjkpZtv3oqT+gtxAqn8ZPkPSKPY4LgXco9juXGiAgnnxCrI4m82lc/LWR/1Ny9gp kGWLIeEgTC724MVkKOw0oQVzHGqq5F6eWn2q2GhS19IDqrav4IaxNFknk6uqKjvRwqlK L3pKvCbm6GXWxSDXniIjN2QaDQe/f2iyIWZbR6dVmJq697aA8zY8CcINufz4e6k9Ogio E6qeKs8xsSqloMVwOY3MMCDhKfUuFGvxd2kBIH3VKFvcySdharZKDyTGIcnZIrXOwzat 6jQ8hdTBiMPmR9PT41rhOw+nQxYiAx0RZOLS5bkIjOzsJK/SAz5FL+D9moDxul40cxfK CaPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=qmPcU7C1; 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 lw7-20020a17090b180700b0021fd4804492si22143275pjb.179.2023.01.13.00.16.46; Fri, 13 Jan 2023 00:16:59 -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=qmPcU7C1; 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 S241012AbjAMIQY (ORCPT + 99 others); Fri, 13 Jan 2023 03:16:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236698AbjAMIPn (ORCPT ); Fri, 13 Jan 2023 03:15:43 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4EAC3395D9; Fri, 13 Jan 2023 00:14:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1673597679; x=1705133679; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=CSSQa3dD4gybR3nOez6pDisJkzG2bVCeG3CLX4+Xp4Q=; b=qmPcU7C1baRvAb+yz+RCH8mb0pCLs3TgtyCz4T9klcnylYpuMSLeaHF6 nJHrx2JXcyFbRksO7lE5ReHaMmN5LdjGlH1tJj842RAKjGddtMeS6InVQ FyCj1Z1noItCR9WS4cJzmIq0XuxsrC2wI2M+rZA4Qbg3W3LD7uZ+0nGld 6fpERjEtqqIOKmwBnLJBYvN1FwXrCdG+zBwbxyxKNJiE0ez9Sf+Jh3Bsm Q7VCrjBM+737QU6DOiOEMbw7IrS8vcefU2qlnesiTP8HK08FDZSE073ov dr+IA1okk0T5BRCuQGjGYGr/0Lfjpa3HoxusQ+aw7vOqXStzfxYqeECD/ w==; X-IronPort-AV: E=Sophos;i="5.97,213,1669100400"; d="scan'208";a="195616560" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 13 Jan 2023 01:14:38 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Fri, 13 Jan 2023 01:14:37 -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; Fri, 13 Jan 2023 01:14:33 -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 v3 1/8] net: microchip: vcap api: Erase VCAP cache before encoding rule Date: Fri, 13 Jan 2023 09:14:17 +0100 Message-ID: <20230113081424.3505035-2-steen.hegelund@microchip.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230113081424.3505035-1-steen.hegelund@microchip.com> References: <20230113081424.3505035-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 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?1754894507253264249?= X-GMAIL-MSGID: =?utf-8?q?1754894507253264249?= 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: