From patchwork Fri Jul 10 12:07:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sriharsha Basavapatna X-Patchwork-Id: 1326724 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.137; helo=fraxinus.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=NaWHCv02; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4B3Bdf0wGqz9sRN for ; Fri, 10 Jul 2020 22:08:22 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 4D901888F6; Fri, 10 Jul 2020 12:08:19 +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 2DfYjPX5KYhj; Fri, 10 Jul 2020 12:08:18 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by fraxinus.osuosl.org (Postfix) with ESMTP id AFB29888F3; Fri, 10 Jul 2020 12:08:18 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 8D780C016F; Fri, 10 Jul 2020 12:08:18 +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 1292AC0895 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 1557487CC3 for ; Fri, 10 Jul 2020 12:07:35 +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 6GaTJaqD2XPK for ; Fri, 10 Jul 2020 12:07:34 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 5838087BDC for ; Fri, 10 Jul 2020 12:07:34 +0000 (UTC) Received: by mail-wm1-f67.google.com with SMTP id l2so5683682wmf.0 for ; Fri, 10 Jul 2020 05:07:34 -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=IRwMJW+c8D4SEsTP+80Qjnw9pNSD/LUWHACgyj6J4hE=; b=NaWHCv02zDqFWzO6Ob7srM9guEcGwu4UlhFSGM3W5JVk/6hOGjXxAKthZh2SF5z3iY STNtGXghUeX1YKgXakayiXrkEJWanT0G1/wg1mKDbEqMkclg1xQVmmouleu5ju/Qc5k6 1KXEEDhdM94QzdeNbrhRklkL4HDAjeuQxH0/g= 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=IRwMJW+c8D4SEsTP+80Qjnw9pNSD/LUWHACgyj6J4hE=; b=hnRn+yV9vrPm6EJFkIXwhUA5gwMoRW4OuDRdHEZQCIgshNi37X08Wrho5JClRh7crg eF3Vw/3hv8G6ayXIGam9p1h6htFHXBdYnhAgxShS9FQA/ME/cTdg+bHJ7yNUdGvmE1qH GIAElEJan+HjNRAP51ipiPc+aeP4ZyW0CN7axfLhYKaREk+8eBlsdaJZF8cPxdN3G3r0 n3Pr96rTeSoUYcyX8x/3dBaVMl7BUsaALDRo9y1HbRPKhbWGIULsEBajaVmUm2RvVKuI 7if0MbFq5ov8U95fkqtDA7/V8Yy0DI4cq/MoOrjYuTVGfLAn8lfPfnDgRLqO+kWuvPux ztrQ== X-Gm-Message-State: AOAM530Ym2OwPVcNmCLjsXdN4jvdc/Qvoi1qwuHpiY7sbUxJzC/Er1SV BFLTRdFuQ/b0t5PfjT+baqKJn30ictbMVzMkMvWYuC3vYghcgLFBOSMfD7pH7Em5pp40rS/4YgE sfyvwxlcnhTcWre0gRAhLIdyCS8WYG/SxKkP5GQUIULdCQuQmpixoEfh80O5bids+dbpH8IeDp6 ayfm2u X-Google-Smtp-Source: ABdhPJyX+mt6HJU4z61UnhK03fkBglBgDTv/kIg10+iKqqd8pOsHeodioYYhkNJIqwnsymJWdZY/Mw== X-Received: by 2002:a1c:2bc1:: with SMTP id r184mr5096762wmr.133.1594382852303; Fri, 10 Jul 2020 05:07:32 -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.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jul 2020 05:07:31 -0700 (PDT) To: dev@openvswitch.org Date: Fri, 10 Jul 2020 08:07:16 -0400 Message-Id: <20200710120718.38633-2-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 1/3] netdev-offload-dpdk: Set transfer attribute to zero for mark/rss offload 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" The offload layer doesn't initialize the 'transfer' attribute for mark/rss offload (partial offload). It should be set to 0. Fixes: 60e778c7533a ("netdev-offload-dpdk: Framework for actions offload.") Signed-off-by: Sriharsha Basavapatna --- lib/netdev-offload-dpdk.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/netdev-offload-dpdk.c b/lib/netdev-offload-dpdk.c index 26a75f0f2..4c652fd82 100644 --- a/lib/netdev-offload-dpdk.c +++ b/lib/netdev-offload-dpdk.c @@ -818,7 +818,8 @@ netdev_offload_dpdk_mark_rss(struct flow_patterns *patterns, .group = 0, .priority = 0, .ingress = 1, - .egress = 0 + .egress = 0, + .transfer = 0 }; struct rte_flow_error error; struct rte_flow *flow; From patchwork Fri Jul 10 12:07:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sriharsha Basavapatna X-Patchwork-Id: 1326723 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=IXx+858w; 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 4B3Bcw5sSWz9sDX for ; Fri, 10 Jul 2020 22:07:44 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id E6570898CB; Fri, 10 Jul 2020 12:07:42 +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 Vz924DEyNBSM; Fri, 10 Jul 2020 12:07:40 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by whitealder.osuosl.org (Postfix) with ESMTP id D052389830; Fri, 10 Jul 2020 12:07:40 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id B9098C077B; Fri, 10 Jul 2020 12:07:40 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 463F5C016F for ; Fri, 10 Jul 2020 12:07:40 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id A251B88162 for ; Fri, 10 Jul 2020 12:07:37 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yJkB0-Lglnwy for ; Fri, 10 Jul 2020 12:07:37 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by hemlock.osuosl.org (Postfix) with ESMTPS id B6CFF88084 for ; Fri, 10 Jul 2020 12:07:36 +0000 (UTC) Received: by mail-wm1-f67.google.com with SMTP id l17so5933652wmj.0 for ; Fri, 10 Jul 2020 05:07:36 -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=YGL4dfQD4iM9SWuhdigUao3S7vYf8C3yZEIKjzr0Cn8=; b=IXx+858wJtxKE1/Hd/1EDdmSoz0SeKnANs1cOjhVsdavq1MYpvEzdC1DtJ9AqxBoQi 8n5JoB5RPd8+IMGwxKrFnjcu3/vhkv2LMpBsj04AjCEYkXmN8C7shWUI9QuuFb8Q2x26 oJZ/5KUDtU4Sk9H8YmjWEhz6yMieIPuHbwZXM= 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=YGL4dfQD4iM9SWuhdigUao3S7vYf8C3yZEIKjzr0Cn8=; b=mNLG7nUWPLoGN+aT919VMgCmVj8/vAc6JN8s4kMon026xLBcArD200E1To1DegFJyR GdA44/XMzcJkpdv1ms9hxQbOoVEyjCiLlGTgVUzNV9FS/5Zjn0n5YzkqJ1JPqh5ar6Ea 1soJjZXNW/nUnKPW1RRjIbANi0DHjxVa1YEnZ3Q1ZvB33HEc3ysCMfN4E8jmTTt16sAX 2UwkNi2C80y5nbiq2UgvDISIdYyk4JImk3hbr/lfhjAtsII32oTrc7uk+uYCk57gaWwF ON/vrtxCdCslhTpwBnoZExvB35mN0GfC+rUuyWAZedZWHUh+Buw+ewspOBYaxuDKAukn R+oQ== X-Gm-Message-State: AOAM532zjgYkYzfe6HLmZOEK8flZy/Zs0Ob/vJrWCSXd6cmXEqQg2gjr gnVBwoLwZVjtdJv8g+xAps6zW4P2QSxe/KfTZw0HMZ0vN8X3z960gBrTrKzmPEb0oxD2nvOE7Uw aEkIEeVZ/S/8185ek1Of84LlTTqnBXlljzsn6cJrizBUyrDzZMjIjtCVp/I32nHXu3XObbGuRzC 1L8z62 X-Google-Smtp-Source: ABdhPJxBO+EPMxKyDWADorp+cDFMsozydWDhiYfJWCO7ugpJmE9Q9D7wTMIoWQjBQYiQhDSVKP7OKQ== X-Received: by 2002:a1c:a986:: with SMTP id s128mr5177490wme.121.1594382854670; Fri, 10 Jul 2020 05:07:34 -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.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jul 2020 05:07:33 -0700 (PDT) To: dev@openvswitch.org Date: Fri, 10 Jul 2020 08:07:17 -0400 Message-Id: <20200710120718.38633-3-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 2/3] netdev-offload-dpdk: Pass L4 proto-id to match in the L3 rte_flow_item 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" The offload layer clears the L4 protocol mask in the L3 item, when the L4 item is passed for matching, as an optimization. This can be confusing while parsing the headers in the PMD. Also, the datapath flow specifies this field to be matched. This optimization is best left to the PMD. This patch restores the code to pass the L4 protocol type in L3 match. Fixes: e8a2b5bf92bb ("netdev-dpdk: implement flow offload with rte flow") Signed-off-by: Sriharsha Basavapatna Acked-by: Eli Britstein --- lib/netdev-offload-dpdk.c | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/lib/netdev-offload-dpdk.c b/lib/netdev-offload-dpdk.c index 4c652fd82..165fd1f47 100644 --- a/lib/netdev-offload-dpdk.c +++ b/lib/netdev-offload-dpdk.c @@ -596,7 +596,6 @@ static int parse_flow_match(struct flow_patterns *patterns, const struct match *match) { - uint8_t *next_proto_mask = NULL; uint8_t proto = 0; /* Eth */ @@ -667,7 +666,6 @@ parse_flow_match(struct flow_patterns *patterns, /* Save proto for L4 protocol setup. */ proto = spec->hdr.next_proto_id & mask->hdr.next_proto_id; - next_proto_mask = &mask->hdr.next_proto_id; } if (proto != IPPROTO_ICMP && proto != IPPROTO_UDP && @@ -701,11 +699,6 @@ parse_flow_match(struct flow_patterns *patterns, mask->hdr.tcp_flags = ntohs(match->wc.masks.tcp_flags) & 0xff; add_flow_pattern(patterns, RTE_FLOW_ITEM_TYPE_TCP, spec, mask); - - /* proto == TCP and ITEM_TYPE_TCP, thus no need for proto match. */ - if (next_proto_mask) { - *next_proto_mask = 0; - } } else if (proto == IPPROTO_UDP) { struct rte_flow_item_udp *spec, *mask; @@ -719,11 +712,6 @@ parse_flow_match(struct flow_patterns *patterns, mask->hdr.dst_port = match->wc.masks.tp_dst; add_flow_pattern(patterns, RTE_FLOW_ITEM_TYPE_UDP, spec, mask); - - /* proto == UDP and ITEM_TYPE_UDP, thus no need for proto match. */ - if (next_proto_mask) { - *next_proto_mask = 0; - } } else if (proto == IPPROTO_SCTP) { struct rte_flow_item_sctp *spec, *mask; @@ -737,11 +725,6 @@ parse_flow_match(struct flow_patterns *patterns, mask->hdr.dst_port = match->wc.masks.tp_dst; add_flow_pattern(patterns, RTE_FLOW_ITEM_TYPE_SCTP, spec, mask); - - /* proto == SCTP and ITEM_TYPE_SCTP, thus no need for proto match. */ - if (next_proto_mask) { - *next_proto_mask = 0; - } } else if (proto == IPPROTO_ICMP) { struct rte_flow_item_icmp *spec, *mask; @@ -755,11 +738,6 @@ parse_flow_match(struct flow_patterns *patterns, mask->hdr.icmp_code = (uint8_t) ntohs(match->wc.masks.tp_dst); add_flow_pattern(patterns, RTE_FLOW_ITEM_TYPE_ICMP, spec, mask); - - /* proto == ICMP and ITEM_TYPE_ICMP, thus no need for proto match. */ - if (next_proto_mask) { - *next_proto_mask = 0; - } } add_flow_pattern(patterns, RTE_FLOW_ITEM_TYPE_END, NULL, NULL); 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);