Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp648176pxb; Tue, 2 Feb 2021 14:18:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJzi+CNkFcCQI38bv73rXm4FKjx+/99Q8xib7Pz/UTMfRH4AkXra+sYFyzsA8hKGA/nsynSa X-Received: by 2002:a05:6402:b6f:: with SMTP id cb15mr199149edb.277.1612304282539; Tue, 02 Feb 2021 14:18:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612304282; cv=none; d=google.com; s=arc-20160816; b=QTzf8DZBdXmpCVaDk0pB1inmKCRe30oWpHlPyHHa86al+1MEZGe9125bKIGjUx0DPR e4lG7jwj8IRstlLljdJjpYwcRVEg0tyc3vjC9EzFqC5CCSKGN+pf0OjjlTL6aS+DCXby HASYVSyjm3/cGI105NrfDtkpEsEP4PHvTKWMhSf9RYm2DmI08HyI/xwkl893ABWZrIuZ DnEPib5dTMcg9viaEEyD1w133X6K5WxIQ1m5lNmyGNPKeAVtc2mBdMJS2itvexlCj2CL 5u5fptUJc2dSFEX4cpOqm8WhGzAlacQ6j4Ctb/H/rcSJMGOzHFQnBaRYQL5ugcnXCKr9 bF/A== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=PSO+jN9mTUSUQZkzA2NpVIpNF91vOORuds6BXfnh8cs=; b=mMRUiGIco/lBgPu4lHhWctw9xdWCzGCENKRNu4LHeIUCWWm7f88arCtWFWRkcDzBhD 8vAtb6Ps+d+oa8jUBV4gRKo7lG3G8E+AElDUYDWo20x0O/LY1TTPyRqrbEXiiB2B2Wwt aCY8+zBUhj2CvozJ9vPnZqUxcEt6qyIHfKoxqVBnrAnb2leB6rRZHZU8vncbu+1FGZhY M/Fw/Kg7rsjFbnrQoeOZtFMc+LNYAAEOKIkvIAW5XMTK8wwSWNecKFiaThb3rKoJZH86 m2wzsOBYngctd2ydXbm8fABvmpDTjSM5Mzo8aFD2vLV0s6xPZOdXIH3YbDQwHfMKDM+O UQag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pJCggKJm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x2si115827ejw.116.2021.02.02.14.17.38; Tue, 02 Feb 2021 14:18:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pJCggKJm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233429AbhBBOAq (ORCPT + 99 others); Tue, 2 Feb 2021 09:00:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:41120 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233240AbhBBNyO (ORCPT ); Tue, 2 Feb 2021 08:54:14 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0C85B64FD0; Tue, 2 Feb 2021 13:44:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1612273463; bh=SOaf2UYdKImNkE1eG9CEv7A7Dlm5pvs+VHYc2PaHKGQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pJCggKJmPz5T+q8uIddAfC/ZPmEVMfWDoBtqNi0FDHXixzybgv/ZVvFPgc8Maufu/ mJv4xuJ0dtE4TBEH1t6TycTAupHPtBsB5d8IYKOg35Xp90wRvSPKPHAFL4ksha/R+y KG11xMlfsa0GNJb44iJMOCuzVdYO+kL2yPZUKttw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nick Nunley , Tony Brelinski , Tony Nguyen , Sasha Levin Subject: [PATCH 5.10 109/142] ice: update dev_addr in ice_set_mac_address even if HW filter exists Date: Tue, 2 Feb 2021 14:37:52 +0100 Message-Id: <20210202133002.208217811@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210202132957.692094111@linuxfoundation.org> References: <20210202132957.692094111@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nick Nunley [ Upstream commit 13ed5e8a9b9ccd140a79e80283f69d724c9bb2be ] Fix the driver to copy the MAC address configured in ndo_set_mac_address into dev_addr, even if the MAC filter already exists in HW. In some situations (e.g. bonding) the netdev's dev_addr could have been modified outside of the driver, with no change to the HW filter, so the driver cannot assume that they match. Fixes: 757976ab16be ("ice: Fix check for removing/adding mac filters") Signed-off-by: Nick Nunley Tested-by: Tony Brelinski Signed-off-by: Tony Nguyen Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/ice/ice_main.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c index 2dea4d0e9415c..7986c677cab59 100644 --- a/drivers/net/ethernet/intel/ice/ice_main.c +++ b/drivers/net/ethernet/intel/ice/ice_main.c @@ -4887,9 +4887,15 @@ static int ice_set_mac_address(struct net_device *netdev, void *pi) goto err_update_filters; } - /* Add filter for new MAC. If filter exists, just return success */ + /* Add filter for new MAC. If filter exists, return success */ status = ice_fltr_add_mac(vsi, mac, ICE_FWD_TO_VSI); if (status == ICE_ERR_ALREADY_EXISTS) { + /* Although this MAC filter is already present in hardware it's + * possible in some cases (e.g. bonding) that dev_addr was + * modified outside of the driver and needs to be restored back + * to this value. + */ + memcpy(netdev->dev_addr, mac, netdev->addr_len); netdev_dbg(netdev, "filter for MAC %pM already exists\n", mac); return 0; } -- 2.27.0