Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1335022imm; Thu, 23 Aug 2018 01:01:39 -0700 (PDT) X-Google-Smtp-Source: AA+uWPwdfGferv8k2Iyu577y3Mg9sRIl/Ash+F0ATVTpLfLKGrPUDUTD+wHNzSgF9RZ9nbO8YHgy X-Received: by 2002:a62:5ec3:: with SMTP id s186-v6mr56314162pfb.146.1535011299344; Thu, 23 Aug 2018 01:01:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535011299; cv=none; d=google.com; s=arc-20160816; b=P0WHEp7BeEdhCx6S2iZs3hYcsQM6UTcrN8htWIkX5bVgYS36KJ0uK6YqDh0dQ9lUmY H2TzuheQincc9sZST3uDg3ZjXHkQphVKX/bTvoPYmpTh+qluJ0RsorICOTQoJAWd54dh vVV9OASb8EfUPRrq/nAsflt8qoxGEmRxbRm4vn2dSlq5Onj7174ciR9ZcJmZgohZrMnC DhAgAxxY98DTBTsfaqbFKngsWszmxLz6ljX5zMhmov+VaxAjCg3VQk+DXhdttPW94Dob 0Vg7ihCGrVvHQniaURsDHZdT49qrMCRUMTqqh/2drxWAsqus6QdfAZlvqN04QWhDeFeo jdTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=szVdOFXrQUdc1BNPYzBEopWUKVRwUkMzMzCFMdOcmcA=; b=GA5JV+sbDC2lOzrwdQgER0dGRSYn4ntp2WVUTNefJTw6F/OEIct25oUAtETkHRfNq3 brcqEPPH5dc0Ccw0LorKKeQM1K0SMpJ9i/l0+StrHxxGOTrbHigWLsrAbQlTGKAyjsRq rw1VsLB6gPLJNExyWSVcd/fD/d4Ql2HmomcyxdJFVyKeNyS4jqioIJI0A6CMDvowSHSD cy7rz5J9dQDVxLtI2Ev4Yqz057iCGYw7NDkOog7r9sZ/yjWk3lisQsBdVBkWY58D/hrb lBgyirgCkXk2czP98YIbzfMo1UxMPYUjeEs5wUb1/cLtGENAs/oz4TudpS86a6HQiO6j gi/w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p19-v6si3894777pgm.109.2018.08.23.01.01.24; Thu, 23 Aug 2018 01:01:39 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728512AbeHWL2A (ORCPT + 99 others); Thu, 23 Aug 2018 07:28:00 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:42050 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726836AbeHWL17 (ORCPT ); Thu, 23 Aug 2018 07:27:59 -0400 Received: from localhost (5355525A.cm-6-6b.dynamic.ziggo.nl [83.85.82.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id D0B489D2; Thu, 23 Aug 2018 07:59:35 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alexander Duyck , Shannon Nelson , Andrew Bowers , Jeff Kirsher , Sasha Levin Subject: [PATCH 4.4 55/79] ixgbe: Be more careful when modifying MAC filters Date: Thu, 23 Aug 2018 09:53:31 +0200 Message-Id: <20180823074922.739954065@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180823074918.641878835@linuxfoundation.org> References: <20180823074918.641878835@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Alexander Duyck [ Upstream commit d14c780c11fbc10f66c43e7b64eefe87ca442bd3 ] This change makes it so that we are much more explicit about the ordering of updates to the receive address register (RAR) table. Prior to this patch I believe we may have been updating the table while entries were still active, or possibly allowing for reordering of things since we weren't explicitly flushing writes to either the lower or upper portion of the register prior to accessing the other half. Signed-off-by: Alexander Duyck Reviewed-by: Shannon Nelson Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/intel/ixgbe/ixgbe_common.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c @@ -1814,7 +1814,12 @@ s32 ixgbe_set_rar_generic(struct ixgbe_h if (enable_addr != 0) rar_high |= IXGBE_RAH_AV; + /* Record lower 32 bits of MAC address and then make + * sure that write is flushed to hardware before writing + * the upper 16 bits and setting the valid bit. + */ IXGBE_WRITE_REG(hw, IXGBE_RAL(index), rar_low); + IXGBE_WRITE_FLUSH(hw); IXGBE_WRITE_REG(hw, IXGBE_RAH(index), rar_high); return 0; @@ -1846,8 +1851,13 @@ s32 ixgbe_clear_rar_generic(struct ixgbe rar_high = IXGBE_READ_REG(hw, IXGBE_RAH(index)); rar_high &= ~(0x0000FFFF | IXGBE_RAH_AV); - IXGBE_WRITE_REG(hw, IXGBE_RAL(index), 0); + /* Clear the address valid bit and upper 16 bits of the address + * before clearing the lower bits. This way we aren't updating + * a live filter. + */ IXGBE_WRITE_REG(hw, IXGBE_RAH(index), rar_high); + IXGBE_WRITE_FLUSH(hw); + IXGBE_WRITE_REG(hw, IXGBE_RAL(index), 0); /* clear VMDq pool/queue selection for this RAR */ hw->mac.ops.clear_vmdq(hw, index, IXGBE_CLEAR_VMDQ_ALL);