From patchwork Thu Jul 16 16:03:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 51182 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f72.google.com (mail-wg0-f72.google.com [74.125.82.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1DC7F22A8A for ; Thu, 16 Jul 2015 16:03:48 +0000 (UTC) Received: by wgfk9 with SMTP id k9sf19897502wgf.1 for ; Thu, 16 Jul 2015 09:03:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:date :message-id:subject:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=rpyXbEPsLUemIg8gqykzXEDj0+/PVe7m+MSMgMM37t8=; b=YwTonvp5mBEwif8z9lRdJy5Bbalp2ptHWY691Em8OGhlxV/Br80p3egiVVSFY3XiAa A5o9VuFKZJGb6oML40dDs3rYMRKKxbs7xZKiyxUTXtDV51hq4Wa+Y5H96ixICGX2IgeX x1/Y0cn346K+Gx5xeEX+ThnPBbVsAfAVRGkGgnuwMLwvf4jSNdo1HukoPVYV6LK1GDdt efBt0IHUA5bJJFWv8cyAndKuomuOA4+ShcmRTSQCEwHS/bZLbteDahj9W2otEThXeB3r oK05NBk4hglfMoJJuwIt4bwJ3O2ddYI4PaqaAghHx3u+ocUVeghW9+TR8VcK9NCFVelP yGRA== X-Gm-Message-State: ALoCoQkxGEhXKl6b7ERP7mPyxtwKg6L9ERP6+AjJ5Bx/imfRCAk23d7xcIryTuHvaawWn31k7vBn X-Received: by 10.112.215.67 with SMTP id og3mr5290276lbc.8.1437062627411; Thu, 16 Jul 2015 09:03:47 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.73 with SMTP id y9ls337333lay.18.gmail; Thu, 16 Jul 2015 09:03:47 -0700 (PDT) X-Received: by 10.152.246.37 with SMTP id xt5mr9958095lac.83.1437062627264; Thu, 16 Jul 2015 09:03:47 -0700 (PDT) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com. [209.85.217.180]) by mx.google.com with ESMTPS id g10si7282670lam.152.2015.07.16.09.03.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Jul 2015 09:03:47 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.180 as permitted sender) client-ip=209.85.217.180; Received: by lblf12 with SMTP id f12so46478481lbl.2 for ; Thu, 16 Jul 2015 09:03:47 -0700 (PDT) X-Received: by 10.112.198.74 with SMTP id ja10mr10078312lbc.19.1437062627123; Thu, 16 Jul 2015 09:03:47 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp348916lbb; Thu, 16 Jul 2015 09:03:46 -0700 (PDT) X-Received: by 10.55.22.5 with SMTP id g5mr17844538qkh.45.1437062625816; Thu, 16 Jul 2015 09:03:45 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id i196si10026900qhc.119.2015.07.16.09.03.44; Thu, 16 Jul 2015 09:03:45 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Received: by lists.linaro.org (Postfix, from userid 109) id BEFD0620AE; Thu, 16 Jul 2015 16:03:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from ip-10-142-244-252.ec2.internal (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 3877B620A6; Thu, 16 Jul 2015 16:03:41 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 21E43620A7; Thu, 16 Jul 2015 16:03:39 +0000 (UTC) Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com [209.85.212.178]) by lists.linaro.org (Postfix) with ESMTPS id 14FFF6209C for ; Thu, 16 Jul 2015 16:03:37 +0000 (UTC) Received: by widic2 with SMTP id ic2so19194411wid.0 for ; Thu, 16 Jul 2015 09:03:36 -0700 (PDT) X-Received: by 10.180.80.138 with SMTP id r10mr7865169wix.18.1437062616136; Thu, 16 Jul 2015 09:03:36 -0700 (PDT) Received: from khorivan.synapse.com ([195.238.92.128]) by smtp.gmail.com with ESMTPSA id ny7sm3941311wic.11.2015.07.16.09.03.35 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 16 Jul 2015 09:03:35 -0700 (PDT) From: Ivan Khoronzhuk To: lng-odp@lists.linaro.org Date: Thu, 16 Jul 2015 19:03:29 +0300 Message-Id: <1437062609-32202-1-git-send-email-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: Classification patch Subject: [lng-odp] [API-NEXT PATCH] api: classification: return given term number available X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ivan.khoronzhuk@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.180 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 It's supposed that odp_pmr_terms_avail() returns common number of terms available. But some platform, like keystone, have different number of term entries on different layers, and there is no ability to return correct number. So, in order to be able to figure out exact number of exact PMR terms that available, add argument - PMR term for what the available number is requested. But, not depending on this change, it's also impossible to know exact number of PMR terms available in case if some PMR, depending on a connection circumstances, can allocate two PMR terms for emulation, actually it will be one PMR, but emulated by two. And implementation cannot know a priori in what circumstances this entry will be used. So, question is open....But, at least, this change allows to return more accurate number. Signed-off-by: Ivan Khoronzhuk --- include/odp/api/classification.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/odp/api/classification.h b/include/odp/api/classification.h index f597b26..3242bf2 100644 --- a/include/odp/api/classification.h +++ b/include/odp/api/classification.h @@ -283,11 +283,13 @@ int odp_cos_pmr_cos(odp_pmr_t pmr_id, odp_cos_t src_cos, odp_cos_t dst_cos); unsigned long long odp_pmr_terms_cap(void); /** - * Return the number of packet matching terms available for use + * Return the number of given packet matching terms available for use + * + * @param[in] term One of the enumerated values supported * * @return A number of packet matcher resources available for use. */ -unsigned odp_pmr_terms_avail(void); +unsigned odp_pmr_terms_avail(odp_pmr_term term); /** * Following structure is used to define composite packet matching rules