From patchwork Fri Jul 10 12:07:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sriharsha Basavapatna X-Patchwork-Id: 1326725 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=openvswitch.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=broadcom.com header.i=@broadcom.com header.a=rsa-sha256 header.s=google header.b=SJKnP/4i; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4B3Bdh0C9qz9sDX for ; Fri, 10 Jul 2020 22:08:24 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 54768898FA; Fri, 10 Jul 2020 12:08:22 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LEwqiYmPDPsz; Fri, 10 Jul 2020 12:08:20 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by whitealder.osuosl.org (Postfix) with ESMTP id 0D77E89873; Fri, 10 Jul 2020 12:08:20 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id D8B87C1818; Fri, 10 Jul 2020 12:08:19 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 70673C016F for ; Fri, 10 Jul 2020 12:08:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id D8A1788513 for ; Fri, 10 Jul 2020 12:07:42 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id x4RhdTsY0ebr for ; Fri, 10 Jul 2020 12:07:39 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 18CCD87CEF for ; Fri, 10 Jul 2020 12:07:39 +0000 (UTC) Received: by mail-wr1-f65.google.com with SMTP id f7so5717496wrw.1 for ; Fri, 10 Jul 2020 05:07:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qHo9bQlRBDQMrw/LizDfbEOwAZ0TYPxyNII3QogBbM0=; b=SJKnP/4igit16VIH1fcN3oLCzqEfnDYspcrV56aeTsAudq6Ndq3LKROw4IhOcpvmY7 rQZHTkwfHCor8SmfE1WiShdO4N010AnxHEr9s9GnKpSK/kYZ/dax7SXdB7BpZZATWqV/ z5nSTYBQamBzeFBYpwk9cYoPxmsdqrkVuoBzQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qHo9bQlRBDQMrw/LizDfbEOwAZ0TYPxyNII3QogBbM0=; b=FVV9QM034AZrKWZV36AjuyTStIfG4OGSjI2CX1NjrgpzR7Ia7CUKmmm6fpDfwcmoiO RxqGBz+rubn6YNj92DCsTofAR4CHMjAiCjtxVyI8HQ9SbpErODwPNYazcm5FFrDXzqZQ PQk4TxqEz0f8jHEnPsT8KhiMpDAVCCruMCD/8tikGommDLcKGa9XQngx9y0ET2SDG2fM 5OPXBE3VjXqj50PPoA9xec7icNbfAT5y1aGzDXJodS7KKltGXSPol6IsXmmMDZ1UDJ6P i37zblZXZ77KFG1IZrsLr9EjzREvwswoO9VSukbZjcASaD5MmqLbFlYBGxkSuADZ+VwP qXJA== X-Gm-Message-State: AOAM532l1mwHGq5LsIfqfQNJqs9yJih1gnB5r2mCLgvX68F2MIUWSuOd 2H18KJbS568ZxkUaoDYpNNPiTvqUAzJRkOW4jWPoXT/LZNhLKOIm0FxyTRiAvVXF5T879QtD037 WbMJIONmRO5AwcPOYbd8pWcpThRA1XLzhud1l5/9p79JQTmURYTCWvdHpxN99js2p4+xDo0ZrGm 7goe5S X-Google-Smtp-Source: ABdhPJwY1AJwPZnF5w7s24DiytV+CazJbZEEJwLqwJ4B//XtrVMGADGLhr3Pe4F5QcnuzKXVSJUE/A== X-Received: by 2002:adf:e8ce:: with SMTP id k14mr65260721wrn.93.1594382857009; Fri, 10 Jul 2020 05:07:37 -0700 (PDT) Received: from dhcp-10-123-153-36.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id e8sm10263183wrp.26.2020.07.10.05.07.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jul 2020 05:07:36 -0700 (PDT) To: dev@openvswitch.org Date: Fri, 10 Jul 2020 08:07:18 -0400 Message-Id: <20200710120718.38633-4-sriharsha.basavapatna@broadcom.com> X-Mailer: git-send-email 2.25.0.rc2 In-Reply-To: <20200710120718.38633-1-sriharsha.basavapatna@broadcom.com> References: <20200710120718.38633-1-sriharsha.basavapatna@broadcom.com> MIME-Version: 1.0 Subject: [ovs-dev] [PATCH 3/3] tunnel: Set ECN mask bits only when it is matched in the IP header 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: , X-Patchwork-Original-From: Sriharsha Basavapatna via dev From: Sriharsha Basavapatna Reply-To: Sriharsha Basavapatna Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" IP_ECN_MASK is set unconditionally in the mask field for a tunneled flow. Set this only when the ECN field is matched. Fixes: abcd4402fec4 ("tunnel: Only un-wildcard the ECN bits for IP traffic") Signed-off-by: Sriharsha Basavapatna Tested-by: Emma Finn --- ofproto/tunnel.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ofproto/tunnel.c b/ofproto/tunnel.c index 03f0ab765..d0a65b430 100644 --- a/ofproto/tunnel.c +++ b/ofproto/tunnel.c @@ -455,13 +455,17 @@ tnl_port_send(const struct ofport_dpif *ofport, struct flow *flow, /* ECN fields are always inherited. */ if (is_ip_any(flow)) { - wc->masks.nw_tos |= IP_ECN_MASK; - if (IP_ECN_is_ce(flow->nw_tos)) { flow->tunnel.ip_tos |= IP_ECN_ECT_0; } else { flow->tunnel.ip_tos |= flow->nw_tos & IP_ECN_MASK; } + + if (flow->tunnel.ip_tos & IP_ECN_MASK) { + wc->masks.nw_tos |= IP_ECN_MASK; + } else { + wc->masks.nw_tos &= ~IP_ECN_MASK; + } } flow->tunnel.flags &= ~(FLOW_TNL_F_MASK & ~FLOW_TNL_PUB_F_MASK);