From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B62B31EEE6; Wed, 25 Jun 2025 00:45:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750812326; cv=none; b=CMDEU75tlnPHPAN7JhIbrod1JM4OpjNSiPdKKdrTHM4sU9Q57fXfeaEUGId1T426BLvr7YXohzWvisiS6xVRNkZ9KEoqaPzFm2SKstztsiN29/ExKja+aDx9N3Dy4IxqBU88Ydsf8xELlmouyCRBqlqIirCgPCldY7nSdeiWDRQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750812326; c=relaxed/simple; bh=eRlCeZDC/evhY2Cx5J9+VqYhSZFBFgu/rZvpddXONDI=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=rlZV4hO0348Dis1ojueXhCqvg2ZXTvkaHsNfPbe70FN3QFL5TF2YPp0oz3OI9WjIbt2sYF2B8WLASAAzWnVFBH4lGjxKFBLEdHFZMwB5Uvle53cS6Azlu0lLY4hrCMCQBr68ruT21h0mcznr57LoOOqkAxisQR7XykA1ab+a07k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=uaZ5hUDh; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="uaZ5hUDh" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7A736C4CEE3; Wed, 25 Jun 2025 00:45:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1750812326; bh=eRlCeZDC/evhY2Cx5J9+VqYhSZFBFgu/rZvpddXONDI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=uaZ5hUDh9nDsLPEBof49fExd7ukHQip1e0CJ2NXNFmJub91Pz54F5jSEnfOxskRgJ cFTA7+as3bmOWQWL45D9YlQClS1wQ61w5ta67g8jlKXOgR8b76KqN9WFrJmU0Lx2XG 7V1+KVRJXsE7PUTWMNn2GXl92Ln6XAVk/HebbGP2lR+XXVEz6XwosQH3hn1bIiEaO/ SHtixl2/mu0gGNY8mZu4oLUFeTwbiF9ddoWnVe6FVD6nb0OFyg9Q+f6CmkIHvWBPob xP3XbsGHEKwo9GyytkzkGzmDZCC+Js9HsaA/9fxFxPCft8CRCQ7BskPFeyXK2Q0RI2 Vz00B0274N6HA== Date: Tue, 24 Jun 2025 17:45:24 -0700 From: Jakub Kicinski To: Yevgeny Kliteynik Cc: Simon Horman , Mark Bloch , "David S. Miller" , Paolo Abeni , Eric Dumazet , Andrew Lunn , saeedm@nvidia.com, gal@nvidia.com, leonro@nvidia.com, tariqt@nvidia.com, Leon Romanovsky , netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, moshe@nvidia.com, Vlad Dogaru Subject: Re: [PATCH net-next v2 3/8] net/mlx5: HWS, Refactor and export rule skip logic Message-ID: <20250624174524.62bc82e6@kernel.org> In-Reply-To: References: <20250622172226.4174-1-mbloch@nvidia.com> <20250622172226.4174-4-mbloch@nvidia.com> <20250624183832.GF1562@horms.kernel.org> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 25 Jun 2025 03:35:52 +0300 Yevgeny Kliteynik wrote: > >> The bwc layer will use `mlx5hws_rule_skip` to keep track of numbers of > >> RX and TX rules individually, so export this function for future usage. > >> > >> While we're in there, reduce nesting by adding a couple of early return > >> statements. > > > > I'm all for reducing nesting. But this patch has two distinct changes. > > Please consider splitting it into two patches. > > Not sure I'd send the refactor thing alone - it isn't worth the effort > IMHO... But since I'm already in here - sure, will sent it in a separate > patch. FWIW having a function which returns void but with 2 output parameters is in itself a bit awkward. I'd personally return a 2 bit bitmask of which mode is enabled. But there's no accounting for taste.