Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp339919ybl; Fri, 9 Aug 2019 06:49:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqxdNWs+NRjPbu2cPe2YkppeA79UbKhWIF9tl5m1FVDW1KPRcCeKVsVLAGvmcPSSCc31Z8sO X-Received: by 2002:a17:902:e106:: with SMTP id cc6mr798764plb.255.1565358596356; Fri, 09 Aug 2019 06:49:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565358596; cv=none; d=google.com; s=arc-20160816; b=s1srm0bXcIjBZqDU7qgF3098/YMBSfDiMC88yomRmU5vFB5rhcUEEBvo2ZqgoaJr+K qFzc18TsGLgBe60nhy+ZZircsO3elBEGDJs2GtyvzTZQFxqA/dn52Z/icSBz2j9tGlX6 eUh2ZKBjDHYHsvzZOXgkF7wG85WhXFjIJyEiUlno9z84lO2sluvha0ZIy4n6rsDAsxod lgEOrPGq8NiOObdRBkj4oRQP3n0sC/VtDjzsXcvdDDYTBcFLoXS6v8BkN3PUblubKTPS frYeKMMN226SZ8yBnAOlmyjVpcNXRb+syMJCkpS6SFHOjQpxS5kz2sHrzQJFN38tWjoV 78ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=uoA/wN8vqLDGJOW+fOSHcFSk08GccBVTGSf6rIk4vNw=; b=HVLzVEKsDwrDWH3XToSp6s4dX3qyQ4c1FWWkcarbhCpUSnzjkOko+oeERmMNmOZViC 1nekgVu7QynQOWCFx/st1zN6iuEG8YbLtmFiIfq+DysypfV5CGkx1EuyP+qXpo5rDfkU GX2C3Y4QoQo5y3LSfqpbojTbh0mihvvpisY1TBli+JV7xS7TyPZyk1UAaIYP9wJkq14D oZIVtDXiVtkCMdSm+h2YyEaf7ipKuC3gXCp5pQWwR6JEOhTIS7E81yCwxtSiozKR2D9q vXvDfSEw/56ibNIuGYytESvUo9QBZnTcSlUEYaVU78Mde3TSpeMUd2VpSBO+TcNlx1qH tqrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kvdrkSwh; 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 x16si57924084pgi.312.2019.08.09.06.49.39; Fri, 09 Aug 2019 06:49:56 -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=@kernel.org header.s=default header.b=kvdrkSwh; 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 S2407217AbfHINrP (ORCPT + 99 others); Fri, 9 Aug 2019 09:47:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:37018 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2407191AbfHINrG (ORCPT ); Fri, 9 Aug 2019 09:47:06 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E6CD521882; Fri, 9 Aug 2019 13:47:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565358425; bh=GMqdQoXIWjF57ZTZWSOEgTW3aV1UfI7oxWttN+HsNz4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kvdrkSwhp39LVy0K1nmGeFTddUB+oI2xMjABLffstUVav9+wZj/PbvsXCpG+9cpVP n5RCC13qq4rQS4i96dYWqBZTicSiA10UegFbPyOMdZzs8lVJrYnIZPaqdV33mbLUvV wPg90arML8LfuhgjyACrpviXRsWnAxD+aBBRKnR8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Parav Pandit , Leon Romanovsky , Mark Zhang , Saeed Mahameed Subject: [PATCH 4.9 19/32] net/mlx5: Use reversed order when unregister devices Date: Fri, 9 Aug 2019 15:45:22 +0200 Message-Id: <20190809133923.571819099@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190809133922.945349906@linuxfoundation.org> References: <20190809133922.945349906@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mark Zhang [ Upstream commit 08aa5e7da6bce1a1963f63cf32c2e7ad434ad578 ] When lag is active, which is controlled by the bonded mlx5e netdev, mlx5 interface unregestering must happen in the reverse order where rdma is unregistered (unloaded) first, to guarantee all references to the lag context in hardware is removed, then remove mlx5e netdev interface which will cleanup the lag context from hardware. Without this fix during destroy of LAG interface, we observed following errors: * mlx5_cmd_check:752:(pid 12556): DESTROY_LAG(0x843) op_mod(0x0) failed, status bad parameter(0x3), syndrome (0xe4ac33) * mlx5_cmd_check:752:(pid 12556): DESTROY_LAG(0x843) op_mod(0x0) failed, status bad parameter(0x3), syndrome (0xa5aee8). Fixes: a31208b1e11d ("net/mlx5_core: New init and exit flow for mlx5_core") Reviewed-by: Parav Pandit Reviewed-by: Leon Romanovsky Signed-off-by: Mark Zhang Signed-off-by: Saeed Mahameed Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/mellanox/mlx5/core/dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/ethernet/mellanox/mlx5/core/dev.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/dev.c @@ -207,7 +207,7 @@ void mlx5_unregister_device(struct mlx5_ struct mlx5_interface *intf; mutex_lock(&mlx5_intf_mutex); - list_for_each_entry(intf, &intf_list, list) + list_for_each_entry_reverse(intf, &intf_list, list) mlx5_remove_device(intf, priv); list_del(&priv->dev_list); mutex_unlock(&mlx5_intf_mutex);