From patchwork Mon Aug 7 16:45:43 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: 13344567 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 100FD125A3 for ; Mon, 7 Aug 2023 16:46:03 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18BEA10DE for ; Mon, 7 Aug 2023 09:46:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691426761; 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=0JEusbIbmSQ5jAXzRRSRSX9wfb+/Nt1rvkTbvcodHlA=; b=h+glvKjy5KBxhPXtWs/eb5HcZ0wz3Nl3O3Bw+kK/CU3Bs8eINTcA5IAApyTwPnlev4uvs2 K29PL4l+0LWJbB2DqXmRJHue5A31csllqhyhFV82sqjOpaKeDIaMu7Yzv6ct5Ig2nKIv01 WU5Dg8uhABP5UcUMqchKf1rrD3jJCSc= Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-562-ia6JNpHtOju5AnsoowXG1w-1; Mon, 07 Aug 2023 12:45:58 -0400 X-MC-Unique: ia6JNpHtOju5AnsoowXG1w-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0735A29AA388; Mon, 7 Aug 2023 16:45:57 +0000 (UTC) Received: from antares.redhat.com (unknown [10.39.194.141]) by smtp.corp.redhat.com (Postfix) with ESMTP id D57F82166B25; Mon, 7 Aug 2023 16:45:55 +0000 (UTC) From: Adrian Moreno To: netdev@vger.kernel.org Cc: Adrian Moreno , aconole@redhat.com, i.maximets@ovn.org, eric@garver.life, dev@openvswitch.org Subject: [net-next v3 2/7] net: openvswitch: add action error drop reason Date: Mon, 7 Aug 2023 18:45:43 +0200 Message-ID: <20230807164551.553365-3-amorenoz@redhat.com> In-Reply-To: <20230807164551.553365-1-amorenoz@redhat.com> References: <20230807164551.553365-1-amorenoz@redhat.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org Add a drop reason for packets that are dropped because an action returns a non-zero error code. Signed-off-by: Adrian Moreno Acked-by: Aaron Conole --- 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 af676dcac2b4..9b66a3334aaa 100644 --- a/net/openvswitch/actions.c +++ b/net/openvswitch/actions.c @@ -1488,7 +1488,7 @@ static int do_execute_actions(struct datapath *dp, struct sk_buff *skb, } if (unlikely(err)) { - kfree_skb(skb); + kfree_skb_reason(skb, OVS_DROP_ACTION_ERROR); return err; } } diff --git a/net/openvswitch/drop.h b/net/openvswitch/drop.h index cdd10629c6be..3cd6489a5a2b 100644 --- a/net/openvswitch/drop.h +++ b/net/openvswitch/drop.h @@ -9,6 +9,7 @@ #define OVS_DROP_REASONS(R) \ R(OVS_DROP_FLOW) \ + R(OVS_DROP_ACTION_ERROR) \ /* deliberate comment for trailing \ */ enum ovs_drop_reason {