From mboxrd@z Thu Jan 1 00:00:00 1970 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 0842EC64EC7 for ; Mon, 13 Feb 2023 15:07:33 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=4jxozhX9TXPhIblAgaOtHWANH8sE4AyifRhgOud7j2c=; b=TM2bXUGHCyh3+A jpy1FlxW6xcdhCH+4y3IVFmqGMiIrxafTuYkvrC9/n5kiLyhNAd1oRpvDvI2W7Bvl0iOvitLXUcNZ D2vizPb4OjgbJ/v2f1b7mmeuBq6qW7hmf9mCQQfQm6OTNHetwsDwufZHAF8XhrFz16xq2Sg5BBlXy DDFUJFt7QyxhpG2k/3wTZebCrVTuOY63OWAdDs9AnSKjh1ywZy7/uNDrLCslrvHzUHJmRRephiitR 3UPVQBvgSZnNVL+gQpvtnCK53l3TQzgvbPv9nujEIJiZWtLg4f4sxRchz4PUF4tPZ0B5ym4LNTOuK W9ZSHrQ3gD5sR8iDxLtA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pRaPb-00F7Th-Jg; Mon, 13 Feb 2023 15:06:35 +0000 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pRaPX-00F7Nu-Sq for linux-arm-kernel@lists.infradead.org; Mon, 13 Feb 2023 15:06:33 +0000 Received: by mail-wm1-x335.google.com with SMTP id l37-20020a05600c1d2500b003dfe46a9801so9310767wms.0 for ; Mon, 13 Feb 2023 07:06:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=R1rzLgzvsB9BwR77x6O/DdOBbqC4srqcO9LCeAj7ObI=; b=OIoJn5QWJ08in7vWs819eTUEIgI2Qlwl+Uo+uIFfA1n9JHF3paUQfpuVcYvUA47DP9 d2uP+Dc7CdbLqqfGjBLZydjuyJEnhYml30qWO2T13/0E4LRj2Rb+NVpNflrZoaIFtim8 L7+HbN906IRn8c+z+1Kl8taWjmJnWCeuQG2YlzG5rLquRzl5jn0wogRY+SPzzP9KdpjE QzlN5vRc7+jDJpmLU99Dh9fQIHri4Ov85Y4e13tGW2CLvxRqiSsoj27yNiE6ZyNxxRgf bicq1wTUpW+ZG1kjwHV6fz9u1Wu0YK8xdeGZsziDPm8zm6UjASAvQVGAns0aFh9x0gmw GBlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=R1rzLgzvsB9BwR77x6O/DdOBbqC4srqcO9LCeAj7ObI=; b=KQGbnK1nMHYh0P4+m+08A20WAQlX1WqahbpgLSimDSVl8gGaLnPv65iWjx1tbmg2aI Ju4WepZr6j+qGDd70c0PNUGAKgxyO97Y1zmIyxxWzE2qPjZI91CEOgal0Wd+cfsCRO69 IbimoB5KZeNinqL+HVYwZrGFaDcXxATWD7lye8JfSo/s16QPJ9ywxEiMHVe1HSnestJr 1v3kfoJItpBIzrt+DA2gY7U9MZvslAXs4QSfLB3NzJCayBV6r3dW2Q+czYIjb5LFo3Dl YaOu5OnjP8eg7roOIOnTlHKdrwvgFYELJ7Ha9mFYyhjeIh3wsxroCR5pgzU2/oTARGVc EjPw== X-Gm-Message-State: AO0yUKVHAZoAraAmyL1up7y82/CnID3QumZGAZM2a/UVUGREOrMHES/i J/ZIE8OOnV5z3GgaUl7ltMo= X-Google-Smtp-Source: AK7set9IGCVLfth33G9aV0RyaLjZaENmQqa7AvYWqD5xtHua8kxL+G7V9b2JeCwdQUCU4tKIkRnguw== X-Received: by 2002:a05:600c:319e:b0:3dc:5dd4:7d3f with SMTP id s30-20020a05600c319e00b003dc5dd47d3fmr18726223wmp.24.1676300776344; Mon, 13 Feb 2023 07:06:16 -0800 (PST) Received: from localhost ([102.36.222.112]) by smtp.gmail.com with ESMTPSA id e1-20020a05600c4e4100b003dc49e0132asm17779341wmq.1.2023.02.13.07.06.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 07:06:15 -0800 (PST) Date: Mon, 13 Feb 2023 18:06:09 +0300 From: Dan Carpenter To: Steen Hegelund Cc: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , UNGLinuxDriver@microchip.com, Randy Dunlap , Casper Andersson , Russell King , Wan Jiabing , Nathan Huckleberry , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Daniel Machon , Horatiu Vultur , Lars Povlsen , Michael Walle Subject: Re: [PATCH net-next 02/10] net: microchip: sparx5: Clear rule counter even if lookup is disabled Message-ID: References: <20230213092426.1331379-1-steen.hegelund@microchip.com> <20230213092426.1331379-3-steen.hegelund@microchip.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230213_070631_960936_8D356725 X-CRM114-Status: GOOD ( 22.73 ) 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: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Feb 13, 2023 at 01:44:35PM +0100, Steen Hegelund wrote: > > > diff --git a/drivers/net/ethernet/microchip/vcap/vcap_api_kunit.c > > > b/drivers/net/ethernet/microchip/vcap/vcap_api_kunit.c > > > index b2753aac8ad2..0a1d4d740567 100644 > > > --- a/drivers/net/ethernet/microchip/vcap/vcap_api_kunit.c > > > +++ b/drivers/net/ethernet/microchip/vcap/vcap_api_kunit.c > > > @@ -1337,8 +1337,8 @@ static void vcap_api_encode_rule_test(struct ku= nit > > > *test) > > > =A0=A0=A0=A0=A0 u32 port_mask_rng_mask =3D 0x0f; > > > =A0=A0=A0=A0=A0 u32 igr_port_mask_value =3D 0xffabcd01; > > > =A0=A0=A0=A0=A0 u32 igr_port_mask_mask =3D ~0; > > > -=A0=A0=A0=A0 /* counter is written as the last operation */ > > > -=A0=A0=A0=A0 u32 expwriteaddr[] =3D {792, 793, 794, 795, 796, 797, 7= 92}; > > > +=A0=A0=A0=A0 /* counter is written as the first operation */ > > > +=A0=A0=A0=A0 u32 expwriteaddr[] =3D {792, 792, 793, 794, 795, 796, 7= 97}; > > = > > So this moves 792 from the last to the first.=A0 I would have expected > > that that would mean that we had to do something like this as well: > > = > > diff --git a/drivers/net/ethernet/microchip/vcap/vcap_api_kunit.c > > b/drivers/net/ethernet/microchip/vcap/vcap_api_kunit.c > > index b2753aac8ad2..4d36fad0acab 100644 > > --- a/drivers/net/ethernet/microchip/vcap/vcap_api_kunit.c > > +++ b/drivers/net/ethernet/microchip/vcap/vcap_api_kunit.c > > @@ -1400,7 +1400,7 @@ static void vcap_api_encode_rule_test(struct kunit > > *test) > > =A0=A0=A0=A0=A0=A0=A0 /* Add rule with write callback */ > > =A0=A0=A0=A0=A0=A0=A0 ret =3D vcap_add_rule(rule); > > =A0=A0=A0=A0=A0=A0=A0 KUNIT_EXPECT_EQ(test, 0, ret); > > -=A0=A0=A0=A0=A0=A0 KUNIT_EXPECT_EQ(test, 792, is2_admin.last_used_addr= ); > > +=A0=A0=A0=A0=A0=A0 KUNIT_EXPECT_EQ(test, 797, is2_admin.last_used_addr= ); > > =A0=A0=A0=A0=A0=A0=A0 for (idx =3D 0; idx < ARRAY_SIZE(expwriteaddr); += +idx) > > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 KUNIT_EXPECT_EQ(test, exp= writeaddr[idx], > > test_updateaddr[idx]); > > = > > = > > But I couldn't really figure out how the .last_used_addr stuff works. > > And presumably fixing this unit test is the point of the patch... > = > It is just the array of addresses written to in the order that they are w= ritten, > so for the visibility I would like to keep it as an array. > = My question was likely noise to begin with, but it's not clear that I phrased it well. I'm asking that since 797 is now the last element in the array, I expected that the KUNIT_EXPECT_EQ() test for last_used_addr would have to be changed to 797 as well. regards, dan carpenter _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel