From patchwork Tue Jan 25 05:25:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tonghao Zhang X-Patchwork-Id: 1583891 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" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=iuyKsEMF; dkim-atps=neutral Authentication-Results: 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=) 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 RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Jjb0Q0lClz9t0k for ; Tue, 25 Jan 2022 16:25:24 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id AF97D84CD8; Tue, 25 Jan 2022 05:25:21 +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 uhNfiVcxTCdK; Tue, 25 Jan 2022 05:25:20 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp1.osuosl.org (Postfix) with ESMTPS id EC74584C31; Tue, 25 Jan 2022 05:25:19 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 98A86C0039; Tue, 25 Jan 2022 05:25: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 99E87C002F for ; Tue, 25 Jan 2022 05:25:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 7590C84C3E for ; Tue, 25 Jan 2022 05:25: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 VBudUW5jlN7D for ; Tue, 25 Jan 2022 05:25:16 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by smtp1.osuosl.org (Postfix) with ESMTPS id B67DD84C31 for ; Tue, 25 Jan 2022 05:25:16 +0000 (UTC) Received: by mail-pj1-x1034.google.com with SMTP id o11so1564567pjf.0 for ; Mon, 24 Jan 2022 21:25:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=4RXMuLMgc67QIKYGJhjuR29aSO+qS7zppSAXRXz56/E=; b=iuyKsEMF2Un9D1qRP8STKZdwO3rXLqvO2Io4vUVEqAcYDXbhJJ1J09rOvYEjKN8wRl baM5MgthCuEr2h0IYy0zfPvGRfyvNCXnnAhJaU1/C88peKJvvhDsTE2uFos5FD8chX9j 2n9hKOb6oK5mDcOLA/JEvPl+NG0I7WH0CIVslnfL+K03yzk1zWGsf2BHh4JhInfiOt9D dD3YJOLt7zkY6jOarHrTbkHhTwwwGaumcCna92oopCdYY+M8zGaVUoKtHW8IofHlOnRk kxnJN549pZv4PRnRd78Yse5rdX5n8kIWNKkhfPVWgjz00z5oNTLj3kmcmedrOH3k0QxV 3Mww== 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=4RXMuLMgc67QIKYGJhjuR29aSO+qS7zppSAXRXz56/E=; b=AllTD3TNY+weaf4qqxcRDJX0sk8RRREVsmXvOETWE13vXxJm/mCK6IJ8hi/LNBi9X4 eTFryzIFvBYlQ3HR0nxZy2caqvyKPahZ4TmFyEtHz74wnd9EADzidhEnaIVD6jBsZSw8 /NWpjSLeAsGcNy/OfiVUJSk/LVmcIPZAV6P0pL4XdagotcC5vXa6r2+9ysCi82UDHSEb 0L30++SJFHwWknIIKvZWuWPR9oxz3dqhORjEtobffleh8moW3m5WZDUE97Pw43YkH07+ YVjzr/H9zLwxKyuSLsCbJgoD+nHKB7F6uyR+4aWFgLIxJ63rXyA76ArFM6uFQ0/UIrFc iA6w== X-Gm-Message-State: AOAM532L6ZytJRKHlM7PFR5n6hmlgOws0nxDI0I15D9VDdCzzDdExU8N 7QEgA5CNhJJc/6AFVk741QTcT2D1kEjYzg== X-Google-Smtp-Source: ABdhPJyhdtGfFf8hkXx2+oJ2fCtlq6pWoCspfoPFlQi7AmK1zn1nfnWRZYIPzzvD7Dc7z+JejE0wSw== X-Received: by 2002:a17:90b:30c9:: with SMTP id hi9mr1883917pjb.68.1643088315825; Mon, 24 Jan 2022 21:25:15 -0800 (PST) Received: from localhost.localdomain ([111.204.182.106]) by smtp.gmail.com with ESMTPSA id f6sm4707145pfv.30.2022.01.24.21.25.14 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Jan 2022 21:25:15 -0800 (PST) From: xiangxia.m.yue@gmail.com To: dev@openvswitch.org Date: Tue, 25 Jan 2022 13:25:08 +0800 Message-Id: <20220125052508.93060-1-xiangxia.m.yue@gmail.com> X-Mailer: git-send-email 2.30.1 (Apple Git-130) MIME-Version: 1.0 Cc: i.maximets@ovn.org Subject: [ovs-dev] [ovs-dev v2] tunnel: Remove padding from packet when encapsulating. 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" From: Tonghao Zhang The old version of openvswitch doesn't remove the padding from packet before L3+ conntrack processing and then packets are dropped in linux kernel stack. The patch [1] fixes the issue. We fix this issue on gateway which running ovs-dpdk as a quick workaround. Padding should be removed because tunnel size + inner size > 64B. More detailes, see [1] [1] - https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=9382fe71c0058465e942a633869629929102843d Signed-off-by: Tonghao Zhang Reviewed-by: Harold Huang --- v2: add OVS_UNLIKELY v1: this version was submitted a year ago http://patchwork.ozlabs.org/project/openvswitch/patch/20201214030936.87354-1-xiangxia.m.yue@gmail.com/ --- lib/netdev-native-tnl.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/netdev-native-tnl.c b/lib/netdev-native-tnl.c index b89dfdd52a86..e23d71d4aec1 100644 --- a/lib/netdev-native-tnl.c +++ b/lib/netdev-native-tnl.c @@ -149,11 +149,15 @@ void * netdev_tnl_push_ip_header(struct dp_packet *packet, const void *header, int size, int *ip_tot_size) { + int padding = dp_packet_l2_pad_size(packet); struct eth_header *eth; struct ip_header *ip; struct ovs_16aligned_ip6_hdr *ip6; eth = dp_packet_push_uninit(packet, size); + if (OVS_UNLIKELY(padding)) { + dp_packet_set_size(packet, dp_packet_size(packet) - padding); + } *ip_tot_size = dp_packet_size(packet) - sizeof (struct eth_header); memcpy(eth, header, size);