From patchwork Wed Jul 10 13:32:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vishal Deep Ajmera X-Patchwork-Id: 1130157 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="PqGb7sb2"; 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 45k7JD1cJfz9s3Z for ; Wed, 10 Jul 2019 15:38:03 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 90E063EDF; Wed, 10 Jul 2019 05:38:00 +0000 (UTC) X-Original-To: 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 0AEAE39C2 for ; Wed, 10 Jul 2019 05:30:11 +0000 (UTC) X-Greylist: from 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 582EACF for ; Wed, 10 Jul 2019 05:30:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; d=ericsson.com; s=mailgw201801; c=relaxed/relaxed; q=dns/txt; i=@ericsson.com; t=1562736608; x=1565328608; 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=giHNm7xyEcPEi/FnqeiElJ0BM3Fly0xOXUQK84U9iYE=; b=PqGb7sb2XLax2CXcvitQ7U3hqyCpN2j/P2yNNegefNVu9iEphh3T3tPjbxFMX9j2 znDo2QFAqoGpGPrPX9mbBFrQsgP1jKvjmjrgfcrHn8zoQMmBKVikkfqaSgUpjSQU XSiiVY7pqwU3Exuo7dQWfY/LX/lW1RNGjnno6uMNEqk=; X-AuditID: c1b4fb30-6ddff70000001814-65-5d2577e0a3c2 Received: from ESESBMB501.ericsson.se (Unknown_Domain [153.88.183.114]) by sesbmg22.ericsson.net (Symantec Mail Security) with SMTP id 67.1D.06164.0E7752D5; Wed, 10 Jul 2019 07:30:08 +0200 (CEST) Received: from ESESBMB505.ericsson.se (153.88.183.172) by ESESBMB501.ericsson.se (153.88.183.168) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Wed, 10 Jul 2019 07:30:08 +0200 Received: from ESGSCHC008.ericsson.se (146.11.116.89) by ESESBMB505.ericsson.se (153.88.183.172) 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; Wed, 10 Jul 2019 07:30:07 +0200 Received: from localhost.localdomain (146.11.116.127) by smtps-ao.internal.ericsson.com (146.11.116.89) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 10 Jul 2019 13:30:04 +0800 From: Vishal Deep Ajmera To: Date: Wed, 10 Jul 2019 19:02:30 +0530 Message-ID: <1562765550-8149-1-git-send-email-vishal.deep.ajmera@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+NgFprPLMWRmVeSWpSXmKPExsUyM2J7ke6DctVYg6n/RC2Ont7D7MDo8ezm f8YAxigum5TUnMyy1CJ9uwSujM9T/rAUfOOu+PBjLnMDYxNnFyMHh4SAicT2n8ZdjFwcQgJH GSUuPf/GCOF8Y5S4f3A3axcjJ5DTySSxcYsERGI3o8TvZd/YQBJsAlYSv6b0s4DYIgKSEv8W bwGLMwukSRw88YIdxBYWiJS4e3Mh2CAWAVWJpwvPM4HYvAJ+Er0bL4PFJQTkJE4em8wKEReU ODnzCQvEHAmJgy9eMEMcoSNx6vl1qHoliWfflrNOYBSYhaRlFpKWBYxMqxhFi1OLk3LTjYz0 Uosyk4uL8/P08lJLNjECg+3glt8GOxhfPnc8xCjAwajEw/t2i3isEGtiWXFl7iFGCQ5mJRFe yXMisUK8KYmVValF+fFFpTmpxYcYpTlYlMR513v/ixESSE8sSc1OTS1ILYLJMnFwSjUwMi6K cFE18Fl4y/K4k4ti1zl3/sWLE5skfV8vCNSXmtv/QJVPr/l3i4deLvu+wofr47fPmbJG57U+ T6qFs6/v6ocXbS6ER/WYMe6+2OqwZ+vcV8f4rywPaVp9LMEzmm8G1+9mr9C7/0pvK0xst5xz Yv3yyPORj5e/tznvfZxnokK3Vs/EZw5iSizFGYmGWsxFxYkAJ48NpDICAAA= X-Spam-Status: No, score=-0.1 required=5.0 tests=AC_FROM_MANY_DOTS, 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 Subject: [ovs-dev] [PATCH] flow: Wildcard UDP ports when using SYMMETRIC_L4 hash for select groups. 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 UDP source and destination ports are not used to derive the hash index used for selecting the bucket in case of SYMMETRIC_L4 hash based select groups. However, they are un-wildcarded in the megaflow entry match criteria. This results in distinct megaflow entry being created for each pair of UDP source and destination ports unnecessarily and causes significant performance deterioration when the megaflow cache limit is reached. This patch wildcards UDP ports when using select group with SYMMETRIC_L4 hash function. Signed-off-by: Vishal Deep Ajmera CC: Jan Scheurich --- lib/flow.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/flow.c b/lib/flow.c index de93704..95da7d4 100644 --- a/lib/flow.c +++ b/lib/flow.c @@ -2478,7 +2478,12 @@ flow_mask_hash_fields(const struct flow *flow, struct flow_wildcards *wc, } if (is_ip_any(flow)) { memset(&wc->masks.nw_proto, 0xff, sizeof wc->masks.nw_proto); - flow_unwildcard_tp_ports(flow, wc); + /* Unwildcard port only for non-UDP packets as udp port + * numbers are not used in hash calculations. + */ + if (flow->nw_proto != IPPROTO_UDP) { + flow_unwildcard_tp_ports(flow, wc); + } } for (i = 0; i < FLOW_MAX_VLAN_HEADERS; i++) { wc->masks.vlans[i].tci |= htons(VLAN_VID_MASK | VLAN_CFI);