From patchwork Fri Jul 21 12:51:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Maximets X-Patchwork-Id: 792095 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=) 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 3xDW135WFjz9s83 for ; Fri, 21 Jul 2017 22:53:59 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 99E52B8B; Fri, 21 Jul 2017 12:52:08 +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 BBFFEB7D for ; Fri, 21 Jul 2017 12:52:07 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 4F5BB3F4 for ; Fri, 21 Jul 2017 12:52:07 +0000 (UTC) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OTF00AGXYET9840@mailout1.w1.samsung.com> for ovs-dev@openvswitch.org; Fri, 21 Jul 2017 13:52:05 +0100 (BST) Received: from eusmges5.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170721125204eucas1p16ef3ab3b934406d087d0a58fa58b3ac4~TWYQfBW8S2523525235eucas1p1Q; Fri, 21 Jul 2017 12:52:04 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges5.samsung.com (EUCPMTA) with SMTP id 1C.E6.25577.4F8F1795; Fri, 21 Jul 2017 13:52:04 +0100 (BST) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170721125204eucas1p1a2147706fe65fa66f1cb8488c89ebc36~TWYPzh1s22523525235eucas1p1M; Fri, 21 Jul 2017 12:52:04 +0000 (GMT) X-AuditID: cbfec7f5-f792f6d0000063e9-ee-5971f8f4b53e Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 3E.95.17452.4F8F1795; Fri, 21 Jul 2017 13:52:04 +0100 (BST) Received: from imaximets.rnd.samsung.ru ([106.109.129.180]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OTF009QNYEA8ZB0@eusync3.samsung.com>; Fri, 21 Jul 2017 13:52:04 +0100 (BST) From: Ilya Maximets To: ovs-dev@openvswitch.org, Darrell Ball Date: Fri, 21 Jul 2017 15:51:42 +0300 Message-id: <1500641502-31926-4-git-send-email-i.maximets@samsung.com> X-Mailer: git-send-email 2.7.4 In-reply-to: <1500641502-31926-1-git-send-email-i.maximets@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrOIsWRmVeSWpSXmKPExsWy7djP87pffhRGGkzap2zxanIDo8XUSUYW Lf0zmS2ev1jIbHH3xwomi2mfb7NbXGn/yW6x8eFZVou1hz6wW6y4cYrRYu6n54wWd2/+YXLg 8Vi85yWTx7Ob/xk9nl/rYfF4v+8qm0ffllWMHu/mv2ULYIvisklJzcksSy3St0vgyvi2bwZr QStfxZq2M6wNjAu5uxg5OSQETCROHG9k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wkni3YygJSxCzQyiyx/+wksCJhAQeJc63vwGwWAVWJXx+fg63gFXCTWLb/CTPEOjmJ m+c6wWxOAXeJlp7dLCC2EFBN87qrjBMYeRcwMqxiFEktLc5Nzy021CtOzC0uzUvXS87P3cQI jIVtx35u3sF4aWPwIUYBDkYlHl6GdQWRQqyJZcWVuYcYJTiYlUR4hb4URgrxpiRWVqUW5ccX leakFh9iNAU6aiKzlGhyPjBO80riDU0MzS0NjYwtLMyNjJTEeUs+XAkXEkhPLEnNTk0tSC2C 6WPi4JRqYIzieLr0ouMv1b23DW89P1Fw+NTDifXsHKGPF+y8ImlcvNpQ9DPn/hjL459SXG6Y HX+wcMKr3wsbtzvN8jBIV2zZmOo/bae2o3c/l9G+yWd9Ti0u+bYmSuWgoWqtxca7AXVVpy90 RnVdeLhI6PMXnvAitxSNRT9LSvocOXbEaZQs37Z6e2bUvddKLMUZiYZazEXFiQCDL2GwmwIA AA== X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170721125204eucas1p1a2147706fe65fa66f1cb8488c89ebc36 X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 X-Local-Sender: =?UTF-8?B?SWx5YSBNYXhpbWV0cxtTUlItVmlydHVhbGl6YXRpb24gTGFi?= =?UTF-8?B?G+yCvOyEseyghOyekBtMZWFkaW5nIEVuZ2luZWVy?= X-Global-Sender: =?UTF-8?B?SWx5YSBNYXhpbWV0cxtTUlItVmlydHVhbGl6YXRpb24gTGFi?= =?UTF-8?B?G1NhbXN1bmcgRWxlY3Ryb25pY3MbTGVhZGluZyBFbmdpbmVlcg==?= X-Sender-Code: =?UTF-8?B?QzEwG0NJU0hRG0MxMEdEMDFHRDAxMDE1NA==?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170721125204eucas1p1a2147706fe65fa66f1cb8488c89ebc36 X-RootMTR: 20170721125204eucas1p1a2147706fe65fa66f1cb8488c89ebc36 References: <1500641502-31926-1-git-send-email-i.maximets@samsung.com> X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Heetae Ahn , Ilya Maximets Subject: [ovs-dev] [PATCH v4 3/3] dpif-netdev: Don't uninit emc on reload. 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: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org There are many reasons for reloading of pmd threads: * reconfiguration of one of the ports. * Adjusting of static_tx_qid. * Adding new tx/rx ports. In many cases EMC is still useful after reload and uninit will only lead to unnecessary upcalls/classifier lookups. Such behaviour slows down the datapath. Uninit itself slows down the reload path. All this factors leads to additional unexpected latencies/drops on events not directly connected to current PMD thread. Lets not uninitialize emc cache on reload path. 'emc_cache_slow_sweep()' and replacements should free all the old/unwanted entries. Signed-off-by: Ilya Maximets Acked-by: Cian Ferriter Tested-by: Cian Ferriter --- lib/dpif-netdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index a1e8c56..74d3535 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -3810,9 +3810,9 @@ pmd_thread_main(void *f_) ovs_numa_thread_setaffinity_core(pmd->core_id); dpdk_set_lcore_id(pmd->core_id); poll_cnt = pmd_load_queues_and_ports(pmd, &poll_list); + emc_cache_init(&pmd->flow_cache); reload: pmd_alloc_static_tx_qid(pmd); - emc_cache_init(&pmd->flow_cache); /* List port/core affinity */ for (i = 0; i < poll_cnt; i++) { @@ -3866,13 +3866,13 @@ reload: * reloading the updated configuration. */ dp_netdev_pmd_reload_done(pmd); - emc_cache_uninit(&pmd->flow_cache); pmd_free_static_tx_qid(pmd); if (!exiting) { goto reload; } + emc_cache_uninit(&pmd->flow_cache); free(poll_list); pmd_free_cached_ports(pmd); return NULL;