Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp14174lqp; Fri, 12 Apr 2024 09:13:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX1V4Lqc6xp3W/fFuZdvPfjy5xglJY37FxWs2NAAhR9h6PCedd85KJitmixtR0hiYfus3mt/aalJvgayDmghp8ORip7p6rcSxapWKJlAg== X-Google-Smtp-Source: AGHT+IECnU7zaT3g5UFqveGMrKSH7VPmkgxtO0cRvfNLIKXiyFzXDTfxtYBg2Z8wNj7fPzJZjhPw X-Received: by 2002:a19:6b19:0:b0:518:95b6:176f with SMTP id d25-20020a196b19000000b0051895b6176fmr818808lfa.50.1712938431675; Fri, 12 Apr 2024 09:13:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712938431; cv=pass; d=google.com; s=arc-20160816; b=rmYwR9ao+3BmBkOI4eoEYaCUgKEM2GqxBP66mP7Q+wKDtXlOPm6eNVvJ1fs+p0JqO0 sDUSBAIlF5PArmr9c2njVfTBLaapHVb64npr8MKBGUQ995DiE7uPjUh8fTGrZs0Lvs0r Bm4953YmMyb2H6II7A3UG0kenAJG+HUrOc7wL0N1i5OjUIufwvn3zu3s2kiRvU9WVQy3 IkbCakkJ9XLe/VMSOnH2s5ofFl8mg62kLSTURVX5l1J5Mx2BjBa7rLKjkU1zHUeNL7uE iTgAtIk+jfJXe0/dpOVv9SfZYP0hCBemKxqwuSbWdK5MF8tdNE8rNOyOovg3+yOjxWiU QfYQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=NO4K8oivl8yvW8anJN2ScIIZI0rK3nARUGCENITQq2I=; fh=16RTrL4O4dV4wsANasVwHAMOabshasPr7EDWXC+LxOs=; b=XnpZkIazjITFI9XcxPQHFBdI+bOpduxVlZD4jiPT9zXR1HCn3SyjJc8qM2YTk9Hj5m TAxaJR/jiB2jKNzoo3iPMOtc24ioEpwZ2hkIORILJEkBIgia218CBse4aBPoB3rIKA+Y BV3BjSooCJ71eOJ6BzGFX7r3w588jj6wA8yM3OzSiTseJ91IeH+Hw2+xx3gSqoKxfzsX InGEBRqubH8uI5GJLbHsELn5JiB8YdpnsmrB87HfaUP/LU20gOe/e0xElaIMEyWIM/uM S00RNImlvbcqPTHCqJp06Jwqxxsoza5LRsUxXQEYFRaS3oyyVbn6lnO0C9OiE5QE+bYR nfnw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-143028-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-143028-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id c4-20020a50d644000000b00568d7c22d4asi1883022edj.277.2024.04.12.09.13.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 09:13:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-143028-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-143028-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-143028-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 2588A1F2218E for ; Fri, 12 Apr 2024 16:13:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C33B5148313; Fri, 12 Apr 2024 16:13:31 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C0A7D1487E4 for ; Fri, 12 Apr 2024 16:13:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712938411; cv=none; b=GTj2Adcbv0L/uEPZ+d0bjVNqE5k5HoGqIR/Kvvg5xrZ7hXDCGquC8pSmXTQDUKCN2ZTxCoiV5eLznOQmikEAn+e/j0byDjlnXRVkZIybB5wzMQqp+NSWWf2wKijG+oLopWTsTwMMg7Xf3Lzu/EEXbHTAIyfe+A1JZe+Y26gsLOs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712938411; c=relaxed/simple; bh=Q4V6Zn9TStSChaSxBLObNVv7hgA1ULUGeyWgeYmigkY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=rtCbdldEl3II2Zp8m+4HzE3t3LpViZlZEeZtM3ISQYV66n9WP7tFQOoj6O1a4kiLZRcUCcu2IHHwDUDFNAZsXM7gLuohgdQbWyfa5sF5vR7QtsiIE/wWXUw/zIGhrmZy9ePIDfmI+J8Z4oafAxwZU7td4D96b8f/6FrRcHO1ofo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 255B0339; Fri, 12 Apr 2024 09:13:58 -0700 (PDT) Received: from e133380.arm.com (e133380.arm.com [10.1.197.52]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 340723F64C; Fri, 12 Apr 2024 09:13:26 -0700 (PDT) Date: Fri, 12 Apr 2024 17:13:23 +0100 From: Dave Martin To: David Hildenbrand Cc: James Morse , x86@kernel.org, linux-kernel@vger.kernel.org, Fenghua Yu , Reinette Chatre , Thomas Gleixner , Ingo Molnar , Borislav Petkov , H Peter Anvin , Babu Moger , shameerali.kolothum.thodi@huawei.com, D Scott Phillips OS , carl@os.amperecomputing.com, lcherian@marvell.com, bobo.shaobowang@huawei.com, tan.shaopeng@fujitsu.com, baolin.wang@linux.alibaba.com, Jamie Iles , Xin Hao , peternewman@google.com, dfustini@baylibre.com, amitsinght@marvell.com, Rex Nie Subject: Re: [PATCH v1 03/31] x86/resctrl: Move ctrlval string parsing policy away from the arch code Message-ID: References: <20240321165106.31602-1-james.morse@arm.com> <20240321165106.31602-4-james.morse@arm.com> <1776b49b-3c0e-41a7-bbc5-19310c428429@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1776b49b-3c0e-41a7-bbc5-19310c428429@redhat.com> Hi, On Tue, Apr 09, 2024 at 05:13:01PM +0200, David Hildenbrand wrote: [...] > > @@ -195,6 +204,14 @@ int parse_cbm(struct rdt_parse_data *data, struct resctrl_schema *s, > > return 0; > > } > > +static ctrlval_parser_t *get_parser(struct rdt_resource *res) > > +{ > > + if (res->fflags & RFTYPE_RES_CACHE) > > + return &parse_cbm; > > + else > > + return &parse_bw; > > +} > > Besides what Reinette said, I'd have added here something that would fire in > case someone adds something unexpected in the future, like > > WARN_ON_ONCE(!(res->fflags & (RFTYPE_RES_CACHE|RFTYPE_RES_MB)); > > At the beginning of the function. > > > Apart from that, nothing jumped at me. > > -- > Cheers, > > David / dhildenb > Thanks for that -- I guess that would benefit from discussion; please see my reply to Reinette on this patch. Cheers ---Dave