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: 40010 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp719278wrt; Fri, 6 Jan 2023 00:56:33 -0800 (PST) X-Google-Smtp-Source: AMrXdXvvDdKByjwoP8eVfrMmAm+5za/AjLOu/YVcfT3H2kyRlUjClMcrcLiR2k/p5CKTNmTbFyy4 X-Received: by 2002:a17:90a:b102:b0:225:c712:5df8 with SMTP id z2-20020a17090ab10200b00225c7125df8mr57701856pjq.3.1672995393393; Fri, 06 Jan 2023 00:56:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672995393; cv=none; d=google.com; s=arc-20160816; b=C/0Ul8kXJOojGgC0crtOdsiWagKGwFDwjIZTF1XQe/pjjiRe5RI8Oyt+VXnBg/X5Sr Y3lrAOwIsAEA8BjmRsCQsg67Toan0z+U5OsX16G5DMxSwbm0e1CrAhGG5PwDGe6D7E/Z wrEgdjlErGRvSDd2W6lZF83Ld+69nziqnm2CVPwQ9GFh49GI/VAr0omn+CSafzy27l60 d4OxZrlXcIqj5RWsbKDTc3vZBUaTi7AlnNu3GDhjtAdXiItr3ZN3ZCCO2ncmIN5jA9kz NTidgzh8sOdoQpG+eiqRwD0ROO1BkpeoijHA8FbXx7qlavWBHiHGXyk0iVFMRLiGWPW/ G2oA== 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=DwrtpLzI4iPMnNsxnwf/II+IF22mYNGD4MInMFaF4IZxeNCetyUVmWZORjBw8TYWcV BHDvoP0PDCf0K6t2ByzmbPq+S5x3SHiJQJJ82PUCRHykx5VJtUZgDb/BWyWfUMoZ5d7h BzBnqLmxPZt7l9SJvFkTgZnmV1tNSysJPrF+bVpyK+z9w7aBEK04rJnqRdiSbmUGmrZD 5Rx1czv8HvHOMYpnHk1gGGmgep+HJ0rQoAk7I34lxIZuk4NMsk9dw4YxaVEVJYWIXQmr tdi9RKyu0QjPy+QBK0jfIIZ40K0CsI0p8m4EprEDo5LnRHAqzR2M9IJFCRYmt/Jrebkv sbGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=AErcUF0Y; 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 bn3-20020a056a02030300b00478e937cdffsi801897pgb.738.2023.01.06.00.56.20; Fri, 06 Jan 2023 00:56:33 -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=AErcUF0Y; 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 S231972AbjAFIxr (ORCPT + 99 others); Fri, 6 Jan 2023 03:53:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229672AbjAFIxe (ORCPT ); Fri, 6 Jan 2023 03:53:34 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 215E2669A9; Fri, 6 Jan 2023 00:53:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1672995213; x=1704531213; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=CSSQa3dD4gybR3nOez6pDisJkzG2bVCeG3CLX4+Xp4Q=; b=AErcUF0YPQRtWeTSlh/Y3IMo5npkiImJv3lEXlA3xzqJ6AGnYpdIlcDV XQSh04tzBpef6l2tgOROqtIA4nQNSrEqGU+cAFWB6QqynQgP05esQIlnL Z0/ufTs2H2COuvRDDIxDqgGBnPDEOOCfYpaxXH55E00UzSiiqb++Ee2TT 1QD1Cqdk82dLo/EqM3TsHf5dpzOmsG0NWMjY8ys/FFMSTpWgIKdlgH+o+ 05e+7zsf8/Mw48OOWzhnywnnWuKWaxqMix7fqoyOtPN4wklCWqt359AT/ czWSx5hjbQtXr344dOR3PCcmbawNB2eFnxy4Rhbt7oYUtkee6X61AQLG8 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-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?1754262817725361880?= X-GMAIL-MSGID: =?utf-8?q?1754262817725361880?= 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: