From patchwork Wed May 3 01:12:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ihar Hrachyshka X-Patchwork-Id: 1776083 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=) 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=SpjgxSVJ; dkim-atps=neutral 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 (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Q9zTN1nfJz1ydX for ; Wed, 3 May 2023 11:12:55 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 897E983B0F; Wed, 3 May 2023 01:12:53 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 897E983B0F Authentication-Results: smtp1.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=SpjgxSVJ 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 TVran8u-hPBi; Wed, 3 May 2023 01:12:49 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp1.osuosl.org (Postfix) with ESMTPS id E33A8822C0; Wed, 3 May 2023 01:12:48 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org E33A8822C0 Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id A7B15C0037; Wed, 3 May 2023 01:12:48 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) by lists.linuxfoundation.org (Postfix) with ESMTP id C818AC002A for ; Wed, 3 May 2023 01:12:47 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 9C912822C3 for ; Wed, 3 May 2023 01:12:47 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 9C912822C3 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 dSM-RK_Q60fa for ; Wed, 3 May 2023 01:12:46 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 7FB27822C0 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 7FB27822C0 for ; Wed, 3 May 2023 01:12:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683076365; 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=53btl46/gbW+1AME5aKGDxaGkOj+bdL4X9QO1hbjWM0=; b=SpjgxSVJeHV7tUazi5ufMz7nSm3h6VZsjpw/vyTt3bTAVd6AumnOOob99lZwC73d8m/H6i E5GdPue2Hej9ecMBUIEuJvtbsN6umbWoB/2zlPWGPvxOLqGZCCMPnt6fFg17eCQT8tKtrQ UPrp5mrSYZypk/H+NWRkrf1Mgo3A1sg= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-387-UMkaz1slNbeNlUWSpRPZrw-1; Tue, 02 May 2023 21:12:44 -0400 X-MC-Unique: UMkaz1slNbeNlUWSpRPZrw-1 Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-61b62c71a61so26238866d6.2 for ; Tue, 02 May 2023 18:12:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683076363; x=1685668363; 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=53btl46/gbW+1AME5aKGDxaGkOj+bdL4X9QO1hbjWM0=; b=H6IpPuBlj9y3w6J91msDtNL6J8+TO5GM3fZxYYPip1NHvHrtG6kderpCBPJN1gWxL2 OovQ4XfCyWCrBMV79FVtQ2972lUxAHsRZsNwA/QO28MqaZG/DCu66IvZbe10QJgFfQjr CEkJuGaKf0qTMlGVyePTfug+0iyJRanJsKumRQAkHPavR19FKIXMErNYHlPobzeyZ/uQ gxAGSKQOBHnPvXHP0cSXv3CSFc2Mw3MvmZav8pPnYgkJlsQ2NxNqpncGcguHSN4gu4Nm 81EMux+E++TiMPl2wcSUP2dq0zGb8pIiaUJ6Z4NCsIny351m37f6lGpdEBtxCmc5I/OE i8Zw== X-Gm-Message-State: AC+VfDytzoLwZgvM0yyV+piIgMRJnR+8I3nYcwhIla7Ik/9Ir5UJMZ5k ExcPZPI0QHl3JxmupOi6BeUfSdvRbDJfoGSzmlh4wKTUmCjZTQuj+VNe+qF0RUv7sjObgLh306W Id4ySrAmSwDB259P1QnyMaHnM/0JTo0pjCaS+pdZIqaTn8TSasyZ58XU7FnrvPBhmjdRS/gBM X-Received: by 2002:ad4:5dc9:0:b0:619:3665:7ef8 with SMTP id m9-20020ad45dc9000000b0061936657ef8mr6965840qvh.26.1683076363375; Tue, 02 May 2023 18:12:43 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6Z7KA/HrebnPQkRf/kpUfhr4Yy9ou28YAu1a/lTulevCp0IWlqWirVrLZNOi3Qst1RvV8cpg== X-Received: by 2002:ad4:5dc9:0:b0:619:3665:7ef8 with SMTP id m9-20020ad45dc9000000b0061936657ef8mr6965829qvh.26.1683076363075; Tue, 02 May 2023 18:12:43 -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 u16-20020a0cf1d0000000b005ef42464646sm9959041qvl.118.2023.05.02.18.12.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 May 2023 18:12:42 -0700 (PDT) From: Ihar Hrachyshka To: dev@openvswitch.org Date: Wed, 3 May 2023 01:12:33 +0000 Message-Id: <20230503011239.2100488-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 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. 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 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 | 586 ++++++++++++++++++++++++++++-------- 18 files changed, 1137 insertions(+), 339 deletions(-)