From patchwork Fri Aug 11 14:12:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Adri=C3=A1n_Moreno?= X-Patchwork-Id: 1820297 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.133; helo=smtp2.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=ZFLoAiG1; dkim-atps=neutral Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RMm4P1tG9z1yf7 for ; Sat, 12 Aug 2023 00:13:57 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 611C34182F; Fri, 11 Aug 2023 14:13:55 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 611C34182F Authentication-Results: smtp2.osuosl.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=ZFLoAiG1 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id e9Z0_NykBNmc; Fri, 11 Aug 2023 14:13:54 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp2.osuosl.org (Postfix) with ESMTPS id 4A95841807; Fri, 11 Aug 2023 14:13:53 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 4A95841807 Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 1F158C0DD8; Fri, 11 Aug 2023 14:13:53 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 230FBC0DDE for ; Fri, 11 Aug 2023 14:13:51 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 4CB9761149 for ; Fri, 11 Aug 2023 14:13:31 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 4CB9761149 Authentication-Results: smtp3.osuosl.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=ZFLoAiG1 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MPZXV3zRxZeg for ; Fri, 11 Aug 2023 14:13:30 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by smtp3.osuosl.org (Postfix) with ESMTPS id 93188613AC for ; Fri, 11 Aug 2023 14:13:30 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 93188613AC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691763209; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7kMu62DxIGlyY+2w5uFs/bD7dgia+F8JpXv/std8jKE=; b=ZFLoAiG1vC6HV/+oDgmVhCr4UqhyS2x4F7J+l+hyhslhmcOPoR8hgRua2kBNK3zXlcE8gt G2yo18gRRNHkD//syX6dhfrMrfMzyl9iES6bwjZaYabRfSvhwTPXa+9lmIaE5OqO8oAYlm K2loIGPmBXzxc+kE2lyA0EcB/p6v+cQ= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-384-QjhgupXnM2WMJUcF9TAT_A-1; Fri, 11 Aug 2023 10:13:28 -0400 X-MC-Unique: QjhgupXnM2WMJUcF9TAT_A-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C69231021E15; Fri, 11 Aug 2023 14:13:27 +0000 (UTC) Received: from antares.redhat.com (unknown [10.39.192.142]) by smtp.corp.redhat.com (Postfix) with ESMTP id A2BA01121314; Fri, 11 Aug 2023 14:13:26 +0000 (UTC) From: Adrian Moreno To: netdev@vger.kernel.org Date: Fri, 11 Aug 2023 16:12:51 +0200 Message-ID: <20230811141255.4103827-5-amorenoz@redhat.com> In-Reply-To: <20230811141255.4103827-1-amorenoz@redhat.com> References: <20230811141255.4103827-1-amorenoz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 Cc: dev@openvswitch.org, eric@garver.life, i.maximets@ovn.org Subject: [ovs-dev] [net-next v5 4/7] net: openvswitch: add meter drop reason X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" By using an independent drop reason it makes it easy to distinguish between QoS-triggered or flow-triggered drop. Acked-by: Aaron Conole Signed-off-by: Adrian Moreno --- net/openvswitch/actions.c | 2 +- net/openvswitch/drop.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/net/openvswitch/actions.c b/net/openvswitch/actions.c index e188f32ea96f..122211478606 100644 --- a/net/openvswitch/actions.c +++ b/net/openvswitch/actions.c @@ -1454,7 +1454,7 @@ static int do_execute_actions(struct datapath *dp, struct sk_buff *skb, case OVS_ACTION_ATTR_METER: if (ovs_meter_execute(dp, skb, key, nla_get_u32(a))) { - consume_skb(skb); + ovs_kfree_skb_reason(skb, OVS_DROP_METER); return 0; } break; diff --git a/net/openvswitch/drop.h b/net/openvswitch/drop.h index 22e66d28c0ca..a35e63d71094 100644 --- a/net/openvswitch/drop.h +++ b/net/openvswitch/drop.h @@ -13,6 +13,7 @@ R(OVS_DROP_ACTION_ERROR) \ R(OVS_DROP_EXPLICIT) \ R(OVS_DROP_EXPLICIT_WITH_ERROR) \ + R(OVS_DROP_METER) \ /* deliberate comment for trailing \ */ enum ovs_drop_reason {