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 68097C61DA3 for ; Tue, 21 Feb 2023 02:25:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232627AbjBUCZp (ORCPT ); Mon, 20 Feb 2023 21:25:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231806AbjBUCZn (ORCPT ); Mon, 20 Feb 2023 21:25:43 -0500 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A393B2201E; Mon, 20 Feb 2023 18:25:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=rbZpLXvJ7Aha1uh0eV22zaYZ2Zs2OOypm/WF5Ox+AyA=; b=zpz0hERUs4p0xB1aoQiZ/eYYZJ gruzJ3AZ4zx7oPcmo+FdiDMPdNnMhYQyNHFvq7dVuJeoUqz0YqFKGQ/7HEzsWxGEUe6YsCQyhiby0 xyOxBpIehMEEOXBqH7kD4tmWZ92F6Kol3nM01YGqOcsPHm9j/qgqg+NBwC5Iikd9iDNQ=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1pUILM-005YLh-D4; Tue, 21 Feb 2023 03:25:24 +0100 Date: Tue, 21 Feb 2023 03:25:24 +0100 From: Andrew Lunn To: Wei Fang Cc: Alexander Lobakin , Shenwei Wang , Clark Wang , "davem@davemloft.net" , "edumazet@google.com" , "kuba@kernel.org" , "pabeni@redhat.com" , "simon.horman@corigine.com" , "netdev@vger.kernel.org" , dl-linux-imx , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH V2 net-next] net: fec: add CBS offload support Message-ID: References: <20230213092912.2314029-1-wei.fang@nxp.com> <8b25bd1f-4265-33ea-bdb9-bc700eff0b0e@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Unfortunately, FEC IP itself not follows the standard 802.1Qav spec completely. > We only can program DMAnCFG[IDLE_SLOPE] field to calculate bandwidth fraction. > And IDLE_SLOPE is restricted to certain values. It's far away from CBS QDisc implemented > in Linux TC framework. It is more difficult to guarantee similar software behavior when > the link speed changes. > If the method of keeping the bandwidth ratio unchanged is not sensible, I can only give up > CBS offload and use pure software CBS. :( I know the hardware supports less parameters. But if you restrict the CBS configuration such that the parameters you don't support are 0, can you accurately implement what you do support? If the user configures TC such that it matches the hardware capabilities, you can accept the offload. If not return -EOPNOTSUPP, and the software CBS should take over. And then you need to clearly document what parameters can be set for hardware offload to work. Andrew