Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp352823pxm; Tue, 22 Feb 2022 12:09:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJw2GwdeUW4MJg581gqCR4aGP+gnWMeVQKmjacRM1bf1c1e+hSznZtQfT4QC7AS69xRp8gyt X-Received: by 2002:a65:4687:0:b0:373:a276:767 with SMTP id h7-20020a654687000000b00373a2760767mr20957001pgr.409.1645560586597; Tue, 22 Feb 2022 12:09:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645560586; cv=none; d=google.com; s=arc-20160816; b=Z57pGhqY8GrtEAW2xKr1sgRlXwE0zRxoBSFV5zCOP6wl5AXFgODRSki6hcjp9ikVSS m8ZmXZJuV1ymhSIZ3xHgkYsxV+ntBRY5SqDKtgYqtdPQSh2imX9i3jTjWQoWMyFCJSAN vzv07uJwgYb2mz6cMRmRgYzSR0Co08AQ9DzLSZxVCToYiI2sFvLwjO6bhDE1KikaUWO5 O+nVP+a2OAmx7q1ZjUC+ZWkBGUKGZ9mgXX3ZBazyjnFCm03ItmToatwHRyKuzw5/T5oC IcIjwrY9bPEr5MBpLAvZcqW5Kgfu9N6R5ySkNfq9cN0r3M5BMez3yITzbf3K7JFXZQNV 9U8w== 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=4ss1OyObCw6S1k0BdD49Bd/baqeCBEC7bJc1jbF4kQ8=; b=jrMWQklFmtnyFciW+LpkvPgPkFfYdMPjbtee77nI/kmMcdn7tWYs2HoTFOu320455Q Yl68Z+RSiXrmtY2SRlVUpLOfVqJxInLMBEVUfA4tyXstyUd/6Sij/S3yBC/PJ3iTrY7x pN3VsDhRPY/OrgnJpV/M0hTGFk7j9dhXiIZxOPA7TpS+CHmr8VpAzrsQWhdapTrF32sn GRsGW5jr3E5JgunRh9WLI6+O1em4mqQSFKE1s8yNpnzQ2+NnvJBNryIdhswgWHaQPoYz yIze6jWpS0HsOlzWbIzHvysvbTMygH4mrf6fLdOJgpLOedRAELYFBjHa9cCrUO+8fjkf TjwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b="Zr/jral3"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f127si20564520pgc.335.2022.02.22.12.09.30; Tue, 22 Feb 2022 12:09:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b="Zr/jral3"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233228AbiBVQb7 (ORCPT + 99 others); Tue, 22 Feb 2022 11:31:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232197AbiBVQbv (ORCPT ); Tue, 22 Feb 2022 11:31:51 -0500 Received: from new2-smtp.messagingengine.com (new2-smtp.messagingengine.com [66.111.4.224]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84657167F91; Tue, 22 Feb 2022 08:31:25 -0800 (PST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailnew.nyi.internal (Postfix) with ESMTP id 50AB35802CB; Tue, 22 Feb 2022 11:31:22 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Tue, 22 Feb 2022 11:31:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=4ss1OyObCw6S1k0Bd D49Bd/baqeCBEC7bJc1jbF4kQ8=; b=Zr/jral3v63ownQ139f6+E1aDV9q8GCHc KcTQMkkm41zRVwqqeRw+mE0twRJb8xNBgaoDzK4OW7As70ult9xz7UFXuMDlqGTN Vin2dmDadlbFkZtCZcMg7Qepi5DEEWurHkkfkgtR5WYoMS2ccaj6VTUjUyjxTR+J Dco1PWhrY+HXa+WRv6BHHjj5ly3XiQH5KOEDii3t6MfowBddgHK2Zr+hJuq3q9tp WnLprQCI2WxP5fcFvqyN/aq+YsCIhlGOp87G9/UVpt7NPAM2qQ8bqGv3L/0eFeXE RbqiQ50evYv7FFDIJddcPlUwjhkDWNalKUFtkBsq2EAXVwz/WGQog== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrkeekgdekkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepkfguohcuufgt hhhimhhmvghluceoihguohhstghhsehiughoshgthhdrohhrgheqnecuggftrfgrthhtvg hrnheptdffkeekfeduffevgeeujeffjefhtefgueeugfevtdeiheduueeukefhudehleet necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepihguoh hstghhsehiughoshgthhdrohhrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 22 Feb 2022 11:31:19 -0500 (EST) Date: Tue, 22 Feb 2022 18:31:14 +0200 From: Ido Schimmel To: Baowen Zheng Cc: Vladimir Oltean , Jianbo Liu , "olteanv@gmail.com" , "andrew@lunn.ch" , Claudiu Manoil , "vivien.didelot@gmail.com" , Petr Machata , "jhs@mojatatu.com" , oss-drivers , "hkelam@marvell.com" , "davem@davemloft.net" , "leon@kernel.org" , Nole Zhang , "louis.peens@netronome.com" , "linux-kernel@vger.kernel.org" , "alexandre.belloni@bootlin.com" , "linux-rdma@vger.kernel.org" , "UNGLinuxDriver@microchip.com" , "rajur@chelsio.com" , Ido Schimmel , Simon Horman , "sbhatta@marvell.com" , "xiyou.wangcong@gmail.com" , Roi Dayan , "kuba@kernel.org" , "jiri@resnulli.us" , Saeed Mahameed , "sgoutham@marvell.com" , "gakula@marvell.com" , "f.fainelli@gmail.com" , "netdev@vger.kernel.org" Subject: Re: [PATCH net-next v2 2/2] flow_offload: reject offload for all drivers with invalid police parameters Message-ID: References: <20220217082803.3881-1-jianbol@nvidia.com> <20220217082803.3881-3-jianbol@nvidia.com> <20220217124935.p7pbgv2cfmhpshxv@skbuf> <6291dabcca7dd2d95b4961f660ec8b0226b8fbce.camel@nvidia.com> <20220222100929.gj2my4maclyrwz35@skbuf> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, 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 On Tue, Feb 22, 2022 at 10:29:57AM +0000, Baowen Zheng wrote: > Since almost all the drivers that support to offload police action make the similar validation, if it make sense to add the validation in the file of flow_offload.h or flow_offload.c? > Then the other drivers do not need to make the similar validation. > WDYT? But not all the drivers need the same validation. For example, nfp is one of the few drivers that supports policing based on packet rate. The octeontx2 driver has different restrictions based on whether the policer is attached to matchall or flower. We can put the restrictions that are common between all the drivers somewhere, but it's not that much and it will also change over time, resulting in needless churn where checks are moved to individual drivers.