From patchwork Wed May 3 20:13:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ihar Hrachyshka X-Patchwork-Id: 1776642 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.137; helo=smtp4.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=h0QGE/XX; dkim-atps=neutral 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 ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QBSnt0Mvsz20fg for ; Thu, 4 May 2023 06:13:53 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 360684089A; Wed, 3 May 2023 20:13:51 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 360684089A Authentication-Results: smtp4.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=h0QGE/XX 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 QNeQIc4rrIPQ; Wed, 3 May 2023 20:13:49 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp4.osuosl.org (Postfix) with ESMTPS id D98E140883; Wed, 3 May 2023 20:13:48 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org D98E140883 Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 995E3C007A; Wed, 3 May 2023 20:13:48 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 3152CC002A for ; Wed, 3 May 2023 20:13:47 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id F14C740883 for ; Wed, 3 May 2023 20:13:46 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org F14C740883 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 0keuVxfEjc2W for ; Wed, 3 May 2023 20:13:45 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 2DEC34086D Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by smtp4.osuosl.org (Postfix) with ESMTPS id 2DEC34086D for ; Wed, 3 May 2023 20:13:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683144823; 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=IXW2hENtphHzzsHaqy2iMXUxSSg+3MWF0PzdBSFKlSQ=; b=h0QGE/XXuCVMltdLpbLXHhv/kn9eX3uZpFqj7Fk+C4T+Yvf5eoZb3Crb/whq36I00UmoWV qR7goKJJC0JD5hTHfNFIJDgFs7To+GPRjQMlaKcx4NQXa1yE/Kj2CRvXyQGguZlnJQ0V7H MMNUlpMQeOLzdOpn/q8gkU8Az+PG2HQ= Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-512-Us9CoYMINNCpdVuYB8TgTQ-1; Wed, 03 May 2023 16:13:42 -0400 X-MC-Unique: Us9CoYMINNCpdVuYB8TgTQ-1 Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-74cef8ed06aso633281985a.0 for ; Wed, 03 May 2023 13:13:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683144821; x=1685736821; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=IXW2hENtphHzzsHaqy2iMXUxSSg+3MWF0PzdBSFKlSQ=; b=RoBEJmNzmIver8zNm84yLML8VWQ9+9rQ0QYeSr6O/MPJ4jV5aK05rGaoszzIT/3AyS 4TEgFYyq8Zuf2Yo/U01DHzc5fhKSj/hAGrwdyJT6our1VHXRkU6bMAghNVEsohkGh6fE hVTiUegA9S+DbCjn1KPWZiCaXp/aUeu4o/FSruAKeFxtTk/0SvrOCkgpA9iEsmDfehL1 9ypILMx+mQToDNN4MKfbiP2G5mgcLYd7rW5qZlCML4bgXLYn1OwyY6wQC8o6yCXChTQB 4k9b/z/eVFjZcZHaMGi3PbcMZ4tTpijLNYhRYZtqwTm2FtPEz4bY1mzeSBV8OSiVvZHs eEOw== X-Gm-Message-State: AC+VfDyX0mV5KMG9FyPLIKFHMf9EdSyYSCd33jboAiynqoaJLpejWmFJ e+lUn8E4q84v/GSqdR9KP50YXO4Yb6cUPYFyEodXFGtiLeUTjkrP2sZ60wxN4H0X2uUBiCUYpJc CEzvxN47q4wUmwEzINd2vs33vWsRBqS0+ngJnCaffJREg09nCIEqEt1duTUnNerEb/u6jY5fu X-Received: by 2002:a05:6214:407:b0:5f1:6892:743c with SMTP id z7-20020a056214040700b005f16892743cmr13919583qvx.24.1683144821448; Wed, 03 May 2023 13:13:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5uvaseQprvGdCdO87EUtsHlF4ieOsjxq+J30snj/WsH+gLtHdfU4qxqoQb/lMrEit199teiA== X-Received: by 2002:a05:6214:407:b0:5f1:6892:743c with SMTP id z7-20020a056214040700b005f16892743cmr13919542qvx.24.1683144821061; Wed, 03 May 2023 13:13:41 -0700 (PDT) Received: from fedora34.localdomain.com (cpe-172-73-180-250.carolina.res.rr.com. [172.73.180.250]) by smtp.gmail.com with ESMTPSA id z13-20020a0cda8d000000b005ef442226bbsm2476138qvj.8.2023.05.03.13.13.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 May 2023 13:13:40 -0700 (PDT) From: Ihar Hrachyshka To: dev@openvswitch.org Date: Wed, 3 May 2023 20:13:31 +0000 Message-Id: <20230503201337.46104-1-ihrachys@redhat.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH ovn v2 0/6] Implement MTU Path Discovery for multichassis ports 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 series fixes a non-optimal behavior with some multichassis ports. Specifically, - when a multichassis port belongs to a switch that also has a localnet port, - because ingress and egress traffic for the port is funnelled through tunnels to guarantee delivery of packets to all chassis that host the port, - because tunnels add overhead to each funnelled packet, - leaving less space for actual packets, ... the effective MTU of the path for multichassis ports is reduced by the size that takes the tunnel to wrap a packet around. (This depends on the type of tunnel, also on IP version of the tunnel.) When this happens, the port and its peers are not notified about the reduced MTU for the path to the port, effectively blackholing some of the larger packets. This patch series makes OVN detect these scenarios and handle them as follows: - for all multichassis ports, 4 flows are added - for inport and outport matches - to detect "too-big" IP packets; - for all "too-big" packets, 2 flows are added to produce a ICMP Fragmentation Needed (for IPv4) or Too Big (for IPv6) packet and return it to the offending sender. The proposed implementation is isolated in ovn-controller. An alternative would be to implement flows producing ICMP errors via the existing Logical_Flow action icmp4_error, as is done for router ports. In this case, the 4 flows that detect "too-big" packets would still have to reside in ovn-controller because of limitations of the current OVN port model, namely lack of `mtu` as an attribute of OVN logical port. Caveats: this works for IP traffic only. The party receiving the ICMP error should handle it by temporarily lowering the MTU used to reach the port. Behavior may depend on protocol implementation of the offending peer as well as its networking stack configuration. This patch series was successfully tested with Linux kernel 6.0.8. This patch series is designed to simplify backporting process. It is split in logical pieces to simplify cherry-picking. I consider the original behavior described at the start of the cover letter a bug and worth a backport. --- v1: - initial version. v2: - more system test cases adjusted to new table numbers for egress pipeline; - switch from xxd to coreutils (tr, head) tools to avoid a new dependency; - adjusted a comment in the new test case to avoid "migrator" terminology that makes no sense outside live migration context - which is not the only potential use case for multichassis ports; - guard the new test case with HAVE_SCAPY; - nit: rewrapped some lines in patch 6/7 to avoid unnecessary line changes; - added a NEWS entry for patch 6/7 that implements the core of the feature; - rebased to latest main. --- Ihar Hrachyshka (6): Track ip version of tunnel in chassis_tunnel struct Track interface MTU in if-status-mgr if-status: track interfaces for additional chassis Add new egress tables to accommodate for too-big packets handling Implement MTU Path Discovery for multichassis ports Update multichassis physical flows on interface MTU update NEWS | 6 + controller/binding.c | 48 +-- controller/binding.h | 4 + controller/if-status.c | 44 ++- controller/if-status.h | 11 +- controller/lflow.c | 4 +- controller/lflow.h | 49 +-- controller/local_data.c | 2 + controller/local_data.h | 1 + controller/ovn-controller.c | 76 +++++ controller/ovsport.c | 9 + controller/ovsport.h | 2 + controller/physical.c | 369 ++++++++++++++++++++-- controller/physical.h | 2 + controller/pinctrl.c | 8 +- lib/ovn-util.h | 11 + ovn-architecture.7.xml | 76 ++--- tests/ovn-controller.at | 174 +++++----- tests/ovn.at | 611 +++++++++++++++++++++++++++--------- tests/system-ovn-kmod.at | 2 +- tests/system-ovn.at | 8 +- 21 files changed, 1161 insertions(+), 356 deletions(-)