Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp3937909rwe; Mon, 17 Apr 2023 05:58:56 -0700 (PDT) X-Google-Smtp-Source: AKy350ZDJ73G49VFpNjlklRwmiu0BnXWixAyGKAN4rsFPiZN5lWEZYaUEAZCheuIVQi1b/W2TvYU X-Received: by 2002:a05:6a00:ccc:b0:634:c780:5bb8 with SMTP id b12-20020a056a000ccc00b00634c7805bb8mr22800248pfv.17.1681736336459; Mon, 17 Apr 2023 05:58:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681736336; cv=none; d=google.com; s=arc-20160816; b=0Bt0PZ1MSb9P+CKJoG2Kh/wG0sQSCbalh5EYbo4X3nbVH1l2kgpJetRbrUYQB3eSXU nm6V2jDebkO6b/crtC7g6mdCOWVbNZSyq+E5e5Q7yIBu7PktC1O58U91RfPCM4o5gIva 7d5xKW0BoaR8EglinDgRL3sWUoeJWh5574zff+hxCBb85T8o2b62U5+14MP4XRYewJRu JVivG7jDM6lEwCBY+gmndTT5zgYvq8wYm3Axm03dDkmkhd4dvmMeBRqMZYcaf0LFpUg4 GG3GtQ8Jzk2GAfSZm/OOnHf9QYvcwrm/86pvDP8c0yaG5i8xLF/fRCYvhtBq0cS5oZQt kqKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=c04Z4NXpAIeTEwDDTm4BcfYvupzlt3zgjEjnDctDkEI=; b=o9/SFO/AjrcoJms+nvM0M7Fat6aL2ZARl5Oz4r6CqeZevILdYd8XPz6wU2cpj0fZAY dPuESPd5+LJZzBWRn/u6v9aCS82Sx5k7WOQT9d6muWc7u3uMSP5IAh3/6/BeNTVb3jYZ e8xjLrUCjVd/PDg/52wMyK/v1hLbRJpKgFiS1B1494lnknW2AsWNe/otGmhCp/P3hawC +viGnQXBCmj70bDDgYtSIBfIg9e2VXkbWYvKwrnWq0w2PLzXueb26PikJJwJz4MUadwf QKUAUOTHFTHJc2HY1+smazSW/DMEUcg6Tj9byvpTzipJLP3F04C0BR0TREM62A57uEsJ 7qRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b="U/kjTj9R"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 62-20020a630441000000b0051453dfd139si12161228pge.613.2023.04.17.05.58.44; Mon, 17 Apr 2023 05:58:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b="U/kjTj9R"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S230401AbjDQM5c (ORCPT + 99 others); Mon, 17 Apr 2023 08:57:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231307AbjDQM5T (ORCPT ); Mon, 17 Apr 2023 08:57:19 -0400 Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [IPv6:2607:f8b0:4864:20::82b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE21493F2; Mon, 17 Apr 2023 05:57:02 -0700 (PDT) Received: by mail-qt1-x82b.google.com with SMTP id ej15so13072277qtb.7; Mon, 17 Apr 2023 05:57:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681736221; x=1684328221; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=c04Z4NXpAIeTEwDDTm4BcfYvupzlt3zgjEjnDctDkEI=; b=U/kjTj9RQcayRHKQxDi3hI56i5xGma0SrEZQuYKgmPEfDko7jLKYHxPhqvWjTwbGqp kAE6I7v/rjIsLgkKb8zC8YijTfD3js2dP1uJe20P3U8bM6BdkjxMpf0UGHcfk/635MPw noHFOIy4OjKRxQEYIaExjZK1WcGK1b+H8nDuA/9/7I5eCHzgtw23D9hYUW7baKyKucrn X+xhuXXHi83rz3UfgcGiO3cvokAlZ3uWwUizKHgGC0gOlO2W8WniWZwrEktrPzpJLJD4 OJX51vZYizilG5qPupZrIOVOxnQed2rdTCMUG6VqsS4BiaKh2yR9PqRtaf0uoXWtGUE6 hrbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681736221; x=1684328221; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=c04Z4NXpAIeTEwDDTm4BcfYvupzlt3zgjEjnDctDkEI=; b=e/TH/aOuU+Ve+ZWQfGphiEm+nWBGmFBMpvI8w41cClQXggRnhZQU4PFd2SRozT5cXb caqbTG9UTnUoYx+K6m9rUmDtaU4c5SBpNL5j/rvNogNi6v+67aCefs88Tx/wRS+N/3Z+ kYWPYliWCrcdbWkR+qz/EqRCGE51b8S4JSCD+HG6PO4gHp2f179BAAcOldWvreWnIsGp 0Y+PSvz+dBsD6k1AGYB/ricLBi5Auu01jDdKpKIirjv2CkjwavADQO4UQMKylWqcfPDe Cl51JWG0zvEtElLUccMY74kCSToyAxBjPIeAHHwl3UMXt3m5V2hdciGKG4cNI8ct1FM1 xBXg== X-Gm-Message-State: AAQBX9cMqgfI1qMVwmqwXy1+e+aIxJ/1zUvZeJGaBIvJAdpRiIu0aJhG m49cdMnmMszTMDTwyIXMpSQ= X-Received: by 2002:a05:622a:1b9f:b0:3e4:e4c7:586a with SMTP id bp31-20020a05622a1b9f00b003e4e4c7586amr23504210qtb.4.1681736221478; Mon, 17 Apr 2023 05:57:01 -0700 (PDT) Received: from [192.168.1.105] (ip72-194-116-95.oc.oc.cox.net. [72.194.116.95]) by smtp.gmail.com with ESMTPSA id d6-20020ac80606000000b003b635a5d56csm3286265qth.30.2023.04.17.05.56.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 17 Apr 2023 05:57:01 -0700 (PDT) Message-ID: Date: Mon, 17 Apr 2023 05:56:58 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH net-next 2/7] net: mscc: ocelot: remove struct ocelot_mm_state :: lock Content-Language: en-US To: Vladimir Oltean , netdev@vger.kernel.org Cc: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Claudiu Manoil , Alexandre Belloni , UNGLinuxDriver@microchip.com, Xiaoliang Yang , linux-kernel@vger.kernel.org References: <20230415170551.3939607-1-vladimir.oltean@nxp.com> <20230415170551.3939607-3-vladimir.oltean@nxp.com> From: Florian Fainelli In-Reply-To: <20230415170551.3939607-3-vladimir.oltean@nxp.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/15/2023 10:05 AM, Vladimir Oltean wrote: > Unfortunately, the workarounds for the hardware bugs make it pointless > to keep fine-grained locking for the MAC Merge state of each port. > > Our vsc9959_cut_through_fwd() implementation requires > ocelot->fwd_domain_lock to be held, in order to serialize with changes > to the bridging domains and to port speed changes (which affect which > ports can be cut-through). Simultaneously, the traffic classes which can > be cut-through cannot be preemptible at the same time, and this will > depend on the MAC Merge layer state (which changes from threaded > interrupt context). > > Since vsc9959_cut_through_fwd() would have to hold the mm->lock of all > ports for a correct and race-free implementation with respect to > ocelot_mm_irq(), in practice it means that any time a port's mm->lock is > held, it would potentially block holders of ocelot->fwd_domain_lock. > > In the interest of simple locking rules, make all MAC Merge layer state > changes (and preemptible traffic class changes) be serialized by the > ocelot->fwd_domain_lock. > > Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli -- Florian