From patchwork Sat Sep 19 13:07:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Flavio Leitner X-Patchwork-Id: 1367570 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=fail (p=none dis=none) header.from=sysclose.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=sysclose.org header.i=@sysclose.org header.a=rsa-sha256 header.s=201903 header.b=tJoG1RXi; 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 4Btrbp4tXmz9sSW for ; Sat, 19 Sep 2020 23:08:06 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 7E99786C64; Sat, 19 Sep 2020 13:08:04 +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 lCNjb3qiT2YA; Sat, 19 Sep 2020 13:08:02 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by whitealder.osuosl.org (Postfix) with ESMTP id D1BED86C52; Sat, 19 Sep 2020 13:08:02 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id A08B0C1AD4; Sat, 19 Sep 2020 13:08:02 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 197C5C0859 for ; Sat, 19 Sep 2020 13:08:01 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id F3AFD2042B for ; Sat, 19 Sep 2020 13:08:00 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pqJXpXwr8spp for ; Sat, 19 Sep 2020 13:07:57 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sysclose.org (smtp.sysclose.org [69.164.214.230]) by silver.osuosl.org (Postfix) with ESMTPS id AB73520429 for ; Sat, 19 Sep 2020 13:07:57 +0000 (UTC) Received: from localhost (unknown [45.71.105.251]) by sysclose.org (Postfix) with ESMTPSA id B0768353F; Sat, 19 Sep 2020 13:09:16 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 sysclose.org B0768353F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sysclose.org; s=201903; t=1600520957; bh=etpvo8izyDNX8Zzbn82vhqXW4eHQntxqJUQPbRsox6E=; h=From:To:Cc:Subject:Date:From; b=tJoG1RXiSc1Qfk7dMdtOe0t2qHG7JR3XJLs5Cy21WQIvn/nphzoGDPmb7FhFNL2jo 8T/1WD38DDbviVuINk74gx+zsJC5IIDYeaPB+4fbRxkCwGR1p5uGqAsSAdFWtA8/5Z AxP3f0+phKOdeuC/vMT5PDHf+r485ZDGejpBF4xFumZk9oDKsBzp2EGMAS9OBmcQ8+ 5F1rkAC6mcv4bbm+GQ8JB1SR9Bpxc1svu5sp7rsJ5COrZrseHICvtcRmRfj1wmG4GN JyuFcvxdlIAEpwiXX0ktefag8jtmjkcyvaZNqMe5amXbctnPNBMMV0Og9Vo8yykXEk dwxVeJZqrzs4Q== From: Flavio Leitner To: dev@openvswitch.org Date: Sat, 19 Sep 2020 10:07:43 -0300 Message-Id: <20200919130743.550736-1-fbl@sysclose.org> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Cc: Flavio Leitner Subject: [ovs-dev] [PATCH] userspace: Switch default cache from EMC to SMC. 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: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" The EMC is not large enough for current production cases and they are scaling up, so this change switches over from EMC to SMC by default, which provides better results. The EMC is still available and could be used when only a few number of flows is used. Signed-off-by: Flavio Leitner --- Documentation/topics/dpdk/bridge.rst | 10 +++++----- NEWS | 3 +++ lib/dpif-netdev.c | 6 +++--- tests/pmd.at | 4 ++-- vswitchd/vswitch.xml | 4 ++-- 5 files changed, 15 insertions(+), 12 deletions(-) diff --git a/Documentation/topics/dpdk/bridge.rst b/Documentation/topics/dpdk/bridge.rst index 526d5c959..0d9aed4eb 100644 --- a/Documentation/topics/dpdk/bridge.rst +++ b/Documentation/topics/dpdk/bridge.rst @@ -130,13 +130,13 @@ SMC cache SMC cache or signature match cache is a new cache level after EMC cache. The difference between SMC and EMC is SMC only stores a signature of a flow thus it is much more memory efficient. With same memory space, EMC can store 8k -flows while SMC can store 1M flows. When traffic flow count is much larger than -EMC size, it is generally beneficial to turn off EMC and turn on SMC. It is -currently turned off by default. +flows while SMC can store 1M flows. When traffic flow count is small than +EMC size, it is generally beneficial to turn off SMC and turn on EMC. It is +currently turned on by default. -To turn on SMC:: +To turn off SMC:: - $ ovs-vsctl --no-wait set Open_vSwitch . other_config:smc-enable=true + $ ovs-vsctl --no-wait set Open_vSwitch . other_config:smc-enable=false Datapath Classifier Performance ------------------------------- diff --git a/NEWS b/NEWS index 2f67d5047..5b88937fb 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,9 @@ Post-v2.14.0 --------------------- + - DPDK: + * The SMC cache is enabled by default. + * The EMC cache is disabled by default. v2.14.0 - 17 Aug 2020 --------------------- diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index 02df8f11e..0f2bb10fd 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -2079,7 +2079,7 @@ port_create(const char *devname, const char *type, port->netdev = netdev; port->type = xstrdup(type); port->sf = NULL; - port->emc_enabled = true; + port->emc_enabled = false; port->need_reconfigure = true; ovs_mutex_init(&port->txq_used_mutex); @@ -4305,7 +4305,7 @@ dpif_netdev_set_config(struct dpif *dpif, const struct smap *other_config) } } - bool smc_enable = smap_get_bool(other_config, "smc-enable", false); + bool smc_enable = smap_get_bool(other_config, "smc-enable", true); bool cur_smc; atomic_read_relaxed(&dp->smc_enable_db, &cur_smc); if (smc_enable != cur_smc) { @@ -4440,7 +4440,7 @@ dpif_netdev_port_set_config(struct dpif *dpif, odp_port_t port_no, struct dp_netdev_port *port; int error = 0; const char *affinity_list = smap_get(cfg, "pmd-rxq-affinity"); - bool emc_enabled = smap_get_bool(cfg, "emc-enable", true); + bool emc_enabled = smap_get_bool(cfg, "emc-enable", false); ovs_mutex_lock(&dp->port_mutex); error = get_port_by_number(dp, port_no, &port); diff --git a/tests/pmd.at b/tests/pmd.at index 5b612f88f..20c179b39 100644 --- a/tests/pmd.at +++ b/tests/pmd.at @@ -238,8 +238,8 @@ pmd thread numa_id core_id : packets received: 20 packet recirculations: 0 avg. datapath passes per packet: 1.00 - emc hits: 19 - smc hits: 0 + emc hits: 0 + smc hits: 19 megaflow hits: 0 avg. subtable lookups per megaflow hit: 0.00 miss with success upcall: 1 diff --git a/vswitchd/vswitch.xml b/vswitchd/vswitch.xml index 81c84927f..009f0e550 100644 --- a/vswitchd/vswitch.xml +++ b/vswitchd/vswitch.xml @@ -513,7 +513,7 @@ when flow count is larger than EMC capacity.

- Defaults to false but can be changed at any time. + Defaults to true but can be changed at any time.

@@ -3296,7 +3296,7 @@ ovs-vsctl add-port br0 p0 -- set Interface p0 type=patch options:peer=p1 \ key="emc-insert-inv-prob"/> will have effect on this interface.

- Defaults to true. + Defaults to false.