From patchwork Sun Mar 15 21:56:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tonghao Zhang X-Patchwork-Id: 1255408 X-Patchwork-Delegate: i.maximets@samsung.com 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=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=ikIODhMv; 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 48gv0V2nM4z9sPJ for ; Mon, 16 Mar 2020 22:17:30 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 9285788615; Mon, 16 Mar 2020 11:17:28 +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 uPMvIMMI6SPX; Mon, 16 Mar 2020 11:17:27 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by whitealder.osuosl.org (Postfix) with ESMTP id 94F2D88610; Mon, 16 Mar 2020 11:17:27 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 7E240C013E; Mon, 16 Mar 2020 11:17:27 +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 99652C013E for ; Mon, 16 Mar 2020 11:17:25 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 86C40899A6 for ; Mon, 16 Mar 2020 11:17:25 +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 GmK+4pNWniOk for ; Mon, 16 Mar 2020 11:17:25 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pj1-f68.google.com (mail-pj1-f68.google.com [209.85.216.68]) by hemlock.osuosl.org (Postfix) with ESMTPS id 1D78E899A1 for ; Mon, 16 Mar 2020 11:17:25 +0000 (UTC) Received: by mail-pj1-f68.google.com with SMTP id nu11so5242390pjb.1 for ; Mon, 16 Mar 2020 04:17:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=+j4aP/nUU0JddS1rIJMURWSFtxALX8sr/t9YrSy+zEA=; b=ikIODhMvk1g+eyUay5Mde5iqfRGzFoasNUdN8foU16q1dKrOhpqNzxpZqNbM/FjHF7 mrIAA7qngHc4nNQE2FMb/dKvgIRAo9NmvxuJGwi164EnV4i9imS+kD/0ZXVAxQqD6eAM JiSs32v992OwZzusQQDZUN8XbuNEi0eAAcfWk+RceYkyYp2RVLTwnffinNeaRI3WcrfO LbjpUiuhDd0nnqdsdy+es0RYeFOj/3Tuvdb+r8AJ0Tb7j1yKzU0RZEZudAt1KLTWz9fI e0CSHPsKGCMnkCwRLRw0mVQZxC3zEbdwFzcoAb7XxRYtrPZqpOTgvAtm3f5AUsFJGU/P xjNQ== 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; bh=+j4aP/nUU0JddS1rIJMURWSFtxALX8sr/t9YrSy+zEA=; b=f+jj11Wq9ds7OsH/Miyf0NoxxZFze8MW+ikBqRxn+nWs88TBAmwgC1I4osXTh3w3Wl AUqjCwQnhzeARMn+hVuFJH/oVIWNsnZl13l4EzI36Y1gDnRRO54800xoWzYVuZEnnmJ0 5lafL8r9t5WOlw37zH8kvQvc8OR0iMPy6Xl++B7K9x7ozeKBWtxXX11oC3V3tiw6n7Za ukXbm6CyFXs2K0ObZ0zba/aeKeKDFYVmFgRsLPC/+iNJHv/eWt0JRQGuUuG4+oclDXYL qZj2Uqh51ef0X9GjwKFMFlk5UBprQShe3LBUBCzstAAoLcJeCdGUAkaVPVErcSpekWcr Nhhw== X-Gm-Message-State: ANhLgQ3q92LcWFiOI/yuICo/u93R02aUisRRXf5H/F5TalgI/xiffZ4G rJVGhrz6P4JNj6lAaP8uvjGDroNH X-Google-Smtp-Source: ADFU+vuM7sG4C02hxpUGb1Xlr/eweGe6DNYHhL2tZ4PQUio/DMNG7tveIRgZKQQiQk9RPnFMtbrJaA== X-Received: by 2002:a17:90a:2109:: with SMTP id a9mr25059650pje.12.1584357444401; Mon, 16 Mar 2020 04:17:24 -0700 (PDT) Received: from local.opencloud.tech.localdomain ([219.143.129.147]) by smtp.gmail.com with ESMTPSA id m14sm14019131pje.19.2020.03.16.04.17.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Mar 2020 04:17:23 -0700 (PDT) From: xiangxia.m.yue@gmail.com To: dev@openvswitch.org Date: Mon, 16 Mar 2020 05:56:03 +0800 Message-Id: <1584309363-15048-1-git-send-email-xiangxia.m.yue@gmail.com> X-Mailer: git-send-email 1.8.3.1 Cc: i.maximets@ovn.org Subject: [ovs-dev] [PATCH ovs] dpif-netdev: Delete the flow limit in dpif-netdev 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: , MIME-Version: 1.0 Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" From: Tonghao Zhang The max number of flow in dpif-netdev is MAX_FLOWS, the previous patch[1] try to install more flows, and introduce the subcommand "dpif-netdev/pmd-set-max-flow" to change the max flow limitation. But 'other_config:flow-limit' option can limit that too. As Ilya Maximets say [2]: | The MAX_FLOWS constant was there from the introduction of dpif-netdev, | however, later new flow-limit mechanism was implemented that | controls number of datapath flows in a dynamic way on ofproto level. | | So, maybe we can just remove the limit and fully rely on ofproto | to decide what flow limit we need? There are no limitations for | flow table size in dpif-netdev beside the artificial one. | 'other_config:flow-limit' seems suitable to control this. [1] - https://mail.openvswitch.org/pipermail/ovs-dev/2020-January/366636.html [2] - https://mail.openvswitch.org/pipermail/ovs-dev/2020-January/366677.html Suggested-by: Ilya Maximets Signed-off-by: Tonghao Zhang --- lib/dpif-netdev.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index a1c45f6..eb0e2da 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -96,9 +96,6 @@ DEFINE_STATIC_PER_THREAD_DATA(uint32_t, recirc_depth, 0) /* Use instant packet send by default. */ #define DEFAULT_TX_FLUSH_INTERVAL 0 -/* Configuration parameters. */ -enum { MAX_FLOWS = 65536 }; /* Maximum number of flows in flow table. */ - /* Maximum number of meters in the table. */ #define METER_ENTRY_MAX (1 << 19) /* Maximum number of bands / meter. */ @@ -3576,13 +3573,8 @@ flow_put_on_pmd(struct dp_netdev_pmd_thread *pmd, netdev_flow = dp_netdev_pmd_lookup_flow(pmd, key, NULL); if (!netdev_flow) { if (put->flags & DPIF_FP_CREATE) { - if (cmap_count(&pmd->flow_table) < MAX_FLOWS) { - dp_netdev_flow_add(pmd, match, ufid, put->actions, - put->actions_len); - error = 0; - } else { - error = EFBIG; - } + dp_netdev_flow_add(pmd, match, ufid, put->actions, + put->actions_len); } else { error = ENOENT; }