Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp6656786ybn; Mon, 30 Sep 2019 01:23:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqzP+/h8DZSSbYMVsQNIjPsWDcA7MfUuDwnzgqUnnUTNzBFK0uFc5UTLGOPDf1DxCSYgvoXN X-Received: by 2002:a17:906:3e96:: with SMTP id a22mr18009233ejj.268.1569831829572; Mon, 30 Sep 2019 01:23:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569831829; cv=none; d=google.com; s=arc-20160816; b=t2gjn+GLgQtcds2/uDIbH5TnG0yEMDl3vZ2n9zEI7+od2nTTkcuAY2BYaBzpom/O1K gFk0Q9uWClF48XA/myA2n0JDKmkEUPZcbJp15Jq+U+Vuie/8Fqdr9jM88E4kauBLZJ5b KsIR0jkUcDTt9onYBKPViU52NibBMrI2PUqOV95pnX/3zxfMEGq9+7MvmvLyF2W/xamw wfMrrWQ4W8bXY35ILANuqFVBzFnomLnXsTQyn3x4CAhMtGV1KI35vxfueXQk6YRkjDt7 tl7IXtdTUESBt0DvASFZh0EI0mnUzdHP0A0RSuk6O7Jea5SntYysz6TKF6grem3SdEvH vWyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=YCGBu2Ga+qS9hElhtxFLKGyzX3PdszwFvu/Uqrj76/k=; b=vfD+G9lI+v8AdTPMryGF+LFQMhCNvIE8a1F2kp1nTj+EtYJXB8LX9F7XfGbAAjydId 9ytyVGPdJ4SAEk7zf0yR0OmwVTvmhdRuC3WNjttElCmS6Lx+1nyH5gi9IeU8FtFnrx9h kpv7Ysh9qm8mYaabgpCoxxXz8fMujGkN3loflcFBymnYDxhWLkFHxzz7Xz6fusTPwJhJ ZZ7TyBEXBu8XfhOBOn2WgMpvkftyV4qOEdhMGOXPxniHknhUO9ypP1/1NYei3R5t9fme QeOyEukzuIpAnkfzLvlkynfTgdKDWE1quK6XzSbMx2CmUIhIzLRShcEXOfZIN3PuDJsf g+lA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=fjXstvOU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g13si6425814ejf.133.2019.09.30.01.23.25; Mon, 30 Sep 2019 01:23:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=fjXstvOU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730211AbfI3IUL (ORCPT + 99 others); Mon, 30 Sep 2019 04:20:11 -0400 Received: from dc2-smtprelay2.synopsys.com ([198.182.61.142]:46062 "EHLO smtprelay-out1.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730018AbfI3IT1 (ORCPT ); Mon, 30 Sep 2019 04:19:27 -0400 Received: from mailhost.synopsys.com (mdc-mailhost1.synopsys.com [10.225.0.209]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id 030FEC0378; Mon, 30 Sep 2019 08:19:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1569831566; bh=F4S+1xHJRXUdoEUQwWWHucAMwa7NK06xIl14jQE+6AA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:In-Reply-To: References:From; b=fjXstvOU18eShkFdAOSybuVAihkK3XUtr6CMjZxY0AadH2cr3dyrFadMOvcZit/hT dnmaEvcUtDwDZgGsgKnlwq7KJVsH9eSJhfus4MmHgk/4R6Jzmi8Pyh8B0Xjc6wThs2 mHIphP0adsJoV9EV/lk+g/sPEtPfu4mIUilyueAPCtMXZzRr3OCLc17F864OXZl289 NQrSb9QGGSAjEQSF79zzADmo1bysj43/hqGKRyJ+7cc7QcHEbPKtv4ETKh+DtDottn NwsiFRzg6URlBz/uIf+7XgrtQ7n6mMq1hJGwah/8blTMfvzxjuHd6Tsk6FaRqXQtS7 IMYzZYbgOCZdw== Received: from de02dwia024.internal.synopsys.com (de02dwia024.internal.synopsys.com [10.225.19.81]) by mailhost.synopsys.com (Postfix) with ESMTP id 4BDA6A005D; Mon, 30 Sep 2019 08:19:23 +0000 (UTC) From: Jose Abreu To: netdev@vger.kernel.org Cc: Joao Pinto , Jose Abreu , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Maxime Coquelin , linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 net 1/9] net: stmmac: xgmac: Not all Unicast addresses may be available Date: Mon, 30 Sep 2019 10:19:05 +0200 Message-Id: <8db4940cc20518eb9e2dffa1277f600365a01404.1569831229.git.Jose.Abreu@synopsys.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some setups may not have all Unicast addresses filters available. Let's check this before trying to setup filters. Fixes: 0efedbf11f07 ("net: stmmac: xgmac: Fix XGMAC selftests") Signed-off-by: Jose Abreu --- Cc: Giuseppe Cavallaro Cc: Alexandre Torgue Cc: Jose Abreu Cc: "David S. Miller" Cc: Maxime Coquelin Cc: netdev@vger.kernel.org Cc: linux-stm32@st-md-mailman.stormreply.com Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c index 2b277b2c586b..6d8ac2ef4fc2 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c @@ -472,7 +472,7 @@ static void dwxgmac2_set_filter(struct mac_device_info *hw, dwxgmac2_set_mchash(ioaddr, mc_filter, mcbitslog2); /* Handle multiple unicast addresses */ - if (netdev_uc_count(dev) > XGMAC_ADDR_MAX) { + if (netdev_uc_count(dev) > hw->unicast_filter_entries) { value |= XGMAC_FILTER_PR; } else { struct netdev_hw_addr *ha; -- 2.7.4