Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp173521pxb; Thu, 21 Jan 2021 04:29:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJz3sIQTac3u32ApCpQWGrU3jo3d5/CzSHpA3DMkv2Z9LOAvU7TMArmAZwq/wq1i4U5byrxc X-Received: by 2002:a17:906:aec1:: with SMTP id me1mr9675451ejb.114.1611232145569; Thu, 21 Jan 2021 04:29:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611232145; cv=none; d=google.com; s=arc-20160816; b=h+3aAhSEzL9/bOYZIWnqO5uNxzA047ilkcUmcCmp6qZiQ3NNh6WljP8TK6ARk3d9s0 Q4frE3jHLq9odYVDtGWKGJSmWebCEIUAg6+C3KB/CjqxeGMhpNI6R3oA9gMjWVKNPWGn 5J9LlSWe+5D5wqSXVx49Ahra2W4V0pyewKV16eh+MG4COrp6ROooA6W8n3IYMxFFTFFF lxrJCeK0bzQvxHZQDxg59uoqTL818wpkQ4A4NTU6DD6HTgmVpFGIlSvy5JSyhztujFgK UJCRfthM46g24yJcodYGvaqIqdKxXMsk+jS1C34b1CtOCQbXsQahuZrZiGU5TG+zKSK5 QeiQ== 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=DSGIPEwviBJva3VGDzbXmz78MH5d3GMIAYRhq7Tqha4=; b=0B9ov8pxCdRMa9nYIH5igJgnMEkKFLYxNAENPTmMJQmVZBKKNxxrtAmJy5WbKRc9eb JeWOqonHPzFub6BdKQ/lHQ6C4UsnO8Gec7lfv/fqsQc3jrV5/VJPXVoi0mL0BnNbXnUd EpTrMmye+mOayIB+ObwT0NQil4o6ZoJrT91YGHxPKTouByJjYunZCbRJJ3NORBzcaIp9 o/rDzT5tyGV9EZdCoBSrTJ0SO/W4GhWnycpRI0dK02JsKvBi/Y4mwW4C2fNvGTXfYn32 IFtGok6r1Q2Ll/AIcwejmV72vBRutxIvQIwKKi0ARv5nQ93WFB6k+VBGxxHsGULBWIbE Kobg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=H1arxmeR; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o16si2398181edi.480.2021.01.21.04.28.40; Thu, 21 Jan 2021 04:29:05 -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=@messagingengine.com header.s=fm1 header.b=H1arxmeR; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731046AbhAUM0t (ORCPT + 99 others); Thu, 21 Jan 2021 07:26:49 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:38907 "EHLO out4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730616AbhAUM0c (ORCPT ); Thu, 21 Jan 2021 07:26:32 -0500 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id B4AAB5C011A; Thu, 21 Jan 2021 07:25:37 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Thu, 21 Jan 2021 07:25:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=DSGIPE wviBJva3VGDzbXmz78MH5d3GMIAYRhq7Tqha4=; b=H1arxmeRvS6xH8cEwdztZi ICCNESdiJvMS52DWR2LRY+EOzaiXSCFp4KEFTSsdKvn+AiZq0sGTFUrbr+9j7Hn0 DnxZluq0FKuV/z/TJ0BxOSBqas/MV80hc2a/80PwtqBnS5AmlJvG03mT75NW8ZbD VQvDXFtwow5hDOFgbYJKvSm/EQDxzEfjTkWLh+oVlS+b7Bd6w6hGXPsOriY4LrQ3 omtGU7KnIpf3K9DM5Y93P5HsrKJzqlgloMq6X9E+OMEJtkZD19mU7Un6rOzXDbpV ctCF7I6HIXSPxhuxYzdhVvS2kbsHXqgeomXbwslVlgmUFqcKI9RvfUmcLVif7J8A == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudeggdegvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepkfguohcuufgt hhhimhhmvghluceoihguohhstghhsehiughoshgthhdrohhrgheqnecuggftrfgrthhtvg hrnheptdffkeekfeduffevgeeujeffjefhtefgueeugfevtdeiheduueeukefhudehleet necukfhppeekgedrvddvledrudehfedrgeegnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepihguohhstghhsehiughoshgthhdrohhrgh X-ME-Proxy: Received: from localhost (igld-84-229-153-44.inter.net.il [84.229.153.44]) by mail.messagingengine.com (Postfix) with ESMTPA id CC4FB24005B; Thu, 21 Jan 2021 07:25:36 -0500 (EST) Date: Thu, 21 Jan 2021 14:25:34 +0200 From: Ido Schimmel To: Oleksandr Mazur Cc: netdev@vger.kernel.org, jiri@nvidia.com, davem@davemloft.net, linux-kernel@vger.kernel.org, kuba@kernel.org Subject: Re: [PATCH iproute2-next] devlink: add support for HARD_DROP trap action Message-ID: <20210121122534.GB2647590@shredder.lan> References: <20210121112954.31039-1-oleksandr.mazur@plvision.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210121112954.31039-1-oleksandr.mazur@plvision.eu> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 21, 2021 at 01:29:54PM +0200, Oleksandr Mazur wrote: > Add support for new HARD_DROP action, which is used for > trap hard drop statistics retrival. It's used whenever > device is unable to report trapped packet to the devlink > subsystem, and thus device could only state how many > packets have been dropped, without passing a packet > to the devlink subsystem to get track of traffic statistics. This patch should also be marked as "RFC". > > Signed-off-by: Oleksandr Mazur > --- > devlink/devlink.c | 4 ++++ > include/uapi/linux/devlink.h | 4 ++++ Missing man page and bash completion extensions: man/man8/devlink-trap.8 bash-completion/devlink > 2 files changed, 8 insertions(+) > > diff --git a/devlink/devlink.c b/devlink/devlink.c > index a2e06644..77185f7c 100644 > --- a/devlink/devlink.c > +++ b/devlink/devlink.c > @@ -1335,6 +1335,8 @@ static int trap_action_get(const char *actionstr, > { > if (strcmp(actionstr, "drop") == 0) { > *p_action = DEVLINK_TRAP_ACTION_DROP; > + } else if (strcmp(actionstr, "hard_drop") == 0) { > + *p_action = DEVLINK_TRAP_ACTION_HARD_DROP; > } else if (strcmp(actionstr, "trap") == 0) { > *p_action = DEVLINK_TRAP_ACTION_TRAP; > } else if (strcmp(actionstr, "mirror") == 0) { > @@ -7726,6 +7728,8 @@ static const char *trap_action_name(uint8_t action) > switch (action) { > case DEVLINK_TRAP_ACTION_DROP: > return "drop"; > + case DEVLINK_TRAP_ACTION_HARD_DROP: > + return "hard_drop"; > case DEVLINK_TRAP_ACTION_TRAP: > return "trap"; > case DEVLINK_TRAP_ACTION_MIRROR: > diff --git a/include/uapi/linux/devlink.h b/include/uapi/linux/devlink.h > index 1414acee..ecee2541 100644 > --- a/include/uapi/linux/devlink.h > +++ b/include/uapi/linux/devlink.h > @@ -261,12 +261,16 @@ enum { > * enum devlink_trap_action - Packet trap action. > * @DEVLINK_TRAP_ACTION_DROP: Packet is dropped by the device and a copy is not > * sent to the CPU. > + * @DEVLINK_TRAP_ACTION_HARD_DROP: Packet was dropped by the underlying device, > + * and device cannot report packet to devlink > + * (or inject it into the kernel RX path). > * @DEVLINK_TRAP_ACTION_TRAP: The sole copy of the packet is sent to the CPU. > * @DEVLINK_TRAP_ACTION_MIRROR: Packet is forwarded by the device and a copy is > * sent to the CPU. > */ > enum devlink_trap_action { > DEVLINK_TRAP_ACTION_DROP, > + DEVLINK_TRAP_ACTION_HARD_DROP, > DEVLINK_TRAP_ACTION_TRAP, > DEVLINK_TRAP_ACTION_MIRROR, > }; > -- > 2.17.1 >