From patchwork Wed Jan 5 14:57:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Flavio Leitner X-Patchwork-Id: 1575720 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=NMf3fL4a; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (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 4JTXfS3xR9z9sPC for ; Thu, 6 Jan 2022 01:58:08 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 267D26FB7F; Wed, 5 Jan 2022 14:58:05 +0000 (UTC) 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 mVy3N_yT5rBj; Wed, 5 Jan 2022 14:58:04 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp3.osuosl.org (Postfix) with ESMTPS id 2EC2B60C2D; Wed, 5 Jan 2022 14:58:03 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 063A4C002F; Wed, 5 Jan 2022 14:58:03 +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 03109C001E for ; Wed, 5 Jan 2022 14:58:02 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id D760B82FE4 for ; Wed, 5 Jan 2022 14:58:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp1.osuosl.org (amavisd-new); dkim=pass (1024-bit key) header.d=redhat.com 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 ddAQhrVs2lzk for ; Wed, 5 Jan 2022 14:58:00 +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 smtp1.osuosl.org (Postfix) with ESMTPS id 8859382FAE for ; Wed, 5 Jan 2022 14:58:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1641394679; 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; bh=cflK+sq9+/1lLkbtQJGvsH3waqQ5b6pHuwxPxfZgTlQ=; b=NMf3fL4aUrGyO9m7Xv0Nbq2nEfsvEW9XkEamnwZQpkuWF62Pj92sm5rsp9R7Q14o2vbsSg Kk4T4l1o7eimB4EzLd+kK98VypEFIKtlDkMO9s/XotJUX/lQCMe/gCcuAi4ZXa6yp+THCl p7qNeEjSaXw7EIdZe4m7s9fhZD/rQfY= Received: from mail-ua1-f72.google.com (mail-ua1-f72.google.com [209.85.222.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-339-4NRRz7_sPB-8ZMhfm3S4yA-1; Wed, 05 Jan 2022 09:57:56 -0500 X-MC-Unique: 4NRRz7_sPB-8ZMhfm3S4yA-1 Received: by mail-ua1-f72.google.com with SMTP id s9-20020ab04a89000000b003033d9b18ccso4022304uae.12 for ; Wed, 05 Jan 2022 06:57:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=cflK+sq9+/1lLkbtQJGvsH3waqQ5b6pHuwxPxfZgTlQ=; b=6f0+SSXzF/GJOzAwqHXMauEcvJxa3356vzgk7SMjPN9iry/46dKXjXScM9VcId60pE cItwmSOafog0HSlZ5mAMtMxHjyj51yZZ1FMP2gUi3dVg+dhxY4Dc4OHARw1LOXn9HzjE bdIUqz3aOB5zWWWbOVX4hnk4QDaO+p7wqgLyoAUihWXyi6R4c+uySbFxpXnrdjmRFMj0 60is5gnEPbpD7fV0oBY5bcI9eoqCQ9lblTo8sxCVF+/AmoPdWRH+HOkgxOG0lzljihNM 54GepRYHl6Ym6R2jXd6kTCK+Yx4mYkJ3J1OShH+oBsZ8YV6kgoUX6LBk1/pHi04vJnYm QI/Q== X-Gm-Message-State: AOAM531NhnJ8dlUIPwKhIYiDszGwOxIIBFnuIS7Xl/Z7BO6/XuSEgGB9 Y31B3RMmTUNLFZVItbJuKRmEZ/JiaA6wGDMVL+OboZ5OEeIzySlmo++d8VHt5I4qPu2gYimFLSh 90GVnn6/U0HYr2+0dSyxSzRQX/8PSqwd6mLFnrY8efskIkkxTq1A5mgXjTA== X-Received: by 2002:a9f:3802:: with SMTP id p2mr882408uad.35.1641394675608; Wed, 05 Jan 2022 06:57:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJx/a7V0xNMAENuxgv9GqG/uZZHOAdsMK03HSA1hwXgTvKmUOD+W3j55/9BTR9cixPAPG7NKOA== X-Received: by 2002:a9f:3802:: with SMTP id p2mr882399uad.35.1641394675179; Wed, 05 Jan 2022 06:57:55 -0800 (PST) Received: from localhost ([2804:828:f232:6427:417b:3f70:a8da:c254]) by smtp.gmail.com with ESMTPSA id m5sm791495vke.43.2022.01.05.06.57.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jan 2022 06:57:54 -0800 (PST) From: Flavio Leitner To: dev@openvswitch.org Date: Wed, 5 Jan 2022 11:57:38 -0300 Message-Id: <20220105145738.758971-1-fbl@redhat.com> X-Mailer: git-send-email 2.33.1 MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=fbl@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Cc: Flavio Leitner Subject: [ovs-dev] [PATCH] system-tso: Skip encap tests when userspace TSO is enabled. 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" It seems Linux native tunnel configuration changed to enable checksum by default and that causes the check-system-tso unit test below to fail: 10: datapath - ping over vxlan tunnel FAILED (system-traffic.at:248) That happens because userspace TSO doesn't support encapsulation as mentioned in the current documentation. In this specific case, udp_extract_tnl_md() checks if the checksum is correct, but since TSO is enabled, the outer UDP header contains only the pseudo checksum and not the full packet checksum. Although the packet is marked correctly with UDP csum offload flag and the code could use that to verify the pseudo csum, more work is needed to properly translate the offloading flags from the outer headers to the inner headers. For example, if the payload is a TCP packet, most probably the flag DP_PACKET_OL_TX_UDP_CKSUM doesn't make sense after decapsulating that. This patch skips the tunnel tests when the userspace TSO is enabled. Fixes: 29bb3093eb8b ("userspace: Enable TSO support for non-DPDK.") Signed-off-by: Flavio Leitner Reviewed-by: David Marchand --- tests/system-common-macros.at | 8 ++++++++ tests/system-traffic.at | 17 +++++++++++++++++ tests/system-tso-macros.at | 2 ++ 3 files changed, 27 insertions(+) diff --git a/tests/system-common-macros.at b/tests/system-common-macros.at index 19a0b125b..8b9f5c752 100644 --- a/tests/system-common-macros.at +++ b/tests/system-common-macros.at @@ -281,6 +281,14 @@ m4_define([OVS_START_L7], # m4_define([OFPROTO_CLEAR_DURATION_IDLE], [[sed -e 's/duration=.*s,/duration=,/g' -e 's/idle_age=[0-9]*,/idle_age=,/g']]) +# OVS_CHECK_TUNNEL_TSO() +# +# Macro to be used in general tunneling tests that could be also +# used by system-tso. In that case, tunneling is not supported and +# the test should be skipped. +m4_define([OVS_CHECK_TUNNEL_TSO], + [m4_ifdef([CHECK_SYSTEM_TSO], [AT_SKIP_IF(:)])]) + # OVS_CHECK_VXLAN() # # Do basic check for vxlan functionality, skip the test if it's not there. diff --git a/tests/system-traffic.at b/tests/system-traffic.at index d79753a99..6b01f8655 100644 --- a/tests/system-traffic.at +++ b/tests/system-traffic.at @@ -218,6 +218,7 @@ OVS_TRAFFIC_VSWITCHD_STOP AT_CLEANUP AT_SETUP([datapath - ping over vxlan tunnel]) +OVS_CHECK_TUNNEL_TSO() OVS_CHECK_VXLAN() OVS_TRAFFIC_VSWITCHD_START() @@ -259,6 +260,7 @@ OVS_TRAFFIC_VSWITCHD_STOP AT_CLEANUP AT_SETUP([datapath - ping over vxlan6 tunnel]) +OVS_CHECK_TUNNEL_TSO() OVS_CHECK_VXLAN_UDP6ZEROCSUM() OVS_TRAFFIC_VSWITCHD_START() @@ -302,6 +304,7 @@ OVS_TRAFFIC_VSWITCHD_STOP AT_CLEANUP AT_SETUP([datapath - ping over gre tunnel]) +OVS_CHECK_TUNNEL_TSO() OVS_CHECK_KERNEL_EXCL(3, 10, 4, 15) OVS_CHECK_GRE() @@ -343,6 +346,7 @@ OVS_TRAFFIC_VSWITCHD_STOP AT_CLEANUP AT_SETUP([datapath - ping over ip6gre L2 tunnel]) +OVS_CHECK_TUNNEL_TSO() OVS_CHECK_KERNEL_EXCL(3, 10, 4, 15) OVS_CHECK_GRE() OVS_CHECK_ERSPAN() @@ -383,6 +387,7 @@ AT_CLEANUP AT_SETUP([datapath - ping over erspan v1 tunnel]) +OVS_CHECK_TUNNEL_TSO() OVS_CHECK_KERNEL_EXCL(3, 10, 4, 15) OVS_CHECK_GRE() OVS_CHECK_ERSPAN() @@ -419,6 +424,7 @@ OVS_TRAFFIC_VSWITCHD_STOP AT_CLEANUP AT_SETUP([datapath - ping over erspan v2 tunnel]) +OVS_CHECK_TUNNEL_TSO() OVS_CHECK_KERNEL_EXCL(3, 10, 4, 15) OVS_CHECK_GRE() OVS_CHECK_ERSPAN() @@ -455,6 +461,7 @@ OVS_TRAFFIC_VSWITCHD_STOP AT_CLEANUP AT_SETUP([datapath - ping over ip6erspan v1 tunnel]) +OVS_CHECK_TUNNEL_TSO() OVS_CHECK_KERNEL_EXCL(3, 10, 4, 15) OVS_CHECK_GRE() OVS_CHECK_ERSPAN() @@ -494,6 +501,7 @@ OVS_TRAFFIC_VSWITCHD_STOP AT_CLEANUP AT_SETUP([datapath - ping over ip6erspan v2 tunnel]) +OVS_CHECK_TUNNEL_TSO() OVS_CHECK_KERNEL_EXCL(3, 10, 4, 15) OVS_CHECK_GRE() OVS_CHECK_ERSPAN() @@ -534,6 +542,7 @@ OVS_TRAFFIC_VSWITCHD_STOP AT_CLEANUP AT_SETUP([datapath - ping over geneve tunnel]) +OVS_CHECK_TUNNEL_TSO() OVS_CHECK_GENEVE() OVS_TRAFFIC_VSWITCHD_START() @@ -575,6 +584,7 @@ OVS_TRAFFIC_VSWITCHD_STOP AT_CLEANUP AT_SETUP([datapath - ping over geneve tunnel, delete flow regression]) +OVS_CHECK_TUNNEL_TSO() OVS_CHECK_GENEVE() OVS_TRAFFIC_VSWITCHD_START() @@ -629,6 +639,7 @@ OVS_TRAFFIC_VSWITCHD_STOP(["/|ERR|/d AT_CLEANUP AT_SETUP([datapath - flow resume with geneve tun_metadata]) +OVS_CHECK_TUNNEL_TSO() OVS_CHECK_GENEVE() OVS_TRAFFIC_VSWITCHD_START() @@ -680,6 +691,7 @@ OVS_TRAFFIC_VSWITCHD_STOP AT_CLEANUP AT_SETUP([datapath - ping over geneve6 tunnel]) +OVS_CHECK_TUNNEL_TSO() OVS_CHECK_GENEVE_UDP6ZEROCSUM() OVS_TRAFFIC_VSWITCHD_START() @@ -723,6 +735,7 @@ OVS_TRAFFIC_VSWITCHD_STOP AT_CLEANUP AT_SETUP([datapath - ping over gre tunnel by simulated packets]) +OVS_CHECK_TUNNEL_TSO() OVS_CHECK_MIN_KERNEL(3, 10) OVS_TRAFFIC_VSWITCHD_START() @@ -769,6 +782,7 @@ OVS_TRAFFIC_VSWITCHD_STOP AT_CLEANUP AT_SETUP([datapath - ping over erspan v1 tunnel by simulated packets]) +OVS_CHECK_TUNNEL_TSO() OVS_CHECK_MIN_KERNEL(3, 10) OVS_TRAFFIC_VSWITCHD_START() @@ -817,6 +831,7 @@ OVS_TRAFFIC_VSWITCHD_STOP AT_CLEANUP AT_SETUP([datapath - ping over erspan v2 tunnel by simulated packets]) +OVS_CHECK_TUNNEL_TSO() OVS_CHECK_MIN_KERNEL(3, 10) OVS_TRAFFIC_VSWITCHD_START() @@ -870,6 +885,7 @@ OVS_TRAFFIC_VSWITCHD_STOP AT_CLEANUP AT_SETUP([datapath - ping over ip6erspan v1 tunnel by simulated packets]) +OVS_CHECK_TUNNEL_TSO() OVS_CHECK_MIN_KERNEL(3, 10) OVS_TRAFFIC_VSWITCHD_START() @@ -925,6 +941,7 @@ OVS_TRAFFIC_VSWITCHD_STOP AT_CLEANUP AT_SETUP([datapath - ping over ip6erspan v2 tunnel by simulated packets]) +OVS_CHECK_TUNNEL_TSO() OVS_CHECK_MIN_KERNEL(3, 10) OVS_TRAFFIC_VSWITCHD_START() diff --git a/tests/system-tso-macros.at b/tests/system-tso-macros.at index 406334f3e..1a8004761 100644 --- a/tests/system-tso-macros.at +++ b/tests/system-tso-macros.at @@ -29,3 +29,5 @@ m4_define([CONFIGURE_VETH_OFFLOADS], [AT_CHECK([ethtool -K $1 sg on], [0], [ignore], [ignore])] [AT_CHECK([ethtool -K $1 tso on], [0], [ignore], [ignore])] ) + +m4_define([CHECK_SYSTEM_TSO], [])