Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2122552rdb; Sun, 3 Dec 2023 03:42:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IFTT+ACBRkXBAIbksQDIGtHc+cEp6VHxKquo/PUaLU3elfVfKLYrKwnH4Vsw7sCVz7Tzsn6 X-Received: by 2002:a05:6e02:f90:b0:35d:4c42:d463 with SMTP id v16-20020a056e020f9000b0035d4c42d463mr3202265ilo.29.1701603748479; Sun, 03 Dec 2023 03:42:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701603748; cv=none; d=google.com; s=arc-20160816; b=m/xPjutACDY+JSzpLFTRDn+F3CwYBuIe+6XNhmyIknuCye5ekHqzOwnHuF2uqvImaW oJWwrxHSGnKh6O5pXpU9037Fk2iO5Fl3NrhokXjWVgR1lX4UnZ40oJFi0kZVxOzyoG84 DbZd0/sbrSX3MzVJllx8kySLJra000nmI4eqgB1FFuk0fY9wIE24nuFNbAsKAFPUouwh wYQVxtQaA6K64t1pqq002jjrYFB+IYxmcHuW/tXTQ2NyU91223O23vfGdGWvQmmJXa09 H1x8GWEr/CHTxe1O7dsHPAl8HpSr1pxBZ5ZJrE37gt9RdpkLozU35qgNNsAXEd91hycA 2rsg== 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=G9/bHdLR/rxDerE557E446iMZf9PegbWgmxq2Wji+54=; fh=IAPFg3fxb4VHAlUfZn03k+44DA/lwAi5wTkOgalqACY=; b=Xahcdbc7NNnN+6+gHl5d0tEkfWFEiSBUQK512Qm//lYEfJHkxqN+ChAmkvQ8dZ4vuA XyQ+EpydnyxskQyBSLqvg5w+Wrttaw62gI8fxRFm9SzugSCbJKsyxuaQLzH504xn8JeH G/ZgiPCMrktO3EH9D6W1ugPmvLQgUhtbFmuWhdWD0COxtv2/SDu7kU0RcOaG+QKHOytD BqspiOP9n5fnvoqy+uXbxeEf/EDcRuEu6t336JxKE14OVecp9ShG62V5FpzqYJp8r9D7 DtzLmavWTNkqmasC+GGEKa4L6EiIp1f77+bi2w0I+w5n+P5EFuIPKPplQcodzQ7NPbDR y9/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=d5lqdJZb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id o12-20020a170902778c00b001cf6aac6b5fsi5932494pll.559.2023.12.03.03.42.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Dec 2023 03:42:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=d5lqdJZb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id CCEAD8095019; Sun, 3 Dec 2023 03:42:26 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233390AbjLCLlk (ORCPT + 99 others); Sun, 3 Dec 2023 06:41:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbjLCLlj (ORCPT ); Sun, 3 Dec 2023 06:41:39 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE53FCB for ; Sun, 3 Dec 2023 03:41:45 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CFCE4C433C7; Sun, 3 Dec 2023 11:41:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701603705; bh=XccCxYSOFM8R5fg3IGTtouCQNjtf99QVUi/l5Jh6WSs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=d5lqdJZb4hhVJH0PsnHgitXGQdQJd18XdAvgVByoC9p5AJgHF+enWKjlVh7y2uU7v AZXqOa+wQmtIao804WE0taU2rYoHHTZTjja4tetQYA71XEmxqCb96pMVHI2w5YlsNE R9GPDbmcKEmBQ+MPI946qqEUgHLIQZATzAEHXSG25rsoC2oVbEMIQkJumvxFwGS/H9 0N85iI1IRVLc/PbOjbgjKpxGOLOrNrUao4yBRFa8TS2bhDi3wIiWCTUjkvOGbo+6nv CxAPvFYqTwSawtGbs4sajQ4G8a3NpuQqAZm2y/8UARFhFumNyG28rHNPpGJc+TvxJH /5qSMmhNR+68Q== Date: Sun, 3 Dec 2023 11:41:39 +0000 From: Simon Horman To: Ivan Vecera Cc: intel-wired-lan@lists.osuosl.org, Jesse Brandeburg , Tony Nguyen , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-kernel@vger.kernel.org, Jacob Keller , Wojciech Drewek , mschmidt@redhat.com, netdev@vger.kernel.org Subject: Re: [PATCH v5 2/5] i40e: Introduce and use macros for iterating VSIs and VEBs Message-ID: <20231203114139.GG50400@kernel.org> References: <20231124150343.81520-1-ivecera@redhat.com> <20231124150343.81520-3-ivecera@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231124150343.81520-3-ivecera@redhat.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sun, 03 Dec 2023 03:42:26 -0800 (PST) On Fri, Nov 24, 2023 at 04:03:40PM +0100, Ivan Vecera wrote: > Introduce i40e_for_each_vsi() and i40e_for_each_veb() helper > macros and use them to iterate relevant arrays. > > Replace pattern: > for (i = 0; i < pf->num_alloc_vsi; i++) > by: > i40e_for_each_vsi(pf, i, vsi) > > and pattern: > for (i = 0; i < I40E_MAX_VEB; i++) > by > i40e_for_each_veb(pf, i, veb) > > These macros also check if array item pf->vsi[i] or pf->veb[i] > are not NULL and skip such items so we can remove redundant > checks from loop bodies. > > Reviewed-by: Wojciech Drewek > Signed-off-by: Ivan Vecera Reviewed-by: Simon Horman