From patchwork Wed Dec 15 16:26:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Coquelin X-Patchwork-Id: 1568426 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=DcKR97mT; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.137; helo=smtp4.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JDgd35c3Pz9sXS for ; Thu, 16 Dec 2021 03:27:19 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id F38E441584; Wed, 15 Dec 2021 16:27:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wm2Lk-9ivcYJ; Wed, 15 Dec 2021 16:27:17 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp4.osuosl.org (Postfix) with ESMTPS id 2389F415A2; Wed, 15 Dec 2021 16:27:16 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id EB9A9C002F; Wed, 15 Dec 2021 16:27:15 +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 02530C002F for ; Wed, 15 Dec 2021 16:27:15 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 8034260EAB for ; Wed, 15 Dec 2021 16:27:11 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp3.osuosl.org (amavisd-new); dkim=pass (1024-bit key) header.d=redhat.com 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 PxhsY6MbB-N8 for ; Wed, 15 Dec 2021 16:27:10 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by smtp3.osuosl.org (Postfix) with ESMTPS id AC65D60EA1 for ; Wed, 15 Dec 2021 16:27:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1639585629; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vmDlZ5C9iZedBg77PsAqIzNNljCjNC3cIIs2BxCsXfs=; b=DcKR97mTVeG15e0yrWCVXsQMRHyQQax9kSHP4clObsoNwgLMMVHnjHhVOrZq4BUOZRo6t8 dIXf6AY4nSz4kDlJlRiqaJQkz9JhL1lGIE5EOKFIt4NdowWyMW2j6TUSO34GVVshMBtd+h 9+eE+5HarqKLtpXrlgLokRvm0n6bE/w= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-131-rRm3dHCrPaO3mqAE-lmsrQ-1; Wed, 15 Dec 2021 11:27:08 -0500 X-MC-Unique: rRm3dHCrPaO3mqAE-lmsrQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 60BA010247A6; Wed, 15 Dec 2021 16:27:07 +0000 (UTC) Received: from max-t490s.redhat.com (unknown [10.39.208.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id BB51745D89; Wed, 15 Dec 2021 16:27:05 +0000 (UTC) From: Maxime Coquelin To: dev@openvswitch.org Date: Wed, 15 Dec 2021 17:26:30 +0100 Message-Id: <20211215162630.90249-6-maxime.coquelin@redhat.com> In-Reply-To: <20211215162630.90249-1-maxime.coquelin@redhat.com> References: <20211215162630.90249-1-maxime.coquelin@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=maxime.coquelin@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Cc: fbl@sysclose.org, Maxime Coquelin , i.maximets@ovn.org, david.marchand@redhat.com Subject: [ovs-dev] [PATCH v3 5/5] dpif-netdev.at: Add test for Tx packets steering. 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" This patch introduces a new test for Tx packets steering modes. First test validates the static mode, by checking that all packets are transmitted on a single queue (single PMD thread), then it tests the same with enabling hash based packet steering, ensuring packets are transmitted on both queues. Signed-off-by: Maxime Coquelin --- tests/dpif-netdev.at | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/tests/dpif-netdev.at b/tests/dpif-netdev.at index 53eee185a..482e5029f 100644 --- a/tests/dpif-netdev.at +++ b/tests/dpif-netdev.at @@ -635,3 +635,47 @@ OVS_WAIT_UNTIL([grep "flow: in_port is not an exact match" ovs-vswitchd.log]) OVS_VSWITCHD_STOP(["/flow: in_port is not an exact match/d /failed to put/d"]) AT_CLEANUP + +# SEND_UDP_PKTS([p_name], [p_ofport]) +# +# Sends 128 packets to port 'p_name' with different UDP destination ports. +m4_define([SEND_UDP_PKTS], + [ + for i in `seq 1 128`; do + pkt="in_port($2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:01:00),eth_type(0x0800),ipv4(src=10.0.1.1,dst=10.0.0.1,proto=17),udp(src=1000,dst=$i)" + ovs-appctl netdev-dummy/receive $1 $pkt --len 256 + done + ] +) + +AT_SETUP([dpif-netdev - tx packets steering]) +OVS_VSWITCHD_START( + [add-port br0 p1 -- set Interface p1 type=dummy-pmd ofport_request=1], [], [], [--dummy-numa 0]) + +AT_CHECK([ovs-vsctl add-port br0 p2 -- set Interface p2 type=dummy-pmd ofport_request=2 options:n_txq=2 other_config:tx-steering=default]) +AT_CHECK([ovs-ofctl add-flow br0 in_port=1,actions=output:2]) + +AT_CHECK([SEND_UDP_PKTS([p1], [1])]) + +OVS_WAIT_UNTIL([test `ovs-vsctl get Interface p2 statistics:tx_packets` -eq 128]) +AT_CHECK([ovs-vsctl get Interface p2 statistics], [], [stdout]) +AT_CHECK([test `ovs-vsctl get Interface p2 statistics:tx_q0_packets` -eq 0 -a \ + `ovs-vsctl get Interface p2 statistics:tx_q1_packets` -eq 128 || \ + test `ovs-vsctl get Interface p2 statistics:tx_q0_packets` -eq 128 -a \ + `ovs-vsctl get Interface p2 statistics:tx_q1_packets` -eq 0]) + +AT_CHECK([ovs-vsctl del-port p2]) + +AT_CHECK([ovs-vsctl add-port br0 p2 -- set Interface p2 type=dummy-pmd ofport_request=2 options:n_txq=2 other_config:tx-steering=hash]) +AT_CHECK([ovs-ofctl add-flow br0 in_port=1,actions=output:2]) + +AT_CHECK([SEND_UDP_PKTS([p1], [1])]) + +OVS_WAIT_UNTIL([test `ovs-vsctl get Interface p2 statistics:tx_packets` -eq 128]) +AT_CHECK([ovs-vsctl get Interface p2 statistics], [], [stdout]) + +AT_CHECK([test `ovs-vsctl get Interface p2 statistics:tx_q0_packets` -ge 0 -a \ + `ovs-vsctl get Interface p2 statistics:tx_q1_packets` -ge 0]) + +OVS_VSWITCHD_STOP +AT_CLEANUP