From patchwork Thu Mar 7 17:08:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Garver X-Patchwork-Id: 1909394 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.138; helo=smtp1.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TrG3B5zB8z1yX4 for ; Fri, 8 Mar 2024 04:08:22 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 8198A82ED2; Thu, 7 Mar 2024 17:08:20 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EXGhraPG2Sci; Thu, 7 Mar 2024 17:08:19 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=2605:bc80:3010:104::8cd3:938; helo=lists.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 6F58F828B5 Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp1.osuosl.org (Postfix) with ESMTPS id 6F58F828B5; Thu, 7 Mar 2024 17:08:19 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 3AF8FC0072; Thu, 7 Mar 2024 17:08:19 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 8E197C0037 for ; Thu, 7 Mar 2024 17:08:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 7639482D96 for ; Thu, 7 Mar 2024 17:08:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 48GGKkG26WkF for ; Thu, 7 Mar 2024 17:08:17 +0000 (UTC) Received-SPF: Neutral (mailfrom) identity=mailfrom; client-ip=205.139.111.44; helo=us-smtp-delivery-44.mimecast.com; envelope-from=eric@garver.life; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp1.osuosl.org AA912828B5 Authentication-Results: smtp1.osuosl.org; dmarc=none (p=none dis=none) header.from=garver.life DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org AA912828B5 Received: from us-smtp-delivery-44.mimecast.com (us-smtp-delivery-44.mimecast.com [205.139.111.44]) by smtp1.osuosl.org (Postfix) with ESMTPS id AA912828B5 for ; Thu, 7 Mar 2024 17:08:15 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-342-5brOj9XtOpKwrXMZGOGNZg-1; Thu, 07 Mar 2024 12:08:13 -0500 X-MC-Unique: 5brOj9XtOpKwrXMZGOGNZg-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 79DAE800265; Thu, 7 Mar 2024 17:08:13 +0000 (UTC) Received: from egarver-mac.redhat.com (unknown [10.22.18.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 42471492BDC; Thu, 7 Mar 2024 17:08:13 +0000 (UTC) From: Eric Garver To: dev@openvswitch.org Date: Thu, 7 Mar 2024 12:08:10 -0500 Message-ID: <20240307170810.63088-6-eric@garver.life> In-Reply-To: <20240307170810.63088-1-eric@garver.life> References: <20240307170810.63088-1-eric@garver.life> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: garver.life Cc: Ilya Maximets Subject: [ovs-dev] [PATCH v10 5/5] tests: system-traffic: Add coverage for drop action. 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" Exercise the drop action in the datapath. This specific tests triggers an xlate_error. For the kernel datapath skb drop reasons can then be seen while this test runs. # perf trace -e skb:kfree_skb --filter="reason >= 0x30000" 0.000 ping/1275884 skb:kfree_skb(skbaddr: 0xffff8acd76546000, \ location: 0xffffffffc0ee3634, protocol: 2048, reason: 196611) Signed-off-by: Eric Garver --- tests/system-common-macros.at | 4 ++++ tests/system-traffic.at | 31 +++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/tests/system-common-macros.at b/tests/system-common-macros.at index 01ebe364ee7c..564bc163945e 100644 --- a/tests/system-common-macros.at +++ b/tests/system-common-macros.at @@ -374,3 +374,7 @@ m4_define([OVS_CHECK_CT_CLEAR], # OVS_CHECK_GITHUB_ACTION m4_define([OVS_CHECK_GITHUB_ACTION], [AT_SKIP_IF([test "$GITHUB_ACTIONS" = "true"])]) + +# OVS_CHECK_DROP_ACTION() +m4_define([OVS_CHECK_DROP_ACTION], + [AT_SKIP_IF([! grep -q "Datapath supports drop action" ovs-vswitchd.log])]) diff --git a/tests/system-traffic.at b/tests/system-traffic.at index 07d09b912e0b..d7673ecac8c9 100644 --- a/tests/system-traffic.at +++ b/tests/system-traffic.at @@ -2231,6 +2231,37 @@ masks-cache:size:256 OVS_TRAFFIC_VSWITCHD_STOP AT_CLEANUP +AT_SETUP([datapath - drop action]) +OVS_TRAFFIC_VSWITCHD_START() +OVS_CHECK_DROP_ACTION() +AT_KEYWORDS(drop_action) + +ADD_NAMESPACES(at_ns0, at_ns1) + +ADD_VETH(p0, at_ns0, br0, "10.1.1.1/24") +ADD_VETH(p1, at_ns1, br0, "10.1.1.2/24") + +dnl Exceed the max number of resubmits. +(echo "dl_type=0x806, actions=normal" +for i in `seq 1 64`; do + j=`expr $i + 1` + echo "in_port=$i, actions=resubmit:$j, resubmit:$j, local" + done + echo "in_port=65, actions=local" +) > flows.txt +AT_CHECK([ovs-ofctl add-flows br0 flows.txt]) + +dnl Generate some traffic. +NS_CHECK_EXEC([at_ns0], [ping -q -c 10 -i 0.1 -w 2 10.1.1.2], [1], [ignore]) + +OVS_WAIT_UNTIL_EQUAL([ovs-appctl dpctl/dump-flows | grep "eth_type(0x0800)" | dnl + sed 's/,packet_type(ns=[[0-9]]*,id=[[0-9]]*),/,/;s/,eth(),/,/;' | dnl + strip_recirc | strip_stats | strip_used | sort], [dnl +recirc_id(),in_port(2),eth_type(0x0800),ipv4(frag=no), packets:0, bytes:0, used:0.0s, actions:drop]) + +OVS_VSWITCHD_STOP(["/|WARN|/d"]) +AT_CLEANUP + AT_SETUP([datapath - simulated flow action update]) OVS_TRAFFIC_VSWITCHD_START()