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 X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 516C6CA9EC7 for ; Wed, 30 Oct 2019 21:52:48 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 248AB20873 for ; Wed, 30 Oct 2019 21:52:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="HsGoPvmo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 248AB20873 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=davemloft.net Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Mime-Version:References:In-Reply-To: From:Subject:To:Message-Id:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=u0OQe6A995MNmNlZavWBVqLKAeaV4bF/Etf2Ab6pgNY=; b=HsGoPvmodvZl/w o9z64yeWIKXtcK26CujTAWkifZmOvw8AdLBs/5P0yBpi1dFtRTn1SuSVGAqlFu8ygmPnviVVWoG81 A5T4A26uyEhgwPZmjFsPvJLfgN6ssUo7/Ggr47Y74Gjk9ScTehVylKV9b99ryMhhwhssRyi/YgmHm ePHxRpjipv2UR+QewgmY+Cw9EUvE2615r5nrjLXrd8OyhxmU5rYmnmy8yairlilJCNpHXxvY1dIsF 9x5PXgMiJxyxE1ZwoqQKhOU8fD6bk9dFlJvmHgBylkkBj+KQMI7xFtbQV0NIWrFe2V5s/URKhKilD flMx5zGK4EKHesqBp9VQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iPvtS-0005zk-5S; Wed, 30 Oct 2019 21:52:42 +0000 Received: from shards.monkeyblade.net ([2620:137:e000::1:9]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iPvtP-0005yg-K5 for linux-arm-kernel@lists.infradead.org; Wed, 30 Oct 2019 21:52:40 +0000 Received: from localhost (unknown [IPv6:2601:601:9f00:1e2::d71]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 5DB1114CFAAEA; Wed, 30 Oct 2019 14:52:35 -0700 (PDT) Date: Wed, 30 Oct 2019 14:52:34 -0700 (PDT) Message-Id: <20191030.145234.1629187794527849559.davem@davemloft.net> To: Jose.Abreu@synopsys.com Subject: Re: [PATCH net 4/9] net: stmmac: selftests: Must remove UC/MC addresses to prevent false positives From: David Miller In-Reply-To: <36d9af9080068c4e38cf50e80b6f2a5eafc9ed99.1572355609.git.Jose.Abreu@synopsys.com> References: <36d9af9080068c4e38cf50e80b6f2a5eafc9ed99.1572355609.git.Jose.Abreu@synopsys.com> X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Wed, 30 Oct 2019 14:52:35 -0700 (PDT) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191030_145239_660959_E681F396 X-CRM114-Status: GOOD ( 10.47 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Joao.Pinto@synopsys.com, alexandre.torgue@st.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, mcoquelin.stm32@gmail.com, peppe.cavallaro@st.com, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Jose Abreu Date: Tue, 29 Oct 2019 15:14:48 +0100 > @@ -499,9 +501,18 @@ static int stmmac_test_hfilt(struct stmmac_priv *priv) > if (netdev_mc_count(priv->dev) >= priv->hw->multicast_filter_bins) > return -EOPNOTSUPP; This test above... > + dummy_dev = alloc_etherdev(0); > + if (!dummy_dev) > + return -ENOMEM; > + > + /* Remove all MC addresses */ > + netdev_for_each_mc_addr(ha, priv->dev) > + dev_mc_add(dummy_dev, ha->addr); > + dev_mc_flush(priv->dev); No longer makes any sense now that you're removing all of the MC addresses. Also I know it seems that it should be guaranteed that re-adding all of the previously configured MC addresses should succeed. But I am always wary when I see error codes ignored like this. This test makes destructure changes to the device's configuration, perhaps in a non-restorable fashion if errors occur re-adding the MC list entries. Running a test should never even remotely introduce a change in the device state like that. I really don't like this, to be honest. I'd hate to be the user who had this somehow trigger on them and then have to diagnose it. :-/ _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel