Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1199584pxb; Wed, 10 Feb 2021 02:36:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJywtrn5+c9STx8vyjHj6q7LCKFYQrBPcJd4C8K9HtTYr8wjanDdGHeUZ72qhG78f9KjAPUH X-Received: by 2002:aa7:ce13:: with SMTP id d19mr2580090edv.208.1612953399112; Wed, 10 Feb 2021 02:36:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612953399; cv=none; d=google.com; s=arc-20160816; b=Dh4UB095scTVg6mAxgZ4EljGRkGmhDsUxfF0mtILT0Amznl+uEMPi4ZIX910cYd9ST rPcd3a+tqV6qTzLZktBqpK9HtWT3UqAnpt07XMZhcP53XF3s27X9oDLCa9SSKlIZgJK4 nSSvElqqKpguBKj0ruA5j6oGGTKHmOeOV5wr6kqwAy2T5b+VTml975kuPSo5+uWZ/7Nc EyxKLYaMaAya508J0WWO/GeXCrgKGP6jXgiH64CUPbOzbbzdiQc0rHorX8+61XlBpTnx QYL6PZxzPPJnLN6eI+/RUBwbGRw1mYh91bSGnNLR42cIcCC2iqQaGM/Cu8EFaB4gPYWQ 2wrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=QQ6ibbCKatXHbmogp1EYUWCfgYRqjn+iKPBMKIlVQ9Y=; b=KoH7XXwflFY2Yo1c/97hjEFjJlynkeIJmdAK+5g2CKaIAKeUNqmcfSaa6/yAHeCbLR AREUWd32nsm4PZffGvDxojKvUqucClBUs+UMDHciBxRgTtr+966VvqcWXVgy4v9scp0V Wcaoiugy/C+P1WDKMXCMdTjcMp8gHYi2BL6751q1/x+9sq0Qz0a183p4A6a9KFYngD4I pM4Nn7adUSqcZO4cUDKtkGFVkm8dRKdvdfJTkSVDtUQNN4ydvDyx6XfEVyWXjNuiKvWc FZdjXTGhyuDKTn1IQ7ngL63TQNyfRaeXaE3PrIDEfHDGlAWHAN5o53E2DLMCGVbQi4fN 3nxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OkJLE9Z6; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dn4si1203545ejc.686.2021.02.10.02.36.15; Wed, 10 Feb 2021 02:36:39 -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=@gmail.com header.s=20161025 header.b=OkJLE9Z6; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229982AbhBJKf2 (ORCPT + 99 others); Wed, 10 Feb 2021 05:35:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230382AbhBJKYL (ORCPT ); Wed, 10 Feb 2021 05:24:11 -0500 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5AE41C061756; Wed, 10 Feb 2021 02:23:31 -0800 (PST) Received: by mail-ej1-x631.google.com with SMTP id hs11so3179062ejc.1; Wed, 10 Feb 2021 02:23:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=QQ6ibbCKatXHbmogp1EYUWCfgYRqjn+iKPBMKIlVQ9Y=; b=OkJLE9Z6va0hGpYeZtIu0b6Wy37PWF448S8/SjiY1YwifTyTSCGyrf8vP3VuzJhXd1 BKN95vIGZ0/+gbavKal1KBQKQdB3ZaRKur+vj8sqClkSST3DEdCtAtwirYgQUdQ58+Dc pthI/LlvvBEWvwPtcsKOLF8FPsPT1Kr0SBfl3uQZEqjdnKGZqenIo5nneu+75/k9NCZ8 gGQAESEpycLRXJpav6xndQBQlyVKQ1TuBqZI3SBkRN5q2teM1/dNOJXeqK4FUh7avo26 6FKcCdariok/z2pdUMdr2L4ysXMcBTnVzieWTdRKyENiEY7tgAhbEbwibXo5bTffHb+8 zLDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=QQ6ibbCKatXHbmogp1EYUWCfgYRqjn+iKPBMKIlVQ9Y=; b=duOKHEFXgoBdnRdqHHJYiST76HgzwpHuPNU3wg8mxcFLGE54pByiDxBzA2PhXh2fHO mhIPYgWm1cC/ee30ilAMxxYFiWiyr2kl4AeYisardEQ2yvq6JFpUe1e6IM8172wiHYYe jDq/fawOd4gKGzLZqvC00wBH6s+OlBz4PCP/7C/hQFqB3daMtp9E5kGP9wnUAqWOeugN CqOHw8LyFTMakQMJZ1UeBf2euYdatT2D7B3S/ivNJ1cVNxwq23Gnu3fl6EPKinrrtKLW OOGT0GU5/NYfjPbCO/ivRUoegwdU+S/vWncrxE2F7DGyEZnuZGHfhMyii2y9ZsIGA0j8 aRDQ== X-Gm-Message-State: AOAM532UPYbr4tY3KXc2NYLDHB0PAmV9ZSfPpxu9k9HX8mdBMJz7VkAJ hOus+myLPBSr78oABYPB0nQ= X-Received: by 2002:a17:906:ecb6:: with SMTP id qh22mr2311964ejb.252.1612952610145; Wed, 10 Feb 2021 02:23:30 -0800 (PST) Received: from skbuf (5-12-227-87.residential.rdsnet.ro. [5.12.227.87]) by smtp.gmail.com with ESMTPSA id q16sm801100ejd.39.2021.02.10.02.23.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Feb 2021 02:23:29 -0800 (PST) Date: Wed, 10 Feb 2021 12:23:28 +0200 From: Vladimir Oltean To: Ido Schimmel Cc: Jakub Kicinski , "David S. Miller" , Andrew Lunn , Vivien Didelot , Florian Fainelli , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bridge@lists.linux-foundation.org, Roopa Prabhu , Nikolay Aleksandrov , Jiri Pirko , Claudiu Manoil , Alexandre Belloni , UNGLinuxDriver@microchip.com, Vadym Kochan , Taras Chornyi , Grygorii Strashko , Ioana Ciornei , Ivan Vecera , linux-omap@vger.kernel.org Subject: Re: [PATCH v3 net-next 07/11] net: prep switchdev drivers for concurrent SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS Message-ID: <20210210102328.7jpzlobpwotdo63z@skbuf> References: <20210210091445.741269-1-olteanv@gmail.com> <20210210091445.741269-8-olteanv@gmail.com> <20210210101257.GA287766@shredder.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210210101257.GA287766@shredder.lan> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 10, 2021 at 12:12:57PM +0200, Ido Schimmel wrote: > On Wed, Feb 10, 2021 at 11:14:41AM +0200, Vladimir Oltean wrote: > > From: Vladimir Oltean > > > > Because the bridge will start offloading SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS > > while not serialized by any lock such as the br->lock spinlock, existing > > drivers that treat that attribute and cache the brport flags might no > > longer work correctly. > > Can you explain the race? This notification is sent from sysfs/netlink > call path, both of which take rtnl. Replying here to both you and Nikolay: there isn't any race, sorry, I missed the fact that brport_store takes the rtnl_mutex and by extension I thought that RTM_SETLINK runs unlocked too, without really checking. Well, at least that's good news, the implementation can be a lot more straightforward then...