Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1464901pxb; Fri, 22 Jan 2021 17:15:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJyEXSR5M6Tbm/yfUjhBdPbH5uW/3jnZeo59NO78RetSTsZOTvHbLpgY2ZUyy6FSOqhM9ppS X-Received: by 2002:a17:907:104c:: with SMTP id oy12mr4632348ejb.503.1611364507988; Fri, 22 Jan 2021 17:15:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611364507; cv=none; d=google.com; s=arc-20160816; b=Z+LmgWPLfi1B32UWn888B299sGFB6yZAB4fl6+whz8gLsTfhdrWhAwHtpNNLXwFut7 Ww7EQenCEpXZQsY1bRqLcIYaPiMye2ypt9a/3fZAeYKcMZkDY67NRKvs6hlcAcJtmL14 9sEJUyKUfJzWQc60N+c8lNo/6VAsiPmrqtonegnJWfTzXSsgL8Fw3KNCpNvTJZ0Op/JU se9sJ/+TX5aQIcNWKW9NQVN1vDq9PKyYY9NlqpTdw5rUtv2PPtofhyoWWKcI8KY0JlOK m4PPa98aPWCSNe+Klh+X+NBGRTASdnchvwWZOuzdjXSgKRnAqoGwL7l1kwnCxJ5NS+Vm lXIQ== 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=WhBJi+DaI0ywKgiDH29/rwgW6Ln0dRPXiyjqNC92k0E=; b=eIySvLaTYJKBxH6bpCoJzJJvBeDQsZqjvIfnRjzq09j3NTEHccnePHXJF77tlThZmr X2RNxTn4BuRcBiCDp9bAuXVxJkHddjcvMu0dhloLRul5jKJ5azCVYjcP7HMfeoRvl9dI kRVM7m/G/QS6SJFbQ4QMwsTK+QLVc+eiQ4kc3Jzszf+ORus9538+pm/IYseyum4PzwQI +2gfQ9QcQiV80GRwVewtlfFebTiIKbi78EiwoOuUAQMVIWCOuoJ8fJ8gSQ6pKw1oHhDQ ODKMaCrotuaYwmpE8tXOZXQr2ejax8xloSZnxPGCsI6BnyEfZaxbcdA15WIhL1LCJ5Zj vi5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ws48govY; 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 g20si3631023ejf.236.2021.01.22.17.14.43; Fri, 22 Jan 2021 17:15:07 -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=Ws48govY; 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 S1726048AbhAWBNB (ORCPT + 99 others); Fri, 22 Jan 2021 20:13:01 -0500 Received: from mail.kernel.org ([198.145.29.99]:54564 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725274AbhAWBNA (ORCPT ); Fri, 22 Jan 2021 20:13:00 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id AA1D523A7D; Sat, 23 Jan 2021 01:12:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1611364345; bh=uPvzidVHRy4/UWt19cxIFD/VdW/vjghzVAz62Fn815U=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Ws48govYua3q3SZcjGeSh9J5n+qcYQgKtT/KeZ+ooNa9cz/7vxSJ0ju0jq0ZCSE1j VcB5bjaS5xCBQqDxGV2Qn1PaG60Aen8L4f/JgGiYep01Yuar9jy3RuyJkkx3Ffsn8B RdKJko1WgBhPh+MvnDR6OSenKtgzwsyTs/aPc+xHOhEYYdCxB3uw1Vqz/vgUBCspbR cQVjEEHdvTSORnQTELfSvBzisNXkcgrVpng+dqTgwimCR63IGv0TTyxK0SUHVc7ZGo tLcJ7EkfFXdWIfFT6XaUyuKbViFK7NkpyfmuyTT3NzLQhzYa4UO41CG6eeIhJrTXgX dOVFaowmZNdow== Date: Fri, 22 Jan 2021 17:12:23 -0800 From: Jakub Kicinski To: Oleksandr Mazur Cc: Ido Schimmel , "netdev@vger.kernel.org" , "jiri@nvidia.com" , "davem@davemloft.net" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH net-next] net: core: devlink: add new trap action HARD_DROP Message-ID: <20210122171223.1f7b55b7@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 22 Jan 2021 08:36:01 +0000 Oleksandr Mazur wrote: > On Thu, 21 Jan 2021 14:21:52 +0200 Ido Schimmel wrote: > > On Thu, Jan 21, 2021 at 01:29:37PM +0200, Oleksandr Mazur wrote: =20 > > > Add new trap action HARD_DROP, which can be used by the > > > drivers to register traps, where it's impossible to get > > > packet reported to the devlink subsystem by the device > > > driver, because it's impossible to retrieve dropped packet > > > from the device itself. > > > In order to use this action, driver must also register > > > additional devlink operation - callback that is used > > > to retrieve number of packets that have been dropped by > > > the device.=C2=A0 =20 > >=20 > > Are these global statistics about number of packets the hardware dropped > > for a specific reason or are these per-port statistics? > >=20 > > It's a creative use of devlink-trap interface, but I think it makes > > sense. Better to re-use an existing interface than creating yet another > > one. =20 >=20 > > Not sure if I agree, if we can't trap why is it a trap? > > It's just a counter. =20 >=20 > It's just another ACTION for trap item. Action however can be > switched, e.g. from HARD_DROP to MIRROR. >=20 > The thing is to be able to configure specific trap to be dropped, and > provide a way for the device to report back how many packets have > been dropped. If device is able to report the packet itself, then > devlink would be in charge of counting. If not, there should be a way > to retrieve these statistics from the devlink. Sure, but the action is drop. The statistics on the trap are orthogonal to the action.