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=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS 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 E6E0EC47247 for ; Fri, 1 May 2020 00:46:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C4BA22073E for ; Fri, 1 May 2020 00:46:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727833AbgEAAqb (ORCPT ); Thu, 30 Apr 2020 20:46:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726384AbgEAAqb (ORCPT ); Thu, 30 Apr 2020 20:46:31 -0400 Received: from shards.monkeyblade.net (shards.monkeyblade.net [IPv6:2620:137:e000::1:9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4ED0C035494 for ; Thu, 30 Apr 2020 17:46:31 -0700 (PDT) Received: from localhost (unknown [IPv6:2601:601:9f00:477::3d5]) (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 B158B120ED55C; Thu, 30 Apr 2020 17:46:30 -0700 (PDT) Date: Thu, 30 Apr 2020 17:46:29 -0700 (PDT) Message-Id: <20200430.174629.548555772744348705.davem@davemloft.net> To: idosch@idosch.org Cc: netdev@vger.kernel.org, bridge@lists.linux-foundation.org, kuba@kernel.org, nikolay@cumulusnetworks.com, roopa@cumulusnetworks.com, s.priebe@profihost.ag, mlxsw@mellanox.com, idosch@mellanox.com Subject: Re: [PATCH net] net: bridge: vlan: Add a schedule point during VLAN processing From: David Miller In-Reply-To: <20200430193845.4087868-1-idosch@idosch.org> References: <20200430193845.4087868-1-idosch@idosch.org> X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Thu, 30 Apr 2020 17:46:31 -0700 (PDT) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Ido Schimmel Date: Thu, 30 Apr 2020 22:38:45 +0300 > From: Ido Schimmel > > User space can request to delete a range of VLANs from a bridge slave in > one netlink request. For each deleted VLAN the FDB needs to be traversed > in order to flush all the affected entries. > > If a large range of VLANs is deleted and the number of FDB entries is > large or the FDB lock is contented, it is possible for the kernel to > loop through the deleted VLANs for a long time. In case preemption is > disabled, this can result in a soft lockup. > > Fix this by adding a schedule point after each VLAN is deleted to yield > the CPU, if needed. This is safe because the VLANs are traversed in > process context. > > Fixes: bdced7ef7838 ("bridge: support for multiple vlans and vlan ranges in setlink and dellink requests") > Signed-off-by: Ido Schimmel > Reported-by: Stefan Priebe - Profihost AG > Tested-by: Stefan Priebe - Profihost AG Applied and queued up for -stable. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Thu, 30 Apr 2020 17:46:29 -0700 (PDT) Message-Id: <20200430.174629.548555772744348705.davem@davemloft.net> From: David Miller In-Reply-To: <20200430193845.4087868-1-idosch@idosch.org> References: <20200430193845.4087868-1-idosch@idosch.org> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: [Bridge] [PATCH net] net: bridge: vlan: Add a schedule point during VLAN processing List-Id: Linux Ethernet Bridging List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: idosch@idosch.org Cc: mlxsw@mellanox.com, s.priebe@profihost.ag, nikolay@cumulusnetworks.com, netdev@vger.kernel.org, roopa@cumulusnetworks.com, bridge@lists.linux-foundation.org, idosch@mellanox.com, kuba@kernel.org From: Ido Schimmel Date: Thu, 30 Apr 2020 22:38:45 +0300 > From: Ido Schimmel > > User space can request to delete a range of VLANs from a bridge slave in > one netlink request. For each deleted VLAN the FDB needs to be traversed > in order to flush all the affected entries. > > If a large range of VLANs is deleted and the number of FDB entries is > large or the FDB lock is contented, it is possible for the kernel to > loop through the deleted VLANs for a long time. In case preemption is > disabled, this can result in a soft lockup. > > Fix this by adding a schedule point after each VLAN is deleted to yield > the CPU, if needed. This is safe because the VLANs are traversed in > process context. > > Fixes: bdced7ef7838 ("bridge: support for multiple vlans and vlan ranges in setlink and dellink requests") > Signed-off-by: Ido Schimmel > Reported-by: Stefan Priebe - Profihost AG > Tested-by: Stefan Priebe - Profihost AG Applied and queued up for -stable.