Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3344649pxb; Mon, 25 Jan 2021 13:26:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJxEfbRenYkfkJL4lDLASeBHXOsWptJEQE0RBH34uFGBI/ae1bsx2fE9sdsDsdbClS5dafZz X-Received: by 2002:a17:907:94c8:: with SMTP id dn8mr1576953ejc.512.1611609986712; Mon, 25 Jan 2021 13:26:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611609986; cv=none; d=google.com; s=arc-20160816; b=rAQ1pOWuYlYOUlFtet56cnCvQOrLDhjR7ycS/dhDM/wZhb/ZyFCo0+55YO5j0ooo1o J9qGCc7E2D4EQ1KyNA/QC9mYdqpbpLKlkkfRASWusXIc393L4qaYgKedtDA7wcne45sh jw3kDuu4BaFuS71iRi++iPtjdLz3g+ZmOgb6seZs++kSrxVILIK98CNwXznmXaNDpXkF pUwqyRg21PRF0cpUG+ndSQqRNgMNEAMdtwS+xMIruJLCsVWaNjFYkCPlPpxO7vz1YFQk 2PuGJvLiglpU1RrTdymnc31qtkePtVF+xIoyFA+SS/n73xazR/LqLitEbkQbpdCYJ8L5 vxiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=SFW3fFMTrzZtQqlbUTyVlDUoWlo/C7GXTL1f8OxL0HI=; b=lFNRoEWu/JEXOD+vQOok+mLvUVbXy0bbvDb+EIsy/CT3ioEAUjoHOxRD/0CTUPxx8Z h0NRJ3LpEBMRRBKfwyNOMz3zs56NKzsJRCzl5DQeBC0fqE3racHyxuXHRq8p1qHqWdCR dCZYmuNE7wFuwJZ/MAriUUwolQjAqEcdol8HdoAh0wWFWnXBVY0HjrjB6wLwdke9LRZ6 mIquhPzP55GfHkxI6CNbCX//ULNl5waPDjrIDjARXFs5Tygv5jGuNbDazoFNx2q7f7LC H7A/w9kf+ysRMo5N8iIHlGyiSVP8ULi/2cXr9idQ5f5w+HZ/uAUglu/KKd47umUiUfne uXkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OpzIe3KY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cy17si8033802edb.193.2021.01.25.13.26.01; Mon, 25 Jan 2021 13:26:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OpzIe3KY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732691AbhAYVYI (ORCPT + 99 others); Mon, 25 Jan 2021 16:24:08 -0500 Received: from mail.kernel.org ([198.145.29.99]:33826 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732608AbhAYVX7 (ORCPT ); Mon, 25 Jan 2021 16:23:59 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 81BBE2074B; Mon, 25 Jan 2021 21:23:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1611609798; bh=EiSMuv3lS+b6L16mi9Gaz56jCTdgSdQyubHBs42fKFw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=OpzIe3KYHoO/6DncBJ3tHM/TNp0oPv7eY2YfzLue7o0z04iU6lv7EP3AoYs5GDHbv D/RuKZrjtCw4bXsE906/0OVxzstUTCaViQW4m4Nf2TNOB3LWj/RFx+37sf5zELOk9F G/nG7gUNsBgTqXG/gjqbkC7aZinBPKy7xJkBljp9ofg5c6O9TEp79YcnxnufNIhkvV 4WzCzc/qnGtofxOVZvCxRCHOegS9a7hMAmxcSnapN7P5MLeaoq7F2KopjkUoyiNpgn ISUU8n6arMFu9USTitdHNTr/88Rw5BJYeOGyK4ZPP85/Q/GGCPdR+Knm2NI7p4OKxy 5YVcdtd1wIyAw== Date: Mon, 25 Jan 2021 13:23:17 -0800 From: Jakub Kicinski To: Oleksandr Mazur Cc: netdev@vger.kernel.org, jiri@nvidia.com, davem@davemloft.net, linux-kernel@vger.kernel.org Subject: Re: [RFC v3 net-next] net: core: devlink: add 'dropped' stats field for DROP trap action Message-ID: <20210125132317.418a4e35@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: <20210125123856.1746-1-oleksandr.mazur@plvision.eu> References: <20210125123856.1746-1-oleksandr.mazur@plvision.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 25 Jan 2021 14:38:56 +0200 Oleksandr Mazur wrote: > + if (trap_item->action == DEVLINK_TRAP_ACTION_DROP && > + devlink->ops->trap_drop_counter_get) { > + err = devlink->ops->trap_drop_counter_get(devlink, > + trap_item->trap, > + &drops); > + if (err) > + return err; > + } Why only report this counter when action is set to drop? Thinking about it again - if the action can be changed wouldn't it be best for the user to actually get a "HW condition hit" counter, which would increment regardless of SW config (incl. policers)? Otherwise if admin logs onto the box and temporarily enables a trap for debug this count would disappear.