From patchwork Fri Aug 16 18:54:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nitin Katiyar X-Patchwork-Id: 1148150 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=ericsson.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ericsson.com header.i=@ericsson.com header.b="P/xiiSFe"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4690Yd5tQ5z9s3Z for ; Fri, 16 Aug 2019 20:53:57 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 74B26EC3; Fri, 16 Aug 2019 10:53:54 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 350D6E93 for ; Fri, 16 Aug 2019 10:53:53 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from sesbmg22.ericsson.net (sesbmg22.ericsson.net [193.180.251.48]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id E724487B for ; Fri, 16 Aug 2019 10:53:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; d=ericsson.com; s=mailgw201801; c=relaxed/relaxed; q=dns/txt; i=@ericsson.com; t=1565952829; x=1568544829; h=From:Sender:Reply-To:Subject:Date:Message-ID:To:CC:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=wn7adE2OR0B1sTrcXrbM4FYFzMVRILIak9Sbi8nAs2g=; b=P/xiiSFeuSc43u/lvdXZbS6hMOR5t1MHW/WOX+lpKMAFRnaKMLUTh8Vqc04q048k AUxsKmfl5D35IhktxKzdoXxb+OSyEt722tcVLSy8OlyRzCtTwF+hcJSorLMvNVJW r31FLPAUrpQWZK8fihV4RICl9HuN9117N56+495T9pc=; X-AuditID: c1b4fb30-6ddff70000001814-b4-5d568b3db9b0 Received: from ESESBMB504.ericsson.se (Unknown_Domain [153.88.183.117]) by sesbmg22.ericsson.net (Symantec Mail Security) with SMTP id 58.7B.06164.D3B865D5; Fri, 16 Aug 2019 12:53:49 +0200 (CEST) Received: from ESESBMR503.ericsson.se (153.88.183.135) by ESESBMB504.ericsson.se (153.88.183.117) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Fri, 16 Aug 2019 12:53:48 +0200 Received: from ESESBMR503.ericsson.se (153.88.183.135) by ESESBMR503.ericsson.se (153.88.183.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Fri, 16 Aug 2019 12:53:48 +0200 Received: from ESGSCHC001.ericsson.se (146.11.116.68) by ESESBMR503.ericsson.se (153.88.183.135) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA_P256) id 15.1.1713.5 via Frontend Transport; Fri, 16 Aug 2019 12:53:48 +0200 Received: from localhost.localdomain (146.11.116.127) by smtps-ao.internal.ericsson.com (146.11.116.68) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 16 Aug 2019 18:53:37 +0800 From: Nitin Katiyar To: Date: Sat, 17 Aug 2019 00:24:33 +0530 Message-ID: <1565981673-3563-1-git-send-email-nitin.katiyar@ericsson.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [146.11.116.127] X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrDLMWRmVeSWpSXmKPExsUyM2J7qa5td1isQe8UAYu5n54zOjB6PLv5 nzGAMYrLJiU1J7MstUjfLoErY+76IywFvzkrNhxby97A+Iy9i5GTQ0LAROL8u42sXYxcHEIC RxklDr2/yAqSEBL4xijRtbIMIgFkb599iw3C6WSSeHL9AAuEs5tR4uPapSwgLWwCBhLbL04C mysiICvRsOEfUJyDg1lAT2LBXrCpwgL+Eqv7LjOB2CwCqhI3Xy9gBrF5BTwlVrdAjJEQkJM4 eWwyK0RcUOLkzCdgcWYBCYmDL14wQ1ynLvHkUTcTRL2SxLNvy1knMArOQtIyC0nLAkamVYyi xanFSbnpRkZ6qUWZycXF+Xl6eaklmxiBYXhwy2+DHYwvnzseYhTgYFTi4X27RTxWiDWxrLgy 9xCjBAezkgiv5DmRWCHelMTKqtSi/Pii0pzU4kOM0hwsSuK8673/xQgJpCeWpGanphakFsFk mTg4pRoYzWxWCIYYHHdmTVwTlshZ2zvd3u340m+pi5l+fM35eXyH3exnp9pXyR+qYmLl7dF8 I/lb6rhhjO/r45dn3445a+RYsXtSvnHf7jTZOanKeS/214dcKzKwN9h4s6yG0dLv4x12zSMr fhY+fa3YnbP2uc6P8jqu60lHFI+LbWq5vLVPl7FkzoWLSizFGYmGWsxFxYkAAc21wz8CAAA= X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00, DATE_IN_FUTURE_06_12, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Nitin Katiyar Subject: [ovs-dev] [PATCH] packets: Fix using outdated RSS hash after MPLS decapsulation. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org When a packet is received, the RSS hash is calculated if it is not already available. The Exact Match Cache (EMC) entry is then looked up using this RSS hash. When a MPLS encapsulated packet is received, the MPLS header is popped and the packet is recirculated. Since the RSS hash has not been invalidated here, the EMC lookup will hit the same entry as that before recirculation. This degrades performance severely. This patch invalidates RSS hash (by resetting offload flags) after MPLS header is popped. Signed-off-by: Nitin Katiyar --- lib/packets.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/packets.c b/lib/packets.c index ab0b1a3..db3f6d0 100644 --- a/lib/packets.c +++ b/lib/packets.c @@ -404,6 +404,10 @@ pop_mpls(struct dp_packet *packet, ovs_be16 ethtype) struct mpls_hdr *mh = dp_packet_l2_5(packet); size_t len = packet->l2_5_ofs; + /* Invalidate offload flags as they are not valid after + * decapsulation of MPLS header. */ + dp_packet_reset_offload(packet); + set_ethertype(packet, ethtype); if (get_16aligned_be32(&mh->mpls_lse) & htonl(MPLS_BOS_MASK)) { dp_packet_set_l2_5(packet, NULL);