From patchwork Thu Jan 5 08:13:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steen Hegelund X-Patchwork-Id: 39362 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp185016wrt; Thu, 5 Jan 2023 00:15:44 -0800 (PST) X-Google-Smtp-Source: AMrXdXsl3PMigsTXeLth5YFcBFkibUx0D6hVMQIbaO++zRtuH7xSG+wPGCg9D7Ja4OyhrWJTQOCT X-Received: by 2002:a17:907:7f8a:b0:7c0:e4b7:517e with SMTP id qk10-20020a1709077f8a00b007c0e4b7517emr60521645ejc.16.1672906544265; Thu, 05 Jan 2023 00:15:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672906544; cv=none; d=google.com; s=arc-20160816; b=OOMtE8PWOyzZw11PjejlAG12wLnd+0d9adzxBPv503GuNs1rQsI6RkVCNkz/RiCsel rzeLjQmV4tsDKR2ari22kuM8lB7SM1emPPGJOFAxVpa36Qs6K5+mwuu749pqjRGbhddF A/T4UoUe7IUt1qxRdil4D11nZoeztVq4qRjrknBo7bDBaExw3AnH3pXJ57LRjGoPgGL8 uHCnxL+ekYrPTnJRq24tCUyupCCMxnj2/G2fy6ZKYt+Ftt14Ei/HffLq2u8RHZSj1GKj rwLhIwb0CYHazILADAcw19wT4a2qHB06E0xbTjwgzORRRhZEhvUD54TJCw43+3r2mPIb a7hA== 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=zWubvykuJmS64nIUAMYI375VTzHWKDq5G/LWGBo+WT3TykL00Df6LAsCv2e33gMa4p JZJllvG8l/yyV5ktyPNsV0uxT2Go/Oi5cnaf/H/44txlffBTMdAZh++Q558Ivf1kor6L JcQhNdBQk9YwjpNGl7HISx9YNft1F0VePiC7j9B68uHB3E/XtWYm4qThbsd/ps3NuFNc EXNr2GR4XkkfTo9N9dNCh6SYXjSwTrD6ZjOyxKrkQQeQ6so4MucSGz6vxgjjKH+CglRi lMBlr0jo+i3KcHwne9EKj3IAskAIVhpOOGEq+pTeKxyV6zOZO/ofEg5BcLXEXgX6OK6r Velw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=ijR6vDFj; 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 z20-20020a170906945400b007bf7bb4702asi25132246ejx.804.2023.01.05.00.15.20; Thu, 05 Jan 2023 00:15: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=ijR6vDFj; 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 S231326AbjAEINu (ORCPT + 99 others); Thu, 5 Jan 2023 03:13:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231366AbjAEINs (ORCPT ); Thu, 5 Jan 2023 03:13:48 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 430375830B; Thu, 5 Jan 2023 00:13:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1672906427; x=1704442427; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=CSSQa3dD4gybR3nOez6pDisJkzG2bVCeG3CLX4+Xp4Q=; b=ijR6vDFjwhHZ3jDhSm2J3VAhmDnShiEjXrA7n/+lOhBf8azmFzl/je+g /T2Bju6shb6wnqzkIA180CKzdy6lxF9kuBdtj4hl9p6lknOD+QN7pLObW 0zBab/UJXJvIeKPNpUzDbBMLCMiIndJ8JPmSkCd3wx1/aXLH3Izoy2NGH wZDrzi+egMxerkg00xeFV1uTRdHlz7n5hbhDM0CFQf0gqZuZSGHOTlf9+ qrNxuHTSJIcox8iOc1FBI6nk/p/e4ILAU2gPb/KjMXPLIQn7Utyr/Euxy p/e6Osm9HvuwFJ54InDtvNOpvT9u7wHWJ18ljWQyo58WMeBhcErybVPSk w==; X-IronPort-AV: E=Sophos;i="5.96,302,1665471600"; d="scan'208";a="130906191" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 05 Jan 2023 01:13:46 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Thu, 5 Jan 2023 01:13:46 -0700 Received: from den-dk-m31857.microchip.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2507.16 via Frontend Transport; Thu, 5 Jan 2023 01:13:42 -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 Subject: [PATCH net-next 1/8] net: microchip: vcap api: Erase VCAP cache before encoding rule Date: Thu, 5 Jan 2023 09:13:28 +0100 Message-ID: <20230105081335.1261636-2-steen.hegelund@microchip.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230105081335.1261636-1-steen.hegelund@microchip.com> References: <20230105081335.1261636-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?1754169652453348537?= X-GMAIL-MSGID: =?utf-8?q?1754169652453348537?= 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: