From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A8EFC43334 for ; Thu, 14 Jul 2022 16:07:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237665AbiGNQHR (ORCPT ); Thu, 14 Jul 2022 12:07:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232483AbiGNQHQ (ORCPT ); Thu, 14 Jul 2022 12:07:16 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4015501A8 for ; Thu, 14 Jul 2022 09:07:15 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7FF4161FD7 for ; Thu, 14 Jul 2022 16:07:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4D1BFC34114; Thu, 14 Jul 2022 16:07:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657814834; bh=EdbRl13BQ02NSiff8+/cyoPQirfa0uAsDedFhODnlpQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=lNnI/U/HNSrl56AWKYVO96OcVmT3WH+hyRNHD4QtRGnuOv9pusHc6c1Pwyf6XZw9x fmMmBsM/WLJFxXLABF+D1h4a90mAbjkdniITGtQnZpEXnchxIR6YlKFB69/LP1ncaD dE8x+/FFw6ULDGNaSGDF9G+IERDbYfLCIA2smDAppVshFp/V0xcotujT1FlRaFoYkg QZhrbmKiigtB2qxg8a5XA/b/xM9WynxEAL/Oi9kNzXhKJHa9QFCMZC5WLckhGJF22P XtXMh35u3vLe6txAOocOjcBoLUKAiv34elGq0i43vwcX0xxsmQA/ZdtRPnT6uCkLhw kx0C/0Rn96FmA== Date: Thu, 14 Jul 2022 09:07:13 -0700 From: Jakub Kicinski To: Jiri Pirko Cc: Jiri Pirko , Dima Chumak , "David S. Miller" , Eric Dumazet , Paolo Abeni , netdev@vger.kernel.org, Simon Horman , Michal Wilczynski Subject: Re: [PATCH net-next 0/5] devlink rate police limiter Message-ID: <20220714090713.3f2353f4@kernel.org> In-Reply-To: References: <20220707131649.7302a997@kernel.org> <20220708110535.63a2b8e9@kernel.org> <20220711102957.0b278c12@kernel.org> <20220712171341.29e2e91c@kernel.org> <20220713105255.4654c4ad@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Thu, 14 Jul 2022 06:55:05 +0200 Jiri Pirko wrote: > Wed, Jul 13, 2022 at 07:52:55PM CEST, kuba@kernel.org wrote: > >On Wed, 13 Jul 2022 07:04:04 +0200 Jiri Pirko wrote: > >> Even if there is no netdevice to hook it to, because it does not exist? > >> I have to be missing something, sorry :/ > > > >What I'm saying is that we can treat the devlink rate API as a "lower > >layer interface". A layer under the netdevs. That seems sensible and > >removes the API duplication which otherwise annoys me. > > > >We want drivers to only have to implement one API. > > > >So when user calls the legacy NDO API it should check if the device has > >devlink rate support, first, and try to translate the legacy request > >into devlink rate. > > > >Same for TC police as installed by the OvS offload feature that Simon > >knows far more about than I do. IIRC we use a combination of matchall > >and police to do shaping. > > > >That way drivers don't have to implement all three APIs, only devlink > >rate (four APIs if we count TC qdisc but I think only NFP uses that > >one and it has RED etc so that's too much). > > > >Does this help or am I still not making sense? > > I think I got it now. But in our case, there is no change for the user, > as the netdev does not exist. So user still uses devlink rate uapi as > proposed by this patchset. Only internal kernel changes requested. > Correct? Right. If the user wants to use devlink-rate directly they can. For legacy users the kernel will translate to devlink-rate. The point is for drivers to only have to implement devlink-rate.