From patchwork Mon Dec 28 09:25:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: taoyunxiang X-Patchwork-Id: 1421002 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.136; helo=silver.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=cmss.chinamobile.com Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4D4Qf76L5sz9sVv for ; Tue, 29 Dec 2020 05:13:35 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 5E8012E15D; Mon, 28 Dec 2020 18:13:34 +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 sROa21I8FWSi; Mon, 28 Dec 2020 18:13:27 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by silver.osuosl.org (Postfix) with ESMTP id 5155C2E145; Mon, 28 Dec 2020 18:11:24 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id C5EF2C1E5E; Mon, 28 Dec 2020 18:11:23 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 576C8C0891 for ; Mon, 28 Dec 2020 09:26:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 5449086C71 for ; Mon, 28 Dec 2020 09:26:17 +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 VPB1kZoeWf8F for ; Mon, 28 Dec 2020 09:26:16 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from cmccmta1.chinamobile.com (cmccmta1.chinamobile.com [221.176.66.79]) by whitealder.osuosl.org (Postfix) with ESMTP id E2B1B86C77 for ; Mon, 28 Dec 2020 09:26:15 +0000 (UTC) Received: from spf.mail.chinamobile.com (unknown[172.16.121.3]) by rmmx-syy-dmz-app02-12002 (RichMail) with SMTP id 2ee25fe9a4acdac-bec35; Mon, 28 Dec 2020 17:26:04 +0800 (CST) X-RM-TRANSID: 2ee25fe9a4acdac-bec35 X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from yun.localdomain (unknown[112.25.154.146]) by rmsmtp-syy-appsvr02-12002 (RichMail) with SMTP id 2ee25fe9a48a90b-7b920; Mon, 28 Dec 2020 17:26:04 +0800 (CST) X-RM-TRANSID: 2ee25fe9a48a90b-7b920 From: Tao YunXiang To: ovs-dev@openvswitch.org Date: Mon, 28 Dec 2020 01:25:18 -0800 Message-Id: <20201228092520.11807-61-taoyunxiang@cmss.chinamobile.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201228092520.11807-1-taoyunxiang@cmss.chinamobile.com> References: <8> <20201228092520.11807-1-taoyunxiang@cmss.chinamobile.com> MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 28 Dec 2020 18:10:34 +0000 Cc: Taoyunxiang Subject: [ovs-dev] [PATCH 60/62] dpif-netdev: modify max supported number of meter 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" From: Taoyunxiang Code Source From: Self Code Description: The max number is assigned by dpif_netdev_meter_get_features. The max supported number in BSC card is 256. So we need to modify the default max number from 65536 to 256. In ofproto-dpif.c, meter_set will verify max number by id_pool_alloc_id. Jira: #[Optional] 市场项目编号(名称):[Optional] --- lib/dpif-netdev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index cf89d6c..1f5fce5 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -98,7 +98,8 @@ DEFINE_STATIC_PER_THREAD_DATA(uint32_t, recirc_depth, 0) /* Configuration parameters. */ enum { MAX_FLOWS = 65536 }; /* Maximum number of flows in flow table. */ -enum { MAX_METERS = 65536 }; /* Maximum number of meters. */ +enum { MAX_METERS = 256 }; /* Maximum number of meters. + 256 is the max supported number in Intel BSC card*/ enum { MAX_BANDS = 8 }; /* Maximum number of bands / meter. */ enum { N_METER_LOCKS = 64 }; /* Maximum number of meters. */