From patchwork Wed Dec 21 13:25:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steen Hegelund X-Patchwork-Id: 35365 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp3522847wrn; Wed, 21 Dec 2022 05:30:24 -0800 (PST) X-Google-Smtp-Source: AMrXdXtXtAXgoe/sqRfild60VZdNAbSn/rUnDvSdEaRTTxQ5LafiHbtmZj1NRcWuqCvyrz99crZA X-Received: by 2002:a17:90b:23ce:b0:212:ef19:1e0 with SMTP id md14-20020a17090b23ce00b00212ef1901e0mr2164138pjb.1.1671629424367; Wed, 21 Dec 2022 05:30:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671629424; cv=none; d=google.com; s=arc-20160816; b=gsxIn3VKGUco7lrSSMnoRM3qIO6vXWXMiW75481SsjmCgY14fBeyqR0VAIOjRFDxt6 QMrWBsPWvNeAGzW2LhKgmhYHcPSRrPIc0svWQt4sk29GmNNzldGf8qLI3+bamcnKuBTi 8/qZcc8/odOpHYlP5vEUR2H8ueBboIda70PcL3/sTrACXhfFjKWMEV50yY13PJs/2/nv PuYO1ROIb+exPBw3tYMJySVc1nWi562rXraVxjIUpX0Ysu3V9i188kT6/tYFtqmL9Slh QoxtchUj6/6GXUIgISand0O/aM13R1G2miO3MNOx91taFtqd5fMWv8hvTQoKNgVx973U KMYQ== 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=WSI/KZ0Eq/eTqnSAsNes561Q5/G0DuS0KHgT3HDzkDTxb8w9p52xQCf7H1JxPmrW7y 1ICBTsWlpo0NgD5V1MUtwGwsrmaIDj3J6zkM9e1WCQP+ZW9bpkBnc2d0f9DO2Gdxeu3t FamztcpCYpP26dX1CPDbX9D8VObILm1wQy9tQvcRA4cNGLusOG3UVHtes/jTCd/dFLh6 b5RMV+wqViO/OunY6FFTFZ1wmCWRaNHRYAAj/yOgohaEN7X2ZD7LbdDsyQgBsAsVTbVR al4S9hc+sqM4wqhU9dgggYivc9tiliI+iiAm/CQEQGimSywWPkZXwF2KCfzVvYrLnmCo y6CA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=zbns0PPs; 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 pf16-20020a17090b1d9000b0020d401a03b5si1867035pjb.180.2022.12.21.05.30.10; Wed, 21 Dec 2022 05:30:24 -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=zbns0PPs; 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 S234144AbiLUNZl (ORCPT + 99 others); Wed, 21 Dec 2022 08:25:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233054AbiLUNZd (ORCPT ); Wed, 21 Dec 2022 08:25:33 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64A591A815; Wed, 21 Dec 2022 05:25:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1671629132; x=1703165132; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=CSSQa3dD4gybR3nOez6pDisJkzG2bVCeG3CLX4+Xp4Q=; b=zbns0PPsMdubpNHh6jKm6JSc4iP5BNUkGDo8XjPFLowoWgSfdiersXOk rbXFL/o62CDuSxP0l6rCF9ZfZz05WRa/kF45m+9McvJaOdsZT8ckTSj/A u+RNBWAPWvbsAx0i5Gmq3eUAz51R5bGBe6jwbCHj505fhoxQWpyhajOxS lveAdDMRhkmDKn7RZ0sAjsE5hUu7qDpbgwm3s6VSIAwt9NnHUsi/0LZua 4r4PbO0TaHGl+QijCg35f9RLlGNZOBbcpOS9PetxYlqyVvxSTuW48IXKH TzQN7cjMZ1zuLIIfuIjRe+v34AQidw4gIsjH74Z/yoB0hEfz+qJjFdESM w==; X-IronPort-AV: E=Sophos;i="5.96,262,1665471600"; d="scan'208";a="192695947" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 21 Dec 2022 06:25:31 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) 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; Wed, 21 Dec 2022 06:25:31 -0700 Received: from den-dk-m31857.microchip.com (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2507.16 via Frontend Transport; Wed, 21 Dec 2022 06:25:27 -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 1/8] net: microchip: vcap api: Erase VCAP cache before encoding rule Date: Wed, 21 Dec 2022 14:25:10 +0100 Message-ID: <20221221132517.2699698-2-steen.hegelund@microchip.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221221132517.2699698-1-steen.hegelund@microchip.com> References: <20221221132517.2699698-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?1752830495157341987?= X-GMAIL-MSGID: =?utf-8?q?1752830495157341987?= 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: